summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore3
-rwxr-xr-xBUILD/compile-amd64-debug-max3
-rwxr-xr-xBUILD/compile-amd64-max3
-rwxr-xr-xBUILD/compile-darwin-mwcc3
-rwxr-xr-xBUILD/compile-hpux11-parisc2-aCC3
-rwxr-xr-xBUILD/compile-irix-mips64-mipspro3
-rwxr-xr-xBUILD/compile-ndb-autotest2
-rwxr-xr-xBUILD/compile-pentium3
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-embedded3
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-ndb2
-rwxr-xr-xBUILD/compile-pentium-max3
-rwxr-xr-xBUILD/compile-ppc-debug3
-rwxr-xr-xBUILD/compile-ppc-debug-max3
-rwxr-xr-xBUILD/compile-ppc-debug-max-no-ndb3
-rwxr-xr-xBUILD/compile-ppc-max3
-rw-r--r--CMakeLists.txt2
-rw-r--r--VERSION2
-rw-r--r--client/client_priv.h2
-rw-r--r--client/completion_hash.h3
-rw-r--r--client/echo.c3
-rw-r--r--client/get_password.c3
-rw-r--r--client/mysql.cc22
-rw-r--r--client/mysqlcheck.c91
-rw-r--r--client/mysqldump.c4
-rw-r--r--client/mysqltest.cc3
-rw-r--r--client/sql_string.cc.dontuse4
-rw-r--r--cmake/configure.pl2
-rw-r--r--cmake/cpack_rpm.cmake30
-rw-r--r--cmake/create_initial_db.cmake.in2
-rw-r--r--cmake/make_dist.cmake.in2
-rw-r--r--cmake/mysql_version.cmake2
-rw-r--r--cmake/os/FreeBSD.cmake6
-rw-r--r--cmake/os/Linux.cmake6
-rw-r--r--cmake/package_name.cmake2
-rw-r--r--cmake/plugin.cmake2
-rw-r--r--cmake/readline.cmake2
-rw-r--r--cmake/ssl.cmake2
-rw-r--r--cmake/zlib.cmake8
-rw-r--r--configure.cmake2
-rw-r--r--debian/dist/Debian/control6
-rw-r--r--debian/dist/Ubuntu/control6
-rw-r--r--extra/charset2html.c3
-rw-r--r--extra/yassl/CMakeLists.txt2
-rw-r--r--extra/yassl/examples/client/client.cpp2
-rw-r--r--extra/yassl/examples/echoclient/echoclient.cpp2
-rw-r--r--extra/yassl/examples/echoserver/echoserver.cpp2
-rw-r--r--extra/yassl/examples/server/server.cpp2
-rw-r--r--extra/yassl/include/buffer.hpp2
-rw-r--r--extra/yassl/include/cert_wrapper.hpp3
-rw-r--r--extra/yassl/include/lock.hpp2
-rw-r--r--extra/yassl/include/openssl/prefix_ssl.h3
-rw-r--r--extra/yassl/include/socket_wrapper.hpp2
-rw-r--r--extra/yassl/include/yassl_error.hpp6
-rw-r--r--extra/yassl/include/yassl_imp.hpp3
-rw-r--r--extra/yassl/include/yassl_int.hpp2
-rw-r--r--extra/yassl/include/yassl_types.hpp9
-rw-r--r--extra/yassl/src/buffer.cpp3
-rw-r--r--extra/yassl/src/cert_wrapper.cpp3
-rw-r--r--extra/yassl/src/crypto_wrapper.cpp2
-rw-r--r--extra/yassl/src/handshake.cpp38
-rw-r--r--extra/yassl/src/lock.cpp2
-rwxr-xr-xextra/yassl/src/make.bat2
-rw-r--r--extra/yassl/src/socket_wrapper.cpp2
-rw-r--r--extra/yassl/src/ssl.cpp3
-rw-r--r--extra/yassl/src/yassl.cpp2
-rw-r--r--extra/yassl/src/yassl_error.cpp6
-rw-r--r--extra/yassl/src/yassl_imp.cpp192
-rw-r--r--extra/yassl/taocrypt/benchmark/benchmark.cpp18
-rwxr-xr-xextra/yassl/taocrypt/benchmark/make.bat2
-rw-r--r--extra/yassl/taocrypt/include/aes.hpp2
-rw-r--r--extra/yassl/taocrypt/include/asn.hpp3
-rw-r--r--extra/yassl/taocrypt/include/block.hpp3
-rw-r--r--extra/yassl/taocrypt/include/blowfish.hpp2
-rw-r--r--extra/yassl/taocrypt/include/des.hpp2
-rw-r--r--extra/yassl/taocrypt/include/hash.hpp2
-rw-r--r--extra/yassl/taocrypt/include/hc128.hpp2
-rw-r--r--extra/yassl/taocrypt/include/integer.hpp2
-rw-r--r--extra/yassl/taocrypt/include/kernelc.hpp2
-rw-r--r--extra/yassl/taocrypt/include/misc.hpp2
-rw-r--r--extra/yassl/taocrypt/include/modes.hpp3
-rw-r--r--extra/yassl/taocrypt/include/pwdbased.hpp2
-rw-r--r--extra/yassl/taocrypt/include/rabbit.hpp2
-rw-r--r--extra/yassl/taocrypt/include/rsa.hpp2
-rw-r--r--extra/yassl/taocrypt/include/runtime.hpp2
-rw-r--r--extra/yassl/taocrypt/include/types.hpp2
-rw-r--r--extra/yassl/taocrypt/mySTL/stdexcept.hpp2
-rw-r--r--extra/yassl/taocrypt/mySTL/vector.hpp2
-rw-r--r--extra/yassl/taocrypt/src/aes.cpp2
-rw-r--r--extra/yassl/taocrypt/src/aestables.cpp2
-rw-r--r--extra/yassl/taocrypt/src/algebra.cpp2
-rw-r--r--extra/yassl/taocrypt/src/arc4.cpp2
-rw-r--r--extra/yassl/taocrypt/src/blowfish.cpp2
-rw-r--r--extra/yassl/taocrypt/src/coding.cpp2
-rw-r--r--extra/yassl/taocrypt/src/dsa.cpp2
-rw-r--r--extra/yassl/taocrypt/src/hash.cpp2
-rw-r--r--extra/yassl/taocrypt/src/hc128.cpp2
-rwxr-xr-xextra/yassl/taocrypt/src/make.bat2
-rw-r--r--extra/yassl/taocrypt/src/md4.cpp2
-rw-r--r--extra/yassl/taocrypt/src/md5.cpp2
-rw-r--r--extra/yassl/taocrypt/src/misc.cpp2
-rw-r--r--extra/yassl/taocrypt/src/rabbit.cpp2
-rw-r--r--extra/yassl/taocrypt/src/random.cpp2
-rw-r--r--extra/yassl/taocrypt/src/ripemd.cpp2
-rw-r--r--extra/yassl/taocrypt/src/rsa.cpp2
-rw-r--r--extra/yassl/taocrypt/src/sha.cpp2
-rw-r--r--extra/yassl/taocrypt/src/twofish.cpp2
-rwxr-xr-xextra/yassl/taocrypt/test/make.bat2
-rw-r--r--extra/yassl/taocrypt/test/memory.cpp2
-rw-r--r--extra/yassl/taocrypt/test/test.cpp18
-rwxr-xr-xextra/yassl/testsuite/make.bat2
-rw-r--r--extra/yassl/testsuite/test.hpp2
-rw-r--r--extra/yassl/testsuite/testsuite.cpp2
-rw-r--r--include/atomic/x86-gcc.h6
-rw-r--r--include/base64.h3
-rw-r--r--include/ft_global.h2
-rw-r--r--include/m_ctype.h5
-rw-r--r--include/m_string.h11
-rw-r--r--include/my_global.h2
-rw-r--r--include/my_md5.h3
-rw-r--r--include/my_pthread.h6
-rw-r--r--include/my_sys.h3
-rw-r--r--include/my_user.h3
-rw-r--r--include/my_xml.h3
-rw-r--r--include/myisamchk.h20
-rw-r--r--include/myisampack.h2
-rw-r--r--include/mysql.h3
-rw-r--r--include/mysql/plugin_audit.h46
-rw-r--r--include/mysql/plugin_audit.h.pp21
-rw-r--r--include/mysql/service_my_snprintf.h2
-rw-r--r--include/mysql_com.h2
-rw-r--r--include/mysql_time.h3
-rw-r--r--include/mysql_version.h.in3
-rw-r--r--include/thread_pool_priv.h2
-rw-r--r--include/welcome_copyright_notice.h2
-rw-r--r--libmysql/libmysql.c9
-rw-r--r--libmysqld/lib_sql.cc13
-rw-r--r--mysql-test/collections/default.experimental1
-rw-r--r--mysql-test/include/get_relay_log_pos.inc2
-rw-r--r--mysql-test/include/rpl_init.inc3
-rwxr-xr-xmysql-test/mysql-test-run.pl27
-rw-r--r--mysql-test/r/cast.result18
-rw-r--r--mysql-test/r/create.result4
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result39
-rw-r--r--mysql-test/r/ctype_ucs2_query_cache.result19
-rw-r--r--mysql-test/r/ctype_utf8mb4.result18
-rw-r--r--mysql-test/r/empty_user_table.result8
-rw-r--r--mysql-test/r/func_compress.result4
-rw-r--r--mysql-test/r/func_group.result28
-rw-r--r--mysql-test/r/func_math.result8
-rw-r--r--mysql-test/r/func_str.result11
-rw-r--r--mysql-test/r/func_time_hires.result4
-rw-r--r--mysql-test/r/gis-rtree.result20
-rw-r--r--mysql-test/r/grant_4332.result96
-rw-r--r--mysql-test/r/init_connection_query_cache.result19
-rw-r--r--mysql-test/r/innodb_ext_key.result122
-rw-r--r--mysql-test/r/join_nested.result24
-rw-r--r--mysql-test/r/join_nested_jcl6.result24
-rw-r--r--mysql-test/r/join_outer.result46
-rw-r--r--mysql-test/r/join_outer_innodb.result22
-rw-r--r--mysql-test/r/join_outer_jcl6.result46
-rw-r--r--mysql-test/r/log_slow.result15
-rw-r--r--mysql-test/r/partition.result4
-rw-r--r--mysql-test/r/select.result39
-rw-r--r--mysql-test/r/select_jcl6.result39
-rw-r--r--mysql-test/r/select_pkeycache.result39
-rw-r--r--mysql-test/r/show_check.result18
-rw-r--r--mysql-test/r/sp.result61
-rw-r--r--mysql-test/r/status_user.result2
-rw-r--r--mysql-test/r/subselect_mat.result14
-rw-r--r--mysql-test/r/subselect_sj.result32
-rw-r--r--mysql-test/r/subselect_sj2_mat.result2
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result32
-rw-r--r--mysql-test/r/subselect_sj_mat.result14
-rw-r--r--mysql-test/r/type_datetime.result16
-rw-r--r--mysql-test/r/user_var-binlog.result12
-rw-r--r--mysql-test/r/varbinary.result61
-rw-r--r--mysql-test/r/variables.result6
-rw-r--r--mysql-test/suite/binlog/disabled.def2
-rw-r--r--mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result4
-rw-r--r--mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test3
-rw-r--r--mysql-test/suite/federated/federated.result13
-rw-r--r--mysql-test/suite/federated/federated.test12
-rw-r--r--mysql-test/suite/federated/federatedx.test1
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result8
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result4
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result4
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_no_prot.result2
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_ps.result2
-rw-r--r--mysql-test/suite/handler/interface.result10
-rw-r--r--mysql-test/suite/handler/interface.test13
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14147491.result19
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug12400341.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14147491.test52
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14676111-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14676111.test5
-rw-r--r--mysql-test/suite/maria/distinct.result25
-rw-r--r--mysql-test/suite/maria/distinct.test25
-rw-r--r--mysql-test/suite/maria/maria-autozerofill.result13
-rw-r--r--mysql-test/suite/maria/maria-autozerofill.test25
-rw-r--r--mysql-test/suite/maria/maria-recovery2.result6
-rw-r--r--mysql-test/suite/maria/maria-recovery2.test2
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result112
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_innodb.result64
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_innodb.result160
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result80
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result80
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result80
-rw-r--r--mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result80
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_innodb.result416
-rw-r--r--mysql-test/suite/parts/r/partition_basic_innodb.result128
-rw-r--r--mysql-test/suite/parts/r/partition_engine_innodb.result22
-rw-r--r--mysql-test/suite/parts/t/partition_basic_innodb.test2
-rw-r--r--mysql-test/suite/plugins/r/audit_null.result83
-rw-r--r--mysql-test/suite/plugins/r/qc_info.result3
-rw-r--r--mysql-test/suite/plugins/r/show_all_plugins.result4
-rw-r--r--mysql-test/suite/plugins/t/audit_null.test29
-rw-r--r--mysql-test/suite/plugins/t/qc_info.test3
-rw-r--r--mysql-test/suite/plugins/t/unix_socket.test3
-rw-r--r--mysql-test/suite/rpl/disabled.def1
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset_sjis.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_password_boundaries.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result17
-rw-r--r--mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset_sjis.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_password_boundaries.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test75
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test44
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test15
-rw-r--r--mysql-test/t/cast.test13
-rw-r--r--mysql-test/t/ctype_cp932_binlog_stm.test17
-rw-r--r--mysql-test/t/ctype_ucs2_query_cache-master.opt1
-rw-r--r--mysql-test/t/ctype_ucs2_query_cache.test19
-rw-r--r--mysql-test/t/ctype_utf8mb4.test15
-rw-r--r--mysql-test/t/empty_user_table.test20
-rw-r--r--mysql-test/t/func_group.test25
-rw-r--r--mysql-test/t/func_str.test12
-rw-r--r--mysql-test/t/gis-rtree.test20
-rw-r--r--mysql-test/t/grant_4332.test108
-rw-r--r--mysql-test/t/init_connection_query_cache-master.opt1
-rw-r--r--mysql-test/t/init_connection_query_cache.test26
-rw-r--r--mysql-test/t/innodb_ext_key.test123
-rw-r--r--mysql-test/t/join_nested.test24
-rw-r--r--mysql-test/t/join_outer.test48
-rw-r--r--mysql-test/t/join_outer_innodb.test23
-rw-r--r--mysql-test/t/log_slow.test14
-rw-r--r--mysql-test/t/mysql_plugin.test66
-rw-r--r--mysql-test/t/mysqlshow.test9
-rw-r--r--mysql-test/t/select.test39
-rw-r--r--mysql-test/t/sp.test63
-rw-r--r--mysql-test/t/subselect_sj.test44
-rw-r--r--mysql-test/t/subselect_sj_mat.test19
-rw-r--r--mysql-test/t/type_datetime.test15
-rw-r--r--mysql-test/t/varbinary.test27
-rw-r--r--mysql-test/t/variables.test12
-rw-r--r--mysys/errors.c4
-rw-r--r--mysys/mf_format.c2
-rw-r--r--mysys/mf_keycache.c3
-rw-r--r--mysys/my_lockmem.c2
-rw-r--r--mysys/my_malloc.c10
-rw-r--r--mysys/my_once.c2
-rw-r--r--mysys/my_thr_init.c2
-rw-r--r--mysys/my_write.c2
-rw-r--r--mysys/thr_alarm.c21
-rw-r--r--packaging/WiX/mysql_server.wxs.in7
-rw-r--r--packaging/rpm-uln/mysql.spec.sh29
-rw-r--r--plugin/audit_null/audit_null.c94
-rw-r--r--plugin/qc_info/qc_info.cc2
-rw-r--r--regex/my_regex.h2
-rw-r--r--regex/regcomp.c2
-rw-r--r--scripts/mysql_system_tables_data.sql15
-rw-r--r--sql-common/client.c4
-rw-r--r--sql/CMakeLists.txt9
-rw-r--r--sql/db.opt2
-rw-r--r--sql/event_db_repository.cc2
-rw-r--r--sql/ha_partition.cc496
-rw-r--r--sql/ha_partition.h20
-rw-r--r--sql/handler.cc35
-rw-r--r--sql/handler.h3
-rw-r--r--sql/item.cc58
-rw-r--r--sql/item.h134
-rw-r--r--sql/item_cmpfunc.cc6
-rw-r--r--sql/item_func.cc6
-rw-r--r--sql/item_func.h19
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_strfunc.h6
-rw-r--r--sql/item_sum.cc21
-rw-r--r--sql/key.cc112
-rw-r--r--sql/key.h4
-rw-r--r--sql/log.cc28
-rw-r--r--sql/log_event.cc31
-rw-r--r--sql/log_event.h31
-rw-r--r--sql/mysql_install_db.cc16
-rw-r--r--sql/mysqld.cc46
-rw-r--r--sql/opt_range.cc119
-rw-r--r--sql/partition_element.h7
-rw-r--r--sql/partition_info.cc289
-rw-r--r--sql/partition_info.h17
-rw-r--r--sql/rpl_mi.h2
-rw-r--r--sql/rpl_rli.cc18
-rw-r--r--sql/rpl_utility.cc1
-rw-r--r--sql/set_var.cc18
-rw-r--r--sql/set_var.h10
-rw-r--r--sql/slave.cc16
-rw-r--r--sql/sp.cc2
-rw-r--r--sql/sp_head.cc9
-rw-r--r--sql/sql_acl.cc31
-rw-r--r--sql/sql_admin.cc5
-rw-r--r--sql/sql_admin.h4
-rw-r--r--sql/sql_audit.cc32
-rw-r--r--sql/sql_audit.h91
-rw-r--r--sql/sql_base.cc4
-rw-r--r--sql/sql_binlog.cc2
-rw-r--r--sql/sql_cache.cc45
-rw-r--r--sql/sql_class.cc20
-rw-r--r--sql/sql_connect.cc2
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_error.cc8
-rw-r--r--sql/sql_error.h14
-rw-r--r--sql/sql_handler.cc10
-rw-r--r--sql/sql_insert.cc3
-rw-r--r--sql/sql_lex.cc3
-rw-r--r--sql/sql_lex.h3
-rw-r--r--sql/sql_parse.cc3
-rw-r--r--sql/sql_partition.cc219
-rw-r--r--sql/sql_partition.h6
-rw-r--r--sql/sql_partition_admin.cc4
-rw-r--r--sql/sql_plugin_compat.h4
-rw-r--r--sql/sql_prepare.cc9
-rw-r--r--sql/sql_repl.cc76
-rw-r--r--sql/sql_select.cc73
-rw-r--r--sql/sql_show.cc45
-rw-r--r--sql/sql_string.cc2
-rw-r--r--sql/sql_string.h10
-rw-r--r--sql/sql_table.cc21
-rw-r--r--sql/sql_test.cc2
-rw-r--r--sql/sql_view.cc12
-rw-r--r--sql/sql_yacc.yy58
-rw-r--r--sql/threadpool_unix.cc22
-rw-r--r--sql/tztime.cc4
-rw-r--r--storage/federated/ha_federated.cc4
-rw-r--r--storage/federatedx/ha_federatedx.cc9
-rw-r--r--storage/innobase/btr/btr0cur.c43
-rw-r--r--storage/innobase/buf/buf0buf.c15
-rw-r--r--storage/innobase/buf/buf0rea.c10
-rw-r--r--storage/innobase/dict/dict0crea.c9
-rw-r--r--storage/innobase/dict/dict0dict.c16
-rw-r--r--storage/innobase/dyn/dyn0dyn.c8
-rw-r--r--storage/innobase/handler/ha_innodb.cc110
-rw-r--r--storage/innobase/handler/i_s.cc3
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c12
-rw-r--r--storage/innobase/include/db0err.h1
-rw-r--r--storage/innobase/include/dyn0dyn.h84
-rw-r--r--storage/innobase/include/dyn0dyn.ic141
-rw-r--r--storage/innobase/include/ha_prototypes.h11
-rw-r--r--storage/innobase/include/mtr0mtr.h10
-rw-r--r--storage/innobase/include/page0zip.ic6
-rw-r--r--storage/innobase/include/ut0dbg.h42
-rw-r--r--storage/innobase/lock/lock0lock.c5
-rw-r--r--storage/innobase/mtr/mtr0mtr.c149
-rw-r--r--storage/innobase/page/page0zip.c11
-rw-r--r--storage/innobase/row/row0mysql.c2
-rw-r--r--storage/innobase/row/row0sel.c6
-rw-r--r--storage/innobase/srv/srv0srv.c40
-rw-r--r--storage/innobase/sync/sync0arr.c8
-rw-r--r--storage/innobase/trx/trx0sys.c2
-rw-r--r--storage/innobase/ut/ut0dbg.c32
-rw-r--r--storage/innobase/ut/ut0ut.c2
-rw-r--r--storage/maria/ha_maria.cc35
-rw-r--r--storage/maria/ma_blockrec.c73
-rw-r--r--storage/maria/ma_blockrec.h4
-rw-r--r--storage/maria/ma_check.c26
-rw-r--r--storage/maria/ma_delete.c1
-rw-r--r--storage/maria/ma_loghandler.c3
-rw-r--r--storage/maria/ma_open.c30
-rw-r--r--storage/maria/ma_pagecrc.c3
-rw-r--r--storage/maria/ma_recovery.c2
-rw-r--r--storage/maria/ma_scan.c3
-rw-r--r--storage/maria/ma_search.c10
-rw-r--r--storage/maria/ma_state.c45
-rw-r--r--storage/maria/ma_state.h1
-rw-r--r--storage/maria/ma_test1.c3
-rw-r--r--storage/maria/ma_test2.c4
-rw-r--r--storage/maria/ma_update.c1
-rw-r--r--storage/maria/ma_write.c1
-rw-r--r--storage/maria/maria_chk.c69
-rw-r--r--storage/maria/maria_def.h6
-rw-r--r--storage/maria/unittest/ma_test_recovery.expected384
-rw-r--r--storage/myisam/mi_write.c7
-rw-r--r--storage/myisam/myisampack.c3
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/perfschema/pfs_engine_table.cc8
-rw-r--r--storage/perfschema/pfs_global.cc4
-rw-r--r--storage/perfschema/pfs_global.h4
-rw-r--r--storage/sphinx/CMakeLists.txt9
-rw-r--r--storage/sphinx/snippets_udf.cc59
-rw-r--r--storage/xtradb/btr/btr0btr.c38
-rw-r--r--storage/xtradb/btr/btr0cur.c111
-rw-r--r--storage/xtradb/btr/btr0pcur.c13
-rw-r--r--storage/xtradb/btr/btr0sea.c5
-rw-r--r--storage/xtradb/buf/buf0buf.c121
-rw-r--r--storage/xtradb/buf/buf0flu.c9
-rw-r--r--storage/xtradb/buf/buf0lru.c40
-rw-r--r--storage/xtradb/buf/buf0rea.c8
-rw-r--r--storage/xtradb/dict/dict0dict.c6
-rw-r--r--storage/xtradb/fil/fil0fil.c105
-rw-r--r--storage/xtradb/fsp/fsp0fsp.c45
-rw-r--r--storage/xtradb/handler/ha_innodb.cc38
-rw-r--r--storage/xtradb/include/btr0btr.ic2
-rw-r--r--storage/xtradb/include/buf0buf.h1
-rw-r--r--storage/xtradb/include/buf0buf.ic9
-rw-r--r--storage/xtradb/include/buf0flu.ic2
-rw-r--r--storage/xtradb/include/buf0lru.h7
-rw-r--r--storage/xtradb/include/fut0fut.ic5
-rw-r--r--storage/xtradb/include/log0log.h16
-rw-r--r--storage/xtradb/include/log0log.ic23
-rw-r--r--storage/xtradb/include/mtr0mtr.h2
-rw-r--r--storage/xtradb/include/mtr0mtr.ic21
-rw-r--r--storage/xtradb/include/read0read.h33
-rw-r--r--storage/xtradb/include/read0read.ic41
-rw-r--r--storage/xtradb/include/srv0srv.h17
-rw-r--r--storage/xtradb/include/trx0purge.h1
-rw-r--r--storage/xtradb/include/trx0sys.h38
-rw-r--r--storage/xtradb/include/trx0sys.ic46
-rw-r--r--storage/xtradb/include/trx0trx.h43
-rw-r--r--storage/xtradb/include/trx0trx.ic8
-rw-r--r--storage/xtradb/include/univ.i2
-rw-r--r--storage/xtradb/lock/lock0lock.c22
-rw-r--r--storage/xtradb/log/log0log.c19
-rw-r--r--storage/xtradb/mtr/mtr0mtr.c39
-rw-r--r--storage/xtradb/read/read0read.c188
-rw-r--r--storage/xtradb/row/row0ins.c9
-rw-r--r--storage/xtradb/row/row0merge.c6
-rw-r--r--storage/xtradb/row/row0sel.c23
-rw-r--r--storage/xtradb/row/row0vers.c6
-rw-r--r--storage/xtradb/srv/srv0srv.c4
-rw-r--r--storage/xtradb/trx/trx0purge.c16
-rw-r--r--storage/xtradb/trx/trx0roll.c8
-rw-r--r--storage/xtradb/trx/trx0sys.c11
-rw-r--r--storage/xtradb/trx/trx0trx.c243
-rw-r--r--strings/ctype-bin.c27
-rw-r--r--strings/ctype-mb.c51
-rw-r--r--strings/ctype-simple.c26
-rw-r--r--strings/ctype-uca.c24
-rw-r--r--strings/ctype-utf8.c30
-rw-r--r--strings/ctype.c2
-rw-r--r--strings/decimal.c2
-rw-r--r--support-files/MySQL-shared-compat.spec.sh2
-rw-r--r--support-files/compiler_warnings.supp3
-rw-r--r--support-files/mysql.spec.sh181
-rw-r--r--tests/mysql_client_test.c119
-rw-r--r--vio/viossl.c3
-rw-r--r--win/packaging/ca/CustomAction.cpp2
-rw-r--r--win/packaging/extra.wxs.in15
-rw-r--r--win/packaging/heidisql.cmake2
464 files changed, 7733 insertions, 3067 deletions
diff --git a/.bzrignore b/.bzrignore
index ec28fd744bd..f0756392d3c 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1068,6 +1068,7 @@ vio/viotest.cpp
ylwrap
zlib/*.ds?
sql-bench/test-table-elimination
+sql/share/bulgarian
sql/share/czech
sql/share/danish
sql/share/dutch
@@ -1128,6 +1129,7 @@ cmd-line-utils/libedit/emacs.h
mysql-test/collections/default.release
support-files/plugins.files
client/mysql_plugin
+*.resource.txt
plugin/handler_socket/perl-Net-HandlerSocket/HandlerSocket.c
plugin/handler_socket/perl-Net-HandlerSocket/blib
plugin/handler_socket/perl-Net-HandlerSocket/pm_to_blib
@@ -1145,3 +1147,4 @@ sql/db.opt
./install_manifest_*.txt
typescript
mysql-test/collections/default.release.done
+sql/sql_yacc.hh
diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max
index 273942df5f8..ebdf278b7d2 100755
--- a/BUILD/compile-amd64-debug-max
+++ b/BUILD/compile-amd64-debug-max
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max
index c14f0d7104c..915129e1863 100755
--- a/BUILD/compile-amd64-max
+++ b/BUILD/compile-amd64-max
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-darwin-mwcc b/BUILD/compile-darwin-mwcc
index 88747de77af..ad2990f2de1 100755
--- a/BUILD/compile-darwin-mwcc
+++ b/BUILD/compile-darwin-mwcc
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-hpux11-parisc2-aCC b/BUILD/compile-hpux11-parisc2-aCC
index 5d0df465bc9..a4c9eb7abfa 100755
--- a/BUILD/compile-hpux11-parisc2-aCC
+++ b/BUILD/compile-hpux11-parisc2-aCC
@@ -1,6 +1,7 @@
#!/bin/sh
-# Copyright (C) 2004, 2005 MySQL AB
+# Copyright (c) 2004, 2005, 2007 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-irix-mips64-mipspro b/BUILD/compile-irix-mips64-mipspro
index a8433c715ab..13df7ea2028 100755
--- a/BUILD/compile-irix-mips64-mipspro
+++ b/BUILD/compile-irix-mips64-mipspro
@@ -1,6 +1,7 @@
#!/bin/sh
-# Copyright (C) 2004, 2005 MySQL AB
+# Copyright (c) 2004, 2005, 2007 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-ndb-autotest b/BUILD/compile-ndb-autotest
index e14855f1489..8002b4c5fad 100755
--- a/BUILD/compile-ndb-autotest
+++ b/BUILD/compile-ndb-autotest
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/BUILD/compile-pentium b/BUILD/compile-pentium
index 1da117541a4..fc3d070393d 100755
--- a/BUILD/compile-pentium
+++ b/BUILD/compile-pentium
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2000, 2002 MySQL AB
+# Copyright (c) 2000-2002, 2007 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded
index 55aede7536f..e88542f5d24 100755
--- a/BUILD/compile-pentium-debug-max-no-embedded
+++ b/BUILD/compile-pentium-debug-max-no-embedded
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2004, 2005 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb
index cb8dbc7e364..3319307fc32 100755
--- a/BUILD/compile-pentium-debug-max-no-ndb
+++ b/BUILD/compile-pentium-debug-max-no-ndb
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2005, 2007 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max
index 7bd063cd24a..77726735c79 100755
--- a/BUILD/compile-pentium-max
+++ b/BUILD/compile-pentium-max
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2001, 2005 MySQL AB
+# Copyright (c) 2001-2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug
index 76b6bf65ce4..2ee49a9fda3 100755
--- a/BUILD/compile-ppc-debug
+++ b/BUILD/compile-ppc-debug
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2004 MySQL AB
+# Copyright (c) 2004, 2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max
index b2c7ec18b3e..408f85f64e6 100755
--- a/BUILD/compile-ppc-debug-max
+++ b/BUILD/compile-ppc-debug-max
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2004, 2005 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-ppc-debug-max-no-ndb b/BUILD/compile-ppc-debug-max-no-ndb
index e77c517b302..958f6b09a11 100755
--- a/BUILD/compile-ppc-debug-max-no-ndb
+++ b/BUILD/compile-ppc-debug-max-no-ndb
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max
index cd2ada87dd8..5aac6af60e9 100755
--- a/BUILD/compile-ppc-max
+++ b/BUILD/compile-ppc-max
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2004, 2005 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB
+# Use is subject to license terms
#
# 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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 823bac6b6e3..70224ae81c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -332,8 +332,8 @@ INCLUDE(cmake/abi_check.cmake)
INCLUDE(cmake/tags.cmake)
IF(WIN32)
- ADD_SUBDIRECTORY(win/packaging)
ADD_SUBDIRECTORY(win/upgrade_wizard)
+ ADD_SUBDIRECTORY(win/packaging)
ENDIF()
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h)
diff --git a/VERSION b/VERSION
index 2dacb98ef55..45cfb298590 100644
--- a/VERSION
+++ b/VERSION
@@ -4,5 +4,5 @@
#
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
-MYSQL_VERSION_PATCH=1
+MYSQL_VERSION_PATCH=3
MYSQL_VERSION_EXTRA=
diff --git a/client/client_priv.h b/client/client_priv.h
index 607bd3997c1..70a9d129433 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/client/completion_hash.h b/client/completion_hash.h
index 8e1b2d6e453..50098e436b9 100644
--- a/client/completion_hash.h
+++ b/client/completion_hash.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2002 MySQL AB
+/* Copyright (c) 2000-2002, 2006 MySQL AB
+ Use is subject to license terms
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/client/echo.c b/client/echo.c
index e3d22edb3ae..cd61b23a826 100644
--- a/client/echo.c
+++ b/client/echo.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2007 MySQL AB
+ Use is subject to license terms
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
diff --git a/client/get_password.c b/client/get_password.c
index 09d307b5553..a73771b00d4 100644
--- a/client/get_password.c
+++ b/client/get_password.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2001, 2003, 2006, 2008 MySQL AB
+ Use is subject to license terms
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
diff --git a/client/mysql.cc b/client/mysql.cc
index d2be06e3ea8..1c81ec22372 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1635,7 +1635,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
{
switch(optid) {
case OPT_CHARSETS_DIR:
- strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1);
+ strmake_buf(mysql_charsets_dir, argument);
charsets_dir = mysql_charsets_dir;
break;
case OPT_DELIMITER:
@@ -1648,7 +1648,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
/* Check that delimiter does not contain a backslash */
if (!strstr(argument, "\\"))
{
- strmake(delimiter, argument, sizeof(delimiter) - 1);
+ strmake_buf(delimiter, argument);
}
else
{
@@ -1680,7 +1680,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (argument && strlen(argument))
{
default_pager_set= 1;
- strmake(pager, argument, sizeof(pager) - 1);
+ strmake_buf(pager, argument);
strmov(default_pager, pager);
}
else if (default_pager_set)
@@ -2961,7 +2961,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
{
char buff[256], *param;
CHARSET_INFO * new_cs;
- strmake(buff, line, sizeof(buff) - 1);
+ strmake_buf(buff, line);
param= get_arg(buff, 0);
if (!param || !*param)
{
@@ -3198,7 +3198,7 @@ static void init_tee(const char *file_name)
return;
}
OUTFILE = new_outfile;
- strmake(outfile, file_name, FN_REFLEN-1);
+ strmake_buf(outfile, file_name);
tee_fprintf(stdout, "Logging to file '%s'\n", file_name);
opt_outfile= 1;
return;
@@ -3827,7 +3827,7 @@ com_tee(String *buffer __attribute__((unused)),
/* eliminate the spaces before the parameters */
while (my_isspace(charset_info,*param))
param++;
- end= strmake(file_name, param, sizeof(file_name) - 1);
+ end= strmake_buf(file_name, param);
/* remove end space from command line */
while (end > file_name && (my_isspace(charset_info,end[-1]) ||
my_iscntrl(charset_info,end[-1])))
@@ -3888,7 +3888,7 @@ com_pager(String *buffer __attribute__((unused)),
}
else
{
- end= strmake(pager_name, param, sizeof(pager_name)-1);
+ end= strmake_buf(pager_name, param);
while (end > pager_name && (my_isspace(charset_info,end[-1]) ||
my_iscntrl(charset_info,end[-1])))
end--;
@@ -4101,7 +4101,7 @@ static int com_source(String *buffer __attribute__((unused)),
INFO_ERROR, 0);
while (my_isspace(charset_info,*param))
param++;
- end=strmake(source_name,param,sizeof(source_name)-1);
+ end=strmake_buf(source_name, param);
while (end > source_name && (my_isspace(charset_info,end[-1]) ||
my_iscntrl(charset_info,end[-1])))
end--;
@@ -4154,7 +4154,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
{
char buff[256], *tmp;
- strmake(buff, line, sizeof(buff) - 1);
+ strmake_buf(buff, line);
tmp= get_arg(buff, 0);
if (!tmp || !*tmp)
@@ -4171,7 +4171,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
return 0;
}
}
- strmake(delimiter, tmp, sizeof(delimiter) - 1);
+ strmake_buf(delimiter, tmp);
delimiter_length= (int)strlen(delimiter);
delimiter_str= delimiter;
return 0;
@@ -4185,7 +4185,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
int select_db;
bzero(buff, sizeof(buff));
- strmake(buff, line, sizeof(buff) - 1);
+ strmake_buf(buff, line);
tmp= get_arg(buff, 0);
if (!tmp || !*tmp)
{
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 8d1122dc0fd..635b7e0d93f 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -18,7 +18,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
-#define CHECK_VERSION "2.7.0"
+#define CHECK_VERSION "2.7.1"
#include "client_priv.h"
#include <m_ctype.h>
@@ -32,6 +32,10 @@
#define EX_USAGE 1
#define EX_MYSQLERR 2
+/* ALTER instead of repair. */
+#define MAX_ALTER_STR_SIZE 128 * 1024
+#define KEY_PARTITIONING_CHANGED_STR "KEY () partitioning changed"
+
static MYSQL mysql_connection, *sock = 0;
static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0,
@@ -47,7 +51,7 @@ static char *opt_password = 0, *current_user = 0,
*default_charset= 0, *current_host= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
-DYNAMIC_ARRAY tables4repair, tables4rebuild;
+DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
static char *shared_memory_base_name=0;
static uint opt_protocol=0;
@@ -620,6 +624,17 @@ static int process_all_tables_in_db(char *database)
} /* process_all_tables_in_db */
+static int run_query(const char *query)
+{
+ if (mysql_query(sock, query))
+ {
+ fprintf(stderr, "Failed to %s\n", query);
+ fprintf(stderr, "Error: %s\n", mysql_error(sock));
+ return 1;
+ }
+ return 0;
+}
+
static int fix_table_storage_name(const char *name)
{
@@ -630,12 +645,7 @@ static int fix_table_storage_name(const char *name)
if (strncmp(name, "#mysql50#", 9))
DBUG_RETURN(1);
sprintf(qbuf, "RENAME TABLE `%s` TO `%s`", name, name + 9);
- if (mysql_query(sock, qbuf))
- {
- fprintf(stderr, "Failed to %s\n", qbuf);
- fprintf(stderr, "Error: %s\n", mysql_error(sock));
- rc= 1;
- }
+ rc= run_query(qbuf);
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
DBUG_RETURN(rc);
@@ -650,12 +660,7 @@ static int fix_database_storage_name(const char *name)
if (strncmp(name, "#mysql50#", 9))
DBUG_RETURN(1);
sprintf(qbuf, "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY NAME", name);
- if (mysql_query(sock, qbuf))
- {
- fprintf(stderr, "Failed to %s\n", qbuf);
- fprintf(stderr, "Error: %s\n", mysql_error(sock));
- rc= 1;
- }
+ rc= run_query(qbuf);
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
DBUG_RETURN(rc);
@@ -726,15 +731,7 @@ static int use_db(char *database)
static int disable_binlog()
{
const char *stmt= "SET SQL_LOG_BIN=0";
- DBUG_ENTER("disable_binlog");
-
- if (mysql_query(sock, stmt))
- {
- fprintf(stderr, "Failed to %s\n", stmt);
- fprintf(stderr, "Error: %s\n", mysql_error(sock));
- DBUG_RETURN(1);
- }
- DBUG_RETURN(0);
+ return run_query(stmt);
}
static int handle_request_for_tables(char *tables, uint length)
@@ -821,6 +818,7 @@ static void print_result()
MYSQL_RES *res;
MYSQL_ROW row;
char prev[(NAME_LEN+9)*2+2];
+ char prev_alter[MAX_ALTER_STR_SIZE];
uint i;
my_bool found_error=0, table_rebuild=0;
DBUG_ENTER("print_result");
@@ -828,6 +826,7 @@ static void print_result()
res = mysql_use_result(sock);
prev[0] = '\0';
+ prev_alter[0]= 0;
for (i = 0; (row = mysql_fetch_row(res)); i++)
{
int changed = strcmp(prev, row[0]);
@@ -844,12 +843,18 @@ static void print_result()
strcmp(row[3],"OK"))
{
if (table_rebuild)
- insert_dynamic(&tables4rebuild, (uchar*) prev);
+ {
+ if (prev_alter[0])
+ insert_dynamic(&alter_table_cmds, (uchar*) prev_alter);
+ else
+ insert_dynamic(&tables4rebuild, (uchar*) prev);
+ }
else
insert_dynamic(&tables4repair, (uchar*) prev);
}
found_error=0;
table_rebuild=0;
+ prev_alter[0]= 0;
if (opt_silent)
continue;
}
@@ -866,11 +871,30 @@ static void print_result()
printf("%-50s %s", row[0], "Needs upgrade");
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
- if (strcmp(row[2],"note"))
+ if (opt_auto_repair && strcmp(row[2],"note"))
{
- found_error=1;
- if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL)
+ const char *alter_txt= strstr(row[3], "ALTER TABLE");
+ found_error=1;
+ if (alter_txt)
+ {
table_rebuild=1;
+ if (!strncmp(row[3], KEY_PARTITIONING_CHANGED_STR,
+ strlen(KEY_PARTITIONING_CHANGED_STR)) &&
+ strstr(alter_txt, "PARTITION BY"))
+ {
+ if (strlen(alter_txt) >= MAX_ALTER_STR_SIZE)
+ {
+ printf("Error: Alter command too long (>= %d),"
+ " please do \"%s\" or dump/reload to fix it!\n",
+ MAX_ALTER_STR_SIZE,
+ alter_txt);
+ table_rebuild= 0;
+ prev_alter[0]= 0;
+ }
+ else
+ strcpy(prev_alter, alter_txt);
+ }
+ }
}
}
else
@@ -882,7 +906,12 @@ static void print_result()
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
{
if (table_rebuild)
- insert_dynamic(&tables4rebuild, (uchar*) prev);
+ {
+ if (prev_alter[0])
+ insert_dynamic(&alter_table_cmds, (uchar*) prev_alter);
+ else
+ insert_dynamic(&tables4rebuild, (uchar*) prev);
+ }
else
insert_dynamic(&tables4repair, (uchar*) prev);
}
@@ -997,7 +1026,9 @@ int main(int argc, char **argv)
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
- 64, MYF(0))))
+ 64, MYF(0)) ||
+ my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0,
+ 1, MYF(0))))
goto end;
if (opt_alldbs)
@@ -1022,6 +1053,8 @@ int main(int argc, char **argv)
}
for (i = 0; i < tables4rebuild.elements ; i++)
rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
+ for (i = 0; i < alter_table_cmds.elements ; i++)
+ run_query((char*) dynamic_array_ptr(&alter_table_cmds, i));
}
ret= test(first_error);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 47cb5132b85..13cc1d3c5f7 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -1914,7 +1914,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
const char *str_create)
{
uint i;
- my_bool __attribute__((unused)) body_found= 0;
+ my_bool body_found __attribute__((unused)) = 0;
char *create_stmt_ptr= NULL;
ulong create_stmt_len= 0;
MYSQL_FIELD *field;
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 222ecbdba6c..bf597ab57a5 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -6353,8 +6353,7 @@ void do_delimiter(struct st_command* command)
if (!(*p))
die("Can't set empty delimiter");
- strmake(delimiter, p, sizeof(delimiter) - 1);
- delimiter_length= strlen(delimiter);
+ delimiter_length= strmake_buf(delimiter, p) - delimiter;
DBUG_PRINT("exit", ("delimiter: %s", delimiter));
command->last_argument= p + delimiter_length;
diff --git a/client/sql_string.cc.dontuse b/client/sql_string.cc.dontuse
index 64219886dd0..9679197b207 100644
--- a/client/sql_string.cc.dontuse
+++ b/client/sql_string.cc.dontuse
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
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
@@ -691,7 +691,7 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
{
if (from->Alloced_length >= from_length)
return from;
- if (from->alloced || !to || from == to)
+ if ((from->alloced && (from->Alloced_length != 0)) || !to || from == to)
{
(void) from->realloc(from_length);
return from;
diff --git a/cmake/configure.pl b/cmake/configure.pl
index 51e83c2815c..d5c0b9b061a 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index ee7c4af7155..ee800fca4e4 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -95,7 +95,7 @@ SET(CPACK_RPM_devel_USER_FILELIST ${ignored})
SET(CPACK_RPM_test_USER_FILELIST ${ignored})
SET(CPACK_RPM_client_PACKAGE_OBSOLETES "mysql-client MySQL-client MySQL-OurDelta-client")
-SET(CPACK_RPM_client_PACKAGE_PROVIDES "MariaDB-client MySQL-client mysql-client")
+SET(CPACK_RPM_client_PACKAGE_PROVIDES "MySQL-client mysql-client")
# this is a workaround for CPackRPM.cmake (as of 2.8.8) bug.
# If a package group does not specify OBSOLETES/REQUIRES the values of the
@@ -104,22 +104,40 @@ SET(CPACK_RPM_common_PACKAGE_OBSOLETES "MySQL-common")
SET(CPACK_RPM_common_PACKAGE_PROVIDES "MariaDB-common")
SET(CPACK_RPM_devel_PACKAGE_OBSOLETES "mysql-devel MySQL-devel MySQL-OurDelta-devel")
-SET(CPACK_RPM_devel_PACKAGE_PROVIDES "MariaDB-devel MySQL-devel mysql-devel")
+SET(CPACK_RPM_devel_PACKAGE_PROVIDES "MySQL-devel mysql-devel")
-SET(CPACK_RPM_server_PACKAGE_OBSOLETES "MariaDB mysql mysql-server MySQL-server MySQL-OurDelta-server")
-SET(CPACK_RPM_server_PACKAGE_PROVIDES "MariaDB MariaDB-server MySQL-server config(MariaDB-server) msqlormysql mysql mysql(x86-32) mysql(x86-64) mysql-server")
+SET(CPACK_RPM_server_PACKAGE_OBSOLETES "MariaDB MySQL mysql-server MySQL-server MySQL-OurDelta-server")
+SET(CPACK_RPM_server_PACKAGE_PROVIDES "MariaDB MySQL MySQL-server msqlormysql mysql-server")
SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)
SET(CPACK_RPM_server_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-preun.sh)
SET(CPACK_RPM_server_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postin.sh)
SET(CPACK_RPM_server_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postun.sh)
SET(CPACK_RPM_shared_PACKAGE_OBSOLETES "mysql-shared MySQL-shared-standard MySQL-shared-pro MySQL-shared-pro-cert MySQL-shared-pro-gpl MySQL-shared-pro-gpl-cert MySQL-shared MySQL-OurDelta-shared mysql-libs")
-SET(CPACK_RPM_shared_PACKAGE_PROVIDES "MariaDB-shared MySQL-shared mysql-shared libmysqlclient.so.18 libmysqlclient.so.18(libmysqlclient_16) libmysqlclient.so.18(libmysqlclient_18) libmysqlclient_r.so.18 libmysqlclient_r.so.18(libmysqlclient_18) mysql-libs")
+SET(CPACK_RPM_shared_PACKAGE_PROVIDES "MySQL-shared mysql-shared")
+
SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
SET(CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
SET(CPACK_RPM_test_PACKAGE_OBSOLETES "mysql-test MySQL-test MySQL-OurDelta-test")
-SET(CPACK_RPM_test_PACKAGE_PROVIDES "MariaDB-test MySQL-test mysql-test")
+SET(CPACK_RPM_test_PACKAGE_PROVIDES "MySQL-test mysql-test")
+
+# Argh! Different distributions call packages differently, to be a drop-in replacement
+# we have to fake distribution-speficic dependencies
+MACRO(ALTERNATIVE_NAME real alt)
+ SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES")
+ SET(${p} "${${p}} ${alt} ${alt}(x86-32) ${alt}(x86-64) config(${alt})")
+ENDMACRO(ALTERNATIVE_NAME)
+
+IF(RPM MATCHES "(rhel|centos)5")
+ ALTERNATIVE_NAME("shared" "mysql")
+ELSEIF(RPM MATCHES "(rhel|centos)6")
+ ALTERNATIVE_NAME("client" "mysql")
+ ALTERNATIVE_NAME("shared" "mysql-libs")
+ELSEIF(RPM MATCHES "fedora")
+ ALTERNATIVE_NAME("client" "mysql")
+ ALTERNATIVE_NAME("shared" "mysql-libs")
+ENDIF()
# workaround for lots of perl dependencies added by rpmbuild
SET(CPACK_RPM_test_PACKAGE_PROVIDES "${CPACK_RPM_test_PACKAGE_PROVIDES} perl(lib::mtr_gcov.pl) perl(lib::mtr_gprof.pl) perl(lib::mtr_io.pl) perl(lib::mtr_misc.pl) perl(lib::mtr_process.pl) perl(lib::v1/mtr_cases.pl) perl(lib::v1/mtr_gcov.pl) perl(lib::v1/mtr_gprof.pl) perl(lib::v1/mtr_im.pl) perl(lib::v1/mtr_io.pl) perl(lib::v1/mtr_match.pl) perl(lib::v1/mtr_misc.pl) perl(lib::v1/mtr_process.pl) perl(lib::v1/mtr_report.pl) perl(lib::v1/mtr_stress.pl) perl(lib::v1/mtr_timer.pl) perl(lib::v1/mtr_unique.pl) perl(mtr_cases) perl(mtr_io.pl) perl(mtr_match) perl(mtr_misc.pl) perl(mtr_report) perl(mtr_results) perl(mtr_unique)")
diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in
index 9888a7df7a2..ce638b14e39 100644
--- a/cmake/create_initial_db.cmake.in
+++ b/cmake/create_initial_db.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index 1b347e41836..ada27c36926 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 9dd2dfed1e6..2abff3dc63d 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/os/FreeBSD.cmake b/cmake/os/FreeBSD.cmake
index 27afe679f25..3a5a29f6de6 100644
--- a/cmake/os/FreeBSD.cmake
+++ b/cmake/os/FreeBSD.cmake
@@ -32,9 +32,3 @@ IF(EXECINFO)
SET(LIBEXECINFO ${EXECINFO})
ENDIF()
-# Use atomic builtins
-IF(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
- SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=i686")
-ENDIF()
diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake
index 108e06cf7b0..36d7ade66a7 100644
--- a/cmake/os/Linux.cmake
+++ b/cmake/os/Linux.cmake
@@ -47,9 +47,3 @@ IF(HAVE_DECL_SHM_HUGETLB)
SET(HAVE_LARGE_PAGE_OPTION 1)
ENDIF()
-IF(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "86")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
- SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=i686")
-ENDIF()
-
diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
index 93e7d968b2a..2d0b689dc7a 100644
--- a/cmake/package_name.cmake
+++ b/cmake/package_name.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index f016d8eab4f..2f1ebc8f428 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/readline.cmake b/cmake/readline.cmake
index 285b436921e..c99557683a6 100644
--- a/cmake/readline.cmake
+++ b/cmake/readline.cmake
@@ -115,7 +115,7 @@ ENDMACRO()
MACRO (MYSQL_USE_BUNDLED_READLINE)
SET(USE_NEW_READLINE_INTERFACE 1)
- SET(HAVE_HIST_ENTRY)
+ SET(HAVE_HIST_ENTRY 0 CACHE INTERNAL "" FORCE)
SET(READLINE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/cmd-line-utils)
SET(READLINE_LIBRARY readline)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/cmd-line-utils/readline)
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index cabff530b47..ca950229129 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index 3ede3aba228..83597357aba 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -57,13 +57,17 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_LIBRARIES z)
CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
+ CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND)
+ CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)
SET(CMAKE_REQUIRED_LIBRARIES)
- IF(HAVE_CRC32)
+ IF(HAVE_CRC32 AND HAVE_COMPRESSBOUND AND HAVE_DEFLATEBOUND)
SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library")
- SET(WITH_ZLIB "system" CACHE STRING "Which zlib to use (possible values are 'bundled' or 'system')")
+ SET(WITH_ZLIB "system" CACHE STRING
+ "Which zlib to use (possible values are 'bundled' or 'system')")
SET(ZLIB_SOURCES "")
ELSE()
SET(ZLIB_FOUND FALSE CACHE INTERNAL "Zlib found but not usable")
+ MESSAGE(STATUS "system zlib found but not usable")
ENDIF()
ENDIF()
IF(NOT ZLIB_FOUND)
diff --git a/configure.cmake b/configure.cmake
index 23fa3a7c5c2..bec53258739 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1,5 +1,5 @@
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control
index 95bde727093..9c96313045d 100644
--- a/debian/dist/Debian/control
+++ b/debian/dist/Debian/control
@@ -204,7 +204,7 @@ Description: MariaDB database server binaries
Package: mariadb-server
Section: database
Architecture: all
-Depends: mariadb-server-5.5, ${misc:Depends}
+Depends: mariadb-server-5.5 (= ${source:Version}), ${misc:Depends}
Description: MariaDB database server (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
mariadb-server (currently mariadb-server-5.5), as determined by the MariaDB
@@ -220,7 +220,7 @@ Description: MariaDB database server (metapackage depending on the latest versio
Package: mariadb-client
Section: database
Architecture: all
-Depends: mariadb-client-5.5, ${misc:Depends}
+Depends: mariadb-client-5.5 (= ${source:Version}), ${misc:Depends}
Description: MariaDB database client (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
mariadb-client (currently mariadb-client-5.5), as determined by the MariaDB
@@ -230,7 +230,7 @@ Description: MariaDB database client (metapackage depending on the latest versio
Package: mariadb-test
Section: database
Architecture: all
-Depends: mariadb-test-5.5
+Depends: mariadb-test-5.5 (= ${source:Version})
Description: MariaDB database regression test suite (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
mariadb-test (currently mariadb-test-5.5), as determined by the MariaDB
diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control
index 70ef5fd2ecf..d1c4917ed63 100644
--- a/debian/dist/Ubuntu/control
+++ b/debian/dist/Ubuntu/control
@@ -198,7 +198,7 @@ Description: MariaDB database server binaries
Package: mariadb-server
Section: database
Architecture: all
-Depends: mariadb-server-5.5, ${misc:Depends}
+Depends: mariadb-server-5.5 (= ${source:Version}), ${misc:Depends}
Description: MariaDB database server (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
mariadb-server (currently mariadb-server-5.5), as determined by the MariaDB
@@ -214,7 +214,7 @@ Description: MariaDB database server (metapackage depending on the latest versio
Package: mariadb-client
Section: database
Architecture: all
-Depends: mariadb-client-5.5, ${misc:Depends}
+Depends: mariadb-client-5.5 (= ${source:Version}), ${misc:Depends}
Description: MariaDB database client (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
mariadb-client (currently mariadb-client-5.5), as determined by the MariaDB
@@ -224,7 +224,7 @@ Description: MariaDB database client (metapackage depending on the latest versio
Package: mariadb-test
Section: database
Architecture: all
-Depends: mariadb-test-5.5
+Depends: mariadb-test-5.5 (= ${source:Version})
Description: MariaDB database regression test suite (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
mariadb-test (currently mariadb-test-5.5), as determined by the MariaDB
diff --git a/extra/charset2html.c b/extra/charset2html.c
index 8dcfa0c8990..834f54f125b 100644
--- a/extra/charset2html.c
+++ b/extra/charset2html.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2002-2004, 2007, 2008 MySQL AB
+ Use is subject to license terms
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
diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt
index 5f2f1956803..26ea7e23e33 100644
--- a/extra/yassl/CMakeLists.txt
+++ b/extra/yassl/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
#
# 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
diff --git a/extra/yassl/examples/client/client.cpp b/extra/yassl/examples/client/client.cpp
index d05c31d4d63..fc05b66aaf7 100644
--- a/extra/yassl/examples/client/client.cpp
+++ b/extra/yassl/examples/client/client.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 MySQL AB
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/examples/echoclient/echoclient.cpp b/extra/yassl/examples/echoclient/echoclient.cpp
index c2b8ff66ac9..fabcfbec29e 100644
--- a/extra/yassl/examples/echoclient/echoclient.cpp
+++ b/extra/yassl/examples/echoclient/echoclient.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 MySQL AB
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/examples/echoserver/echoserver.cpp b/extra/yassl/examples/echoserver/echoserver.cpp
index bd044e70e8b..82696568ace 100644
--- a/extra/yassl/examples/echoserver/echoserver.cpp
+++ b/extra/yassl/examples/echoserver/echoserver.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 MySQL AB
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/examples/server/server.cpp b/extra/yassl/examples/server/server.cpp
index 3fac40e88c4..173ce8fb548 100644
--- a/extra/yassl/examples/server/server.cpp
+++ b/extra/yassl/examples/server/server.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 MySQL AB
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/buffer.hpp b/extra/yassl/include/buffer.hpp
index 2d7817a7ca2..27f71199093 100644
--- a/extra/yassl/include/buffer.hpp
+++ b/extra/yassl/include/buffer.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/cert_wrapper.hpp b/extra/yassl/include/cert_wrapper.hpp
index d07e5b627b0..8be0f3b3e6a 100644
--- a/extra/yassl/include/cert_wrapper.hpp
+++ b/extra/yassl/include/cert_wrapper.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp
index 487bedfcc70..5273f92f151 100644
--- a/extra/yassl/include/lock.hpp
+++ b/extra/yassl/include/lock.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h
index 024cb0a9aff..22b3f4de34b 100644
--- a/extra/yassl/include/openssl/prefix_ssl.h
+++ b/extra/yassl/include/openssl/prefix_ssl.h
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2006, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp
index 2372e64e56c..c9f1e3af09c 100644
--- a/extra/yassl/include/socket_wrapper.hpp
+++ b/extra/yassl/include/socket_wrapper.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/yassl_error.hpp b/extra/yassl/include/yassl_error.hpp
index 8efc7f72e87..a4b29ae2e8c 100644
--- a/extra/yassl/include/yassl_error.hpp
+++ b/extra/yassl/include/yassl_error.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2010 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
@@ -53,7 +52,8 @@ enum YasslError {
badVersion_error = 117,
compress_error = 118,
decompress_error = 119,
- pms_version_error = 120
+ pms_version_error = 120,
+ sanityCipher_error = 121
// !!!! add error message to .cpp !!!!
diff --git a/extra/yassl/include/yassl_imp.hpp b/extra/yassl/include/yassl_imp.hpp
index 04e85c16a04..a952da0d3d9 100644
--- a/extra/yassl/include/yassl_imp.hpp
+++ b/extra/yassl/include/yassl_imp.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index e5ee00bc21c..f93727aa9f3 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/yassl_types.hpp b/extra/yassl/include/yassl_types.hpp
index a9e22833eb1..6a8c3f6c075 100644
--- a/extra/yassl/include/yassl_types.hpp
+++ b/extra/yassl/include/yassl_types.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
@@ -220,7 +219,11 @@ const int DEFAULT_TIMEOUT = 500; // Default Session timeout in seconds
const int MAX_RECORD_SIZE = 16384; // 2^14, max size by standard
const int COMPRESS_EXTRA = 1024; // extra compression possible addition
const int SESSION_FLUSH_COUNT = 256; // when to flush session cache
-
+const int MAX_PAD_SIZE = 256; // max TLS padding size
+const int COMPRESS_CONSTANT = 13; // compression calculation constant
+const int COMPRESS_UPPER = 55; // compression calculation numerator
+const int COMPRESS_LOWER = 64; // compression calculation denominator
+const int COMPRESS_DUMMY_SIZE = 64; // compression dummy round size
typedef uint8 Cipher; // first byte is always 0x00 for SSLv3 & TLS
diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp
index d885c953207..ec35f1760e7 100644
--- a/extra/yassl/src/buffer.cpp
+++ b/extra/yassl/src/buffer.cpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/cert_wrapper.cpp b/extra/yassl/src/cert_wrapper.cpp
index 917cfa1a8fb..639f0996d7e 100644
--- a/extra/yassl/src/cert_wrapper.cpp
+++ b/extra/yassl/src/cert_wrapper.cpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp
index 42a43627760..d85cc6ba6a0 100644
--- a/extra/yassl/src/crypto_wrapper.cpp
+++ b/extra/yassl/src/crypto_wrapper.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index c7dbaf86071..d0f6827e862 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
@@ -221,12 +220,45 @@ void buildSHA(SSL& ssl, Finished& fin, const opaque* sender)
}
+// sanity checks on encrypted message size
+static int sanity_check_message(SSL& ssl, uint msgSz)
+{
+ uint minSz = 0;
+
+ if (ssl.getSecurity().get_parms().cipher_type_ == block) {
+ uint blockSz = ssl.getCrypto().get_cipher().get_blockSize();
+ if (msgSz % blockSz)
+ return -1;
+
+ minSz = ssl.getSecurity().get_parms().hash_size_ + 1; // pad byte too
+ if (blockSz > minSz)
+ minSz = blockSz;
+
+ if (ssl.isTLSv1_1())
+ minSz += blockSz; // explicit IV
+ }
+ else { // stream
+ minSz = ssl.getSecurity().get_parms().hash_size_;
+ }
+
+ if (msgSz < minSz)
+ return -1;
+
+ return 0;
+}
+
+
// decrypt input message in place, store size in case needed later
void decrypt_message(SSL& ssl, input_buffer& input, uint sz)
{
input_buffer plain(sz);
opaque* cipher = input.get_buffer() + input.get_current();
+ if (sanity_check_message(ssl, sz) != 0) {
+ ssl.SetError(sanityCipher_error);
+ return;
+ }
+
ssl.useCrypto().use_cipher().decrypt(plain.get_buffer(), cipher, sz);
memcpy(cipher, plain.get_buffer(), sz);
ssl.useSecurity().use_parms().encrypt_size_ = sz;
@@ -774,6 +806,8 @@ int DoProcessReply(SSL& ssl)
return 0;
}
decrypt_message(ssl, buffer, hdr.length_);
+ if (ssl.GetError())
+ return 0;
}
mySTL::auto_ptr<Message> msg(mf.CreateObject(hdr.type_));
diff --git a/extra/yassl/src/lock.cpp b/extra/yassl/src/lock.cpp
index d603440757f..c74ea1c6b76 100644
--- a/extra/yassl/src/lock.cpp
+++ b/extra/yassl/src/lock.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/make.bat b/extra/yassl/src/make.bat
index cccd11dbd17..42f49ee4c0a 100755
--- a/extra/yassl/src/make.bat
+++ b/extra/yassl/src/make.bat
@@ -1,4 +1,4 @@
-REM Copyright (C) 2006, 2007 MySQL AB
+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp
index d88df13c08e..7afd4d41d1d 100644
--- a/extra/yassl/src/socket_wrapper.cpp
+++ b/extra/yassl/src/socket_wrapper.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 6c839bc2f79..becc4e5ba83 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2008-2010 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/yassl.cpp b/extra/yassl/src/yassl.cpp
index 99a1da5371b..b6b9a87e09a 100644
--- a/extra/yassl/src/yassl.cpp
+++ b/extra/yassl/src/yassl.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index f48fbdc925e..2d42e82ab4a 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2011, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
@@ -144,6 +144,10 @@ void SetErrorString(YasslError error, char* buffer)
strncpy(buffer, "bad PreMasterSecret version error", max);
break;
+ case sanityCipher_error :
+ strncpy(buffer, "sanity check on cipher text size error", max);
+ break;
+
// openssl errors
case SSL_ERROR_WANT_READ :
strncpy(buffer, "the read operation would block", max);
diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp
index c0ef23a4e94..d943775101b 100644
--- a/extra/yassl/src/yassl_imp.cpp
+++ b/extra/yassl/src/yassl_imp.cpp
@@ -972,30 +972,193 @@ output_buffer& operator<<(output_buffer& output, const Data& data)
}
+// check all bytes for equality
+static int constant_compare(const byte* a, const byte* b, int len)
+{
+ int good = 0;
+ int bad = 0;
+
+ for (int i = 0; i < len; i++) {
+ if (a[i] == b[i])
+ good++;
+ else
+ bad++;
+ }
+
+ if (good == len)
+ return 0;
+ else
+ return 0 - bad; // failure
+}
+
+
+// check bytes for pad value
+static int pad_check(const byte* input, byte pad, int len)
+{
+ int good = 0;
+ int bad = 0;
+
+ for (int i = 0; i < len; i++) {
+ if (input[i] == pad)
+ good++;
+ else
+ bad++;
+ }
+
+ if (good == len)
+ return 0;
+ else
+ return 0 - bad; // failure
+}
+
+
+// get number of compression rounds
+static inline int get_rounds(int pLen, int padLen, int t)
+{
+ int roundL1 = 1; // round ups
+ int roundL2 = 1;
+
+ int L1 = COMPRESS_CONSTANT + pLen - t;
+ int L2 = COMPRESS_CONSTANT + pLen - padLen - 1 - t;
+
+ L1 -= COMPRESS_UPPER;
+ L2 -= COMPRESS_UPPER;
+
+ if ( (L1 % COMPRESS_LOWER) == 0)
+ roundL1 = 0;
+ if ( (L2 % COMPRESS_LOWER) == 0)
+ roundL2 = 0;
+
+ L1 /= COMPRESS_LOWER;
+ L2 /= COMPRESS_LOWER;
+
+ L1 += roundL1;
+ L2 += roundL2;
+
+ return L1 - L2;
+}
+
+
+// do compression rounds on dummy data
+static inline void compress_rounds(SSL& ssl, int rounds, const byte* dummy)
+{
+ if (rounds) {
+ Digest* digest = NULL;
+
+ MACAlgorithm ma = ssl.getSecurity().get_parms().mac_algorithm_;
+ if (ma == sha)
+ digest = NEW_YS SHA;
+ else if (ma == md5)
+ digest = NEW_YS MD5;
+ else if (ma == rmd)
+ digest = NEW_YS RMD;
+ else
+ return;
+
+ for (int i = 0; i < rounds; i++)
+ digest->update(dummy, COMPRESS_LOWER);
+
+ ysDelete(digest);
+ }
+}
+
+
+// timing resistant pad verification
+static int timing_verify(SSL& ssl, const byte* input, int padLen, int t,
+ int pLen)
+{
+ byte verify[SHA_LEN];
+ byte dummy[MAX_PAD_SIZE];
+
+ memset(dummy, 1, sizeof(dummy));
+
+ if ( (t + padLen + 1) > pLen) {
+ pad_check(dummy, (byte)padLen, MAX_PAD_SIZE);
+ if (ssl.isTLS())
+ TLS_hmac(ssl, verify, input, pLen - t, application_data, 1);
+ else
+ hmac(ssl, verify, input, pLen - t, application_data, 1);
+ constant_compare(verify, input + pLen - t, t);
+
+ return -1;
+ }
+
+ if (pad_check(input + pLen - (padLen + 1), (byte)padLen, padLen + 1) != 0) {
+ pad_check(dummy, (byte)padLen, MAX_PAD_SIZE - padLen - 1);
+ if (ssl.isTLS())
+ TLS_hmac(ssl, verify, input, pLen - t, application_data, 1);
+ else
+ hmac(ssl, verify, input, pLen - t, application_data, 1);
+ constant_compare(verify, input + pLen - t, t);
+
+ return -1;
+ }
+
+ pad_check(dummy, (byte)padLen, MAX_PAD_SIZE - padLen - 1);
+ if (ssl.isTLS())
+ TLS_hmac(ssl, verify, input, pLen - padLen - 1 - t, application_data,1);
+ else
+ hmac(ssl, verify, input, pLen - padLen - 1 - t, application_data, 1);
+
+ compress_rounds(ssl, get_rounds(pLen, padLen, t), dummy);
+
+ if (constant_compare(verify, input + (pLen - padLen - 1 - t), t) != 0)
+ return -1;
+
+ return 0;
+}
+
+
// Process handler for Data
void Data::Process(input_buffer& input, SSL& ssl)
{
int msgSz = ssl.getSecurity().get_parms().encrypt_size_;
int pad = 0, padSz = 0;
int ivExtra = 0;
+ int digestSz = ssl.getCrypto().get_digest().get_digestSize();
+ const byte* rawData = input.get_buffer() + input.get_current();
+ opaque verify[SHA_LEN];
if (ssl.getSecurity().get_parms().cipher_type_ == block) {
if (ssl.isTLSv1_1()) // IV
ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1);
padSz = 1;
+
+ if (ssl.isTLS()) {
+ if (timing_verify(ssl, rawData, pad,digestSz, msgSz-ivExtra) != 0) {
+ ssl.SetError(verify_error);
+ return;
+ }
+ }
+ else { // SSLv3, some don't do this padding right
+ int sz3 = msgSz - digestSz - pad - 1;
+ hmac(ssl, verify, rawData, sz3, application_data, true);
+ if (constant_compare(verify, rawData + sz3, digestSz) != 0) {
+ ssl.SetError(verify_error);
+ return;
+ }
+ }
}
- int digestSz = ssl.getCrypto().get_digest().get_digestSize();
+ else { // stream
+ int streamSz = msgSz - digestSz;
+ if (ssl.isTLS())
+ TLS_hmac(ssl, verify, rawData, streamSz, application_data, true);
+ else
+ hmac(ssl, verify, rawData, streamSz, application_data, true);
+ if (constant_compare(verify, rawData + streamSz, digestSz) != 0) {
+ ssl.SetError(verify_error);
+ return;
+ }
+ }
+
int dataSz = msgSz - ivExtra - digestSz - pad - padSz;
- opaque verify[SHA_LEN];
if (dataSz < 0) {
ssl.SetError(bad_input);
return;
}
- const byte* rawData = input.get_buffer() + input.get_current();
-
// read data
if (dataSz) { // could be compressed
if (ssl.CompressionOn()) {
@@ -1013,27 +1176,10 @@ void Data::Process(input_buffer& input, SSL& ssl)
input.read(data->get_buffer(), dataSz);
data->add_size(dataSz);
}
-
- if (ssl.isTLS())
- TLS_hmac(ssl, verify, rawData, dataSz, application_data, true);
- else
- hmac(ssl, verify, rawData, dataSz, application_data, true);
}
- // read mac and skip fill
- opaque mac[SHA_LEN];
- input.read(mac, digestSz);
- input.set_current(input.get_current() + pad + padSz);
-
- // verify
- if (dataSz) {
- if (memcmp(mac, verify, digestSz)) {
- ssl.SetError(verify_error);
- return;
- }
- }
- else
- ssl.get_SEQIncrement(true); // even though no data, increment verify
+ // advance past mac and fill
+ input.set_current(input.get_current() + digestSz + pad + padSz);
}
diff --git a/extra/yassl/taocrypt/benchmark/benchmark.cpp b/extra/yassl/taocrypt/benchmark/benchmark.cpp
index 6ed7351a56b..834f340b651 100644
--- a/extra/yassl/taocrypt/benchmark/benchmark.cpp
+++ b/extra/yassl/taocrypt/benchmark/benchmark.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates.
+
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// benchmark.cpp
// TaoCrypt benchmark
diff --git a/extra/yassl/taocrypt/benchmark/make.bat b/extra/yassl/taocrypt/benchmark/make.bat
index 1457521bce9..e9156e0c8af 100755
--- a/extra/yassl/taocrypt/benchmark/make.bat
+++ b/extra/yassl/taocrypt/benchmark/make.bat
@@ -1,4 +1,4 @@
-REM Copyright (C) 2006, 2007 MySQL AB
+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/aes.hpp b/extra/yassl/taocrypt/include/aes.hpp
index e2041fc9350..01763033156 100644
--- a/extra/yassl/taocrypt/include/aes.hpp
+++ b/extra/yassl/taocrypt/include/aes.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/asn.hpp b/extra/yassl/taocrypt/include/asn.hpp
index c20387d86c7..fee2f26fb73 100644
--- a/extra/yassl/taocrypt/include/asn.hpp
+++ b/extra/yassl/taocrypt/include/asn.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2010 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/block.hpp b/extra/yassl/taocrypt/include/block.hpp
index 77017e9d5e4..601d9dbce57 100644
--- a/extra/yassl/taocrypt/include/block.hpp
+++ b/extra/yassl/taocrypt/include/block.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/blowfish.hpp b/extra/yassl/taocrypt/include/blowfish.hpp
index e868872d3cf..347cf05de4b 100644
--- a/extra/yassl/taocrypt/include/blowfish.hpp
+++ b/extra/yassl/taocrypt/include/blowfish.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/include/des.hpp b/extra/yassl/taocrypt/include/des.hpp
index 2bc41fc2628..d88e9ef2f46 100644
--- a/extra/yassl/taocrypt/include/des.hpp
+++ b/extra/yassl/taocrypt/include/des.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/hash.hpp b/extra/yassl/taocrypt/include/hash.hpp
index 4ebc82e073d..4d2f7dd35a1 100644
--- a/extra/yassl/taocrypt/include/hash.hpp
+++ b/extra/yassl/taocrypt/include/hash.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/hc128.hpp b/extra/yassl/taocrypt/include/hc128.hpp
index d1cf5f075f2..0449b28d8c7 100644
--- a/extra/yassl/taocrypt/include/hc128.hpp
+++ b/extra/yassl/taocrypt/include/hc128.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/integer.hpp b/extra/yassl/taocrypt/include/integer.hpp
index 256573cf622..e1a2ed5f426 100644
--- a/extra/yassl/taocrypt/include/integer.hpp
+++ b/extra/yassl/taocrypt/include/integer.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/kernelc.hpp b/extra/yassl/taocrypt/include/kernelc.hpp
index 5bdf1cffa3f..0840b3f2740 100644
--- a/extra/yassl/taocrypt/include/kernelc.hpp
+++ b/extra/yassl/taocrypt/include/kernelc.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/misc.hpp b/extra/yassl/taocrypt/include/misc.hpp
index c58713855dd..4c8926483e2 100644
--- a/extra/yassl/taocrypt/include/misc.hpp
+++ b/extra/yassl/taocrypt/include/misc.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp
index 5fd36b80d3e..bfe8c6ec5d4 100644
--- a/extra/yassl/taocrypt/include/modes.hpp
+++ b/extra/yassl/taocrypt/include/modes.hpp
@@ -1,6 +1,5 @@
/*
- Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/pwdbased.hpp b/extra/yassl/taocrypt/include/pwdbased.hpp
index 58bd5902a58..9b1b62fea45 100644
--- a/extra/yassl/taocrypt/include/pwdbased.hpp
+++ b/extra/yassl/taocrypt/include/pwdbased.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/rabbit.hpp b/extra/yassl/taocrypt/include/rabbit.hpp
index 1e7276dd8ec..fb4e12c66bc 100644
--- a/extra/yassl/taocrypt/include/rabbit.hpp
+++ b/extra/yassl/taocrypt/include/rabbit.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/rsa.hpp b/extra/yassl/taocrypt/include/rsa.hpp
index 11a4ccfd039..ee3e378a69f 100644
--- a/extra/yassl/taocrypt/include/rsa.hpp
+++ b/extra/yassl/taocrypt/include/rsa.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp
index 328c8e9e978..29c4d2db236 100644
--- a/extra/yassl/taocrypt/include/runtime.hpp
+++ b/extra/yassl/taocrypt/include/runtime.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/include/types.hpp b/extra/yassl/taocrypt/include/types.hpp
index 5d8bc9f0683..973e1d19893 100644
--- a/extra/yassl/taocrypt/include/types.hpp
+++ b/extra/yassl/taocrypt/include/types.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/mySTL/stdexcept.hpp b/extra/yassl/taocrypt/mySTL/stdexcept.hpp
index 15533eebc02..79ae6de3380 100644
--- a/extra/yassl/taocrypt/mySTL/stdexcept.hpp
+++ b/extra/yassl/taocrypt/mySTL/stdexcept.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/mySTL/vector.hpp b/extra/yassl/taocrypt/mySTL/vector.hpp
index 35b92610942..f3702b75125 100644
--- a/extra/yassl/taocrypt/mySTL/vector.hpp
+++ b/extra/yassl/taocrypt/mySTL/vector.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp
index 3b09c5280bf..f976650e028 100644
--- a/extra/yassl/taocrypt/src/aes.cpp
+++ b/extra/yassl/taocrypt/src/aes.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/src/aestables.cpp b/extra/yassl/taocrypt/src/aestables.cpp
index 05c2c3b8e62..60795a549e4 100644
--- a/extra/yassl/taocrypt/src/aestables.cpp
+++ b/extra/yassl/taocrypt/src/aestables.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp
index b2bebfe8b94..a28d8915330 100644
--- a/extra/yassl/taocrypt/src/algebra.cpp
+++ b/extra/yassl/taocrypt/src/algebra.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/src/arc4.cpp b/extra/yassl/taocrypt/src/arc4.cpp
index 4630adcb11a..a76a37904f9 100644
--- a/extra/yassl/taocrypt/src/arc4.cpp
+++ b/extra/yassl/taocrypt/src/arc4.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp
index e1c7c852d19..864f8bac260 100644
--- a/extra/yassl/taocrypt/src/blowfish.cpp
+++ b/extra/yassl/taocrypt/src/blowfish.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp
index 0512ea9c889..8f317a484d8 100644
--- a/extra/yassl/taocrypt/src/coding.cpp
+++ b/extra/yassl/taocrypt/src/coding.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/src/dsa.cpp b/extra/yassl/taocrypt/src/dsa.cpp
index 7b882b10cd1..72221441b2b 100644
--- a/extra/yassl/taocrypt/src/dsa.cpp
+++ b/extra/yassl/taocrypt/src/dsa.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/hash.cpp b/extra/yassl/taocrypt/src/hash.cpp
index b36a486368c..c176e6a68d0 100644
--- a/extra/yassl/taocrypt/src/hash.cpp
+++ b/extra/yassl/taocrypt/src/hash.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/hc128.cpp b/extra/yassl/taocrypt/src/hc128.cpp
index aac92f0abb4..8934c318781 100644
--- a/extra/yassl/taocrypt/src/hc128.cpp
+++ b/extra/yassl/taocrypt/src/hc128.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/make.bat b/extra/yassl/taocrypt/src/make.bat
index ecd3023f5ab..a8c00f8ee0d 100755
--- a/extra/yassl/taocrypt/src/make.bat
+++ b/extra/yassl/taocrypt/src/make.bat
@@ -1,4 +1,4 @@
-REM Copyright (C) 2006, 2007 MySQL AB
+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/md4.cpp b/extra/yassl/taocrypt/src/md4.cpp
index 54820f4c944..9364a1c23b1 100644
--- a/extra/yassl/taocrypt/src/md4.cpp
+++ b/extra/yassl/taocrypt/src/md4.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/md5.cpp b/extra/yassl/taocrypt/src/md5.cpp
index 4d0a8bd03be..ee0d64acc17 100644
--- a/extra/yassl/taocrypt/src/md5.cpp
+++ b/extra/yassl/taocrypt/src/md5.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp
index 1a4dd4a52d3..e410cfe1946 100644
--- a/extra/yassl/taocrypt/src/misc.cpp
+++ b/extra/yassl/taocrypt/src/misc.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/src/rabbit.cpp b/extra/yassl/taocrypt/src/rabbit.cpp
index 0ea4146618a..071a25191f8 100644
--- a/extra/yassl/taocrypt/src/rabbit.cpp
+++ b/extra/yassl/taocrypt/src/rabbit.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp
index aa9be7f1985..084871c5447 100644
--- a/extra/yassl/taocrypt/src/random.cpp
+++ b/extra/yassl/taocrypt/src/random.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/ripemd.cpp b/extra/yassl/taocrypt/src/ripemd.cpp
index e012db43de5..f77010ca94d 100644
--- a/extra/yassl/taocrypt/src/ripemd.cpp
+++ b/extra/yassl/taocrypt/src/ripemd.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp
index 576146377a3..69c59402e48 100644
--- a/extra/yassl/taocrypt/src/rsa.cpp
+++ b/extra/yassl/taocrypt/src/rsa.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/sha.cpp b/extra/yassl/taocrypt/src/sha.cpp
index 1ae42d94e4c..f67a4f55067 100644
--- a/extra/yassl/taocrypt/src/sha.cpp
+++ b/extra/yassl/taocrypt/src/sha.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/src/twofish.cpp b/extra/yassl/taocrypt/src/twofish.cpp
index 4ae493624dc..bf57f5dde44 100644
--- a/extra/yassl/taocrypt/src/twofish.cpp
+++ b/extra/yassl/taocrypt/src/twofish.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates
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
diff --git a/extra/yassl/taocrypt/test/make.bat b/extra/yassl/taocrypt/test/make.bat
index d6d62b984a8..51f266a1ee6 100755
--- a/extra/yassl/taocrypt/test/make.bat
+++ b/extra/yassl/taocrypt/test/make.bat
@@ -1,4 +1,4 @@
-REM Copyright (C) 2006, 2007 MySQL AB
+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/test/memory.cpp b/extra/yassl/taocrypt/test/memory.cpp
index a9b21f94902..053d79688a2 100644
--- a/extra/yassl/taocrypt/test/memory.cpp
+++ b/extra/yassl/taocrypt/test/memory.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp
index 807f91f32ae..00547d0f963 100644
--- a/extra/yassl/taocrypt/test/test.cpp
+++ b/extra/yassl/taocrypt/test/test.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates.
+
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// test.cpp
// test taocrypt functionality
diff --git a/extra/yassl/testsuite/make.bat b/extra/yassl/testsuite/make.bat
index 941e499d7e6..e056f3fed53 100755
--- a/extra/yassl/testsuite/make.bat
+++ b/extra/yassl/testsuite/make.bat
@@ -1,4 +1,4 @@
-REM Copyright (C) 2006, 2007 MySQL AB
+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp
index 559ebe54f1b..33f398ae269 100644
--- a/extra/yassl/testsuite/test.hpp
+++ b/extra/yassl/testsuite/test.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates.
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
diff --git a/extra/yassl/testsuite/testsuite.cpp b/extra/yassl/testsuite/testsuite.cpp
index fa8c997e7c2..7973a3704e1 100644
--- a/extra/yassl/testsuite/testsuite.cpp
+++ b/extra/yassl/testsuite/testsuite.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006, 2007 MySQL AB
+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h
index 2238347d419..173e32e790c 100644
--- a/include/atomic/x86-gcc.h
+++ b/include/atomic/x86-gcc.h
@@ -124,10 +124,10 @@
asm volatile ("push %%ebx;" \
"movl (%%ecx), %%ebx;" \
"movl 4(%%ecx), %%ecx;" \
- LOCK_prefix "; cmpxchg8b %0;" \
+ LOCK_prefix "; cmpxchg8b (%%esi);" \
"setz %2; pop %%ebx" \
- : "=m" (*a), "+A" (*cmp), "=c" (ret) \
- : "c" (&set), "m" (*a) \
+ : "+S" (a), "+A" (*cmp), "=c" (ret) \
+ : "c" (&set) \
: "memory", "esp")
#endif
diff --git a/include/base64.h b/include/base64.h
index 4ac0aa72ad8..e19da8762cb 100644
--- a/include/base64.h
+++ b/include/base64.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003-2006 MySQL AB
+ Use is subject to license terms
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
diff --git a/include/ft_global.h b/include/ft_global.h
index 8a1069d6e62..73726018d0a 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000-2005, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 969cb0058ac..001884afe81 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -1,5 +1,4 @@
-/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
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
@@ -172,6 +171,8 @@ enum my_lex_states
struct charset_info_st;
+extern int (*my_string_stack_guard)(int);
+
/* See strings/CHARSET_INFO.txt for information about this structure */
struct my_collation_handler_st
{
diff --git a/include/m_string.h b/include/m_string.h
index 9efa0376942..1f59fd06084 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates.
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
@@ -108,6 +108,15 @@ extern char *strcend(const char *, pchar);
extern char *strfill(char * s,size_t len,pchar fill);
extern char *strmake(char *dst,const char *src,size_t length);
+#if !defined(__GNUC__) || (__GNUC__ < 4)
+#define strmake_buf(D,S) strmake(D, S, sizeof(D) - 1)
+#else
+#define strmake_buf(D,S) ({ \
+ compile_time_assert(sizeof(D) != sizeof(char*)); \
+ strmake(D, S, sizeof(D) - 1); \
+ })
+#endif
+
#ifndef strmov
extern char *strmov(char *dst,const char *src);
#endif
diff --git a/include/my_global.h b/include/my_global.h
index 1b59e1b1a36..67dd08b4a43 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1423,6 +1423,7 @@ static inline char *dlerror(void)
#endif
/* Provide __func__ macro definition for platforms that miss it. */
+#if !defined (__func__)
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __func__ __FUNCTION__
@@ -1440,6 +1441,7 @@ static inline char *dlerror(void)
#else
# define __func__ "<unknown>"
#endif
+#endif /* !defined(__func__) */
#ifndef HAVE_RINT
/**
diff --git a/include/my_md5.h b/include/my_md5.h
index 782bef8a27a..7328661eb71 100644
--- a/include/my_md5.h
+++ b/include/my_md5.h
@@ -1,7 +1,8 @@
#ifndef MY_MD5_INCLUDED
#define MY_MD5_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2001, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms
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
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 5a921fe0f26..d9aae5f47c9 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -119,7 +119,6 @@ int pthread_cancel(pthread_t thread);
#define HAVE_LOCALTIME_R 1
#define _REENTRANT 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
-#define PTHREAD_STACK_MIN 65536
#undef SAFE_MUTEX /* This will cause conflicts */
#define pthread_key(T,V) DWORD V
@@ -857,6 +856,11 @@ extern uint thd_lib_detected;
#define mysql_mutex_record_order(A,B) do { } while(0)
#endif
+/* At least Windows and NetBSD do not have this definition */
+#ifndef PTHREAD_STACK_MIN
+#define PTHREAD_STACK_MIN 65536
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/include/my_sys.h b/include/my_sys.h
index f2d31405687..5d608eb1d69 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2013, 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
diff --git a/include/my_user.h b/include/my_user.h
index 44eebf1551d..067425a2b47 100644
--- a/include/my_user.h
+++ b/include/my_user.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005-2007 MySQL AB
+ Use is subject to license terms
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
diff --git a/include/my_xml.h b/include/my_xml.h
index 6a453ee90be..e97232c7039 100644
--- a/include/my_xml.h
+++ b/include/my_xml.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2002, 2003, 2005, 2007 MySQL AB
+ Use is subject to license terms
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
diff --git a/include/myisamchk.h b/include/myisamchk.h
index 152467db547..0a30615c629 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -31,27 +31,27 @@
#define T_AUTO_REPAIR 2 /* QQ to be removed */
#define T_BACKUP_DATA 4
#define T_CALC_CHECKSUM 8
-#define T_CHECK 16 /* QQ to be removed */
-#define T_CHECK_ONLY_CHANGED 32 /* QQ to be removed */
+#define T_CHECK 16
+#define T_CHECK_ONLY_CHANGED 32
#define T_CREATE_MISSING_KEYS 64
#define T_DESCRIPT 128
#define T_DONT_CHECK_CHECKSUM 256
#define T_EXTEND 512
-#define T_FAST (1L << 10) /* QQ to be removed */
-#define T_FORCE_CREATE (1L << 11) /* QQ to be removed */
+#define T_FAST (1L << 10)
+#define T_FORCE_CREATE (1L << 11)
#define T_FORCE_UNIQUENESS (1L << 12)
#define T_INFO (1L << 13)
#define T_MEDIUM (1L << 14)
-#define T_QUICK (1L << 15) /* QQ to be removed */
-#define T_READONLY (1L << 16) /* QQ to be removed */
+#define T_QUICK (1L << 15)
+#define T_READONLY (1L << 16)
#define T_REP (1L << 17)
-#define T_REP_BY_SORT (1L << 18) /* QQ to be removed */
-#define T_REP_PARALLEL (1L << 19) /* QQ to be removed */
+#define T_REP_BY_SORT (1L << 18)
+#define T_REP_PARALLEL (1L << 19)
#define T_RETRY_WITHOUT_QUICK (1L << 20)
#define T_SAFE_REPAIR (1L << 21)
#define T_SILENT (1L << 22)
-#define T_SORT_INDEX (1L << 23) /* QQ to be removed */
-#define T_SORT_RECORDS (1L << 24) /* QQ to be removed */
+#define T_SORT_INDEX (1L << 23)
+#define T_SORT_RECORDS (1L << 24)
#define T_STATISTICS (1L << 25)
#define T_UNPACK (1L << 26)
#define T_UPDATE_STATE (1L << 27)
diff --git a/include/myisampack.h b/include/myisampack.h
index a065de378d8..0795455dc3e 100644
--- a/include/myisampack.h
+++ b/include/myisampack.h
@@ -1,7 +1,7 @@
#ifndef MYISAMPACK_INCLUDED
#define MYISAMPACK_INCLUDED
-/* Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000-2002, 2004 MySQL AB, 2009 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql.h b/include/mysql.h
index 122b5a2751f..768ef944954 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -1,5 +1,6 @@
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2012, 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
diff --git a/include/mysql/plugin_audit.h b/include/mysql/plugin_audit.h
index eee32a9e523..86b6dea5668 100644
--- a/include/mysql/plugin_audit.h
+++ b/include/mysql/plugin_audit.h
@@ -25,7 +25,7 @@
#define MYSQL_AUDIT_CLASS_MASK_SIZE 1
-#define MYSQL_AUDIT_INTERFACE_VERSION 0x0300
+#define MYSQL_AUDIT_INTERFACE_VERSION 0x0301
/*************************************************************************
@@ -97,6 +97,50 @@ struct mysql_event_connection
unsigned int database_length;
};
+/*
+ AUDIT CLASS : TABLE
+
+ LOCK occurs when a connection "locks" (this does not necessarily mean a table
+ lock and also happens for row-locking engines) the table at the beginning of
+ a statement. This event is generated at the beginning of every statement for
+ every affected table, unless there's a LOCK TABLES statement in effect (in
+ which case it is generated once for LOCK TABLES and then is suppressed until
+ the tables are unlocked).
+
+ CREATE/DROP/RENAME occur when a table is created, dropped, or renamed.
+*/
+
+#define MYSQL_AUDIT_TABLE_CLASS 15
+#define MYSQL_AUDIT_TABLE_CLASSMASK (1 << MYSQL_AUDIT_TABLE_CLASS)
+#define MYSQL_AUDIT_TABLE_LOCK 0
+#define MYSQL_AUDIT_TABLE_CREATE 1
+#define MYSQL_AUDIT_TABLE_DROP 2
+#define MYSQL_AUDIT_TABLE_RENAME 3
+#define MYSQL_AUDIT_TABLE_ALTER 4
+
+struct mysql_event_table
+{
+ unsigned int event_subclass;
+ unsigned long thread_id;
+ const char *user;
+ const char *priv_user;
+ const char *priv_host;
+ const char *external_user;
+ const char *proxy_user;
+ const char *host;
+ const char *ip;
+ const char *database;
+ unsigned int database_length;
+ const char *table;
+ unsigned int table_length;
+ /* for MYSQL_AUDIT_TABLE_LOCK, true if read-only, false if read/write */
+ int read_only;
+ /* for MYSQL_AUDIT_TABLE_RENAME */
+ const char *new_database;
+ unsigned int new_database_length;
+ const char *new_table;
+ unsigned int new_table_length;
+};
/*************************************************************************
Here we define the descriptor structure, that is referred from
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index 2e74f8fd706..d630359f5fe 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -271,6 +271,27 @@ struct mysql_event_connection
const char *database;
unsigned int database_length;
};
+struct mysql_event_table
+{
+ unsigned int event_subclass;
+ unsigned long thread_id;
+ const char *user;
+ const char *priv_user;
+ const char *priv_host;
+ const char *external_user;
+ const char *proxy_user;
+ const char *host;
+ const char *ip;
+ const char *database;
+ unsigned int database_length;
+ const char *table;
+ unsigned int table_length;
+ int read_only;
+ const char *new_database;
+ unsigned int new_database_length;
+ const char *new_table;
+ unsigned int new_table_length;
+};
struct st_mysql_audit
{
int interface_version;
diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h
index a7fd3e8a2c6..d4ce97076e6 100644
--- a/include/mysql/service_my_snprintf.h
+++ b/include/mysql/service_my_snprintf.h
@@ -1,5 +1,5 @@
#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/include/mysql_com.h b/include/mysql_com.h
index be1d727c15a..d8d9d78c6a9 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -24,7 +24,7 @@
#define HOSTNAME_LENGTH 60
#define SYSTEM_CHARSET_MBMAXLEN 3
#define NAME_CHAR_LEN 64 /* Field/table name length */
-#define USERNAME_CHAR_LENGTH 16
+#define USERNAME_CHAR_LENGTH 128
#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
diff --git a/include/mysql_time.h b/include/mysql_time.h
index 0a3f17a81fb..c92267232a1 100644
--- a/include/mysql_time.h
+++ b/include/mysql_time.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2006 MySQL AB
+ Use is subject to license terms
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
diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in
index 18c61040c22..56b2fe50ec0 100644
--- a/include/mysql_version.h.in
+++ b/include/mysql_version.h.in
@@ -1,4 +1,5 @@
-/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
+/* Copyright (c) 1996, 1999-2004, 2007 MySQL AB
+ Use is subject to license terms
This file is public domain and comes with NO WARRANTY of any kind */
/* Version numbers for protocol & mysqld */
diff --git a/include/thread_pool_priv.h b/include/thread_pool_priv.h
index 84c7faa2e2b..9a9c65af6da 100644
--- a/include/thread_pool_priv.h
+++ b/include/thread_pool_priv.h
@@ -1,6 +1,6 @@
#error don't use
/*
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h
index 9878ab1c07d..302f623e377 100644
--- a/include/welcome_copyright_notice.h
+++ b/include/welcome_copyright_notice.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2013, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2012, Oracle and/or its affiliates.
Copyright (c) 2011, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 69fce429ab9..2be7c00b4a4 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -2131,7 +2131,14 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
- net_clear(net, 1); /* Sets net->write_pos */
+ if (net->vio)
+ net_clear(net, 1); /* Sets net->write_pos */
+ else
+ {
+ set_stmt_errmsg(stmt, net);
+ DBUG_RETURN(1);
+ }
+
/* Reserve place for null-marker bytes */
null_count= (stmt->param_count+7) /8;
if (my_realloc_str(net, null_count + 1))
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 16c6cc94f1b..d8936173401 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -90,7 +90,7 @@ void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data)
NET *net= &mysql->net;
struct embedded_query_result *ei= data->embedded_info;
net->last_errno= ei->last_errno;
- strmake(net->last_error, ei->info, sizeof(net->last_error)-1);
+ strmake_buf(net->last_error, ei->info);
memcpy(net->sqlstate, ei->sqlstate, sizeof(net->sqlstate));
mysql->server_status= ei->server_status;
my_free(data);
@@ -704,8 +704,8 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
thd->update_charset();
Security_context *sctx= thd->security_ctx;
sctx->host_or_ip= sctx->host= (char*) my_localhost;
- strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
- strmake(sctx->priv_user, mysql->user, USERNAME_LENGTH-1);
+ strmake_buf(sctx->priv_host, (char*) my_localhost);
+ strmake_buf(sctx->priv_user, mysql->user);
sctx->user= my_strdup(mysql->user, MYF(0));
sctx->proxy_user[0]= 0;
sctx->master_access= GLOBAL_ACLS; // Full rights
@@ -773,7 +773,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
return 0;
err:
- strmake(net->last_error, thd->main_da.message(), sizeof(net->last_error)-1);
+ strmake_buf(net->last_error, thd->main_da.message());
memcpy(net->sqlstate,
mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
sizeof(net->sqlstate)-1);
@@ -1121,8 +1121,7 @@ net_send_ok(THD *thd,
data->embedded_info->affected_rows= affected_rows;
data->embedded_info->insert_id= id;
if (message)
- strmake(data->embedded_info->info, message,
- sizeof(data->embedded_info->info)-1);
+ strmake_buf(data->embedded_info->info, message);
bool error= write_eof_packet(thd, server_status, statement_warn_count);
thd->cur_data= 0;
@@ -1173,7 +1172,7 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
err, strlen(err),
system_charset_info, &error);
/* Converted error message is always null-terminated. */
- strmake(ei->info, converted_err, sizeof(ei->info)-1);
+ strmake_buf(ei->info, converted_err);
strmov(ei->sqlstate, sqlstate);
ei->server_status= thd->server_status;
thd->cur_data= 0;
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 56b8feb6739..dca07e1a388 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -6,6 +6,7 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment
funcs_1.charset_collation_1 # depends on compile-time decisions
main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
+main.kill @solaris # Bug#16064876 2013-01-02 prthirum main.kill fails on sol10 sparc64
main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc
index 61ee07fc655..47a74c9bd41 100644
--- a/mysql-test/include/get_relay_log_pos.inc
+++ b/mysql-test/include/get_relay_log_pos.inc
@@ -40,7 +40,6 @@ CREATE TEMPORARY TABLE mysqlbinlog_events(c1 INT AUTO_INCREMENT KEY, c2 varchar(
# '# .... end_log_pos 46'
eval LOAD DATA LOCAL INFILE '$_tmp_file' INTO TABLE mysqlbinlog_events
LINES STARTING BY '#' (c2) SET c1 = NULL;
---enable_warnings
# Event pos in relay log file is inserted into table events_at
CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
@@ -49,6 +48,7 @@ CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
# Event pos in master log file is inserted into table events_pos
CREATE TEMPORARY TABLE events_pos(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE '% end_log_pos %' ORDER BY c1;
+--enable_warnings
# events_at events_pos
# c1------c2-------------------------- c1------c2------------------------
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
index dbe93adbec3..09569fc2b57 100644
--- a/mysql-test/include/rpl_init.inc
+++ b/mysql-test/include/rpl_init.inc
@@ -7,7 +7,6 @@
# well as extra connections server_1_1, server_2_1, ...,
# server_N_1. server_I and server_I_1 are connections to the same
# server.
-# - Sets up @@auto_increment_increment and @@auto_increment_increment.
# - Verifies that @@server_id of all servers are different.
# - Calls RESET MASTER, RESET SLAVE, USE test, CHANGE MASTER, START SLAVE.
# - Sets the connection to server_1 before exiting.
@@ -180,8 +179,6 @@ while ($_rpl_server)
SET GLOBAL gtid_slave_pos= "";
RESET SLAVE;
}
- eval SET auto_increment_increment= $rpl_server_count;
- eval SET auto_increment_offset= $_rpl_server;
--dec $_rpl_server
}
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index cb69a3c0124..f7ab9be1c48 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -749,9 +749,11 @@ sub run_test_server ($$$) {
mtr_report("\nRetrying test $tname, ".
"attempt($retries/$opt_retry)...\n");
#saving the log file as filename.failed in case of retry
- my $worker_logdir= $result->{savedir};
- my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
- rename $log_file_name,$log_file_name.".failed";
+ if ( $result->is_failed() ) {
+ my $worker_logdir= $result->{savedir};
+ my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
+ rename $log_file_name,$log_file_name.".failed";
+ }
delete($result->{result});
$result->{retries}= $retries+1;
$result->write_test($sock, 'TESTCASE');
@@ -4150,6 +4152,7 @@ sub resfile_report_test ($) {
sub run_testcase ($$) {
my ($tinfo, $server_socket)= @_;
+ my $print_freq=20;
mtr_verbose("Running test:", $tinfo->{name});
resfile_report_test($tinfo) if $opt_resfile;
@@ -4333,6 +4336,7 @@ sub run_testcase ($$) {
my $test= $tinfo->{suite}->start_test($tinfo);
# Set only when we have to keep waiting after expectedly died server
my $keep_waiting_proc = 0;
+ my $print_timeout= start_timer($print_freq * 60);
while (1)
{
@@ -4357,7 +4361,22 @@ sub run_testcase ($$) {
}
if (! $keep_waiting_proc)
{
- $proc= My::SafeProcess->wait_any_timeout($test_timeout);
+ if($test_timeout > $print_timeout)
+ {
+ $proc= My::SafeProcess->wait_any_timeout($print_timeout);
+ if ( $proc->{timeout} )
+ {
+ #print out that the test is still on
+ mtr_print("Test still running: $tinfo->{name}");
+ #reset the timer
+ $print_timeout= start_timer($print_freq * 60);
+ next;
+ }
+ }
+ else
+ {
+ $proc= My::SafeProcess->wait_any_timeout($test_timeout);
+ }
}
# Will be restored if we need to keep waiting
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 31f1d57f916..625791a7c4b 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -737,6 +737,24 @@ WHERE CAST(a as BINARY)=x'62736D697468'
AND CAST(a AS BINARY)=x'65736D697468';
a
DROP TABLE t1;
+#
+# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
+# LONGTEXT, UNION, USER VARIABLE
+# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
+#
+CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)),
+CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED));
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
+Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '',
+ `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+# End of test for Bug#13581962, Bug#14096619
End of 5.1 tests
select cast("2101-00-01 02:03:04" as datetime);
cast("2101-00-01 02:03:04" as datetime)
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 7e814283d32..d0d953f4e38 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1752,7 +1752,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
@@ -1772,7 +1772,7 @@ show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index ead84237c2e..d5abf8d482c 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(0x8300)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(X'8300')
master-bin.000001 # Query # # COMMIT
SELECT HEX(f1) FROM t1;
HEX(f1)
@@ -47,7 +47,7 @@ BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Query # # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
+master-bin.000001 # Query # # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 X'466F6F2773206120426172' COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 X'ED40ED41ED42' COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293
@@ -19496,5 +19496,40 @@ EFBFA4 FA55
EFBFA5 818F
DROP TABLE t1;
#
+# Bug#MDEV-4489 Replication of big5, cp932, gbk, sjis strings makes wrong values on slave
+#
+SET NAMES cp932;
+CREATE TABLE t1 (a INT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (0x31);
+INSERT INTO t1 VALUES (X'31');
+PREPARE stmt FROM 'INSERT INTO t1 (a) VALUES (?)';
+SET @a='1';
+SELECT charset(@a);
+charset(@a)
+cp932
+EXECUTE stmt USING @a;
+DROP PREPARE stmt;
+DROP TABLE t1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (0x31)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (X'31')
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 (a) VALUES (X'31')
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_ucs2_query_cache.result b/mysql-test/r/ctype_ucs2_query_cache.result
new file mode 100644
index 00000000000..c5f1ef5918d
--- /dev/null
+++ b/mysql-test/r/ctype_ucs2_query_cache.result
@@ -0,0 +1,19 @@
+#
+# Start of 5.5 tests
+#
+#
+# Bug#MDEV-4518 Server crashes in is_white_space when it's run
+# with query cache, charset ucs2 and collation ucs2_unicode_ci
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+SELECT * FROM t1;
+a
+1
+2
+3
+4
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index a956a474ef7..d8642955b89 100644
--- a/mysql-test/r/ctype_utf8mb4.result
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -2539,6 +2539,24 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
#
+# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
+# LONGTEXT, UNION, USER VARIABLE
+# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
+#
+CREATE TABLE t1(f1 LONGTEXT CHARACTER SET utf8mb4);
+INSERT INTO t1 VALUES ('a');
+SELECT @a:= CAST(f1 AS SIGNED) FROM t1
+UNION ALL
+SELECT CAST(f1 AS SIGNED) FROM t1;
+@a:= CAST(f1 AS SIGNED)
+0
+0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+DROP TABLE t1;
+# End of test for Bug#13581962,Bug#14096619
+#
# End of 5.5 tests
#
#
diff --git a/mysql-test/r/empty_user_table.result b/mysql-test/r/empty_user_table.result
new file mode 100644
index 00000000000..b93596ab59a
--- /dev/null
+++ b/mysql-test/r/empty_user_table.result
@@ -0,0 +1,8 @@
+create table t1 as select * from mysql.user;
+truncate table mysql.user;
+flush privileges;
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+Got one of the listed errors
+insert mysql.user select * from t1;
+drop table t1;
+flush privileges;
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index 02284186c76..c2f1e5bf273 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -11,7 +11,7 @@ explain extended select uncompress(compress(@test_compress_string));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
+Note 1003 select uncompress(compress((@`test_compress_string`))) AS `uncompress(compress(@test_compress_string))`
select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
1
@@ -19,7 +19,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
+Note 1003 select (uncompressed_length(compress((@`test_compress_string`))) = length((@`test_compress_string`))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
select uncompressed_length(compress(@test_compress_string));
uncompressed_length(compress(@test_compress_string))
117
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index c6fa040246a..38aa3f49c4d 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -2098,6 +2098,34 @@ avg(export_set( 3, 'y', sha(i))) group_concat(d)
0 2010-12-12
drop table t1;
#
+# MDEV-4290: crash in st_select_lex::mark_as_dependent
+#
+create table `t1`(`a` int);
+select 1 from t1 v1 right join t1 on count(*);
+ERROR HY000: Invalid use of group function
+select 1 from t1 order by
+(
+select 1 from
+(
+select 1 from t1 v1 right join t1 on count(*)
+) v
+);
+ERROR HY000: Invalid use of group function
+insert into t1 values (1),(1),(2),(2);
+select count(*) from t1;
+count(*)
+4
+select z from (select count(*) as z from t1) v;
+z
+4
+# next is how it implemented now (may be changed in case of dependent
+# derived tables)
+select z from (select count(*) as z from t1) v group by 1;
+z
+4
+drop table t1;
+# end of 5.3 tests
+#
# Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),
# file .\item_sum.cc, line 587
#
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 67f3f664ad8..04e71a715ce 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -666,13 +666,13 @@ ERROR 22003: BIGINT value is out of range in '-(9223372036854775809)'
DROP TABLE t1;
SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999;
SELECT @a + @a;
-ERROR 22003: DECIMAL value is out of range in '((@a) + (@a))'
+ERROR 22003: DECIMAL value is out of range in '((@`a`) + (@`a`))'
SELECT @a * @a;
-ERROR 22003: DECIMAL value is out of range in '((@a) * (@a))'
+ERROR 22003: DECIMAL value is out of range in '((@`a`) * (@`a`))'
SELECT -@a - @a;
-ERROR 22003: DECIMAL value is out of range in '(-((@a)) - (@a))'
+ERROR 22003: DECIMAL value is out of range in '(-((@`a`)) - (@`a`))'
SELECT @a / 0.5;
-ERROR 22003: DECIMAL value is out of range in '((@a) / 0.5)'
+ERROR 22003: DECIMAL value is out of range in '((@`a`) / 0.5)'
SELECT COT(1/0);
COT(1/0)
NULL
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 16c0854241f..ad5d640b402 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -2911,6 +2911,17 @@ select 1 div convert(a using utf8) from t1;
1 div convert(a using utf8)
NULL
drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+create procedure foo (var char(100))
+select replace(var, '00000000', table_name)
+from information_schema.tables where table_schema='test';
+call foo('(( 00000000 ++ 00000000 ))');
+replace(var, '00000000', table_name)
+(( t1 ++ t1 ))
+(( t2 ++ t2 ))
+drop procedure foo;
+drop table t1,t2;
#
# End of 5.5 tests
#
diff --git a/mysql-test/r/func_time_hires.result b/mysql-test/r/func_time_hires.result
index 73b82a6ac1f..4aa0333c4b4 100644
--- a/mysql-test/r/func_time_hires.result
+++ b/mysql-test/r/func_time_hires.result
@@ -156,12 +156,12 @@ explain extended select cast(cast(@a as datetime(4)) as time(0));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select cast(cast((@a) as datetime(4)) as time) AS `cast(cast(@a as datetime(4)) as time(0))`
+Note 1003 select cast(cast((@`a`) as datetime(4)) as time) AS `cast(cast(@a as datetime(4)) as time(0))`
select cast(cast(@a as time(2)) as time(6));
cast(cast(@a as time(2)) as time(6))
12:13:14.120000
select CAST(@a AS DATETIME(7));
-ERROR 42000: Too big precision 7 specified for '(@a)'. Maximum is 6.
+ERROR 42000: Too big precision 7 specified for '(@`a`)'. Maximum is 6.
SELECT CONVERT_TZ('2011-01-02 12:00:00', '+00:00', '+03:00');
CONVERT_TZ('2011-01-02 12:00:00', '+00:00', '+03:00')
2011-01-02 15:00:00
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index c394aec8851..22c30479125 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -1576,3 +1576,23 @@ a ASTEXT(b)
0 POINT(1 1)
DROP TABLE t1;
End of 5.1 tests
+CREATE TABLE t1 (
+l LINESTRING NOT NULL,
+SPATIAL KEY(l)
+) ENGINE = myisam;
+INSERT INTO t1 VALUES(GeomFromText('LINESTRING(0 0, 1 1)'));
+INSERT INTO t1 VALUES(GeomFromText('LINESTRING(1 1, 2 2)'));
+INSERT INTO t1 VALUES(GeomFromText('LINESTRING(2 2, 3 3)'));
+SELECT COUNT(*) FROM t1 IGNORE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(0 0)'));
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1 IGNORE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l);
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(0 0)'));
+COUNT(*)
+1
+SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l);
+COUNT(*)
+1
+DROP TABLE t1;
diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result
new file mode 100644
index 00000000000..ef92b62ab32
--- /dev/null
+++ b/mysql-test/r/grant_4332.result
@@ -0,0 +1,96 @@
+select user();
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def user() 253 77 14 N 1 31 8
+user()
+root@localhost
+create user a17aaaaaaaaaaaaa0@localhost;
+ERROR HY000: String 'a17aaaaaaaaaaaaa0' is too long for user name (should be no longer than 16)
+alter table mysql.user modify User char(80) binary not null default '';
+alter table mysql.db modify User char(80) binary not null default '';
+alter table mysql.tables_priv modify User char(80) binary not null default '';
+alter table mysql.columns_priv modify User char(80) binary not null default '';
+alter table mysql.procs_priv modify User char(80) binary not null default '';
+alter table mysql.proc modify definer char(141) collate utf8_bin not null default '';
+alter table mysql.event modify definer char(141) collate utf8_bin not null default '';
+set global event_scheduler = on;
+select user();
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def user() 253 141 14 N 1 31 8
+user()
+root@localhost
+create user a17aaaaaaaaaaaaa0@localhost;
+grant usage on *.* to a17aaaaaaaaaaaaa0@localhost;
+grant select on mysql.user to b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost;
+grant select(User) on mysql.tables_priv to c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost;
+select user(), current_user();
+user() current_user()
+a17aaaaaaaaaaaaa0@localhost a17aaaaaaaaaaaaa0@localhost
+show grants;
+Grants for a17aaaaaaaaaaaaa0@localhost
+GRANT USAGE ON *.* TO 'a17aaaaaaaaaaaaa0'@'localhost'
+select user(), current_user();
+user() current_user()
+b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost
+show grants;
+Grants for b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost
+GRANT USAGE ON *.* TO 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0'@'localhost'
+GRANT SELECT ON `mysql`.`user` TO 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0'@'localhost'
+select user,host from mysql.user where user like '%0';
+user host
+a17aaaaaaaaaaaaa0 localhost
+b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0 localhost
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0 localhost
+select user,host from mysql.db;
+ERROR 42000: SELECT command denied to user 'b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'@'localhost' for table 'db'
+select user(), current_user();
+user() current_user()
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
+show grants;
+Grants for c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
+GRANT USAGE ON *.* TO 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost'
+GRANT SELECT (User) ON `mysql`.`tables_priv` TO 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost'
+select user from mysql.tables_priv;
+user
+b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0
+c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0
+select user,host from mysql.tables_priv;
+ERROR 42000: SELECT command denied to user 'c80ccccccccccccccccccccccccccccccccccccccccccccc'@'localhost' for column 'host' in table 'tables_priv'
+create procedure test.p1() select user(), current_user(), user from mysql.tables_priv;
+show create procedure test.p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0`@`localhost` PROCEDURE `p1`()
+select user(), current_user(), user from mysql.tables_priv latin1 latin1_swedish_ci latin1_swedish_ci
+create table test.t1 (a text);
+create event e1 on schedule every 1 second
+do insert test.t1 values (concat(user(), ' ', current_user()));
+call test.p1();
+user() current_user() user
+root@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0
+root@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0
+select * from t1 limit 1;
+a
+event_scheduler@localhost c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost
+grant usage on *.* to d81ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd0@lodalhost;
+ERROR HY000: String 'd81ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd' is too long for user name (should be no longer than 80)
+drop user d81ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd0@lodalhost;
+ERROR HY000: String 'd81ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd' is too long for user name (should be no longer than 80)
+drop user c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost;
+drop user b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost;
+drop user a17aaaaaaaaaaaaa0@localhost;
+set global event_scheduler = off;
+drop event e1;
+drop procedure test.p1;
+drop table t1;
+alter table mysql.user modify User char(16) binary not null default '';
+alter table mysql.db modify User char(16) binary not null default '';
+alter table mysql.tables_priv modify User char(16) binary not null default '';
+alter table mysql.columns_priv modify User char(16) binary not null default '';
+alter table mysql.procs_priv modify User char(16) binary not null default '';
+alter table mysql.proc modify definer char(77) collate utf8_bin not null default '';
+alter table mysql.event modify definer char(77) collate utf8_bin not null default '';
+flush privileges;
+select user();
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def user() 253 77 14 N 1 31 8
+user()
+root@localhost
diff --git a/mysql-test/r/init_connection_query_cache.result b/mysql-test/r/init_connection_query_cache.result
new file mode 100644
index 00000000000..5a1e5c5244f
--- /dev/null
+++ b/mysql-test/r/init_connection_query_cache.result
@@ -0,0 +1,19 @@
+#
+# MDEV-4520: Assertion `0' fails in Query_cache::end_of_result on
+# concurrent drop event and event execution
+#
+set GLOBAL query_cache_size=1355776;
+create user mysqltest1@localhost;
+grant SELECT on test.* to mysqltest1@localhost;
+create table t1 (a int);
+# This explain put here to be sure that init connection query
+# has 'Impossible WHERE'.
+explain extended select * from test.t1 where 0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+revoke all privileges, grant option from mysqltest1@localhost;
+drop user mysqltest1@localhost;
+drop table t1;
+set GLOBAL query_cache_size=default;
diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result
index 0da4feaf26f..4a6b902e869 100644
--- a/mysql-test/r/innodb_ext_key.result
+++ b/mysql-test/r/innodb_ext_key.result
@@ -865,6 +865,128 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
1 SIMPLE t3 ref PRIMARY,col1 col1 12 test.t1.a,test.t1.a,test.t1.a # Using index
drop table t1,t2,t3;
+#
+# Bug mdev-4340: performance regression with extended_keys=on
+#
+set @save_optimizer_switch=@@optimizer_switch;
+CREATE TABLE t1 (
+page_id int(8) unsigned NOT NULL AUTO_INCREMENT,
+page_namespace int(11) NOT NULL DEFAULT '0',
+page_title varbinary(255) NOT NULL DEFAULT '',
+page_restrictions tinyblob NOT NULL,
+page_counter bigint(20) unsigned NOT NULL DEFAULT '0',
+page_is_redirect tinyint(1) unsigned NOT NULL DEFAULT '0',
+page_is_new tinyint(1) unsigned NOT NULL DEFAULT '0',
+page_random double unsigned NOT NULL DEFAULT '0',
+page_touched varbinary(14) NOT NULL DEFAULT '',
+page_latest int(8) unsigned NOT NULL DEFAULT '0',
+page_len int(8) unsigned NOT NULL DEFAULT '0',
+PRIMARY KEY (page_id),
+UNIQUE KEY name_title (page_namespace,page_title),
+KEY page_random (page_random),
+KEY page_len (page_len),
+KEY page_redirect_namespace_len (page_is_redirect,page_namespace,page_len)
+) ENGINE=InnoDB AUTO_INCREMENT=38929100 DEFAULT CHARSET=binary;
+INSERT INTO t1 VALUES
+(38928077,0,'Sandbox','',0,0,0,0,'',0,0),(38928078,1,'Sandbox','',0,0,0,1,'',0,0),
+(38928079,2,'Sandbox','',0,0,0,2,'',0,0),(38928080,3,'Sandbox','',0,0,0,3,'',0,0),
+(38928081,4,'Sandbox','',0,0,0,4,'',0,0),(38928082,5,'Sandbox','',0,0,0,5,'',0,0);
+CREATE TABLE t2 (
+rev_id int(8) unsigned NOT NULL AUTO_INCREMENT,
+rev_page int(8) unsigned NOT NULL DEFAULT '0',
+rev_text_id int(8) unsigned NOT NULL DEFAULT '0',
+rev_comment varbinary(255) DEFAULT NULL,
+rev_user int(5) unsigned NOT NULL DEFAULT '0',
+rev_user_text varbinary(255) NOT NULL DEFAULT '',
+rev_timestamp varbinary(14) NOT NULL DEFAULT '',
+rev_minor_edit tinyint(1) unsigned NOT NULL DEFAULT '0',
+rev_deleted tinyint(1) unsigned NOT NULL DEFAULT '0',
+rev_len int(8) unsigned DEFAULT NULL,
+rev_parent_id int(8) unsigned DEFAULT NULL,
+rev_sha1 varbinary(32) NOT NULL DEFAULT '',
+PRIMARY KEY (rev_page,rev_id),
+UNIQUE KEY rev_id (rev_id),
+KEY rev_timestamp (rev_timestamp),
+KEY page_timestamp (rev_page,rev_timestamp),
+KEY user_timestamp (rev_user,rev_timestamp),
+KEY usertext_timestamp (rev_user_text,rev_timestamp,rev_user,rev_deleted,rev_minor_edit,rev_text_id,rev_comment)
+) ENGINE=InnoDB DEFAULT CHARSET=binary;
+INSERT INTO t2 VALUES
+(547116222,20,0,NULL,3,'','',0,0,NULL,NULL,''),(547117245,20,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547118268,20,0,NULL,5,'','',0,0,NULL,NULL,''),(547114177,21,0,NULL,1,'','',0,0,NULL,NULL,''),
+(547115200,21,0,NULL,2,'','',0,0,NULL,NULL,''),(547116223,21,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547117246,21,0,NULL,4,'','',0,0,NULL,NULL,''),(547118269,21,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547114178,22,0,NULL,1,'','',0,0,NULL,NULL,''),(547115201,22,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547116224,22,0,NULL,3,'','',0,0,NULL,NULL,''),(547117247,22,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547116226,24,0,NULL,3,'','',0,0,NULL,NULL,''),(547117249,24,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547118272,24,0,NULL,5,'','',0,0,NULL,NULL,''),(547114181,25,0,NULL,1,'','',0,0,NULL,NULL,''),
+(547115204,25,0,NULL,2,'','',0,0,NULL,NULL,''),(547116227,25,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547116157,978,0,NULL,2,'','',0,0,NULL,NULL,''),(547117180,978,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547118203,978,0,NULL,4,'','',0,0,NULL,NULL,''),(547119226,978,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547115135,979,0,NULL,1,'','',0,0,NULL,NULL,''),(547116158,979,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547116173,994,0,NULL,2,'','',0,0,NULL,NULL,''),(547117196,994,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547118219,994,0,NULL,4,'','',0,0,NULL,NULL,''),(547119242,994,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547115151,995,0,NULL,1,'','',0,0,NULL,NULL,''),(547116174,995,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547117197,995,0,NULL,3,'','',0,0,NULL,NULL,''),(547118220,995,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547118223,998,0,NULL,4,'','',0,0,NULL,NULL,''),(547119246,998,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547115155,999,0,NULL,1,'','',0,0,NULL,NULL,''),(547116178,999,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547117201,999,0,NULL,3,'','',0,0,NULL,NULL,''),(547118224,999,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547119271,38928081,0,NULL,10,'','',0,0,NULL,NULL,''),(547119272,38928081,0,NULL,11,'','',0,0,NULL,NULL,''),
+(547119273,38928081,0,NULL,12,'','',0,0,NULL,NULL,''),(547119274,38928081,0,NULL,13,'','',0,0,NULL,NULL,''),
+(547119275,38928081,0,NULL,14,'','',0,0,NULL,NULL,''),(547119276,38928081,0,NULL,15,'','',0,0,NULL,NULL,''),
+(547119277,38928081,0,NULL,16,'','',0,0,NULL,NULL,''),(547119278,38928081,0,NULL,17,'','',0,0,NULL,NULL,''),
+(547119279,38928081,0,NULL,18,'','',0,0,NULL,NULL,''),(547119280,38928081,0,NULL,19,'','',0,0,NULL,NULL,'');
+CREATE TABLE t3 (
+old_id int(10) unsigned NOT NULL AUTO_INCREMENT,
+old_text mediumblob NOT NULL,
+old_flags tinyblob NOT NULL,
+PRIMARY KEY (old_id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t3 VALUES
+(1,'text-0',''),(2,'text-1000',''),(3,'text-2000',''),(4,'text-3000',''),
+(5,'text-4000',''),(6,'text-5000',''),(7,'text-6000',''),(8,'text-7000',''),
+(9,'text-8000',''),(10,'text-9000',''),(11,'text-1',''),(12,'text-1001',''),
+(13,'text-2001',''),(14,'text-3001',''),(15,'text-4001',''),(16,'text-5001',''),
+(17,'text-6001',''),(18,'text-7001',''),(19,'text-8001',''),(20,'text-9001',''),
+(21,'text-2',''),(22,'text-1002',''),(23,'text-2002',''),(24,'text-3002',''),
+(25,'text-4002',''),(26,'text-5002',''),(27,'text-6002',''),(28,'text-7002',''),
+(29,'text-8002',''),(30,'text-9002',''),(31,'text-3',''),(32,'text-1003',''),
+(33,'text-2003',''),(34,'text-3003',''),(35,'text-4003',''),(36,'text-5003',''),
+(37,'text-6003',''),(38,'text-7003',''),(39,'text-8003',''),(40,'text-9003',''),
+(41,'text-4',''),(42,'text-1004',''),(43,'text-2004',''),(44,'text-3004',''),
+(45,'text-4004',''),(46,'text-5004',''),(47,'text-6004',''),(48,'text-7004',''),
+(49,'text-8004',''),(50,'text-9004',''),(51,'text-5',''),(52,'text-1005',''),
+(53,'text-2005',''),(54,'text-3005',''),(55,'text-4005',''),(56,'text-5005',''),
+(57,'text-6005',''),(58,'text-7005',''),(59,'text-8005',''),(60,'text-9005',''),
+(61,'text-6',''),(62,'text-1006',''),(63,'text-2006',''),(64,'text-3006',''),
+(65,'text-4006',''),(66,'text-5006',''),(67,'text-6006',''),(68,'text-7006',''),
+(69,'text-8006',''),(70,'text-9006',''),(71,'text-7',''),(72,'text-1007',''),
+(73,'text-2007',''),(74,'text-3007',''),(75,'text-4007',''),(76,'text-5007',''),
+(77,'text-6007',''),(78,'text-7007',''),(79,'text-8007',''),(80,'text-9007',''),
+(81,'text-8',''),(82,'text-1008',''),(83,'text-2008',''),(84,'text-3008',''),
+(85,'text-4008',''),(86,'text-5008',''),(87,'text-6008',''),(88,'text-7008',''),
+(89,'text-8008',''),(90,'text-9008',''),(91,'text-9',''),(92,'text-1009',''),
+(93,'text-2009',''),(94,'text-3009',''),(95,'text-4009',''),(96,'text-5009',''),
+(97,'text-6009',''),(98,'text-7009',''),(99,'text-8009',''),(100,'text-9009','');
+set optimizer_switch='extended_keys=off';
+EXPLAIN
+SELECT * FROM t1, t2 IGNORE INDEX (PRIMARY), t3
+WHERE page_id=rev_page AND rev_text_id=old_id AND page_namespace=4 AND page_title='Sandbox'
+ORDER BY rev_timestamp ASC LIMIT 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY,name_title name_title 261 const,const 1
+1 SIMPLE t2 ref page_timestamp page_timestamp 4 const 10 Using where
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.rev_text_id 1
+set optimizer_switch='extended_keys=on';
+EXPLAIN
+SELECT * FROM t1, t2 IGNORE INDEX (PRIMARY), t3
+WHERE page_id=rev_page AND rev_text_id=old_id AND page_namespace=4 AND page_title='Sandbox'
+ORDER BY rev_timestamp ASC LIMIT 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY,name_title name_title 261 const,const 1
+1 SIMPLE t2 ref page_timestamp page_timestamp 4 const 10 Using where
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.rev_text_id 1
+DROP TABLE t1,t2,t3;
set optimizer_switch=@save_optimizer_switch;
set optimizer_switch=@save_ext_key_optimizer_switch;
SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result
index 255714a7236..84b6ff640e9 100644
--- a/mysql-test/r/join_nested.result
+++ b/mysql-test/r/join_nested.result
@@ -1847,3 +1847,27 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` A
DROP TABLE t1,t2,t3,t4;
SET optimizer_switch=@save_optimizer_switch;
End of 5.0 tests
+#
+# MDEV-621: LP:693329 - Assertion `!is_interleave_error' failed on low optimizer_search_depth
+#
+set @tmp_mdev621= @@optimizer_search_depth;
+SET SESSION optimizer_search_depth = 4;
+CREATE TABLE t1 (f1 int,f2 int,f3 int,f4 int) ;
+INSERT IGNORE INTO t1 VALUES (0,0,2,0),(NULL,0,2,0);
+CREATE TABLE t2 (f1 int) ;
+CREATE TABLE t3 (f3 int,PRIMARY KEY (f3)) ;
+CREATE TABLE t4 (f5 int) ;
+CREATE TABLE t5 (f2 int) ;
+SELECT alias2.f4 FROM t1 AS alias1
+LEFT JOIN t1 AS alias2
+LEFT JOIN t2 AS alias3
+LEFT JOIN t3 AS alias4 ON alias3.f1 = alias4.f3
+ON alias2.f1
+LEFT JOIN t4 AS alias5
+JOIN t5 ON alias5.f5
+ON alias2.f3 ON alias1.f2;
+f4
+NULL
+NULL
+DROP TABLE t1,t2,t3,t4,t5;
+set optimizer_search_depth= @tmp_mdev621;
diff --git a/mysql-test/r/join_nested_jcl6.result b/mysql-test/r/join_nested_jcl6.result
index c744df9e2fe..6b5a50ba978 100644
--- a/mysql-test/r/join_nested_jcl6.result
+++ b/mysql-test/r/join_nested_jcl6.result
@@ -1858,6 +1858,30 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` A
DROP TABLE t1,t2,t3,t4;
SET optimizer_switch=@save_optimizer_switch;
End of 5.0 tests
+#
+# MDEV-621: LP:693329 - Assertion `!is_interleave_error' failed on low optimizer_search_depth
+#
+set @tmp_mdev621= @@optimizer_search_depth;
+SET SESSION optimizer_search_depth = 4;
+CREATE TABLE t1 (f1 int,f2 int,f3 int,f4 int) ;
+INSERT IGNORE INTO t1 VALUES (0,0,2,0),(NULL,0,2,0);
+CREATE TABLE t2 (f1 int) ;
+CREATE TABLE t3 (f3 int,PRIMARY KEY (f3)) ;
+CREATE TABLE t4 (f5 int) ;
+CREATE TABLE t5 (f2 int) ;
+SELECT alias2.f4 FROM t1 AS alias1
+LEFT JOIN t1 AS alias2
+LEFT JOIN t2 AS alias3
+LEFT JOIN t3 AS alias4 ON alias3.f1 = alias4.f3
+ON alias2.f1
+LEFT JOIN t4 AS alias5
+JOIN t5 ON alias5.f5
+ON alias2.f3 ON alias1.f2;
+f4
+NULL
+NULL
+DROP TABLE t1,t2,t3,t4,t5;
+set optimizer_search_depth= @tmp_mdev621;
CREATE TABLE t5 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b));
CREATE TABLE t6 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b));
CREATE TABLE t7 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b));
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index c28887d4ff2..8920539ef2e 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1853,6 +1853,38 @@ 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;
+#
+# Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS
+# WRONG RESULT
+#
+CREATE TABLE t1 (i1 int);
+INSERT INTO t1 VALUES (100), (101);
+CREATE TABLE t2 (i2 int, i3 int);
+INSERT INTO t2 VALUES (20,1),(10,2);
+CREATE TABLE t3 (i4 int(11));
+INSERT INTO t3 VALUES (1),(2);
+
+SELECT (
+SELECT MAX( t2.i2 )
+FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
+WHERE t2.i3 <> t1.i1
+) AS field1
+FROM t1;;
+field1
+20
+20
+
+SELECT (
+SELECT MAX( t2.i2 )
+FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
+WHERE t2.i3 <> t1.i1
+) AS field1
+FROM t1 GROUP BY field1;;
+field1
+20
+
+drop table t1,t2,t3;
+# End of test for Bug#13068506
End of 5.1 tests
#
# LP BUG#994392: Wrong result with RIGHT/LEFT JOIN and ALL subquery
@@ -2071,4 +2103,18 @@ b c d
5 8 88
5 8 81
DROP TABLE t1,t2;
+#
+# Bug mdev-4336: LEFT JOIN with disjunctive
+# <non-nullable datetime field> IS NULL in WHERE
+# causes a hang and eventual crash
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL,
+modified datetime NOT NULL,
+PRIMARY KEY (id)
+);
+SELECT a.* FROM t1 a LEFT JOIN t1 b ON a.id = b.id
+WHERE a.modified > b.modified or b.modified IS NULL;
+id modified
+DROP TABLE t1;
SET optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result
index 0184e236d14..1081fc0eed3 100644
--- a/mysql-test/r/join_outer_innodb.result
+++ b/mysql-test/r/join_outer_innodb.result
@@ -476,3 +476,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
drop view v1;
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16;
+#
+# MDEV-4270: crash in fix_semijoin_strategies_for_picked_join_order
+#
+drop table if exists t1,t2,t3;
+Warnings:
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
+Note 1051 Unknown table 't3'
+create table t2(a int,unique key (a)) engine=innodb;
+create table t3(b int) engine=innodb;
+create table t1(a int,b int)engine=innodb;
+set @mdev4270_opl= @@optimizer_prune_level;
+set @mdev4270_osd= @@optimizer_search_depth;
+set optimizer_prune_level=0;
+set optimizer_search_depth=2;
+select 1 from t1 join t2 a
+natural left join t2 b
+natural right outer join t3;
+1
+drop table t1,t2,t3;
+set optimizer_prune_level=@mdev4270_opl;
+set optimizer_search_depth=@mdev4270_osd;
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 4efb6126cba..43443aa2fef 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -1864,6 +1864,38 @@ 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;
+#
+# Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS
+# WRONG RESULT
+#
+CREATE TABLE t1 (i1 int);
+INSERT INTO t1 VALUES (100), (101);
+CREATE TABLE t2 (i2 int, i3 int);
+INSERT INTO t2 VALUES (20,1),(10,2);
+CREATE TABLE t3 (i4 int(11));
+INSERT INTO t3 VALUES (1),(2);
+
+SELECT (
+SELECT MAX( t2.i2 )
+FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
+WHERE t2.i3 <> t1.i1
+) AS field1
+FROM t1;;
+field1
+20
+20
+
+SELECT (
+SELECT MAX( t2.i2 )
+FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
+WHERE t2.i3 <> t1.i1
+) AS field1
+FROM t1 GROUP BY field1;;
+field1
+20
+
+drop table t1,t2,t3;
+# End of test for Bug#13068506
End of 5.1 tests
#
# LP BUG#994392: Wrong result with RIGHT/LEFT JOIN and ALL subquery
@@ -2082,6 +2114,20 @@ b c d
5 8 88
5 8 81
DROP TABLE t1,t2;
+#
+# Bug mdev-4336: LEFT JOIN with disjunctive
+# <non-nullable datetime field> IS NULL in WHERE
+# causes a hang and eventual crash
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL,
+modified datetime NOT NULL,
+PRIMARY KEY (id)
+);
+SELECT a.* FROM t1 a LEFT JOIN t1 b ON a.id = b.id
+WHERE a.modified > b.modified or b.modified IS NULL;
+id modified
+DROP TABLE t1;
SET optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;
show variables like 'join_cache_level';
diff --git a/mysql-test/r/log_slow.result b/mysql-test/r/log_slow.result
index 76cf45631bd..6500ba3ca53 100644
--- a/mysql-test/r/log_slow.result
+++ b/mysql-test/r/log_slow.result
@@ -13,6 +13,7 @@ log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,
log_slow_queries ON
log_slow_rate_limit 1
log_slow_verbosity
+set @org_slow_query_log= @@global.slow_query_log;
set @@log_slow_filter= "filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk,admin";
select @@log_slow_filter;
@@log_slow_filter
@@ -56,5 +57,19 @@ insert_id int(11) NO NULL
server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL
flush slow logs;
+set long_query_time=0.1;
+set log_slow_filter='';
+set global slow_query_log=1;
+set global log_output='TABLE';
+select sleep(0.5);
+sleep(0.5)
+0
+select count(*) FROM mysql.slow_log;
+count(*)
+1
+truncate mysql.slow_log;
+set @@long_query_time=default;
+set global slow_query_log= @org_slow_query_log;
set @@log_slow_filter=default;
set @@log_slow_verbosity=default;
+set global log_output= default;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index c6a806bec80..c68d43831ad 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1764,13 +1764,13 @@ engine=MEMORY
partition by key (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
+test.t1 check status OK
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 3d16d37c5f1..c086a62275a 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2921,8 +2921,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
DROP TABLE t1,t2;
-select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
-x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
+select x'3136' + 0, X'3136' + 0, b'10' + 0, B'10' + 0;
+x'3136' + 0 X'3136' + 0 b'10' + 0 B'10' + 0
16 16 2 2
create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null);
create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4));
@@ -5119,6 +5119,7 @@ SELECT 1 FROM t1 GROUP BY 1;
1
1
drop table t1;
+set sql_buffer_result= 0;
#
# Bug #58422: Incorrect result when OUTER JOIN'ing
# with an empty table
@@ -5322,4 +5323,38 @@ AND Time_zone_id = Time_zone_id
OR Time_zone_id <> Time_zone_id )
AND Use_leap_seconds <> 'N';
Time_zone_id Use_leap_seconds
+#
+# Bug mdev-4274: result of simplification of OR badly merged
+# into embedding AND
+#
+CREATE TABLE t1 (a int, b int, INDEX idx(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (8,8);
+CREATE TABLE t2 (c int, INDEX idx(c)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8), (9);
+EXPLAIN EXTENDED
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+WHERE 1 IS NULL OR b < 33 AND b = c;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
+1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
+Warnings:
+Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1)
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+WHERE 1 IS NULL OR b < 33 AND b = c;
+a b c
+8 8 8
+DROP TABLE t1,t2;
+#
+# Bug mdev-4413: another manifestations of bug mdev-2474
+# (valgrind complains)
+#
+CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,1);
+CREATE TABLE t2 (c int) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0), (8);
+SELECT * FROM t1, t2
+WHERE c = a AND
+( 0 OR ( b BETWEEN 45 AND 300 OR a > 45 AND a < 100 ) AND b = c );
+a b c
+DROP TABLE t1, t2;
End of 5.3 tests
diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result
index 467f940c85d..00b356fc1c0 100644
--- a/mysql-test/r/select_jcl6.result
+++ b/mysql-test/r/select_jcl6.result
@@ -2932,8 +2932,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.a 5 Using where; Using join buffer (flat, BNLH join)
DROP TABLE t1,t2;
-select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
-x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
+select x'3136' + 0, X'3136' + 0, b'10' + 0, B'10' + 0;
+x'3136' + 0 X'3136' + 0 b'10' + 0 B'10' + 0
16 16 2 2
create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null);
create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4));
@@ -5130,6 +5130,7 @@ SELECT 1 FROM t1 GROUP BY 1;
1
1
drop table t1;
+set sql_buffer_result= 0;
#
# Bug #58422: Incorrect result when OUTER JOIN'ing
# with an empty table
@@ -5333,6 +5334,40 @@ AND Time_zone_id = Time_zone_id
OR Time_zone_id <> Time_zone_id )
AND Use_leap_seconds <> 'N';
Time_zone_id Use_leap_seconds
+#
+# Bug mdev-4274: result of simplification of OR badly merged
+# into embedding AND
+#
+CREATE TABLE t1 (a int, b int, INDEX idx(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (8,8);
+CREATE TABLE t2 (c int, INDEX idx(c)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8), (9);
+EXPLAIN EXTENDED
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+WHERE 1 IS NULL OR b < 33 AND b = c;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
+1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
+Warnings:
+Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1)
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+WHERE 1 IS NULL OR b < 33 AND b = c;
+a b c
+8 8 8
+DROP TABLE t1,t2;
+#
+# Bug mdev-4413: another manifestations of bug mdev-2474
+# (valgrind complains)
+#
+CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,1);
+CREATE TABLE t2 (c int) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0), (8);
+SELECT * FROM t1, t2
+WHERE c = a AND
+( 0 OR ( b BETWEEN 45 AND 300 OR a > 45 AND a < 100 ) AND b = c );
+a b c
+DROP TABLE t1, t2;
End of 5.3 tests
set join_cache_level=default;
show variables like 'join_cache_level';
diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result
index 3d16d37c5f1..c086a62275a 100644
--- a/mysql-test/r/select_pkeycache.result
+++ b/mysql-test/r/select_pkeycache.result
@@ -2921,8 +2921,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
DROP TABLE t1,t2;
-select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
-x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0
+select x'3136' + 0, X'3136' + 0, b'10' + 0, B'10' + 0;
+x'3136' + 0 X'3136' + 0 b'10' + 0 B'10' + 0
16 16 2 2
create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null);
create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4));
@@ -5119,6 +5119,7 @@ SELECT 1 FROM t1 GROUP BY 1;
1
1
drop table t1;
+set sql_buffer_result= 0;
#
# Bug #58422: Incorrect result when OUTER JOIN'ing
# with an empty table
@@ -5322,4 +5323,38 @@ AND Time_zone_id = Time_zone_id
OR Time_zone_id <> Time_zone_id )
AND Use_leap_seconds <> 'N';
Time_zone_id Use_leap_seconds
+#
+# Bug mdev-4274: result of simplification of OR badly merged
+# into embedding AND
+#
+CREATE TABLE t1 (a int, b int, INDEX idx(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (8,8);
+CREATE TABLE t2 (c int, INDEX idx(c)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8), (9);
+EXPLAIN EXTENDED
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+WHERE 1 IS NULL OR b < 33 AND b = c;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system idx NULL NULL NULL 1 100.00
+1 SIMPLE t2 ref idx idx 5 const 1 100.00 Using index
+Warnings:
+Note 1003 select 8 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 8) and 1)
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+WHERE 1 IS NULL OR b < 33 AND b = c;
+a b c
+8 8 8
+DROP TABLE t1,t2;
+#
+# Bug mdev-4413: another manifestations of bug mdev-2474
+# (valgrind complains)
+#
+CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,1);
+CREATE TABLE t2 (c int) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0), (8);
+SELECT * FROM t1, t2
+WHERE c = a AND
+( 0 OR ( b BETWEEN 45 AND 300 OR a > 45 AND a < 100 ) AND b = c );
+a b c
+DROP TABLE t1, t2;
End of 5.3 tests
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 2b7439b09e0..809aef3ac99 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -15,7 +15,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 27 Y 0 31 8
+def Msg_text 250 393216 27 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status Table is already up to date
check table t1 fast;
@@ -23,7 +23,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 27 Y 0 31 8
+def Msg_text 250 393216 27 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status Table is already up to date
check table t1 changed;
@@ -31,7 +31,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
insert into t1 values (5,5,5);
@@ -40,7 +40,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
check table t1 medium;
@@ -48,7 +48,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
check table t1 extended;
@@ -56,7 +56,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
@@ -88,7 +88,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 8 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 optimize status OK
optimize table t1;
@@ -160,7 +160,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 7 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
@@ -177,7 +177,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def Table 253 128 7 Y 0 31 8
def Op 253 10 6 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
-def Msg_text 253 255 2 Y 0 31 8
+def Msg_text 250 393216 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 repair status OK
show index from t1;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index c297ceda572..6e6f05667ed 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -7916,4 +7916,65 @@ DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
DROP FUNCTION f4;
+
+Stored procedures and a condition handler in a nested procedure call
+doesn't suppress the condition from being passed on to the calling
+procedure
+
+drop procedure if exists p1;
+drop procedure if exists p0;
+create table t1 (id int);
+create procedure p1 () begin
+declare i int default 0;
+declare continue handler for not found begin
+select "You should see this message and the warning that generated this" as "message";
+show warnings;
+end;
+select id into i from t1;
+end$$
+create procedure p0 () begin
+declare continue handler for not found begin
+select "You should NOT see this message" as "message";
+end;
+call p1();
+end$$
+call p0();
+message
+You should see this message and the warning that generated this
+Level Code Message
+Warning 1329 No data - zero rows fetched, selected, or processed
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+drop procedure p1;
+drop procedure p0;
+drop table t1;
+
+Test if stored procedures propagates errors
+
+create table t1 (id int primary key);
+create procedure p1 () begin
+insert into t1 values(1);
+insert into t1 values(2);
+insert into t1 values(2);
+insert into t1 values(3);
+end$$
+create procedure p2 () begin
+declare x int;
+select id into x from t1 where id=5;
+end$$
+call p1();
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+show warnings;
+Level Code Message
+Error 1062 Duplicate entry '2' for key 'PRIMARY'
+select * from t1;
+id
+1
+2
+call p2();
+Warnings:
+Warning 1329 No data - zero rows fetched, selected, or processed
+drop procedure p1;
+drop procedure p2;
+drop table t1;
# End of 5.5 test
diff --git a/mysql-test/r/status_user.result b/mysql-test/r/status_user.result
index 040b2d85a51..fb6dac3f5ac 100644
--- a/mysql-test/r/status_user.result
+++ b/mysql-test/r/status_user.result
@@ -27,7 +27,7 @@ ACCESS_DENIED bigint(21) NO 0
EMPTY_QUERIES bigint(21) NO 0
show columns from information_schema.user_statistics;
Field Type Null Key Default Extra
-USER varchar(48) NO
+USER varchar(128) NO
TOTAL_CONNECTIONS int(11) NO 0
CONCURRENT_CONNECTIONS int(11) NO 0
CONNECTED_TIME int(11) NO 0
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index 53334dbc32b..0a98efb5c0e 100644
--- a/mysql-test/r/subselect_mat.result
+++ b/mysql-test/r/subselect_mat.result
@@ -1999,6 +1999,20 @@ b b v v
b b s s
b b y y
DROP TABLE t1,t2;
+#
+# MDEV-4465: Reproducible crash (mysqld got signal 11) in multi_delete::initialize_tables with semijoin+materialization
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL
+);
+CREATE TABLE t2 (
+id int(11) NOT NULL,
+a_id int(11) DEFAULT NULL
+);
+insert into t1 values (1), (2), (3);
+insert into t2 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 3), (6, 3), (7, 3);
+delete t2 from t2 where a_id in (select * from (select t1.id from t1 limit 2) as x);
+drop table t1,t2;
# This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 92c626eca61..56c3044c4e4 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -2852,4 +2852,36 @@ field1
o
o
DROP TABLE t1, t2;
+#
+# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
+# (testcase only)
+#
+SET join_cache_level = 5;
+SET optimizer_switch = 'semijoin=on';
+CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4,'p'),(1,'q'),(8,'e');
+CREATE TABLE t2 (c INT, d CHAR(1), KEY(c), KEY(d)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (4,'f'),(2,'i'),(5,'h'),(3,'q'),(1,'g');
+SELECT a, COUNT(*) AS cnt
+FROM t1 LEFT JOIN t2 ON (d = b)
+WHERE a IN ( SELECT c FROM t2 WHERE b > 'k' )
+GROUP BY a ORDER BY a, cnt LIMIT 2;
+a cnt
+1 1
+4 1
+drop table t1, t2;
+#
+# MDEV-4071: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with ...
+#
+CREATE TABLE t1 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'v'),(0,'s');
+CREATE TABLE t2 (a INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0),(8);
+SELECT c, SUM( DISTINCT b ) AS sm FROM t1
+WHERE ( 5, 108 ) IN ( SELECT MIN(a), MAX(a) FROM t2 )
+GROUP BY b
+HAVING c <> ( SELECT MAX( c ) FROM t1 )
+ORDER BY sm;
+c sm
+DROP TABLE t1,t2;
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result
index c91ee67a717..1af507668da 100644
--- a/mysql-test/r/subselect_sj2_mat.result
+++ b/mysql-test/r/subselect_sj2_mat.result
@@ -1377,7 +1377,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`) and (`test`.`t3`.`i3` > 0))
+Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`) and (`test`.`t2`.`i2` > 0))
SELECT * FROM t1
WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2);
i1
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 04a54c9a371..7be29201c63 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -2866,6 +2866,38 @@ field1
o
o
DROP TABLE t1, t2;
+#
+# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
+# (testcase only)
+#
+SET join_cache_level = 5;
+SET optimizer_switch = 'semijoin=on';
+CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4,'p'),(1,'q'),(8,'e');
+CREATE TABLE t2 (c INT, d CHAR(1), KEY(c), KEY(d)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (4,'f'),(2,'i'),(5,'h'),(3,'q'),(1,'g');
+SELECT a, COUNT(*) AS cnt
+FROM t1 LEFT JOIN t2 ON (d = b)
+WHERE a IN ( SELECT c FROM t2 WHERE b > 'k' )
+GROUP BY a ORDER BY a, cnt LIMIT 2;
+a cnt
+1 1
+4 1
+drop table t1, t2;
+#
+# MDEV-4071: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with ...
+#
+CREATE TABLE t1 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'v'),(0,'s');
+CREATE TABLE t2 (a INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0),(8);
+SELECT c, SUM( DISTINCT b ) AS sm FROM t1
+WHERE ( 5, 108 ) IN ( SELECT MIN(a), MAX(a) FROM t2 )
+GROUP BY b
+HAVING c <> ( SELECT MAX( c ) FROM t1 )
+ORDER BY sm;
+c sm
+DROP TABLE t1,t2;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result
index 549282c9dbe..4e8d1697b83 100644
--- a/mysql-test/r/subselect_sj_mat.result
+++ b/mysql-test/r/subselect_sj_mat.result
@@ -2039,6 +2039,20 @@ b b v v
b b s s
b b y y
DROP TABLE t1,t2;
+#
+# MDEV-4465: Reproducible crash (mysqld got signal 11) in multi_delete::initialize_tables with semijoin+materialization
+#
+CREATE TABLE t1 (
+id int(11) NOT NULL
+);
+CREATE TABLE t2 (
+id int(11) NOT NULL,
+a_id int(11) DEFAULT NULL
+);
+insert into t1 values (1), (2), (3);
+insert into t2 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 3), (6, 3), (7, 3);
+delete t2 from t2 where a_id in (select * from (select t1.id from t1 limit 2) as x);
+drop table t1,t2;
# This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 05cdcf7e256..d6676bbf16b 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -665,6 +665,22 @@ Warning 1292 Incorrect datetime value: '10:19:31'
Warning 1292 Incorrect datetime value: '22:55:23'
Warning 1292 Incorrect datetime value: '10:19:31'
drop table t1;
+#
+# Semantics of the condition <non-nullable datetime field> IS NULL
+# when the field belongs to an inner table of an outer join
+#
+create table t1 (a int, b date not null);
+insert t1 values (1, 0), (2, '1999-01-02');
+create table t2 (c int);
+insert t2 values (1),(3);
+select * from t2 left join t1 on t1.a=t2.c where t1.a is null;
+c a b
+3 NULL NULL
+select * from t2 left join t1 on t1.a=t2.c where t1.b is null;
+c a b
+1 1 0000-00-00
+3 NULL NULL
+drop table t1,t2;
End of 5.3 tests
#
# Start of 5.5 tests
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index 56fe19200f8..eaaf5c39ec4 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -9,12 +9,12 @@ insert into t1 values (@var1),(@var2);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # User var # # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
+master-bin.000001 # User var # # @`a b`=_latin1 X'68656C6C6F' COLLATE latin1_swedish_ci
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # User var # # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
-master-bin.000001 # User var # # @`var2`=_binary 0x61 COLLATE binary
+master-bin.000001 # User var # # @`var1`=_latin1 X'273B616161' COLLATE latin1_swedish_ci
+master-bin.000001 # User var # # @`var2`=_binary X'61' COLLATE binary
master-bin.000001 # Query # # use `test`; insert into t1 values (@var1),(@var2)
master-bin.000001 # Query # # COMMIT
flush logs;
@@ -25,7 +25,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
BEGIN
/*!*/;
-SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
+SET @`a b`:=_latin1 X'68656C6C6F' COLLATE `latin1_swedish_ci`/*!*/;
use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
@@ -43,8 +43,8 @@ COMMIT
/*!*/;
BEGIN
/*!*/;
-SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/;
-SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/;
+SET @`var1`:=_latin1 X'273B616161' COLLATE `latin1_swedish_ci`/*!*/;
+SET @`var2`:=_binary X'61' COLLATE `binary`/*!*/;
SET TIMESTAMP=10000/*!*/;
insert into t1 values (@var1),(@var2)
/*!*/;
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index 065abbb9c00..689db16b5d4 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -5,9 +5,62 @@ A 65 9223372036854775807 18446744073709551615
select 0x31+1,concat(0x31)+1,-0xf;
0x31+1 concat(0x31)+1 -0xf
50 2 -15
-select x'31',X'ffff'+0;
-x'31' X'ffff'+0
+select x'31',0xffff+0;
+x'31' 0xffff+0
1 65535
+select X'FFFF'+0;
+X'FFFF'+0
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '\xFF\xFF'
+SELECT x'31'+0, 0x31+0;
+x'31'+0 0x31+0
+1 49
+SELECT x'31'+0.1e0, 0x31+0.1e0;
+x'31'+0.1e0 0x31+0.1e0
+1.1 49.1
+SELECT x'312E39'+0e0, 0x312E39+0e0;
+x'312E39'+0e0 0x312E39+0e0
+1.9 3223097
+SELECT CAST(x'31' AS SIGNED), CAST(0x31 AS SIGNED);
+CAST(x'31' AS SIGNED) CAST(0x31 AS SIGNED)
+1 49
+SELECT CAST(x'31' AS DECIMAL(10,1)), CAST(0x31 AS DECIMAL(10,1));
+CAST(x'31' AS DECIMAL(10,1)) CAST(0x31 AS DECIMAL(10,1))
+1.0 49.0
+SELECT CAST(x'312E39' AS SIGNED), CAST(0x312E39 AS SIGNED);
+CAST(x'312E39' AS SIGNED) CAST(0x312E39 AS SIGNED)
+1 3223097
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '1.9'
+SELECT CAST(x'312E39' AS DECIMAL(10,1)), CAST(0x312E39 AS DECIMAL(10,1));
+CAST(x'312E39' AS DECIMAL(10,1)) CAST(0x312E39 AS DECIMAL(10,1))
+1.9 3223097.0
+EXPLAIN EXTENDED SELECT X'FFFF', 0xFFFF;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select X'ffff' AS `X'FFFF'`,0xffff AS `0xFFFF`
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (X'31'),(0x31);
+INSERT INTO t1 VALUES (X'312E39'),(0x312E39);
+SELECT * FROM t1;
+a
+1
+49
+2
+3223097
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(10,1));
+INSERT INTO t1 VALUES (X'31'),(0x31);
+INSERT INTO t1 VALUES (X'312E39'),(0x312E39);
+SELECT * FROM t1;
+a
+1.0
+49.0
+1.9
+3223097.0
+DROP TABLE t1;
create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) );
insert into t1 set UNIQ=0x38afba1d73e6a18a;
insert into t1 set UNIQ=123;
@@ -104,8 +157,8 @@ A
select b'01000001';
b'01000001'
A
-select x'41', 0+x'41';
-x'41' 0+x'41'
+select x'41', 0+x'3635';
+x'41' 0+x'3635'
A 65
select N'abc', length(N'abc');
abc length(N'abc')
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index f280fce08d3..817c725f131 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -78,7 +78,7 @@ explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3`
+Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@`t1`) AS `@t1`,(@`t2`) AS `@t2`,(@`t3`) AS `@t3`
select @t5;
@t5
1.23456
@@ -1786,4 +1786,8 @@ set session collation_connection=2048;
ERROR HY000: Unknown collation: '2048'
set session collation_database=2048;
ERROR HY000: Unknown collation: '2048'
+set session rand_seed1=DEFAULT;
+ERROR 42000: Variable 'rand_seed1' doesn't have a default value
+set autocommit = values(v);
+ERROR 42S22: Unknown column 'v' in 'field list'
End of 5.5 tests
diff --git a/mysql-test/suite/binlog/disabled.def b/mysql-test/suite/binlog/disabled.def
index 1abc9951322..424e5549541 100644
--- a/mysql-test/suite/binlog/disabled.def
+++ b/mysql-test/suite/binlog/disabled.def
@@ -10,4 +10,4 @@
#
##############################################################################
binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
-binlog_spurious_ddl_errors : BUG#11761680 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
+binlog_spurious_ddl_errors : BUG#11761680 2013-01-18 astha Fixed on mysql-5.6 and trunk
diff --git a/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result b/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
index 17a473ff062..1a81eee1a58 100644
--- a/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
+++ b/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
@@ -48,6 +48,7 @@ DROP TABLE t_stmt;
################################################################################
# CLEAN UP #
################################################################################
+flush tables;
UNINSTALL PLUGIN example;
SET @@global.binlog_format = @old_binlog_format;
SET @@session.binlog_format = @old_binlog_format;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index 6a7467b7fcd..89f81b3ca99 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -6,7 +6,7 @@ insert into t2 values (@v);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # User var # # @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
+master-bin.000001 # User var # # @`v`=_ucs2 X'006100620063' COLLATE ucs2_general_ci
master-bin.000001 # Query # # use `test`; insert into t2 values (@v)
master-bin.000001 # Query # # COMMIT
flush logs;
@@ -17,7 +17,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
BEGIN
/*!*/;
-SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/;
+SET @`v`:=_ucs2 X'006100620063' COLLATE `ucs2_general_ci`/*!*/;
use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
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 b4e0747a07b..2c9a5118b9b 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
@@ -959,10 +959,10 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Intvar # # INSERT_ID=10
-master-bin.000001 # User var # # @`b`=_latin1 0x<binlog_start>5 COLLATE latin1_swedish_ci
+master-bin.000001 # User var # # @`b`=_latin1 X'<binlog_start>5' COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
-master-bin.000001 # User var # # @`b`=_latin1 0x<binlog_start>5 COLLATE latin1_swedish_ci
+master-bin.000001 # User var # # @`b`=_latin1 X'<binlog_start>5' COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
drop trigger trg_del_t2;
diff --git a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
index 6514ff1f712..e64e7838a31 100644
--- a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
+++ b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
@@ -26,7 +26,7 @@
--source include/have_log_bin.inc
SET @old_binlog_format= @@global.binlog_format;
-INSTALL PLUGIN example SONAME 'ha_example.so';
+INSTALL PLUGIN example SONAME 'ha_example';
--echo ################################################################################
--echo # Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog
@@ -90,6 +90,7 @@ DROP TABLE t_stmt;
--echo ################################################################################
--echo # CLEAN UP #
--echo ################################################################################
+flush tables;
UNINSTALL PLUGIN example;
SET @@global.binlog_format = @old_binlog_format;
SET @@session.binlog_format = @old_binlog_format;
diff --git a/mysql-test/suite/federated/federated.result b/mysql-test/suite/federated/federated.result
new file mode 100644
index 00000000000..49f9d338c6a
--- /dev/null
+++ b/mysql-test/suite/federated/federated.result
@@ -0,0 +1,13 @@
+CREATE DATABASE federated;
+CREATE DATABASE federated;
+CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='non_existing';
+ERROR HY000: server name: 'non_existing' doesn't exist!
+SHOW WARNINGS;
+Level Code Message
+Error 1 server name: 'non_existing' doesn't exist!
+Error 1 Can't create/write to file 'non_existing' (Errcode: 14 "Bad address")
+Error 1005 Can't create table `test`.`t1` (errno: 1 "Operation not permitted")
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated.test b/mysql-test/suite/federated/federated.test
new file mode 100644
index 00000000000..88d20817996
--- /dev/null
+++ b/mysql-test/suite/federated/federated.test
@@ -0,0 +1,12 @@
+source include/federated.inc;
+
+connection master;
+#
+# MDEV-388 Creating a federated table with a non-existing server returns a random error code
+#
+--error 1
+CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='non_existing';
+SHOW WARNINGS;
+
+source include/federated_cleanup.inc;
+
diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test
index 15fdd47c4da..cfe6a425944 100644
--- a/mysql-test/suite/federated/federatedx.test
+++ b/mysql-test/suite/federated/federatedx.test
@@ -1999,4 +1999,5 @@ connection slave;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection default;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 8bf290ba168..52a8fbaadc6 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -245,7 +245,7 @@ def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7) select
def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select
-def information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select
+def information_schema PROCESSLIST USER 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -413,7 +413,7 @@ def information_schema USER_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19
def information_schema USER_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select
def information_schema USER_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select
-def information_schema USER_STATISTICS USER 1 NO varchar 48 144 NULL NULL NULL utf8 utf8_general_ci varchar(48) select
+def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select
def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select
def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select
@@ -716,7 +716,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12)
3.0000 information_schema PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80)
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
-3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
+3.0000 information_schema PROCESSLIST USER varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PROCESSLIST DB varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PROCESSLIST COMMAND varchar 16 48 utf8 utf8_general_ci varchar(16)
@@ -874,7 +874,7 @@ NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema USER_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
-3.0000 information_schema USER_STATISTICS USER varchar 48 144 utf8 utf8_general_ci varchar(48)
+3.0000 information_schema USER_STATISTICS USER varchar 128 384 utf8 utf8_general_ci varchar(128)
NULL information_schema USER_STATISTICS TOTAL_CONNECTIONS int NULL NULL NULL NULL int(11)
NULL information_schema USER_STATISTICS CONCURRENT_CONNECTIONS int NULL NULL NULL NULL int(11)
NULL information_schema USER_STATISTICS CONNECTED_TIME int NULL NULL NULL NULL int(11)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index ba5166691c1..1fe4e2ebeb6 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -246,7 +246,7 @@ def information_schema PROCESSLIST STAGE 10 0 NO tinyint NULL NULL 3 0 NULL NULL
def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(7)
def information_schema PROCESSLIST TIME_MS 9 0.000 NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3)
-def information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema PROCESSLIST USER 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128)
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512)
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
@@ -414,7 +414,7 @@ def information_schema USER_STATISTICS ROWS_UPDATED 14 0 NO bigint NULL NULL 19
def information_schema USER_STATISTICS SELECT_COMMANDS 15 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(11)
def information_schema USER_STATISTICS UPDATE_COMMANDS 16 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21)
-def information_schema USER_STATISTICS USER 1 NO varchar 48 144 NULL NULL NULL utf8 utf8_general_ci varchar(48)
+def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128)
def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8)
def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32)
@@ -721,7 +721,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12)
3.0000 information_schema PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80)
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
-3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
+3.0000 information_schema PROCESSLIST USER varchar 128 384 utf8 utf8_general_ci varchar(128)
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PROCESSLIST DB varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PROCESSLIST COMMAND varchar 16 48 utf8 utf8_general_ci varchar(16)
@@ -879,7 +879,7 @@ NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema USER_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
-3.0000 information_schema USER_STATISTICS USER varchar 48 144 utf8 utf8_general_ci varchar(48)
+3.0000 information_schema USER_STATISTICS USER varchar 128 384 utf8 utf8_general_ci varchar(128)
NULL information_schema USER_STATISTICS TOTAL_CONNECTIONS int NULL NULL NULL NULL int(11)
NULL information_schema USER_STATISTICS CONCURRENT_CONNECTIONS int NULL NULL NULL NULL int(11)
NULL information_schema USER_STATISTICS CONNECTED_TIME int NULL NULL NULL NULL int(11)
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index 17c88527959..296e657a23b 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -23,7 +23,7 @@ SHOW CREATE TABLE processlist;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
@@ -98,7 +98,7 @@ SHOW CREATE TABLE processlist;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 112558c8280..4156fc914d2 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -23,7 +23,7 @@ SHOW CREATE TABLE processlist;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
@@ -98,7 +98,7 @@ SHOW CREATE TABLE processlist;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
index 9560f77e0da..0dcaf1798ef 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
@@ -13,7 +13,7 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
index aa24a46b718..92872564cac 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
@@ -13,7 +13,7 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.PROCESSLIST;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`ID` bigint(4) NOT NULL DEFAULT '0',
- `USER` varchar(16) NOT NULL DEFAULT '',
+ `USER` varchar(128) NOT NULL DEFAULT '',
`HOST` varchar(64) NOT NULL DEFAULT '',
`DB` varchar(64) DEFAULT NULL,
`COMMAND` varchar(16) NOT NULL DEFAULT '',
diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result
index cebbc2784df..89dec29f412 100644
--- a/mysql-test/suite/handler/interface.result
+++ b/mysql-test/suite/handler/interface.result
@@ -294,3 +294,13 @@ ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
USE test;
PREPARE h_r FROM 'HANDLER t1 READ `PRIMARY` LAST';
ERROR 42S02: Unknown table 't1' in HANDLER
+create view v as select 1;
+create temporary table v as select 2;
+handler v open;
+prepare stmt from 'create table if not exists v as select 3';
+execute stmt;
+Warnings:
+Note 1050 Table 'v' already exists
+handler v read next;
+ERROR 42S02: Unknown table 'v' in HANDLER
+drop view v;
diff --git a/mysql-test/suite/handler/interface.test b/mysql-test/suite/handler/interface.test
index e4e854b2515..2ef617c3ce7 100644
--- a/mysql-test/suite/handler/interface.test
+++ b/mysql-test/suite/handler/interface.test
@@ -377,3 +377,16 @@ USE test;
#
--error ER_UNKNOWN_TABLE
PREPARE h_r FROM 'HANDLER t1 READ `PRIMARY` LAST';
+
+#
+# MySQL Bug#16385711: HANDLER, CREATE TABLE IF NOT EXISTS, PROBLEM AFTER MYSQL_HA_FIND
+#
+create view v as select 1;
+create temporary table v as select 2;
+handler v open;
+prepare stmt from 'create table if not exists v as select 3';
+execute stmt;
+--error ER_UNKNOWN_TABLE
+handler v read next;
+drop view v;
+
diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result
index 6279f85f676..faf922ca5f8 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -4,14 +4,25 @@ CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
INSERT INTO t1 (b) VALUES ('corrupt me');
-# Restart server to flush buffers
+# Write file to make mysql-test-run.pl expect the "crash", but don't
+# start it until it's told to
+# We give 30 seconds to do a clean shutdown because we do not want
+# to redo apply the pages of t1.ibd at the time of recovery.
+# We want SQL to initiate the first access to t1.ibd.
+# Wait until disconnected.
+# Backup the t1.ibd before corrupting
# Corrupt the table
Munged a string.
Munged a string.
-# Write file to make mysql-test-run.pl expect crash and restart
+# Write file to make mysql-test-run.pl start up the server again
+SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
+# Write file to make mysql-test-run.pl expect the "crash", but don't
+# start it until it's told to
+# The below SELECT query will crash the server because some pages
+# on the disk are corrupted
SELECT * FROM t1;
ERROR HY000: Lost connection to MySQL server during query
-# Turn on reconnect
-# Wait for server to fully start
+# Restore the original t1.ibd
+# Write file to make mysql-test-run.pl start up the server again
# Cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test
index 2ab1be81f6d..ab69e20c495 100644
--- a/mysql-test/suite/innodb/t/innodb_bug12400341.test
+++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test
@@ -7,6 +7,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n
--skip Test requires InnoDB built with UNIV_DEBUG definition.
}
+# Don't test under valgrind, undo slots of the previous test might exist still
+# and cause unstable result.
+--source include/not_valgrind.inc
+
call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
--disable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test
index ee3519c53fc..050f7fbdd73 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -10,6 +10,8 @@ source include/not_crashrep.inc;
source include/not_embedded.inc;
# Require InnoDB
source include/have_innodb.inc;
+# Require Debug for SET DEBUG
+source include/have_debug.inc;
CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
@@ -27,13 +29,26 @@ while ($i)
--enable_query_log
INSERT INTO t1 (b) VALUES ('corrupt me');
---echo # Restart server to flush buffers
-source include/restart_mysqld.inc;
-
---echo # Corrupt the table
let $MYSQLD_DATADIR=`select @@datadir`;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
+--echo # start it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # We give 30 seconds to do a clean shutdown because we do not want
+--echo # to redo apply the pages of t1.ibd at the time of recovery.
+--echo # We want SQL to initiate the first access to t1.ibd.
+shutdown_server 30;
+
+--echo # Wait until disconnected.
+--source include/wait_until_disconnected.inc
+
+--echo # Backup the t1.ibd before corrupting
+--copy_file $t1_IBD $MYSQLD_DATADIR/test/t1.ibd.backup
+
+--echo # Corrupt the table
+
perl;
use strict;
use warnings;
@@ -59,17 +74,38 @@ while ($len = sysread IBD_FILE, $chunk, 1024)
close IBD_FILE;
EOF
---echo # Write file to make mysql-test-run.pl expect crash and restart
+--echo # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
+--echo # start it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # The below SELECT query will crash the server because some pages
+--echo # on the disk are corrupted
--error 2013
SELECT * FROM t1;
---echo # Turn on reconnect
---enable_reconnect
+# The below mtr command --remove_file fails randomly on windows with
+# error number 13 which is permission denied on nix systems. We sleep
+# 1 second hoping that any process holding lock on t1.ibd is released.
+SLEEP 1;
---echo # Wait for server to fully start
+--echo # Restore the original t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+--move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+
+--echo # Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
--source include/wait_until_connected_again.inc
+# Note SET DEBUG = '-d,innodb_page_corruption_retries' is not required
+# because the session information is lost after server restart
+
--echo # Cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug14676111-master.opt b/mysql-test/suite/innodb/t/innodb_bug14676111-master.opt
new file mode 100644
index 00000000000..e16b9b0b895
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug14676111-master.opt
@@ -0,0 +1 @@
+--loose-innodb-purge-threads=0
diff --git a/mysql-test/suite/innodb/t/innodb_bug14676111.test b/mysql-test/suite/innodb/t/innodb_bug14676111.test
index fadd111fdc9..41862b8105e 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14676111.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14676111.test
@@ -3,6 +3,11 @@
-- source include/have_innodb.inc
-- source include/have_debug.inc
+# Note that this test needs to be able to manipulate how/when purge is done
+# using @@innodb_limit_optimistic_insert_debug. This does not work with
+# background purge threads, so we disabled them in the -master.opt (they are
+# off by default in normal 5.5 innodb but on by default in xtradb)
+
if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG'`)
{
--skip Test requires InnoDB built with UNIV_DEBUG definition.
diff --git a/mysql-test/suite/maria/distinct.result b/mysql-test/suite/maria/distinct.result
new file mode 100644
index 00000000000..7963e7b72ff
--- /dev/null
+++ b/mysql-test/suite/maria/distinct.result
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT, b INT) ENGINE=Aria;
+INSERT t1 VALUES (3,2004),(2,2006),(1,2007),(3,2008),(2,2005),(2,2001);
+SELECT GROUP_CONCAT(a) FROM t1 GROUP BY b;
+GROUP_CONCAT(a)
+2
+3
+2
+2
+1
+3
+SELECT DISTINCT GROUP_CONCAT(a) FROM t1 GROUP BY b;
+GROUP_CONCAT(a)
+2
+3
+1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'q'),(2,NULL),(7,'g'),(6,'x');
+SELECT DISTINCT MAX( a ) FROM t1 GROUP BY b ORDER BY MD5( b );
+MAX( a )
+2
+7
+6
+DROP TABLE t1;
diff --git a/mysql-test/suite/maria/distinct.test b/mysql-test/suite/maria/distinct.test
new file mode 100644
index 00000000000..c71a172597c
--- /dev/null
+++ b/mysql-test/suite/maria/distinct.test
@@ -0,0 +1,25 @@
+#
+# MDEV-4280:
+# Assertion `empty_size == empty_size_on_page' failure in ma_blockrec.c or
+# ER_NOT_KEYFILE on query with DISTINCT and GROUP BY
+#
+# This issue was a bug in how we delete row during duplicate removal when
+# we use Aria for internal temporary table.
+#
+
+-- source include/have_maria.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=Aria;
+INSERT t1 VALUES (3,2004),(2,2006),(1,2007),(3,2008),(2,2005),(2,2001);
+SELECT GROUP_CONCAT(a) FROM t1 GROUP BY b;
+SELECT DISTINCT GROUP_CONCAT(a) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'q'),(2,NULL),(7,'g'),(6,'x');
+SELECT DISTINCT MAX( a ) FROM t1 GROUP BY b ORDER BY MD5( b );
+DROP TABLE t1;
diff --git a/mysql-test/suite/maria/maria-autozerofill.result b/mysql-test/suite/maria/maria-autozerofill.result
index 22856fe54b0..ef9e2f77345 100644
--- a/mysql-test/suite/maria/maria-autozerofill.result
+++ b/mysql-test/suite/maria/maria-autozerofill.result
@@ -12,6 +12,8 @@ create table t4 (a int) engine=aria;
INSERT INTO t4 VALUES (1),(2);
create table t5 (a int) engine=aria;
INSERT INTO t5 VALUES (1),(2);
+create table t6 (a int) engine=aria;
+INSERT INTO t6 VALUES (1),(2);
flush tables;
create_rename_lsn has non-magic value
* shut down mysqld, removed logs, restarted it
@@ -25,6 +27,10 @@ Status: changed,sorted index pages,zerofilled
insert into t1 values(2);
flush table t1;
create_rename_lsn has non-magic value
+#
+# BUG#44422 "mysql_upgrade destroys Maria tables?"
+# Check repair and optimize of moved table
+#
check table t2;
Table Op Msg_type Msg_text
mysqltest.t2 check error Table is from another system and must be zerofilled or repaired to be usable on this system
@@ -59,4 +65,11 @@ mysqltest.t5 repair status OK
check table t5;
Table Op Msg_type Msg_text
mysqltest.t5 check status OK
+select * from t6;
+a
+1
+2
+check table t6;
+Table Op Msg_type Msg_text
+mysqltest.t6 check status OK
drop database mysqltest;
diff --git a/mysql-test/suite/maria/maria-autozerofill.test b/mysql-test/suite/maria/maria-autozerofill.test
index 9bb2782105a..e56f71d2c5f 100644
--- a/mysql-test/suite/maria/maria-autozerofill.test
+++ b/mysql-test/suite/maria/maria-autozerofill.test
@@ -33,11 +33,13 @@ create table t4 (a int) engine=aria;
INSERT INTO t4 VALUES (1),(2);
create table t5 (a int) engine=aria;
INSERT INTO t5 VALUES (1),(2);
+create table t6 (a int) engine=aria;
+INSERT INTO t6 VALUES (1),(2);
flush tables;
# Check that table is not zerofilled, not movable
let $MYSQLD_DATADIR= `select @@datadir`;
---exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+--exec $MARIA_CHK -dv --ignore-control-file $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
perl;
use strict;
use warnings;
@@ -62,7 +64,7 @@ enable_ps_protocol;
flush table t1;
# Check that table is auto-zerofilled, movable
---exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+--exec $MARIA_CHK -dv --ignore-control-file $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
perl;
use strict;
use warnings;
@@ -79,7 +81,7 @@ insert into t1 values(2);
flush table t1;
# Check that table is not zerofilled, not movable
---exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+--exec $MARIA_CHK -dv --ignore-control-file $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
perl;
use strict;
use warnings;
@@ -91,10 +93,13 @@ perl;
close FILE;
EOF
-#
-# BUG#44422 "mysql_upgrade destroys Maria tables?"
-# Check repair and optimize of moved table
-#
+--echo #
+--echo # BUG#44422 "mysql_upgrade destroys Maria tables?"
+--echo # Check repair and optimize of moved table
+--echo #
+
+# Table t2 is regarded as it would be from another server as we removed
+# the aria control file earlier
check table t2;
check table t2;
repair table t2;
@@ -108,4 +113,10 @@ check table t5;
repair table t5;
check table t5;
+# Check that if we zerofill with aria_chk, we should not get any warnings when
+# accessing the table
+--exec $MARIA_CHK --zerofill $MYSQLD_DATADIR/mysqltest/t6 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+select * from t6;
+check table t6;
+
drop database mysqltest;
diff --git a/mysql-test/suite/maria/maria-recovery2.result b/mysql-test/suite/maria/maria-recovery2.result
index 6e4daa64615..054e86d079c 100644
--- a/mysql-test/suite/maria/maria-recovery2.result
+++ b/mysql-test/suite/maria/maria-recovery2.result
@@ -107,6 +107,9 @@ flush table t1;
* copied t1 for comparison
lock tables t1 write, t2 read;
delete from t1 limit 1;
+select count(*) from t1;
+count(*)
+0
insert into t1 select * from t2;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
@@ -123,6 +126,9 @@ use mysqltest;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 a 1 a A 1 NULL NULL YES BTREE
+select count(*) from t1;
+count(*)
+1
drop table t1;
* TEST of recovery when OPTIMIZE has replaced the index file and crash
create table t_corrupted1 (a varchar(100), key(a)) engine=aria;
diff --git a/mysql-test/suite/maria/maria-recovery2.test b/mysql-test/suite/maria/maria-recovery2.test
index 3c0ad75f8a8..3551d873ca4 100644
--- a/mysql-test/suite/maria/maria-recovery2.test
+++ b/mysql-test/suite/maria/maria-recovery2.test
@@ -130,9 +130,11 @@ insert into t1 values(30);
lock tables t1 write, t2 read;
delete from t1 limit 1;
# 127 rows in t2, >100, so this will use repair-at-end
+select count(*) from t1;
insert into t1 select * from t2;
-- source include/maria_verify_recovery.inc
show keys from t1; # should be enabled
+select count(*) from t1;
drop table t1;
--echo * TEST of recovery when OPTIMIZE has replaced the index file and crash
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
index 8dbb9b44e2f..3ef62f2b050 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result
@@ -531,7 +531,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1023,7 +1023,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1530,7 +1530,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2031,7 +2031,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2530,7 +2530,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3040,7 +3040,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3552,7 +3552,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4052,7 +4052,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4545,7 +4545,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5037,7 +5037,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5544,7 +5544,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6045,7 +6045,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6544,7 +6544,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7054,7 +7054,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7566,7 +7566,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8066,7 +8066,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8576,7 +8576,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9084,7 +9084,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9607,7 +9607,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10124,7 +10124,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10639,7 +10639,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11165,7 +11165,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11693,7 +11693,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12209,7 +12209,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12718,7 +12718,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13226,7 +13226,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13749,7 +13749,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14266,7 +14266,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14781,7 +14781,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15307,7 +15307,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15835,7 +15835,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16351,7 +16351,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16846,7 +16846,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17339,7 +17339,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17847,7 +17847,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18349,7 +18349,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18849,7 +18849,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19360,7 +19360,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19873,7 +19873,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20374,7 +20374,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20868,7 +20868,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21361,7 +21361,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21869,7 +21869,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22371,7 +22371,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22871,7 +22871,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23382,7 +23382,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23895,7 +23895,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24396,7 +24396,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24890,7 +24890,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25383,7 +25383,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25891,7 +25891,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26393,7 +26393,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26893,7 +26893,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27404,7 +27404,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27917,7 +27917,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28418,7 +28418,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
index 075346cfe94..66d84768b5e 100644
--- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result
@@ -849,7 +849,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1341,7 +1341,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1848,7 +1848,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2349,7 +2349,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2850,7 +2850,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3360,7 +3360,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3872,7 +3872,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4372,7 +4372,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4865,7 +4865,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5357,7 +5357,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5864,7 +5864,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6365,7 +6365,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6866,7 +6866,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7376,7 +7376,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7888,7 +7888,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8388,7 +8388,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8898,7 +8898,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9406,7 +9406,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9929,7 +9929,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10446,7 +10446,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10963,7 +10963,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11489,7 +11489,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12017,7 +12017,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12533,7 +12533,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13042,7 +13042,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13550,7 +13550,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14073,7 +14073,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14590,7 +14590,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15107,7 +15107,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15633,7 +15633,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16161,7 +16161,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16677,7 +16677,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
index b25ed98c355..f1a1aeecb66 100644
--- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result
@@ -478,7 +478,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -918,7 +918,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1373,7 +1373,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1822,7 +1822,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2271,7 +2271,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2729,7 +2729,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3189,7 +3189,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3637,7 +3637,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4078,7 +4078,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4518,7 +4518,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4973,7 +4973,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5422,7 +5422,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5871,7 +5871,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6329,7 +6329,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6789,7 +6789,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7237,7 +7237,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7694,7 +7694,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8150,7 +8150,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8621,7 +8621,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9086,7 +9086,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9551,7 +9551,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10025,7 +10025,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10501,7 +10501,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10965,7 +10965,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11410,7 +11410,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11850,7 +11850,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12305,7 +12305,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12754,7 +12754,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13201,7 +13201,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13659,7 +13659,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14119,7 +14119,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14567,7 +14567,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15008,7 +15008,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15448,7 +15448,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15903,7 +15903,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16352,7 +16352,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16799,7 +16799,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17257,7 +17257,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17717,7 +17717,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18165,7 +18165,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18623,7 +18623,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19079,7 +19079,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19550,7 +19550,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20015,7 +20015,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20478,7 +20478,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20952,7 +20952,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21428,7 +21428,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21892,7 +21892,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22349,7 +22349,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22805,7 +22805,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23276,7 +23276,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23741,7 +23741,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24204,7 +24204,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24678,7 +24678,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25154,7 +25154,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25618,7 +25618,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26060,7 +26060,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26500,7 +26500,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26955,7 +26955,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27404,7 +27404,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27851,7 +27851,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28309,7 +28309,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28769,7 +28769,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -29217,7 +29217,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -29658,7 +29658,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30098,7 +30098,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30553,7 +30553,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31002,7 +31002,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31449,7 +31449,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31907,7 +31907,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -32367,7 +32367,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -32815,7 +32815,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -33272,7 +33272,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -33728,7 +33728,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -34199,7 +34199,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -34664,7 +34664,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -35127,7 +35127,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -35601,7 +35601,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -36077,7 +36077,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -36541,7 +36541,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result
index 1b08b2f74fd..314044044bb 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result
@@ -495,7 +495,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -951,7 +951,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1422,7 +1422,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1887,7 +1887,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2352,7 +2352,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2826,7 +2826,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3302,7 +3302,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3766,7 +3766,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4260,7 +4260,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4752,7 +4752,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5259,7 +5259,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5760,7 +5760,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6261,7 +6261,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6771,7 +6771,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7283,7 +7283,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7783,7 +7783,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8276,7 +8276,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8768,7 +8768,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9275,7 +9275,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9776,7 +9776,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10277,7 +10277,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10787,7 +10787,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11299,7 +11299,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11799,7 +11799,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12309,7 +12309,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12817,7 +12817,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13340,7 +13340,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13857,7 +13857,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14374,7 +14374,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14900,7 +14900,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15428,7 +15428,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15944,7 +15944,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16453,7 +16453,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16961,7 +16961,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17484,7 +17484,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18001,7 +18001,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18518,7 +18518,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19044,7 +19044,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19572,7 +19572,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20088,7 +20088,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result
index b69fcee1b1f..e824cf45ce9 100644
--- a/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result
@@ -491,7 +491,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -947,7 +947,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1418,7 +1418,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1883,7 +1883,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2346,7 +2346,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2820,7 +2820,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3296,7 +3296,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3760,7 +3760,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4254,7 +4254,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4746,7 +4746,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5253,7 +5253,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5754,7 +5754,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6253,7 +6253,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6763,7 +6763,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7275,7 +7275,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7775,7 +7775,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8268,7 +8268,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8760,7 +8760,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9267,7 +9267,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9768,7 +9768,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10267,7 +10267,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10777,7 +10777,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11289,7 +11289,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11789,7 +11789,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12299,7 +12299,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12807,7 +12807,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13330,7 +13330,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13847,7 +13847,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14362,7 +14362,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14888,7 +14888,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15416,7 +15416,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15932,7 +15932,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16441,7 +16441,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16949,7 +16949,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17472,7 +17472,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17989,7 +17989,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18504,7 +18504,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19030,7 +19030,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19558,7 +19558,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20074,7 +20074,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result
index 1ff53af9111..faba21b41f7 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result
@@ -497,7 +497,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -955,7 +955,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1428,7 +1428,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1893,7 +1893,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2360,7 +2360,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2834,7 +2834,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3312,7 +3312,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3778,7 +3778,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4273,7 +4273,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4767,7 +4767,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5276,7 +5276,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5777,7 +5777,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6280,7 +6280,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6790,7 +6790,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7304,7 +7304,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7806,7 +7806,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8301,7 +8301,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8795,7 +8795,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9304,7 +9304,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9805,7 +9805,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10308,7 +10308,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10818,7 +10818,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11332,7 +11332,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11834,7 +11834,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12346,7 +12346,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12856,7 +12856,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13381,7 +13381,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13898,7 +13898,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14417,7 +14417,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14943,7 +14943,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15473,7 +15473,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15991,7 +15991,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16502,7 +16502,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17012,7 +17012,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17537,7 +17537,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18054,7 +18054,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18573,7 +18573,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19099,7 +19099,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19629,7 +19629,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20147,7 +20147,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result
index 1859859b24f..2557cd5a219 100644
--- a/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result
@@ -493,7 +493,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -952,7 +952,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1426,7 +1426,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1896,7 +1896,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2364,7 +2364,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2843,7 +2843,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3322,7 +3322,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3789,7 +3789,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4286,7 +4286,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4781,7 +4781,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5291,7 +5291,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5797,7 +5797,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6301,7 +6301,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6816,7 +6816,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7331,7 +7331,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7834,7 +7834,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8330,7 +8330,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8825,7 +8825,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9335,7 +9335,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9841,7 +9841,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10345,7 +10345,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10860,7 +10860,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11375,7 +11375,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11878,7 +11878,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12391,7 +12391,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12902,7 +12902,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13428,7 +13428,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13950,7 +13950,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14470,7 +14470,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15001,7 +15001,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15532,7 +15532,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16051,7 +16051,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16563,7 +16563,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17074,7 +17074,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17600,7 +17600,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18122,7 +18122,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18642,7 +18642,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19173,7 +19173,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19704,7 +19704,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20223,7 +20223,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result
index b0f340664b7..46f3ed3c974 100644
--- a/mysql-test/suite/parts/r/partition_alter4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result
@@ -497,7 +497,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -959,7 +959,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1432,7 +1432,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1899,7 +1899,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2366,7 +2366,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2842,7 +2842,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3320,7 +3320,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3786,7 +3786,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4247,7 +4247,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4709,7 +4709,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5182,7 +5182,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5649,7 +5649,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6116,7 +6116,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6592,7 +6592,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7070,7 +7070,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7536,7 +7536,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7997,7 +7997,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8459,7 +8459,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8932,7 +8932,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9399,7 +9399,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9866,7 +9866,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10342,7 +10342,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10820,7 +10820,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11286,7 +11286,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11747,7 +11747,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12209,7 +12209,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12682,7 +12682,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13149,7 +13149,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13616,7 +13616,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14092,7 +14092,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14570,7 +14570,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15036,7 +15036,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15497,7 +15497,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15959,7 +15959,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16432,7 +16432,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16899,7 +16899,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17366,7 +17366,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17842,7 +17842,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18320,7 +18320,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18786,7 +18786,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19250,7 +19250,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19712,7 +19712,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20185,7 +20185,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20652,7 +20652,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21119,7 +21119,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21595,7 +21595,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22073,7 +22073,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22539,7 +22539,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23000,7 +23000,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23462,7 +23462,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23935,7 +23935,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24402,7 +24402,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24869,7 +24869,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25345,7 +25345,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25823,7 +25823,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26289,7 +26289,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26750,7 +26750,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27212,7 +27212,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27685,7 +27685,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28152,7 +28152,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28619,7 +28619,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -29095,7 +29095,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -29573,7 +29573,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30039,7 +30039,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30500,7 +30500,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30962,7 +30962,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31435,7 +31435,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31902,7 +31902,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -32369,7 +32369,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -32845,7 +32845,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -33323,7 +33323,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -33789,7 +33789,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -34250,7 +34250,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -34712,7 +34712,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -35185,7 +35185,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -35652,7 +35652,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -36119,7 +36119,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -36595,7 +36595,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -37073,7 +37073,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -37539,7 +37539,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -38004,7 +38004,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -38467,7 +38467,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -38941,7 +38941,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -39409,7 +39409,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -39877,7 +39877,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -40354,7 +40354,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -40833,7 +40833,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -41300,7 +41300,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -41762,7 +41762,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -42225,7 +42225,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -42699,7 +42699,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -43167,7 +43167,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -43635,7 +43635,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -44112,7 +44112,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -44591,7 +44591,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -45058,7 +45058,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -45519,7 +45519,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -45981,7 +45981,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -46454,7 +46454,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -46921,7 +46921,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -47388,7 +47388,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -47864,7 +47864,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -48342,7 +48342,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -48808,7 +48808,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -49269,7 +49269,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -49731,7 +49731,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -50204,7 +50204,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -50671,7 +50671,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -51138,7 +51138,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -51614,7 +51614,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -52092,7 +52092,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -52558,7 +52558,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -53020,7 +53020,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -53483,7 +53483,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -53957,7 +53957,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -54425,7 +54425,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -54893,7 +54893,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -55370,7 +55370,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -55849,7 +55849,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -56316,7 +56316,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -56778,7 +56778,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -57238,7 +57238,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -57709,7 +57709,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -58174,7 +58174,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -58639,7 +58639,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -59113,7 +59113,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -59589,7 +59589,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -60053,7 +60053,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -60512,7 +60512,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -60972,7 +60972,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -61443,7 +61443,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -61908,7 +61908,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -62373,7 +62373,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -62847,7 +62847,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -63323,7 +63323,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -63787,7 +63787,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -64566,7 +64566,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -65026,7 +65026,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -65497,7 +65497,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -65962,7 +65962,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -66427,7 +66427,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -66901,7 +66901,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -67377,7 +67377,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -67841,7 +67841,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -67868,7 +67868,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -68305,7 +68305,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -68327,7 +68327,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -68767,7 +68767,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -68797,7 +68797,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -69240,7 +69240,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -69268,7 +69268,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -69707,7 +69707,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -69733,7 +69733,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -70174,7 +70174,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -70204,7 +70204,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -70650,7 +70650,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -70680,7 +70680,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -71128,7 +71128,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -71154,7 +71154,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -71594,7 +71594,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -71618,7 +71618,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -72055,7 +72055,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -72077,7 +72077,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -72517,7 +72517,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -72547,7 +72547,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -72990,7 +72990,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -73018,7 +73018,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -73457,7 +73457,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -73483,7 +73483,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -73924,7 +73924,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -73954,7 +73954,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -74400,7 +74400,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -74430,7 +74430,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -74878,7 +74878,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -74904,7 +74904,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -75344,7 +75344,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -75805,7 +75805,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -76267,7 +76267,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -76740,7 +76740,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -77207,7 +77207,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -77674,7 +77674,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -78150,7 +78150,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -78628,7 +78628,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -79094,7 +79094,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -79555,7 +79555,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -80017,7 +80017,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -80490,7 +80490,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -80957,7 +80957,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -81424,7 +81424,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -81900,7 +81900,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -82378,7 +82378,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -82844,7 +82844,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -82868,7 +82868,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83305,7 +83305,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -83327,7 +83327,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83767,7 +83767,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -83797,7 +83797,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84240,7 +84240,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -84268,7 +84268,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84707,7 +84707,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -84733,7 +84733,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85174,7 +85174,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -85204,7 +85204,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85650,7 +85650,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -85680,7 +85680,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -86128,7 +86128,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -86154,7 +86154,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -86594,7 +86594,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result
index 21c5d70e6e3..ea5a53fc5f4 100644
--- a/mysql-test/suite/parts/r/partition_basic_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_innodb.result
@@ -498,7 +498,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -953,7 +953,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1423,7 +1423,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1887,7 +1887,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2351,7 +2351,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2824,7 +2824,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3303,7 +3303,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3766,7 +3766,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4223,7 +4223,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4678,7 +4678,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5148,7 +5148,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5612,7 +5612,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6074,7 +6074,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -6547,7 +6547,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7022,7 +7022,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7485,7 +7485,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -7983,7 +7983,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8475,7 +8475,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -8982,7 +8982,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9483,7 +9483,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -9984,7 +9984,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -10494,7 +10494,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11010,7 +11010,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -11510,7 +11510,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12003,7 +12003,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -12495,7 +12495,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13002,7 +13002,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -13503,7 +13503,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14004,7 +14004,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -14514,7 +14514,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15030,7 +15030,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -15530,7 +15530,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16039,7 +16039,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -16547,7 +16547,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17070,7 +17070,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -17587,7 +17587,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18104,7 +18104,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -18630,7 +18630,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19162,7 +19162,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -19678,7 +19678,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20176,7 +20176,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -20668,7 +20668,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21175,7 +21175,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -21676,7 +21676,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22175,7 +22175,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -22685,7 +22685,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23197,7 +23197,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -23697,7 +23697,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24190,7 +24190,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -24682,7 +24682,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25189,7 +25189,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -25690,7 +25690,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26189,7 +26189,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -26699,7 +26699,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27211,7 +27211,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -27711,7 +27711,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28220,7 +28220,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -28728,7 +28728,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -29251,7 +29251,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -29768,7 +29768,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30283,7 +30283,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -30809,7 +30809,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31337,7 +31337,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -31853,7 +31853,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result
index c033ea36351..5335983b560 100644
--- a/mysql-test/suite/parts/r/partition_engine_innodb.result
+++ b/mysql-test/suite/parts/r/partition_engine_innodb.result
@@ -489,7 +489,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -947,7 +947,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1409,7 +1409,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -1934,7 +1934,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2435,7 +2435,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -2897,7 +2897,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3356,7 +3356,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -3818,7 +3818,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4283,7 +4283,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -4737,7 +4737,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
@@ -5192,7 +5192,7 @@ test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
+test.t1 repair status OK
# check layout success: 1
TRUNCATE t1;
diff --git a/mysql-test/suite/parts/t/partition_basic_innodb.test b/mysql-test/suite/parts/t/partition_basic_innodb.test
index 8240257f087..398f62dab28 100644
--- a/mysql-test/suite/parts/t/partition_basic_innodb.test
+++ b/mysql-test/suite/parts/t/partition_basic_innodb.test
@@ -22,7 +22,7 @@
# any of the variables.
#
---source include/long_test.inc
+--source include/big_test.inc
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/plugins/r/audit_null.result b/mysql-test/suite/plugins/r/audit_null.result
index 2b1b64a9d85..81d047c077b 100644
--- a/mysql-test/suite/plugins/r/audit_null.result
+++ b/mysql-test/suite/plugins/r/audit_null.result
@@ -1,5 +1,6 @@
set @old_global_general_log=@@global.general_log;
set global general_log=OFF;
+grant select on *.* to testuser@localhost;
install plugin audit_null soname 'adt_null';
select 1;
1
@@ -9,8 +10,8 @@ ERROR 42S22: Unknown column 'foobar' in 'field list'
show status like 'audit_null%';
Variable_name Value
Audit_null_called 9
-Audit_null_general_log 3
Audit_null_general_error 1
+Audit_null_general_log 3
Audit_null_general_result 2
create procedure au1(x char(16)) select concat("test1", x);
call au1("-12");
@@ -18,12 +19,88 @@ concat("test1", x)
test1-12
show status like 'audit_null%';
Variable_name Value
-Audit_null_called 19
-Audit_null_general_log 7
+Audit_null_called 21
Audit_null_general_error 1
+Audit_null_general_log 7
Audit_null_general_result 5
+create table t1 (a int);
+insert t1 values (1), (2);
+select * from t1;
+a
+1
+2
+rename table t1 to t2;
+alter table t2 add column b int;
+create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy;
+select * from v1;
+t2.a+1 t2_copy.a+2
+2 3
+3 3
+2 4
+3 4
+drop view v1;
+create temporary table t2 (a date);
+insert t2 values ('2020-10-09');
+select * from t2;
+a
+2020-10-09
+drop table t2;
+explain select distinct * from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using temporary
+select distinct * from t2;
+a b
+1 NULL
+2 NULL
+drop table t2;
uninstall plugin audit_null;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
drop procedure au1;
+drop user testuser@localhost;
set global general_log=@old_global_general_log;
+root[root] @ localhost [] >> select 1
+root[root] @ localhost [] >> select foobar
+root[root] @ localhost [] >> show status like 'audit_null%'
+root[root] @ localhost [] >> create procedure au1(x char(16)) select concat("test1", x)
+root[root] @ localhost [] mysql.proc : write
+root[root] @ localhost [] >> call au1("-12")
+root[root] @ localhost [] mysql.proc : read
+root[root] @ localhost [] >> select concat("test1", NAME_CONST('x',_latin1'-12' COLLATE 'latin1_swedish_ci'))
+root[root] @ localhost [] >> show status like 'audit_null%'
+root[root] @ localhost [] >> create table t1 (a int)
+root[root] @ localhost [] test.t1 : create
+root[root] @ localhost [] >> insert t1 values (1), (2)
+root[root] @ localhost [] test.t1 : write
+root[root] @ localhost [] >> select * from t1
+root[root] @ localhost [] test.t1 : read
+root[root] @ localhost [] >> rename table t1 to t2
+root[root] @ localhost [] test.t1 : rename to test.t2
+root[root] @ localhost [] mysql.table_stats : write
+root[root] @ localhost [] mysql.column_stats : write
+root[root] @ localhost [] mysql.index_stats : write
+root[root] @ localhost [] >> alter table t2 add column b int
+root[root] @ localhost [] test.t2 : alter
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] >> create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] >> select * from v1
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] >> drop view v1
+root[root] @ localhost [] >> create temporary table t2 (a date)
+root[root] @ localhost [] >> insert t2 values ('2020-10-09')
+root[root] @ localhost [] >> select * from t2
+root[root] @ localhost [] >> drop table t2
+root[root] @ localhost [] >> explain select distinct * from t2
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] >> select distinct * from t2
+root[root] @ localhost [] test.t2 : read
+root[root] @ localhost [] >> drop table t2
+root[root] @ localhost [] mysql.table_stats : write
+root[root] @ localhost [] mysql.column_stats : write
+root[root] @ localhost [] mysql.index_stats : write
+root[root] @ localhost [] test.t2 : drop
+root[root] @ localhost [] >> uninstall plugin audit_null
+root[root] @ localhost [] mysql.plugin : write
diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result
index 3e967d55f43..ab646d74511 100644
--- a/mysql-test/suite/plugins/r/qc_info.result
+++ b/mysql-test/suite/plugins/r/qc_info.result
@@ -12,4 +12,7 @@ test select * from t1 1 512
drop table t1;
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
statement_schema statement_text result_blocks_count result_blocks_size
+set global query_cache_size = 0;
+select * from information_schema.query_cache_info;
+STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED
set global query_cache_size= default;
diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result
index 8b9a41e0e1f..7d9f57c6c90 100644
--- a/mysql-test/suite/plugins/r/show_all_plugins.result
+++ b/mysql-test/suite/plugins/r/show_all_plugins.result
@@ -4,8 +4,8 @@ Variable_name Value
Opened_plugin_libraries 0
select * from information_schema.all_plugins where plugin_library='ha_example.so';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION
-EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE 100001.0 ha_example.so 1.4 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
-UNUSABLE 3.14 NOT INSTALLED DAEMON 100001.0 ha_example.so 1.4 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
+EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE 100003.0 ha_example.so 1.4 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
+UNUSABLE 3.14 NOT INSTALLED DAEMON 100003.0 ha_example.so 1.4 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 1
diff --git a/mysql-test/suite/plugins/t/audit_null.test b/mysql-test/suite/plugins/t/audit_null.test
index 428fd0c276e..60883bbe4f9 100644
--- a/mysql-test/suite/plugins/t/audit_null.test
+++ b/mysql-test/suite/plugins/t/audit_null.test
@@ -8,6 +8,8 @@ if (!$ADT_NULL_SO) {
set @old_global_general_log=@@global.general_log;
set global general_log=OFF;
+grant select on *.* to testuser@localhost;
+
--disable_ps_protocol
install plugin audit_null soname 'adt_null';
@@ -22,9 +24,36 @@ call au1("-12");
show status like 'audit_null%';
+create table t1 (a int);
+insert t1 values (1), (2);
+select * from t1;
+rename table t1 to t2;
+alter table t2 add column b int;
+
+create definer=testuser@localhost view v1 as select t2.a+1, t2_copy.a+2 from t2, t2 as t2_copy;
+select * from v1;
+drop view v1;
+
+# temp table generates no audit events
+create temporary table t2 (a date);
+insert t2 values ('2020-10-09');
+select * from t2;
+drop table t2;
+
+# internal temp table generates no audit events
+explain select distinct * from t2;
+select distinct * from t2;
+
+drop table t2;
+
uninstall plugin audit_null;
--enable_ps_protocol
drop procedure au1;
+drop user testuser@localhost;
set global general_log=@old_global_general_log;
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ /#sql2-[-0-9a-f_]*/#sql2-temporary/ /::1// /127.0.0.1//
+cat_file $MYSQLD_DATADIR/audit_null_tables.log;
+
diff --git a/mysql-test/suite/plugins/t/qc_info.test b/mysql-test/suite/plugins/t/qc_info.test
index fc6c9d5af3a..a081617c524 100644
--- a/mysql-test/suite/plugins/t/qc_info.test
+++ b/mysql-test/suite/plugins/t/qc_info.test
@@ -4,5 +4,8 @@ drop table t1;
# the query was invalidated
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info;
+set global query_cache_size = 0;
+select * from information_schema.query_cache_info;
+
set global query_cache_size= default;
diff --git a/mysql-test/suite/plugins/t/unix_socket.test b/mysql-test/suite/plugins/t/unix_socket.test
index fc2e6c5b3c6..72106fab46d 100644
--- a/mysql-test/suite/plugins/t/unix_socket.test
+++ b/mysql-test/suite/plugins/t/unix_socket.test
@@ -1,4 +1,7 @@
--source include/not_embedded.inc
+# If we run this as root, $USER gets authenticated as the `root' user, and we
+# get .result differences from CURRENT_USER().
+--source include/not_as_root.inc
if (!$AUTH_SOCKET_SO) {
skip No auth_socket plugin;
diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def
index 9eb5f57c7be..f9af9c30f5c 100644
--- a/mysql-test/suite/rpl/disabled.def
+++ b/mysql-test/suite/rpl/disabled.def
@@ -13,4 +13,3 @@
rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576
rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
-rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
diff --git a/mysql-test/suite/rpl/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
index b31bad28a59..ff6296987f8 100644
--- a/mysql-test/suite/rpl/r/rpl_charset_sjis.result
+++ b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
@@ -20,4 +20,36 @@ hex(a)
965C
drop table t1;
drop procedure p1;
+#
+# Start of 5.5 tests
+#
+#
+# Bug#MDEV-4489 Replication of big5, cp932, gbk, sjis strings makes wrong values on slave
+#
+--- on master ---
+SET NAMES sjis;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0x31),(X'31'),('1');
+PREPARE stmt FROM 'INSERT INTO t1 (a) VALUES (?)';
+SET @a='1';
+EXECUTE stmt USING @a;
+DROP PREPARE stmt;
+SELECT * FROM t1;
+a
+49
+1
+1
+1
+--- on slave ---
+SELECT * FROM t1;
+a
+49
+1
+1
+1
+--- on master ---
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
index c51279bf8df..c4878fa3f4b 100644
--- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -1,6 +1,18 @@
*** Set up circular replication on four servers ***
include/rpl_init.inc [topology=1->2->3->4->1]
+[connection server_4]
+SET auto_increment_increment= 4;
+SET auto_increment_offset= 4;
+[connection server_3]
+SET auto_increment_increment= 4;
+SET auto_increment_offset= 3;
+[connection server_2]
+SET auto_increment_increment= 4;
+SET auto_increment_offset= 2;
+[connection server_1]
+SET auto_increment_increment= 4;
+SET auto_increment_offset= 1;
*** Preparing data ***
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index e75f0dd3550..aafd3c8bb5d 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -254,7 +254,7 @@ master-bin.000001 # User var # # @`a``3`=9223372036854775807
master-bin.000001 # User var # # @`a``4`=18446744073709551615
master-bin.000001 # User var # # @`b```=-1.234560123456789e125
master-bin.000001 # User var # # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789
-master-bin.000001 # User var # # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci
+master-bin.000001 # User var # # @```d```=_latin1 X'78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878' COLLATE latin1_swedish_ci
master-bin.000001 # Query # # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
master-bin.000001 # Query # # COMMIT
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
@@ -290,7 +290,7 @@ SET @`a``3`:=9223372036854775807/*!*/;
SET @`a``4`:=18446744073709551615/*!*/;
SET @`b```:=-1.2345601234568e+125/*!*/;
SET @```c`:=-1234501234567890123456789012345678901234567890123456789.0123456789/*!*/;
-SET @```d```:=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE `latin1_swedish_ci`/*!*/;
+SET @```d```:=_latin1 X'78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878' COLLATE `latin1_swedish_ci`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_password_boundaries.result b/mysql-test/suite/rpl/r/rpl_password_boundaries.result
index 71f32f492a2..a0ccc0ce33c 100644
--- a/mysql-test/suite/rpl/r/rpl_password_boundaries.result
+++ b/mysql-test/suite/rpl/r/rpl_password_boundaries.result
@@ -24,10 +24,10 @@ set sql_log_bin=1;
include/stop_slave.inc
change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
ERROR HY000: String '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345' is too long for MASTER_PASSWORD (should be no longer than 96)
-change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
-ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for MASTER_USER (should be no longer than 47)
+change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
+ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for MASTER_USER (should be no longer than 128)
change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
-ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbb' is too long for MASTER_HOST (should be no longer than 180)
+ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbb' is too long for MASTER_HOST (should be no longer than 60)
[ on master ]
set sql_log_bin=0;
grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index 5629f5c8cdd..a09d44227a3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -27,13 +27,6 @@ n
3
4
include/check_slave_param.inc [Exec_Master_Log_Pos]
-START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
-include/wait_for_slave_sql_to_stop.inc
-SELECT * FROM t2;
-n
-1
-2
-include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE;
include/wait_for_slave_to_start.inc
include/stop_slave.inc
@@ -51,10 +44,19 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-START SLAVE;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
-Warnings:
-Note 1254 Slave is already running
include/stop_slave.inc
RESET SLAVE;
+include/start_slave.inc
+include/rpl_reset.inc
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+include/stop_slave_sql.inc
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+include/sync_slave_io_with_master.inc
+include/wait_for_slave_sql_to_stop.inc
+include/assert.inc [table t1 should have two rows.]
+include/start_slave.inc
+DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index a6e3ae03963..413ff41879d 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -273,5 +273,21 @@ drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
+set names utf8;
+CREATE FUNCTION f() RETURNS timestamp DETERMINISTIC
+BEGIN RETURN '2012-12-21 12:12:12'; END |
+CREATE PROCEDURE p(t timestamp)
+BEGIN
+SET @t = t;
+PREPARE stmt FROM "
+ UPDATE t1 SET a = @t WHERE '2012-12-31 08:00:00' < f() ";
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+END |
+create table t1 (a timestamp);
+call p('2012-12-31 08:00:00');
+drop table t1;
+drop procedure p;
+drop function f;
end of the tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 9047825d565..b1cea5227f6 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
[on slave]
include/stop_slave.inc
==== Create some events on master ====
@@ -34,7 +35,7 @@ n
3
4
include/check_slave_param.inc [Exec_Master_Log_Pos]
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS;
+start slave until relay_log_file='slave-relay-bin.000003', relay_log_pos=RELAY_LOG_POS;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
select * from t2;
@@ -94,18 +95,4 @@ one
1
drop table t1;
start slave;
-include/rpl_reset.inc
-flush logs;
-drop table if exists t1;
-stop slave;
-flush logs;
-flush logs;
-reset slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; /* to stop right before DROP */;
-include/wait_for_slave_sql_to_stop.inc
-show tables /* t1 must exist */;
-Tables_in_test
-t1
-drop table t1;
-stop slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
index 86ee64b5e73..a97801f9ab0 100644
--- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
@@ -67,7 +67,9 @@ stop slave;
reset slave;
# Table was created from binlog, it may not be created if SQL thread is running
# slowly and IO thread reaches incident before SQL thread applies it.
+--disable_warnings
drop table if exists t;
+--enable_warnings
reset master;
--echo End of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
index a3a3de8c1d0..7d3d21cf9a0 100644
--- a/mysql-test/suite/rpl/t/rpl_charset_sjis.test
+++ b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
@@ -23,4 +23,37 @@ sync_slave_with_master;
connection master;
# End of 5.0 tests
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
+--echo # Bug#MDEV-4489 Replication of big5, cp932, gbk, sjis strings makes wrong values on slave
+--echo #
+
+connection master;
+--echo --- on master ---
+SET NAMES sjis;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0x31),(X'31'),('1');
+PREPARE stmt FROM 'INSERT INTO t1 (a) VALUES (?)';
+SET @a='1';
+EXECUTE stmt USING @a;
+DROP PREPARE stmt;
+SELECT * FROM t1;
+sync_slave_with_master;
+connection slave;
+--echo --- on slave ---
+SELECT * FROM t1;
+connection master;
+--echo --- on master ---
+DROP TABLE t1;
+sync_slave_with_master;
+connection master;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
index 5f492419ae7..aea43a1c2a1 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -23,6 +23,18 @@ let $keep_connection= 1;
--source include/rpl_init.inc
--echo
+#set auto inc variables at each server
+--let $_rpl_server= $rpl_server_count
+while ($_rpl_server)
+{
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connection.inc
+ eval SET auto_increment_increment= $rpl_server_count;
+ eval SET auto_increment_offset= $_rpl_server;
+
+ --dec $_rpl_server
+}
+
# Preparing data.
--echo *** Preparing data ***
--connection server_1
diff --git a/mysql-test/suite/rpl/t/rpl_password_boundaries.test b/mysql-test/suite/rpl/t/rpl_password_boundaries.test
index cf8abfbda11..d812ab5efc8 100644
--- a/mysql-test/suite/rpl/t/rpl_password_boundaries.test
+++ b/mysql-test/suite/rpl/t/rpl_password_boundaries.test
@@ -53,7 +53,7 @@ change master to master_user='rpl33',master_password='0123456789abcdef0123456789
# Check also master_user and master_host
--error ER_WRONG_STRING_LENGTH
-change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
+change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
--error ER_WRONG_STRING_LENGTH
change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index 182c84f1ee7..97b60a3055f 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -2,7 +2,13 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
-# Note: The test is dependent on binlog positions
+##############################################################################
+# The test is dependent on binlog positions. The test is divided into two
+# sections. The first section checks START SLAVE UNTIL MASTER_LOG_FILE =
+# 'log_name', MASTER_LOG_POS = log_pos followed by a couple of failure
+# scenarios. The second section checks START SLAVE UNTIL RELAY_LOG_FILE =
+# 'log_name', RELAY_LOG_POS = log_pos.
+##############################################################################
# Create some events on master
connection master;
@@ -24,13 +30,6 @@ CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2);
# Save master log position for query INSERT INTO t2 VALUES (1),(2);
let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
-sync_slave_with_master;
-#show binlog events;
-
-# Save relay log position for query INSERT INTO t2 VALUES (1),(2);
-let $relay_pos_insert1_t2= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
-
-connection master;
INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
# Save master log position for query DROP TABLE t2;
@@ -71,18 +70,6 @@ SELECT * FROM t1;
--let $slave_param_value= $master_pos_drop_t1
--source include/check_slave_param.inc
-# Try replicate all up to and not including the second insert to t2;
-echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2;
---disable_query_log
-eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$relay_pos_insert1_t2;
---enable_query_log
---source include/wait_for_slave_sql_to_stop.inc
-SELECT * FROM t2;
-
---let $slave_param= Exec_Master_Log_Pos
---let $slave_param_value= $master_pos_insert1_t2
---source include/check_slave_param.inc
-
# clean up
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -118,14 +105,54 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009';
--replace_result 561 MASTER_LOG_POS
--error 1277
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
-# Warning should be given for second command
-START SLAVE;
--replace_result 740 MASTER_LOG_POS
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;
--source include/stop_slave.inc
-# Clear slave IO error.
RESET SLAVE;
+--source include/start_slave.inc
---let $rpl_only_running_threads= 1
+##############################################################################
+# The second section - checks START SLAVE UNTIL RELAY_LOG_FILE =# 'log_name',
+# RELAY_LOG_POS = log_pos. This section of the test does the following:
+# 1) At master, create a table and inserts a value. Let slave replicate this.
+# 2) Stop slave sql thread.
+# 3) Insert some more values at master. Note that io thread copies this insert
+# 4) Use start slave until to start the sql thread and check if it
+# stops at the correct position.
+##############################################################################
+
+--source include/rpl_reset.inc
+
+--connection master
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+
+--sync_slave_with_master
+--source include/stop_slave_sql.inc
+
+--connection master
+INSERT INTO t1 VALUES (2);
+--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+INSERT INTO t1 VALUES (3);
+
+--source include/sync_slave_io_with_master.inc
+
+--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1)
+--source include/get_relay_log_pos.inc
+
+--disable_query_log
+--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos
+--enable_query_log
+--source include/wait_for_slave_sql_to_stop.inc
+
+--let $assert_cond= COUNT(*) = 2 FROM t1
+--let $assert_text= table t1 should have two rows.
+--source include/assert.inc
+
+#cleanup
+--source include/start_slave.inc
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index df13ff253b1..82d61d94bd4 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -260,5 +260,27 @@ SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creato
sync_slave_with_master;
+#
+# Bug#16056537: MYSQLD CRASHES IN ITEM_FUNC_GET_USER_VAR::FIX_LENGTH_AND_DEC()
+#
+set names utf8;
+--delimiter |
+CREATE FUNCTION f() RETURNS timestamp DETERMINISTIC
+BEGIN RETURN '2012-12-21 12:12:12'; END |
+CREATE PROCEDURE p(t timestamp)
+BEGIN
+ SET @t = t;
+ PREPARE stmt FROM "
+ UPDATE t1 SET a = @t WHERE '2012-12-31 08:00:00' < f() ";
+ EXECUTE stmt;
+ DEALLOCATE PREPARE stmt;
+END |
+--delimiter ;
+create table t1 (a timestamp);
+call p('2012-12-31 08:00:00');
+drop table t1;
+drop procedure p;
+drop function f;
+
--echo end of the tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 210b6b50fa8..074d38ca0c6 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -22,6 +22,7 @@
-- source include/rpl_reset.inc
# Test is dependent on binlog positions
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
# prepare version for substitutions
let $VERSION=`select version()`;
@@ -73,7 +74,7 @@ select * from t1;
--let $slave_param_value= $master_log_pos_1
--source include/check_slave_param.inc
-let $relay_log_file= slave-relay-bin.000004;
+let $relay_log_file= slave-relay-bin.000003;
let $master_log_pos= $master_log_pos_2;
source include/get_relay_log_pos.inc;
# try replicate all up to and not including the second insert to t2;
@@ -187,47 +188,6 @@ connection slave;
start slave;
sync_with_master;
- # Bug #47142 "slave start until" stops 1 event too late in 4.1 to 5.0 replication
-#
-# testing fixes that refine the start position of prior-5.0 master's event
-# and by that provide correct execution of
-# START SLAVE UNTIL ... master_log_pos= x;
-# Keep the test at the end of the file because it manipulates with binlog files
-# to substitute the genuine one with a prepared on 4.1 server.
-#
-
---source include/rpl_reset.inc
-
-connection master;
---disable_warnings
-drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001
---enable_warnings
-sync_slave_with_master;
-connection slave;
-stop slave;
-connection master;
-
-flush logs;
-let $MYSQLD_DATADIR= `select @@datadir`;
---remove_file $MYSQLD_DATADIR/master-bin.000001
---copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
-# this a constant bound to the bug47142_master-bin.000001 binlog file
---let $binlog_before_drop=294;
-
-connection slave;
-stop slave;
-reset slave;
---replace_regex /master_log_pos=[0-9]+/master_log_pos=MASTER_LOG_POS/
-eval start slave until master_log_file='master-bin.000001', master_log_pos=$binlog_before_drop /* to stop right before DROP */;
---source include/wait_for_slave_sql_to_stop.inc
-
-show tables /* t1 must exist */;
-
-# clean-up of Bug #47142 testing
-
-drop table t1; # drop on slave only, master does not have t1.
-stop slave;
-
# End of tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result
new file mode 100644
index 00000000000..459ad95bdc6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result
@@ -0,0 +1,7 @@
+SELECT @@global.innodb_buffer_pool_evict;
+@@global.innodb_buffer_pool_evict
+
+SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
+SELECT @@global.innodb_buffer_pool_evict;
+@@global.innodb_buffer_pool_evict
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
new file mode 100644
index 00000000000..ce42f64395f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
@@ -0,0 +1,15 @@
+-- source include/have_innodb.inc
+# This is a debug variable for now
+-- source include/have_debug.inc
+
+if (`select plugin_auth_version <= "5.5.31-MariaDB-30.2" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB 5.5.31-MariaDB-30.2 or earlier
+}
+
+SELECT @@global.innodb_buffer_pool_evict;
+
+SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
+
+# Should always be empty.
+SELECT @@global.innodb_buffer_pool_evict;
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index c39b7267f83..64e8225530b 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -412,6 +412,19 @@ WHERE CAST(a as BINARY)=x'62736D697468'
DROP TABLE t1;
+--echo #
+--echo # Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
+--echo # LONGTEXT, UNION, USER VARIABLE
+--echo # Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
+--echo #
+
+CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)),
+ CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED));
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo # End of test for Bug#13581962, Bug#14096619
+
--echo End of 5.1 tests
select cast("2101-00-01 02:03:04" as datetime);
diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test
index 6140178c0f4..e7b6fe1a014 100644
--- a/mysql-test/t/ctype_cp932_binlog_stm.test
+++ b/mysql-test/t/ctype_cp932_binlog_stm.test
@@ -141,6 +141,23 @@ SELECT HEX(a), HEX(CONVERT(a using cp932)) as b FROM t1 HAVING b<>'3F' ORDER BY
DROP TABLE t1;
+--echo #
+--echo # Bug#MDEV-4489 Replication of big5, cp932, gbk, sjis strings makes wrong values on slave
+--echo #
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+SET NAMES cp932;
+CREATE TABLE t1 (a INT);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (0x31);
+INSERT INTO t1 VALUES (X'31');
+PREPARE stmt FROM 'INSERT INTO t1 (a) VALUES (?)';
+SET @a='1';
+SELECT charset(@a);
+EXECUTE stmt USING @a;
+DROP PREPARE stmt;
+DROP TABLE t1;
+--source include/show_binlog_events.inc
+
--echo #
--echo # End of 5.5 tests
diff --git a/mysql-test/t/ctype_ucs2_query_cache-master.opt b/mysql-test/t/ctype_ucs2_query_cache-master.opt
new file mode 100644
index 00000000000..413ebb9f898
--- /dev/null
+++ b/mysql-test/t/ctype_ucs2_query_cache-master.opt
@@ -0,0 +1 @@
+--collation-server=ucs2_unicode_ci --character-set-server=ucs2,latin1 --query-cache-size=1048576
diff --git a/mysql-test/t/ctype_ucs2_query_cache.test b/mysql-test/t/ctype_ucs2_query_cache.test
new file mode 100644
index 00000000000..bdc1d079d5e
--- /dev/null
+++ b/mysql-test/t/ctype_ucs2_query_cache.test
@@ -0,0 +1,19 @@
+-- source include/have_query_cache.inc
+-- source include/have_ucs2.inc
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
+--echo # Bug#MDEV-4518 Server crashes in is_white_space when it's run
+--echo # with query cache, charset ucs2 and collation ucs2_unicode_ci
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf8mb4.test b/mysql-test/t/ctype_utf8mb4.test
index 03696f385b5..fda20ca0ec5 100644
--- a/mysql-test/t/ctype_utf8mb4.test
+++ b/mysql-test/t/ctype_utf8mb4.test
@@ -1812,6 +1812,21 @@ SHOW CREATE TABLE t2;
DROP TABLE t1, t2;
--echo #
+--echo # Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
+--echo # LONGTEXT, UNION, USER VARIABLE
+--echo # Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
+--echo #
+
+CREATE TABLE t1(f1 LONGTEXT CHARACTER SET utf8mb4);
+INSERT INTO t1 VALUES ('a');
+SELECT @a:= CAST(f1 AS SIGNED) FROM t1
+UNION ALL
+SELECT CAST(f1 AS SIGNED) FROM t1;
+DROP TABLE t1;
+
+--echo # End of test for Bug#13581962,Bug#14096619
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/empty_user_table.test b/mysql-test/t/empty_user_table.test
new file mode 100644
index 00000000000..b54f2109e30
--- /dev/null
+++ b/mysql-test/t/empty_user_table.test
@@ -0,0 +1,20 @@
+#
+# MDEV-4462 mysqld gets SIGFPE when mysql.user table is empty
+#
+
+source include/not_embedded.inc;
+
+create table t1 as select * from mysql.user;
+truncate table mysql.user;
+flush privileges;
+
+# connecting via unix socket gives ER_ACCESS_DENIED_ERROR
+# connecting via tcp/ip gives ER_HOST_NOT_PRIVILEGED
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR,ER_HOST_NOT_PRIVILEGED
+connect (fail,localhost,u1);
+
+insert mysql.user select * from t1;
+drop table t1;
+flush privileges;
+
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 97766fefa91..a5c35c0dff2 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1380,7 +1380,30 @@ insert into t1 values (1, '2008-10-02'), (2, '2010-12-12');
select avg(export_set( 3, 'y', sha(i))), group_concat(d) from t1 group by d order by i;
drop table t1;
-#### End of 5.3 tests
+--echo #
+--echo # MDEV-4290: crash in st_select_lex::mark_as_dependent
+--echo #
+create table `t1`(`a` int);
+
+--error ER_INVALID_GROUP_FUNC_USE
+select 1 from t1 v1 right join t1 on count(*);
+--error ER_INVALID_GROUP_FUNC_USE
+select 1 from t1 order by
+(
+ select 1 from
+ (
+ select 1 from t1 v1 right join t1 on count(*)
+ ) v
+);
+insert into t1 values (1),(1),(2),(2);
+select count(*) from t1;
+select z from (select count(*) as z from t1) v;
+--echo # next is how it implemented now (may be changed in case of dependent
+--echo # derived tables)
+select z from (select count(*) as z from t1) v group by 1;
+drop table t1;
+
+--echo # end of 5.3 tests
--echo #
--echo # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index f245b4f9f78..1a60b0c222a 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1538,6 +1538,18 @@ create table t1(a int) select null;
select 1 div convert(a using utf8) from t1;
drop table t1;
+#
+# BUG#11757250: REPLACE(...) INSIDE A STORED PROCEDURE.
+#
+create table t1 (a int);
+create table t2 (a int);
+create procedure foo (var char(100))
+ select replace(var, '00000000', table_name)
+ from information_schema.tables where table_schema='test';
+--sorted_result
+call foo('(( 00000000 ++ 00000000 ))');
+drop procedure foo;
+drop table t1,t2;
--echo #
--echo # End of 5.5 tests
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 731efe5648e..404f0447f56 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -956,3 +956,23 @@ SELECT a, ASTEXT(b) FROM t1;
DROP TABLE t1;
--echo End of 5.1 tests
+
+#
+# MDEV-4521 MBRContains, MBRWithin no longer work with geometries of different type.
+#
+CREATE TABLE t1 (
+ l LINESTRING NOT NULL,
+ SPATIAL KEY(l)
+) ENGINE = myisam;
+
+INSERT INTO t1 VALUES(GeomFromText('LINESTRING(0 0, 1 1)'));
+INSERT INTO t1 VALUES(GeomFromText('LINESTRING(1 1, 2 2)'));
+INSERT INTO t1 VALUES(GeomFromText('LINESTRING(2 2, 3 3)'));
+
+SELECT COUNT(*) FROM t1 IGNORE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(0 0)'));
+SELECT COUNT(*) FROM t1 IGNORE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l);
+
+SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRContains(l, GEOMFROMTEXT('POINT(0 0)'));
+SELECT COUNT(*) FROM t1 FORCE INDEX(l) WHERE MBRWithin(GEOMFROMTEXT('POINT(0 0)'), l);
+
+DROP TABLE t1;
diff --git a/mysql-test/t/grant_4332.test b/mysql-test/t/grant_4332.test
new file mode 100644
index 00000000000..f77d3be350f
--- /dev/null
+++ b/mysql-test/t/grant_4332.test
@@ -0,0 +1,108 @@
+#
+# MDEV-4332 Increase username length from 16 characters
+#
+
+# user names here have the pattern
+# <letter><length><more letters>0
+# where '0' at the end is the end-of-name marker
+
+--source include/not_embedded.inc
+
+--enable_metadata
+select user();
+--disable_metadata
+
+--error ER_WRONG_STRING_LENGTH
+create user a17aaaaaaaaaaaaa0@localhost;
+
+alter table mysql.user modify User char(80) binary not null default '';
+alter table mysql.db modify User char(80) binary not null default '';
+alter table mysql.tables_priv modify User char(80) binary not null default '';
+alter table mysql.columns_priv modify User char(80) binary not null default '';
+alter table mysql.procs_priv modify User char(80) binary not null default '';
+alter table mysql.proc modify definer char(141) collate utf8_bin not null default '';
+alter table mysql.event modify definer char(141) collate utf8_bin not null default '';
+
+--source include/restart_mysqld.inc
+
+set global event_scheduler = on;
+
+--enable_metadata
+select user();
+--disable_metadata
+
+create user a17aaaaaaaaaaaaa0@localhost;
+grant usage on *.* to a17aaaaaaaaaaaaa0@localhost;
+grant select on mysql.user to b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost;
+grant select(User) on mysql.tables_priv to c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost;
+
+connect (a17,localhost,a17aaaaaaaaaaaaa0,,);
+connect (b64,localhost,b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0,,);
+connect (c80,localhost,c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0,,);
+
+connection a17;
+select user(), current_user();
+show grants;
+
+connection b64;
+select user(), current_user();
+show grants;
+select user,host from mysql.user where user like '%0';
+--error ER_TABLEACCESS_DENIED_ERROR
+select user,host from mysql.db;
+
+connection c80;
+select user(), current_user();
+show grants;
+select user from mysql.tables_priv;
+--error ER_COLUMNACCESS_DENIED_ERROR
+select user,host from mysql.tables_priv;
+
+create procedure test.p1() select user(), current_user(), user from mysql.tables_priv;
+
+show create procedure test.p1;
+
+create table test.t1 (a text);
+create event e1 on schedule every 1 second
+ do insert test.t1 values (concat(user(), ' ', current_user()));
+
+connection default;
+
+call test.p1();
+
+disconnect a17;
+disconnect b64;
+disconnect c80;
+
+let $wait_timeout= 10;
+let $wait_condition= SELECT 1 from t1;
+--source include/wait_condition.inc
+
+select * from t1 limit 1;
+--error ER_WRONG_STRING_LENGTH
+grant usage on *.* to d81ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd0@lodalhost;
+
+--error ER_WRONG_STRING_LENGTH
+drop user d81ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd0@lodalhost;
+drop user c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost;
+drop user b64bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0@localhost;
+drop user a17aaaaaaaaaaaaa0@localhost;
+
+set global event_scheduler = off;
+drop event e1;
+drop procedure test.p1;
+drop table t1;
+
+alter table mysql.user modify User char(16) binary not null default '';
+alter table mysql.db modify User char(16) binary not null default '';
+alter table mysql.tables_priv modify User char(16) binary not null default '';
+alter table mysql.columns_priv modify User char(16) binary not null default '';
+alter table mysql.procs_priv modify User char(16) binary not null default '';
+alter table mysql.proc modify definer char(77) collate utf8_bin not null default '';
+alter table mysql.event modify definer char(77) collate utf8_bin not null default '';
+flush privileges;
+
+--enable_metadata
+select user();
+--disable_metadata
+
diff --git a/mysql-test/t/init_connection_query_cache-master.opt b/mysql-test/t/init_connection_query_cache-master.opt
new file mode 100644
index 00000000000..7bef2af8d35
--- /dev/null
+++ b/mysql-test/t/init_connection_query_cache-master.opt
@@ -0,0 +1 @@
+--init_connect="select * from test.t1 where 0"
diff --git a/mysql-test/t/init_connection_query_cache.test b/mysql-test/t/init_connection_query_cache.test
new file mode 100644
index 00000000000..4d83304163e
--- /dev/null
+++ b/mysql-test/t/init_connection_query_cache.test
@@ -0,0 +1,26 @@
+-- source include/have_query_cache.inc
+
+--echo #
+--echo # MDEV-4520: Assertion `0' fails in Query_cache::end_of_result on
+--echo # concurrent drop event and event execution
+--echo #
+set GLOBAL query_cache_size=1355776;
+
+create user mysqltest1@localhost;
+grant SELECT on test.* to mysqltest1@localhost;
+
+create table t1 (a int);
+
+connect (con1,localhost,mysqltest1,,);
+connection con1;
+--echo # This explain put here to be sure that init connection query
+--echo # has 'Impossible WHERE'.
+explain extended select * from test.t1 where 0;
+connection default;
+disconnect con1;
+revoke all privileges, grant option from mysqltest1@localhost;
+drop user mysqltest1@localhost;
+
+drop table t1;
+
+set GLOBAL query_cache_size=default;
diff --git a/mysql-test/t/innodb_ext_key.test b/mysql-test/t/innodb_ext_key.test
index 31c6fca2b95..36414105917 100644
--- a/mysql-test/t/innodb_ext_key.test
+++ b/mysql-test/t/innodb_ext_key.test
@@ -539,6 +539,129 @@ select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a;
drop table t1,t2,t3;
+--echo #
+--echo # Bug mdev-4340: performance regression with extended_keys=on
+--echo #
+
+set @save_optimizer_switch=@@optimizer_switch;
+
+CREATE TABLE t1 (
+ page_id int(8) unsigned NOT NULL AUTO_INCREMENT,
+ page_namespace int(11) NOT NULL DEFAULT '0',
+ page_title varbinary(255) NOT NULL DEFAULT '',
+ page_restrictions tinyblob NOT NULL,
+ page_counter bigint(20) unsigned NOT NULL DEFAULT '0',
+ page_is_redirect tinyint(1) unsigned NOT NULL DEFAULT '0',
+ page_is_new tinyint(1) unsigned NOT NULL DEFAULT '0',
+ page_random double unsigned NOT NULL DEFAULT '0',
+ page_touched varbinary(14) NOT NULL DEFAULT '',
+ page_latest int(8) unsigned NOT NULL DEFAULT '0',
+ page_len int(8) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (page_id),
+ UNIQUE KEY name_title (page_namespace,page_title),
+ KEY page_random (page_random),
+ KEY page_len (page_len),
+ KEY page_redirect_namespace_len (page_is_redirect,page_namespace,page_len)
+) ENGINE=InnoDB AUTO_INCREMENT=38929100 DEFAULT CHARSET=binary;
+INSERT INTO t1 VALUES
+(38928077,0,'Sandbox','',0,0,0,0,'',0,0),(38928078,1,'Sandbox','',0,0,0,1,'',0,0),
+(38928079,2,'Sandbox','',0,0,0,2,'',0,0),(38928080,3,'Sandbox','',0,0,0,3,'',0,0),
+(38928081,4,'Sandbox','',0,0,0,4,'',0,0),(38928082,5,'Sandbox','',0,0,0,5,'',0,0);
+
+CREATE TABLE t2 (
+ rev_id int(8) unsigned NOT NULL AUTO_INCREMENT,
+ rev_page int(8) unsigned NOT NULL DEFAULT '0',
+ rev_text_id int(8) unsigned NOT NULL DEFAULT '0',
+ rev_comment varbinary(255) DEFAULT NULL,
+ rev_user int(5) unsigned NOT NULL DEFAULT '0',
+ rev_user_text varbinary(255) NOT NULL DEFAULT '',
+ rev_timestamp varbinary(14) NOT NULL DEFAULT '',
+ rev_minor_edit tinyint(1) unsigned NOT NULL DEFAULT '0',
+ rev_deleted tinyint(1) unsigned NOT NULL DEFAULT '0',
+ rev_len int(8) unsigned DEFAULT NULL,
+ rev_parent_id int(8) unsigned DEFAULT NULL,
+ rev_sha1 varbinary(32) NOT NULL DEFAULT '',
+ PRIMARY KEY (rev_page,rev_id),
+ UNIQUE KEY rev_id (rev_id),
+ KEY rev_timestamp (rev_timestamp),
+ KEY page_timestamp (rev_page,rev_timestamp),
+ KEY user_timestamp (rev_user,rev_timestamp),
+ KEY usertext_timestamp (rev_user_text,rev_timestamp,rev_user,rev_deleted,rev_minor_edit,rev_text_id,rev_comment)
+) ENGINE=InnoDB DEFAULT CHARSET=binary;
+INSERT INTO t2 VALUES
+(547116222,20,0,NULL,3,'','',0,0,NULL,NULL,''),(547117245,20,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547118268,20,0,NULL,5,'','',0,0,NULL,NULL,''),(547114177,21,0,NULL,1,'','',0,0,NULL,NULL,''),
+(547115200,21,0,NULL,2,'','',0,0,NULL,NULL,''),(547116223,21,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547117246,21,0,NULL,4,'','',0,0,NULL,NULL,''),(547118269,21,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547114178,22,0,NULL,1,'','',0,0,NULL,NULL,''),(547115201,22,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547116224,22,0,NULL,3,'','',0,0,NULL,NULL,''),(547117247,22,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547116226,24,0,NULL,3,'','',0,0,NULL,NULL,''),(547117249,24,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547118272,24,0,NULL,5,'','',0,0,NULL,NULL,''),(547114181,25,0,NULL,1,'','',0,0,NULL,NULL,''),
+(547115204,25,0,NULL,2,'','',0,0,NULL,NULL,''),(547116227,25,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547116157,978,0,NULL,2,'','',0,0,NULL,NULL,''),(547117180,978,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547118203,978,0,NULL,4,'','',0,0,NULL,NULL,''),(547119226,978,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547115135,979,0,NULL,1,'','',0,0,NULL,NULL,''),(547116158,979,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547116173,994,0,NULL,2,'','',0,0,NULL,NULL,''),(547117196,994,0,NULL,3,'','',0,0,NULL,NULL,''),
+(547118219,994,0,NULL,4,'','',0,0,NULL,NULL,''),(547119242,994,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547115151,995,0,NULL,1,'','',0,0,NULL,NULL,''),(547116174,995,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547117197,995,0,NULL,3,'','',0,0,NULL,NULL,''),(547118220,995,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547118223,998,0,NULL,4,'','',0,0,NULL,NULL,''),(547119246,998,0,NULL,5,'','',0,0,NULL,NULL,''),
+(547115155,999,0,NULL,1,'','',0,0,NULL,NULL,''),(547116178,999,0,NULL,2,'','',0,0,NULL,NULL,''),
+(547117201,999,0,NULL,3,'','',0,0,NULL,NULL,''),(547118224,999,0,NULL,4,'','',0,0,NULL,NULL,''),
+(547119271,38928081,0,NULL,10,'','',0,0,NULL,NULL,''),(547119272,38928081,0,NULL,11,'','',0,0,NULL,NULL,''),
+(547119273,38928081,0,NULL,12,'','',0,0,NULL,NULL,''),(547119274,38928081,0,NULL,13,'','',0,0,NULL,NULL,''),
+(547119275,38928081,0,NULL,14,'','',0,0,NULL,NULL,''),(547119276,38928081,0,NULL,15,'','',0,0,NULL,NULL,''),
+(547119277,38928081,0,NULL,16,'','',0,0,NULL,NULL,''),(547119278,38928081,0,NULL,17,'','',0,0,NULL,NULL,''),
+(547119279,38928081,0,NULL,18,'','',0,0,NULL,NULL,''),(547119280,38928081,0,NULL,19,'','',0,0,NULL,NULL,'');
+
+CREATE TABLE t3 (
+ old_id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ old_text mediumblob NOT NULL,
+ old_flags tinyblob NOT NULL,
+ PRIMARY KEY (old_id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t3 VALUES
+(1,'text-0',''),(2,'text-1000',''),(3,'text-2000',''),(4,'text-3000',''),
+(5,'text-4000',''),(6,'text-5000',''),(7,'text-6000',''),(8,'text-7000',''),
+(9,'text-8000',''),(10,'text-9000',''),(11,'text-1',''),(12,'text-1001',''),
+(13,'text-2001',''),(14,'text-3001',''),(15,'text-4001',''),(16,'text-5001',''),
+(17,'text-6001',''),(18,'text-7001',''),(19,'text-8001',''),(20,'text-9001',''),
+(21,'text-2',''),(22,'text-1002',''),(23,'text-2002',''),(24,'text-3002',''),
+(25,'text-4002',''),(26,'text-5002',''),(27,'text-6002',''),(28,'text-7002',''),
+(29,'text-8002',''),(30,'text-9002',''),(31,'text-3',''),(32,'text-1003',''),
+(33,'text-2003',''),(34,'text-3003',''),(35,'text-4003',''),(36,'text-5003',''),
+(37,'text-6003',''),(38,'text-7003',''),(39,'text-8003',''),(40,'text-9003',''),
+(41,'text-4',''),(42,'text-1004',''),(43,'text-2004',''),(44,'text-3004',''),
+(45,'text-4004',''),(46,'text-5004',''),(47,'text-6004',''),(48,'text-7004',''),
+(49,'text-8004',''),(50,'text-9004',''),(51,'text-5',''),(52,'text-1005',''),
+(53,'text-2005',''),(54,'text-3005',''),(55,'text-4005',''),(56,'text-5005',''),
+(57,'text-6005',''),(58,'text-7005',''),(59,'text-8005',''),(60,'text-9005',''),
+(61,'text-6',''),(62,'text-1006',''),(63,'text-2006',''),(64,'text-3006',''),
+(65,'text-4006',''),(66,'text-5006',''),(67,'text-6006',''),(68,'text-7006',''),
+(69,'text-8006',''),(70,'text-9006',''),(71,'text-7',''),(72,'text-1007',''),
+(73,'text-2007',''),(74,'text-3007',''),(75,'text-4007',''),(76,'text-5007',''),
+(77,'text-6007',''),(78,'text-7007',''),(79,'text-8007',''),(80,'text-9007',''),
+(81,'text-8',''),(82,'text-1008',''),(83,'text-2008',''),(84,'text-3008',''),
+(85,'text-4008',''),(86,'text-5008',''),(87,'text-6008',''),(88,'text-7008',''),
+(89,'text-8008',''),(90,'text-9008',''),(91,'text-9',''),(92,'text-1009',''),
+(93,'text-2009',''),(94,'text-3009',''),(95,'text-4009',''),(96,'text-5009',''),
+(97,'text-6009',''),(98,'text-7009',''),(99,'text-8009',''),(100,'text-9009','');
+
+
+set optimizer_switch='extended_keys=off';
+EXPLAIN
+SELECT * FROM t1, t2 IGNORE INDEX (PRIMARY), t3
+ WHERE page_id=rev_page AND rev_text_id=old_id AND page_namespace=4 AND page_title='Sandbox'
+ORDER BY rev_timestamp ASC LIMIT 10;
+
+set optimizer_switch='extended_keys=on';
+EXPLAIN
+SELECT * FROM t1, t2 IGNORE INDEX (PRIMARY), t3
+ WHERE page_id=rev_page AND rev_text_id=old_id AND page_namespace=4 AND page_title='Sandbox'
+ORDER BY rev_timestamp ASC LIMIT 10;
+
+DROP TABLE t1,t2,t3;
+
set optimizer_switch=@save_optimizer_switch;
set optimizer_switch=@save_ext_key_optimizer_switch;
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index 3168e95f620..7b7d9236835 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -1287,3 +1287,27 @@ SET optimizer_switch=@save_optimizer_switch;
--echo End of 5.0 tests
+--echo #
+--echo # MDEV-621: LP:693329 - Assertion `!is_interleave_error' failed on low optimizer_search_depth
+--echo #
+set @tmp_mdev621= @@optimizer_search_depth;
+SET SESSION optimizer_search_depth = 4;
+
+CREATE TABLE t1 (f1 int,f2 int,f3 int,f4 int) ;
+INSERT IGNORE INTO t1 VALUES (0,0,2,0),(NULL,0,2,0);
+CREATE TABLE t2 (f1 int) ;
+CREATE TABLE t3 (f3 int,PRIMARY KEY (f3)) ;
+CREATE TABLE t4 (f5 int) ;
+CREATE TABLE t5 (f2 int) ;
+
+SELECT alias2.f4 FROM t1 AS alias1
+LEFT JOIN t1 AS alias2
+ LEFT JOIN t2 AS alias3
+ LEFT JOIN t3 AS alias4 ON alias3.f1 = alias4.f3
+ ON alias2.f1
+LEFT JOIN t4 AS alias5
+ JOIN t5 ON alias5.f5
+ON alias2.f3 ON alias1.f2;
+DROP TABLE t1,t2,t3,t4,t5;
+set optimizer_search_depth= @tmp_mdev621;
+
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 44f4afd451b..24885c056b8 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1439,6 +1439,37 @@ GROUP BY t2.f1, t2.f2;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS
+--echo # WRONG RESULT
+--echo #
+
+CREATE TABLE t1 (i1 int);
+INSERT INTO t1 VALUES (100), (101);
+
+CREATE TABLE t2 (i2 int, i3 int);
+INSERT INTO t2 VALUES (20,1),(10,2);
+
+CREATE TABLE t3 (i4 int(11));
+INSERT INTO t3 VALUES (1),(2);
+
+let $query= SELECT (
+ SELECT MAX( t2.i2 )
+ FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
+ WHERE t2.i3 <> t1.i1
+) AS field1
+FROM t1;
+
+--echo
+--eval $query;
+--echo
+--eval $query GROUP BY field1;
+
+--echo
+drop table t1,t2,t3;
+
+--echo # End of test for Bug#13068506
+
--echo End of 5.1 tests
--echo #
@@ -1622,4 +1653,21 @@ ORDER BY t1.b;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug mdev-4336: LEFT JOIN with disjunctive
+--echo # <non-nullable datetime field> IS NULL in WHERE
+--echo # causes a hang and eventual crash
+--echo #
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL,
+ modified datetime NOT NULL,
+ PRIMARY KEY (id)
+);
+
+SELECT a.* FROM t1 a LEFT JOIN t1 b ON a.id = b.id
+ WHERE a.modified > b.modified or b.modified IS NULL;
+
+DROP TABLE t1;
+
SET optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/t/join_outer_innodb.test b/mysql-test/t/join_outer_innodb.test
index adb555d5f85..539d85a8b11 100644
--- a/mysql-test/t/join_outer_innodb.test
+++ b/mysql-test/t/join_outer_innodb.test
@@ -350,3 +350,26 @@ explain select * from v1;
drop view v1;
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16;
+
+
+--echo #
+--echo # MDEV-4270: crash in fix_semijoin_strategies_for_picked_join_order
+--echo #
+drop table if exists t1,t2,t3;
+create table t2(a int,unique key (a)) engine=innodb;
+create table t3(b int) engine=innodb;
+create table t1(a int,b int)engine=innodb;
+
+set @mdev4270_opl= @@optimizer_prune_level;
+set @mdev4270_osd= @@optimizer_search_depth;
+set optimizer_prune_level=0;
+set optimizer_search_depth=2;
+
+select 1 from t1 join t2 a
+natural left join t2 b
+natural right outer join t3;
+
+drop table t1,t2,t3;
+set optimizer_prune_level=@mdev4270_opl;
+set optimizer_search_depth=@mdev4270_osd;
+
diff --git a/mysql-test/t/log_slow.test b/mysql-test/t/log_slow.test
index af8a948d318..8d5a09d7a94 100644
--- a/mysql-test/t/log_slow.test
+++ b/mysql-test/t/log_slow.test
@@ -6,6 +6,7 @@ select @@log_slow_filter;
select @@log_slow_rate_limit;
select @@log_slow_verbosity;
show variables like "log_slow%";
+set @org_slow_query_log= @@global.slow_query_log;
# Some simple test to set log_slow_filter
set @@log_slow_filter= "filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk,admin";
@@ -42,7 +43,18 @@ show fields from mysql.slow_log;
flush slow logs;
-# Reset used variables
+# MDEV-4206 (empty filter should be no filter)
+set long_query_time=0.1;
+set log_slow_filter='';
+set global slow_query_log=1;
+set global log_output='TABLE';
+select sleep(0.5);
+select count(*) FROM mysql.slow_log;
+truncate mysql.slow_log;
+# Reset used variables
+set @@long_query_time=default;
+set global slow_query_log= @org_slow_query_log;
set @@log_slow_filter=default;
set @@log_slow_verbosity=default;
+set global log_output= default;
diff --git a/mysql-test/t/mysql_plugin.test b/mysql-test/t/mysql_plugin.test
index a05b5a624d9..10bc03e0f06 100644
--- a/mysql-test/t/mysql_plugin.test
+++ b/mysql-test/t/mysql_plugin.test
@@ -110,13 +110,8 @@ SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
--echo #
--echo # Enable the plugin...
--echo #
-let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
-# MTR will remove this file later, but this might be too late.
---error 0,1
---remove_file $expect_file
---write_file $expect_file
-wait
-EOF
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 10
--source include/wait_until_disconnected.inc
@@ -132,9 +127,8 @@ EOF
#
# Restart the server
#
---append_file $expect_file
-restart
-EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
@@ -155,12 +149,7 @@ eval INSERT INTO mysql.plugin VALUES ('wonky', '$DAEMONEXAMPLE');
--replace_regex /\.dll/.so/
SELECT * FROM mysql.plugin WHERE dl like 'libdaemon%' ORDER BY name;
-# MTR will remove this file later, but this might be too late.
---error 0,1
---remove_file $expect_file
---write_file $expect_file
-wait
-EOF
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 10
--source include/wait_until_disconnected.inc
@@ -177,9 +166,7 @@ EOF
#
# Restart the server
#
---append_file $expect_file
-restart
-EOF
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
@@ -189,12 +176,7 @@ EOF
--replace_regex /\.dll/.so/
SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
-# MTR will remove this file later, but this might be too late.
---error 0,1
---remove_file $expect_file
---write_file $expect_file
-wait
-EOF
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 10
--source include/wait_until_disconnected.inc
@@ -211,9 +193,7 @@ let $DAEMON_RELOAD = lib$DAEMONEXAMPLE;
#
# Restart the server
#
---append_file $expect_file
-restart
-EOF
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
@@ -226,12 +206,8 @@ SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
--echo #
--echo # Disable the plugin...
--echo #
-# MTR will remove this file later, but this might be too late.
---error 0,1
---remove_file $expect_file
---write_file $expect_file
-wait
-EOF
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 10
--source include/wait_until_disconnected.inc
@@ -248,9 +224,7 @@ EOF
#
# Restart the server
#
---append_file $expect_file
-restart
-EOF
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
@@ -262,13 +236,8 @@ SELECT * FROM mysql.plugin WHERE dl like '%libdaemon%' ORDER BY name;
#
# Stop the server for error conditions
#
-let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
-# MTR will remove this file later, but this might be too late.
---error 0,1
---remove_file $expect_file
---write_file $expect_file
-wait
-EOF
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 10
--source include/wait_until_disconnected.inc
@@ -382,17 +351,14 @@ replace_result $MYSQL_PLUGIN mysql_plugin;
#
# Restart the server
#
---append_file $expect_file
-restart
-EOF
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
#
# Cleanup
-# MTR will remove this file later, but this might be too late.
---error 0,1
---remove_file $expect_file
+
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Cleanup the share folder in the binary path.
--remove_file $MYSQLD_BASEDIR/share/errmsg.sys
diff --git a/mysql-test/t/mysqlshow.test b/mysql-test/t/mysqlshow.test
index cf8661d090c..4602c15e566 100644
--- a/mysql-test/t/mysqlshow.test
+++ b/mysql-test/t/mysqlshow.test
@@ -29,17 +29,14 @@ select "---- -v -v -t ------" as "";
DROP TABLE t1, t2;
-if (`select count(*) from information_schema.plugins where plugin_name='innodb' and plugin_auth_version > "5.5.31"`)
-{
# because of lp:1066512 this test shows xtradb I_S plugins, even when
# xtradb is supposed to be disabled
#
# Bug #19147: mysqlshow INFORMATION_SCHEMA does not work
#
---exec $MYSQL_SHOW information_schema
---exec $MYSQL_SHOW INFORMATION_SCHEMA
---exec $MYSQL_SHOW inf_rmation_schema
-}
+#--exec $MYSQL_SHOW information_schema
+#--exec $MYSQL_SHOW INFORMATION_SCHEMA
+#--exec $MYSQL_SHOW inf_rmation_schema
--echo End of 5.0 tests
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index af507b1f7ef..6a82a2901c5 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2493,7 +2493,7 @@ DROP TABLE t1,t2;
# Bug #10650
#
-select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0;
+select x'3136' + 0, X'3136' + 0, b'10' + 0, B'10' + 0;
#
# Bug #11398 Bug in field_conv() results in wrong result of join with index
@@ -4289,6 +4289,7 @@ SELECT f1 FROM t1 GROUP BY 1;
SELECT f1 FROM t1 GROUP BY '123' = 'abc';
SELECT 1 FROM t1 GROUP BY 1;
drop table t1;
+set sql_buffer_result= 0;
--echo #
@@ -4479,5 +4480,41 @@ WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1)
OR Time_zone_id <> Time_zone_id )
AND Use_leap_seconds <> 'N';
+--echo #
+--echo # Bug mdev-4274: result of simplification of OR badly merged
+--echo # into embedding AND
+--echo #
+
+CREATE TABLE t1 (a int, b int, INDEX idx(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (8,8);
+
+CREATE TABLE t2 (c int, INDEX idx(c)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8), (9);
+
+EXPLAIN EXTENDED
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+ WHERE 1 IS NULL OR b < 33 AND b = c;
+SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
+ WHERE 1 IS NULL OR b < 33 AND b = c;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug mdev-4413: another manifestations of bug mdev-2474
+--echo # (valgrind complains)
+--echo #
+
+CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,1);
+
+CREATE TABLE t2 (c int) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0), (8);
+
+SELECT * FROM t1, t2
+ WHERE c = a AND
+ ( 0 OR ( b BETWEEN 45 AND 300 OR a > 45 AND a < 100 ) AND b = c );
+
+DROP TABLE t1, t2;
+
--echo End of 5.3 tests
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 9db6709a8d2..0fb3474f877 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9209,5 +9209,66 @@ DROP FUNCTION f2;
DROP FUNCTION f3;
DROP FUNCTION f4;
---echo # End of 5.5 test
+--echo
+--echo Stored procedures and a condition handler in a nested procedure call
+--echo doesn't suppress the condition from being passed on to the calling
+--echo procedure
+--echo
+
+--disable_warnings
+drop procedure if exists p1;
+drop procedure if exists p0;
+--enable_warnings
+
+create table t1 (id int);
+delimiter $$;
+create procedure p1 () begin
+declare i int default 0;
+declare continue handler for not found begin
+select "You should see this message and the warning that generated this" as "message";
+show warnings;
+end;
+select id into i from t1;
+end$$
+create procedure p0 () begin
+declare continue handler for not found begin
+select "You should NOT see this message" as "message";
+end;
+call p1();
+end$$
+delimiter ;$$
+call p0();
+drop procedure p1;
+drop procedure p0;
+drop table t1;
+
+--echo
+--echo Test if stored procedures propagates errors
+--echo
+
+create table t1 (id int primary key);
+delimiter $$;
+create procedure p1 () begin
+insert into t1 values(1);
+insert into t1 values(2);
+insert into t1 values(2);
+insert into t1 values(3);
+end$$
+create procedure p2 () begin
+ declare x int;
+ select id into x from t1 where id=5;
+end$$
+delimiter ;$$
+--error ER_DUP_ENTRY
+call p1();
+show warnings;
+select * from t1;
+call p2();
+
+drop procedure p1;
+drop procedure p2;
+
+drop table t1;
+
+--echo # End of 5.5 test
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index e2abb8040b3..bfdc6335f1d 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -2540,5 +2540,49 @@ WHERE (field1) IN ($query);
DROP TABLE t1, t2;
+--echo #
+--echo # MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
+--echo # (testcase only)
+--echo #
+
+# Use another connection to get rid of this test's settings
+connect (con1,localhost,root,,);
+connection con1;
+
+SET join_cache_level = 5;
+SET optimizer_switch = 'semijoin=on';
+
+CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (4,'p'),(1,'q'),(8,'e');
+
+CREATE TABLE t2 (c INT, d CHAR(1), KEY(c), KEY(d)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (4,'f'),(2,'i'),(5,'h'),(3,'q'),(1,'g');
+
+SELECT a, COUNT(*) AS cnt
+FROM t1 LEFT JOIN t2 ON (d = b)
+WHERE a IN ( SELECT c FROM t2 WHERE b > 'k' )
+GROUP BY a ORDER BY a, cnt LIMIT 2;
+
+drop table t1, t2;
+connection default;
+disconnect con1;
+
+--echo #
+--echo # MDEV-4071: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with ...
+--echo #
+CREATE TABLE t1 (b INT, c VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'v'),(0,'s');
+
+CREATE TABLE t2 (a INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0),(8);
+
+SELECT c, SUM( DISTINCT b ) AS sm FROM t1
+WHERE ( 5, 108 ) IN ( SELECT MIN(a), MAX(a) FROM t2 )
+GROUP BY b
+HAVING c <> ( SELECT MAX( c ) FROM t1 )
+ORDER BY sm;
+
+DROP TABLE t1,t2;
+
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test
index 4c40b2b5487..711f2f4f9b6 100644
--- a/mysql-test/t/subselect_sj_mat.test
+++ b/mysql-test/t/subselect_sj_mat.test
@@ -1677,6 +1677,25 @@ SELECT * FROM t1, t2 WHERE b1 IN ( SELECT b2 FROM t2 WHERE b1 > 'o' ) AND ( b1 <
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-4465: Reproducible crash (mysqld got signal 11) in multi_delete::initialize_tables with semijoin+materialization
+--echo #
+CREATE TABLE t1 (
+ id int(11) NOT NULL
+);
+
+CREATE TABLE t2 (
+ id int(11) NOT NULL,
+ a_id int(11) DEFAULT NULL
+);
+
+insert into t1 values (1), (2), (3);
+insert into t2 values (1, 1), (2, 1), (3, 1), (4, 2), (5, 3), (6, 3), (7, 3);
+
+delete t2 from t2 where a_id in (select * from (select t1.id from t1 limit 2) as x);
+
+drop table t1,t2;
+
--echo # This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index d1648254fb2..05bc72291cd 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -471,6 +471,21 @@ insert into t1 values ('2000-12-03','22:55:23'),('2008-05-03','10:19:31');
select case when d = '2012-12-12' then d else t end as cond, group_concat( d ) from t1 group by cond;
drop table t1;
+--echo #
+--echo # Semantics of the condition <non-nullable datetime field> IS NULL
+--echo # when the field belongs to an inner table of an outer join
+--echo #
+
+create table t1 (a int, b date not null);
+insert t1 values (1, 0), (2, '1999-01-02');
+create table t2 (c int);
+insert t2 values (1),(3);
+
+select * from t2 left join t1 on t1.a=t2.c where t1.a is null;
+select * from t2 left join t1 on t1.a=t2.c where t1.b is null;
+
+drop table t1,t2;
+
--echo End of 5.3 tests
--echo #
diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test
index 1f9f7b5412d..f03f3fcf703 100644
--- a/mysql-test/t/varbinary.test
+++ b/mysql-test/t/varbinary.test
@@ -13,7 +13,30 @@ drop table if exists t1;
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ;
select 0x31+1,concat(0x31)+1,-0xf;
-select x'31',X'ffff'+0;
+select x'31',0xffff+0;
+select X'FFFF'+0;
+
+#
+# Hex string vs hex hybrid
+#
+SELECT x'31'+0, 0x31+0;
+SELECT x'31'+0.1e0, 0x31+0.1e0;
+SELECT x'312E39'+0e0, 0x312E39+0e0;
+SELECT CAST(x'31' AS SIGNED), CAST(0x31 AS SIGNED);
+SELECT CAST(x'31' AS DECIMAL(10,1)), CAST(0x31 AS DECIMAL(10,1));
+SELECT CAST(x'312E39' AS SIGNED), CAST(0x312E39 AS SIGNED);
+SELECT CAST(x'312E39' AS DECIMAL(10,1)), CAST(0x312E39 AS DECIMAL(10,1));
+EXPLAIN EXTENDED SELECT X'FFFF', 0xFFFF;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (X'31'),(0x31);
+INSERT INTO t1 VALUES (X'312E39'),(0x312E39);
+SELECT * FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(10,1));
+INSERT INTO t1 VALUES (X'31'),(0x31);
+INSERT INTO t1 VALUES (X'312E39'),(0x312E39);
+SELECT * FROM t1;
+DROP TABLE t1;
#
# Test of hex constants in WHERE:
@@ -115,7 +138,7 @@ select 0x41;
select b'01000001';
-select x'41', 0+x'41';
+select x'41', 0+x'3635';
select N'abc', length(N'abc');
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 08e7e68c225..244c5f039fa 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -1522,4 +1522,16 @@ set session collation_connection=2048;
--error ER_UNKNOWN_COLLATION
set session collation_database=2048;
+#
+# Bug #16044655 CRASH: SETTING DEFAULT VALUE FOR SOME VARIABLES
+#
+--error ER_NO_DEFAULT
+set session rand_seed1=DEFAULT;
+
+#
+# Bug #14211565 CRASH WHEN ATTEMPTING TO SET SYSTEM VARIABLE TO RESULT OF VALUES()
+#
+--error ER_BAD_FIELD_ERROR
+set autocommit = values(v);
+
--echo End of 5.5 tests
diff --git a/mysys/errors.c b/mysys/errors.c
index ebbdc410901..11e7d04e79e 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2010, Oracle and/or its affiliates
- Copyright (c) 1995, 2012 Monty Program Ab
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates
+ Copyright (c) 1995, 2013, 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
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index 2b2356c08df..d20ce882459 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -46,7 +46,7 @@ char * fn_format(char * to, const char *name, const char *dir,
else if ((flag & MY_RELATIVE_PATH) && !test_if_hard_path(dev))
{
/* Put 'dir' before the given path */
- strmake(buff,dev,sizeof(buff)-1);
+ strmake_buf(buff, dev);
pos=convert_dirname(dev,dir,NullS);
strmake(pos,buff,sizeof(buff)-1- (int) (pos-dev));
}
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 30f269454c2..5b52998f3ca 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -553,7 +553,8 @@ int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, uint key_cache_block_si
if (blocks < 8)
{
my_errno= ENOMEM;
- my_error(EE_OUTOFMEMORY, MYF(0), blocks * keycache->key_cache_block_size);
+ my_error(EE_OUTOFMEMORY, MYF(ME_FATALERROR),
+ blocks * keycache->key_cache_block_size);
goto err;
}
blocks= blocks / 4*3;
diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c
index 8f06192d9f8..2e036936c70 100644
--- a/mysys/my_lockmem.c
+++ b/mysys/my_lockmem.c
@@ -43,7 +43,7 @@ uchar *my_malloc_lock(uint size,myf MyFlags)
if (!(ptr=memalign(pagesize,size)))
{
if (MyFlags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size);
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_FATALERROR), size);
DBUG_RETURN(0);
}
success = mlock((uchar*) ptr,size);
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index 5a84b051a23..2f3a5276a59 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -1,5 +1,6 @@
/*
Copyright (c) 2000, 2010, Oracle and/or its affiliates
+ Copyright (c) 2009, 2013, 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
@@ -104,11 +105,8 @@ void *my_malloc(size_t size, myf my_flags)
if (my_flags & MY_FAE)
error_handler_hook=fatal_error_handler_hook;
if (my_flags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY,
- MYF(ME_BELL | ME_WAITTANG | ME_NOREFRESH | (my_flags & ME_JUST_INFO)),
- size);
- DBUG_EXECUTE_IF("simulate_out_of_memory",
- DBUG_SET("-d,simulate_out_of_memory"););
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL + ME_WAITTANG +
+ ME_NOREFRESH + ME_FATALERROR),size);
if (my_flags & MY_FAE)
exit(1);
}
@@ -175,7 +173,7 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags)
DBUG_RETURN(oldpoint);
my_errno=errno;
if (my_flags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size);
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL + ME_WAITTANG + ME_FATALERROR), size);
}
else
{
diff --git a/mysys/my_once.c b/mysys/my_once.c
index 7df9b0a1981..b9232db9b2e 100644
--- a/mysys/my_once.c
+++ b/mysys/my_once.c
@@ -59,7 +59,7 @@ void* my_once_alloc(size_t Size, myf MyFlags)
{
my_errno=errno;
if (MyFlags & (MY_FAE+MY_WME))
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),get_size);
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_FATALERROR), get_size);
return((uchar*) 0);
}
DBUG_PRINT("test",("my_once_malloc %lu byte malloced", (ulong) get_size));
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 56f7ca8b31a..4d1bc18930a 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -451,7 +451,7 @@ const char *my_thread_name(void)
{
my_thread_id id= my_thread_dbug_id();
sprintf(name_buff,"T@%lu", (ulong) id);
- strmake(tmp->name,name_buff,THREAD_NAME_SIZE);
+ strmake_buf(tmp->name, name_buff);
}
return tmp->name;
}
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 3c94fab2ec7..a7985997036 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 9c21033eca4..7fd87edda6c 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -66,6 +66,8 @@ static QUEUE alarm_queue;
static uint max_used_alarms=0;
pthread_t alarm_thread;
+#define MY_THR_ALARM_QUEUE_EXTENT 10
+
#ifdef USE_ALARM_THREAD
static void *alarm_handler(void *arg);
#define reschedule_alarms() mysql_cond_signal(&COND_alarm)
@@ -89,7 +91,8 @@ void init_thr_alarm(uint max_alarms)
alarm_aborted=0;
next_alarm_expire_time= ~ (time_t) 0;
init_queue(&alarm_queue, max_alarms+1, offsetof(ALARM,expire_time), 0,
- compare_ulong, NullS, offsetof(ALARM, index_in_queue)+1, 0);
+ compare_ulong, NullS, offsetof(ALARM, index_in_queue)+1,
+ MY_THR_ALARM_QUEUE_EXTENT);
sigfillset(&full_signal_set); /* Neaded to block signals */
mysql_mutex_init(key_LOCK_alarm, &LOCK_alarm, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_COND_alarm, &COND_alarm, NULL);
@@ -140,7 +143,10 @@ void resize_thr_alarm(uint max_alarms)
than max_alarms
*/
if (alarm_queue.elements < max_alarms)
+ {
resize_queue(&alarm_queue,max_alarms+1);
+ max_used_alarms= alarm_queue.elements;
+ }
mysql_mutex_unlock(&LOCK_alarm);
}
@@ -209,16 +215,10 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
mysql_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */
if (alarm_queue.elements >= max_used_alarms)
{
- if (alarm_queue.elements == alarm_queue.max_elements)
- {
- DBUG_PRINT("info", ("alarm queue full"));
- fprintf(stderr,"Warning: thr_alarm queue is full\n");
- goto abort;
- }
max_used_alarms=alarm_queue.elements+1;
}
reschedule= (ulong) next_alarm_expire_time > (ulong) next;
- queue_insert(&alarm_queue,(uchar*) alarm_data);
+ queue_insert_safe(&alarm_queue, (uchar*) alarm_data);
assert(alarm_data->index_in_queue > 0);
/* Reschedule alarm if the current one has more than sec left */
@@ -238,11 +238,6 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
(*alrm)= &alarm_data->alarmed;
DBUG_RETURN(0);
-abort:
- if (alarm_data->malloced)
- my_free(alarm_data);
- mysql_mutex_unlock(&LOCK_alarm);
- one_signal_hand_sigmask(SIG_SETMASK,&old_mask,NULL);
abort_no_unlock:
*alrm= 0; /* No alarm */
DBUG_RETURN(1);
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
index 370830d82db..752dc15304e 100644
--- a/packaging/WiX/mysql_server.wxs.in
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -34,8 +34,9 @@
Languages='1033'
Compressed='yes'
SummaryCodepage='1252'
- Platform='@Platform@'/>
-
+ Platform='@Platform@'
+ InstallScope="perMachine"/>
+
<Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
<!-- Upgrade -->
@@ -44,11 +45,13 @@
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
IncludeMinimum="yes"
Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
+ IncludeMaximum="yes"
Property="OLDERVERSIONBEINGUPGRADED"
MigrateFeatures="yes"
/>
<UpgradeVersion
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
+ IncludeMinimum="no"
OnlyDetect="yes"
Property="NEWERVERSIONDETECTED" />
</Upgrade>
diff --git a/packaging/rpm-uln/mysql.spec.sh b/packaging/rpm-uln/mysql.spec.sh
index 3e2c5c3f11c..ec195bc9e16 100644
--- a/packaging/rpm-uln/mysql.spec.sh
+++ b/packaging/rpm-uln/mysql.spec.sh
@@ -268,11 +268,12 @@ Requires: bash
Provides: mysql
# MySQL (with caps) is upstream's spelling of their own RPMs for mysql
-Conflicts: MySQL
+Obsoletes: MySQL
# mysql-cluster used to be built from this SRPM, but no more
Obsoletes: mysql-cluster < 5.1.44
# We need cross-product "Obsoletes:" to allow cross-product upgrades:
-Obsoletes: mysql mysql-advanced
+Obsoletes: mysql < %{version}-%{release}
+Obsoletes: mysql-advanced < %{version}-%{release}
# Working around perl dependency checking bug in rpm FTTB. Remove later.
%global __perl_requires %{SOURCE999}
@@ -295,8 +296,9 @@ further info.
Summary: The shared libraries required for MySQL clients
Group: Applications/Databases
Requires: /sbin/ldconfig
+Obsoletes: mysql-libs < %{version}-%{release}
+Obsoletes: mysql-libs-advanced < %{version}-%{release}
Provides: mysql-libs
-Obsoletes: mysql-libs mysql-libs-advanced
%description -n mysql-libs%{product_suffix}
The mysql-libs package provides the essential shared libraries for any
@@ -318,9 +320,10 @@ Requires(preun): initscripts
Requires(postun): initscripts
# mysqlhotcopy needs DBI/DBD support
Requires: perl-DBI, perl-DBD-MySQL
+Obsoletes: MySQL-server
+Obsoletes: mysql-server < %{version}-%{release}
+Obsoletes: mysql-server-advanced < %{version}-%{release}
Provides: mysql-server
-Conflicts: MySQL-server
-Obsoletes: mysql-server mysql-server-advanced
%description -n mysql-server%{product_suffix}
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
@@ -334,9 +337,10 @@ Summary: Files for development of MySQL applications
Group: Applications/Databases
Requires: mysql%{product_suffix} = %{version}-%{release}
Requires: openssl-devel
+Obsoletes: MySQL-devel
+Obsoletes: mysql-devel < %{version}-%{release}
+Obsoletes: mysql-devel-advanced < %{version}-%{release}
Provides: mysql-devel
-Conflicts: MySQL-devel
-Obsoletes: mysql-devel mysql-devel-advanced
%description -n mysql-devel%{product_suffix}
MySQL is a multi-user, multi-threaded SQL database server. This
@@ -347,8 +351,9 @@ developing MySQL client applications.
Summary: MySQL as an embeddable library
Group: Applications/Databases
+Obsoletes: mysql-embedded < %{version}-%{release}
+Obsoletes: mysql-embedded-advanced < %{version}-%{release}
Provides: mysql-embedded
-Obsoletes: mysql-embedded mysql-embedded-advanced
%description -n mysql-embedded%{product_suffix}
MySQL is a multi-user, multi-threaded SQL database server. This
@@ -362,8 +367,9 @@ Summary: Development files for MySQL as an embeddable library
Group: Applications/Databases
Requires: mysql-embedded%{product_suffix} = %{version}-%{release}
Requires: mysql-devel%{product_suffix} = %{version}-%{release}
+Obsoletes: mysql-embedded-devel < %{version}-%{release}
+Obsoletes: mysql-embedded-devel-advanced < %{version}-%{release}
Provides: mysql-embedded-devel
-Obsoletes: mysql-embedded-devel mysql-embedded-devel-advanced
%description -n mysql-embedded-devel%{product_suffix}
MySQL is a multi-user, multi-threaded SQL database server. This
@@ -376,9 +382,10 @@ Summary: The test suite distributed with MySQL
Group: Applications/Databases
Requires: mysql%{product_suffix} = %{version}-%{release}
Requires: mysql-server%{product_suffix} = %{version}-%{release}
+Obsoletes: MySQL-test
+Obsoletes: mysql-test < %{version}-%{release}
+Obsoletes: mysql-test-advanced < %{version}-%{release}
Provides: mysql-test
-Conflicts: MySQL-test
-Obsoletes: mysql-test mysql-test-advanced
%description -n mysql-test%{product_suffix}
MySQL is a multi-user, multi-threaded SQL database server. This
diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c
index 0616f192f20..2747063670c 100644
--- a/plugin/audit_null/audit_null.c
+++ b/plugin/audit_null/audit_null.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2012, 2013, 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
@@ -22,11 +23,16 @@
#define __attribute__(A)
#endif
-static volatile int number_of_calls; /* for SHOW STATUS, see below */
-static volatile int number_of_calls_general_log;
-static volatile int number_of_calls_general_error;
-static volatile int number_of_calls_general_result;
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+static volatile int ncalls; /* for SHOW STATUS, see below */
+static volatile int ncalls_general_log;
+static volatile int ncalls_general_error;
+static volatile int ncalls_general_result;
+FILE *f;
/*
Initialize the plugin at server start or plugin installation.
@@ -44,11 +50,16 @@ static volatile int number_of_calls_general_result;
static int audit_null_plugin_init(void *arg __attribute__((unused)))
{
- number_of_calls= 0;
- number_of_calls_general_log= 0;
- number_of_calls_general_error= 0;
- number_of_calls_general_result= 0;
- return(0);
+ ncalls= 0;
+ ncalls_general_log= 0;
+ ncalls_general_error= 0;
+ ncalls_general_result= 0;
+
+ f = fopen("audit_null_tables.log", "w");
+ if (!f)
+ return 1;
+
+ return 0;
}
@@ -67,7 +78,8 @@ static int audit_null_plugin_init(void *arg __attribute__((unused)))
static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
{
- return(0);
+ fclose(f);
+ return 0;
}
@@ -86,7 +98,7 @@ static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
const void *event)
{
/* prone to races, oh well */
- number_of_calls++;
+ ncalls++;
if (event_class == MYSQL_AUDIT_GENERAL_CLASS)
{
const struct mysql_event_general *event_general=
@@ -94,18 +106,56 @@ static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
switch (event_general->event_subclass)
{
case MYSQL_AUDIT_GENERAL_LOG:
- number_of_calls_general_log++;
+ ncalls_general_log++;
+ fprintf(f, "%s\t>> %s\n", event_general->general_user,
+ event_general->general_query);
break;
case MYSQL_AUDIT_GENERAL_ERROR:
- number_of_calls_general_error++;
+ ncalls_general_error++;
break;
case MYSQL_AUDIT_GENERAL_RESULT:
- number_of_calls_general_result++;
+ ncalls_general_result++;
break;
default:
break;
}
}
+ else
+ if (event_class == MYSQL_AUDIT_TABLE_CLASS)
+ {
+ const struct mysql_event_table *event_table=
+ (const struct mysql_event_table *) event;
+ const char *ip= event_table->ip ? event_table->ip : "";
+ const char *op= 0;
+ char buf[1024];
+
+ switch (event_table->event_subclass)
+ {
+ case MYSQL_AUDIT_TABLE_LOCK:
+ op= event_table->read_only ? "read" : "write";
+ break;
+ case MYSQL_AUDIT_TABLE_CREATE:
+ op= "create";
+ break;
+ case MYSQL_AUDIT_TABLE_DROP:
+ op= "drop";
+ break;
+ case MYSQL_AUDIT_TABLE_ALTER:
+ op= "alter";
+ break;
+ case MYSQL_AUDIT_TABLE_RENAME:
+ snprintf(buf, sizeof(buf), "rename to %s.%s",
+ event_table->new_database, event_table->new_table);
+ buf[sizeof(buf)-1]= 0;
+ op= buf;
+ break;
+ }
+
+ fprintf(f, "%s[%s] @ %s [%s]\t%s.%s : %s\n",
+ event_table->priv_user, event_table->user,
+ event_table->host, ip,
+ event_table->database, event_table->table, op);
+ }
}
@@ -115,10 +165,8 @@ static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
static struct st_mysql_audit audit_null_descriptor=
{
- MYSQL_AUDIT_INTERFACE_VERSION, /* interface version */
- NULL, /* release_thd function */
- audit_null_notify, /* notify function */
- { (unsigned long) MYSQL_AUDIT_GENERAL_CLASSMASK } /* class mask */
+ MYSQL_AUDIT_INTERFACE_VERSION, NULL, audit_null_notify,
+ { MYSQL_AUDIT_GENERAL_CLASSMASK | MYSQL_AUDIT_TABLE_CLASSMASK }
};
/*
@@ -127,10 +175,10 @@ static struct st_mysql_audit audit_null_descriptor=
static struct st_mysql_show_var simple_status[]=
{
- { "called", (char *) &number_of_calls, SHOW_INT },
- { "general_log", (char *) &number_of_calls_general_log, SHOW_INT },
- { "general_error", (char *) &number_of_calls_general_error, SHOW_INT },
- { "general_result", (char *) &number_of_calls_general_result, SHOW_INT },
+ { "called", (char *) &ncalls, SHOW_INT },
+ { "general_error", (char *) &ncalls_general_error, SHOW_INT },
+ { "general_log", (char *) &ncalls_general_log, SHOW_INT },
+ { "general_result", (char *) &ncalls_general_result, SHOW_INT },
{ 0, 0, 0}
};
diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc
index af13b6edf93..8489b14c5db 100644
--- a/plugin/qc_info/qc_info.cc
+++ b/plugin/qc_info/qc_info.cc
@@ -83,7 +83,7 @@ static int qc_info_fill_table(THD *thd, TABLE_LIST *tables,
return 0;
if (qc->try_lock(thd))
- return status;
+ return 0; // QC is or is being disabled
/* loop through all queries in the query cache */
for (uint i= 0; i < queries->records; i++)
diff --git a/regex/my_regex.h b/regex/my_regex.h
index 30896e29b91..1f96b8c461e 100644
--- a/regex/my_regex.h
+++ b/regex/my_regex.h
@@ -28,7 +28,7 @@ typedef struct {
/* === regcomp.c === */
-typedef int (*my_regex_stack_check_t)();
+typedef int (*my_regex_stack_check_t)(int);
extern int my_regcomp(my_regex_t *, const char *, int, CHARSET_INFO *charset);
#define REG_BASIC 0000
#define REG_EXTENDED 0001
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 6e2d2511fc1..abc18174f56 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -227,7 +227,7 @@ int stop; /* character this ERE should end at */
while (MORE() && (c = PEEK()) != '|' && c != stop)
{
if (my_regex_enough_mem_in_stack &&
- my_regex_enough_mem_in_stack())
+ my_regex_enough_mem_in_stack(0))
{
SETERROR(REG_ESPACE);
return;
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index 878555e9458..a222d22b670 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -1,5 +1,4 @@
--- Copyright (c) 2007 MySQL AB, 2008 Sun Microsystems, Inc.
--- Use is subject to license terms.
+-- Copyright (c) 2007, 2013, Oracle and/or its affiliates.
--
-- 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
@@ -21,7 +20,12 @@
-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix
-- host which will later be included in a Windows zip file), any lines
-- containing "@current_hostname" are filtered out by mysql_install_db.
-set @current_hostname= @@hostname;
+
+-- Get the hostname, if the hostname has any wildcard character like "_" or "%"
+-- add escape character in front of wildcard character to convert "_" or "%" to
+-- a plain character
+SET @get_hostname= @@hostname;
+SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname;
-- Fill "db" table with default grants for anyone to
@@ -33,10 +37,9 @@ INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
DROP TABLE tmp_db;
--- Fill "users" table with default users allowing root access
--- from local machine if "users" table didn't exist before
+-- Fill "user" table with default users allowing root access
+-- from local machine if "user" table didn't exist before
CREATE TEMPORARY TABLE tmp_user LIKE user;
-set @current_hostname= @@hostname;
INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','' FROM dual WHERE LOWER( @current_hostname) != 'localhost';
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
diff --git a/sql-common/client.c b/sql-common/client.c
index a1904bae93a..956d735368c 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -776,7 +776,7 @@ restart:
len-=2;
if (protocol_41(mysql) && (char) pos[0] == '#')
{
- strmake(net->sqlstate, (char*) pos+1, SQLSTATE_LENGTH);
+ strmake_buf(net->sqlstate, (char*) pos+1);
pos+= SQLSTATE_LENGTH+1;
}
else
@@ -3126,7 +3126,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
bzero((char*) &UNIXaddr, sizeof(UNIXaddr));
UNIXaddr.sun_family= AF_UNIX;
- strmake(UNIXaddr.sun_path, unix_socket, sizeof(UNIXaddr.sun_path)-1);
+ strmake_buf(UNIXaddr.sun_path, unix_socket);
if (connect_sync_or_async(mysql, net, sock,
(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr)))
{
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 63e2df46bed..36ab121cadf 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -274,12 +274,9 @@ ADD_CUSTOM_TARGET(distclean
IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
-# We need to create empty directories (data/test) the installation.
-# This does not work with current CPack due to http://www.cmake.org/Bug/view.php?id=8767
-# Avoid completely empty directories and install dummy file instead.
-SET(DUMMY_FILE ${CMAKE_CURRENT_BINARY_DIR}/db.opt )
-FILE(WRITE ${DUMMY_FILE} "")
-INSTALL(FILES ${DUMMY_FILE} DESTINATION data/test COMPONENT DataFiles)
+# Copy db.opt into data/test/
+SET(DBOPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/db.opt )
+INSTALL(FILES ${DBOPT_FILE} DESTINATION data/test COMPONENT DataFiles)
# Install initial database on windows
IF(NOT CMAKE_CROSSCOMPILING)
diff --git a/sql/db.opt b/sql/db.opt
new file mode 100644
index 00000000000..d8429c4e0de
--- /dev/null
+++ b/sql/db.opt
@@ -0,0 +1,2 @@
+default-character-set=latin1
+default-collation=latin1_swedish_ci
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index edd4e248038..233fd6a3bd6 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -55,7 +55,7 @@ const TABLE_FIELD_TYPE event_table_fields[ET_FIELD_COUNT] =
},
{
{ C_STRING_WITH_LEN("definer") },
- { C_STRING_WITH_LEN("char(77)") },
+ { C_STRING_WITH_LEN("char(") },
{ C_STRING_WITH_LEN("utf8") }
},
{
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index b28580b7831..f41df69de27 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2005, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2005, 2013, Oracle and/or its affiliates.
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
@@ -63,6 +63,8 @@
#include "key.h"
#include "sql_plugin.h"
#include "table.h" /* HA_DATA_PARTITION */
+#include "sql_show.h" // append_identifier
+#include "sql_admin.h" // SQL_ADMIN_MSG_TEXT_SIZE
#include "debug_sync.h"
@@ -287,6 +289,7 @@ void ha_partition::init_handler_variables()
m_rec_length= 0;
m_last_part= 0;
m_rec0= 0;
+ m_err_rec= NULL;
m_curr_key_info[0]= NULL;
m_curr_key_info[1]= NULL;
m_part_func_monotonicity_info= NON_MONOTONIC;
@@ -1046,10 +1049,11 @@ int ha_partition::preload_keys(THD *thd, HA_CHECK_OPT *check_opt)
0 Success
*/
-static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
- handler *file, uint flag)
+int ha_partition::handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
+ uint part_id, uint flag)
{
int error;
+ handler *file= m_file[part_id];
DBUG_ENTER("handle_opt_part");
DBUG_PRINT("enter", ("flag = %u", flag));
@@ -1058,9 +1062,27 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
else if (flag == ANALYZE_PARTS)
error= file->ha_analyze(thd, check_opt);
else if (flag == CHECK_PARTS)
+ {
error= file->ha_check(thd, check_opt);
+ if (!error ||
+ error == HA_ADMIN_ALREADY_DONE ||
+ error == HA_ADMIN_NOT_IMPLEMENTED)
+ {
+ if (check_opt->flags & (T_MEDIUM | T_EXTEND))
+ error= check_misplaced_rows(part_id, false);
+ }
+ }
else if (flag == REPAIR_PARTS)
+ {
error= file->ha_repair(thd, check_opt);
+ if (!error ||
+ error == HA_ADMIN_ALREADY_DONE ||
+ error == HA_ADMIN_NOT_IMPLEMENTED)
+ {
+ if (check_opt->flags & (T_MEDIUM | T_EXTEND))
+ error= check_misplaced_rows(part_id, true);
+ }
+ }
else if (flag == ASSIGN_KEYCACHE_PARTS)
error= file->assign_to_keycache(thd, check_opt);
else if (flag == PRELOAD_KEYS_PARTS)
@@ -1082,11 +1104,11 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
TODO: move this into the handler, or rewrite mysql_admin_table.
*/
static bool print_admin_msg(THD* thd, const char* msg_type,
- const char* db_name, const char* table_name,
+ const char* db_name, String &table_name,
const char* op_name, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 6, 7);
static bool print_admin_msg(THD* thd, const char* msg_type,
- const char* db_name, const char* table_name,
+ const char* db_name, String &table_name,
const char* op_name, const char *fmt, ...)
{
va_list args;
@@ -1107,7 +1129,7 @@ static bool print_admin_msg(THD* thd, const char* msg_type,
return TRUE;
}
- length=(uint) (strxmov(name, db_name, ".", table_name,NullS) - name);
+ length=(uint) (strxmov(name, db_name, ".", table_name.c_ptr_safe(), NullS) - name);
/*
TODO: switch from protocol to push_warning here. The main reason we didn't
it yet is parallel repair. Due to following trace:
@@ -1179,15 +1201,14 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
part= i * num_subparts + j;
DBUG_PRINT("info", ("Optimize subpartition %u (%s)",
part, sub_elem->partition_name));
- if ((error= handle_opt_part(thd, check_opt, m_file[part], flag)))
+ if ((error= handle_opt_part(thd, check_opt, part, flag)))
{
/* print a line which partition the error belongs to */
if (error != HA_ADMIN_NOT_IMPLEMENTED &&
error != HA_ADMIN_ALREADY_DONE &&
error != HA_ADMIN_TRY_ALTER)
{
- print_admin_msg(thd, "error", table_share->db.str,
- table->alias.c_ptr(),
+ print_admin_msg(thd, "error", table_share->db.str, table->alias,
opt_op_name[flag],
"Subpartition %s returned error",
sub_elem->partition_name);
@@ -1206,15 +1227,14 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
{
DBUG_PRINT("info", ("Optimize partition %u (%s)", i,
part_elem->partition_name));
- if ((error= handle_opt_part(thd, check_opt, m_file[i], flag)))
+ if ((error= handle_opt_part(thd, check_opt, i, flag)))
{
/* print a line which partition the error belongs to */
if (error != HA_ADMIN_NOT_IMPLEMENTED &&
error != HA_ADMIN_ALREADY_DONE &&
error != HA_ADMIN_TRY_ALTER)
{
- print_admin_msg(thd, "error", table_share->db.str,
- table->alias.c_ptr(),
+ print_admin_msg(thd, "error", table_share->db.str, table->alias,
opt_op_name[flag], "Partition %s returned error",
part_elem->partition_name);
}
@@ -3554,7 +3574,7 @@ exit:
Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
new_data is always record[0]
- old_data is normally record[1] but may be anything
+ old_data is always record[1]
*/
int ha_partition::update_row(const uchar *old_data, uchar *new_data)
@@ -3564,6 +3584,7 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
int error= 0;
longlong func_value;
DBUG_ENTER("ha_partition::update_row");
+ m_err_rec= NULL;
if ((error= get_parts_for_update(old_data, new_data, table->record[0],
m_part_info, &old_part_id, &new_part_id,
@@ -3572,6 +3593,25 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
m_part_info->err_value= func_value;
goto exit;
}
+ /*
+ The protocol for updating a row is:
+ 1) position the handler (cursor) on the row to be updated,
+ either through the last read row (rnd or index) or by rnd_pos.
+ 2) call update_row with both old and new full records as arguments.
+
+ This means that m_last_part should already be set to actual partition
+ where the row was read from. And if that is not the same as the
+ calculated part_id we found a misplaced row, we return an error to
+ notify the user that something is broken in the row distribution
+ between partitions! Since we don't check all rows on read, we return an
+ error instead of correcting m_last_part, to make the user aware of the
+ problem!
+ */
+ if (old_part_id != m_last_part)
+ {
+ m_err_rec= old_data;
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+ }
m_last_part= new_part_id;
start_part_bulk_insert(thd, new_part_id);
@@ -3676,12 +3716,34 @@ int ha_partition::delete_row(const uchar *buf)
int error;
THD *thd= ha_thd();
DBUG_ENTER("ha_partition::delete_row");
+ m_err_rec= NULL;
if ((error= get_part_for_delete(buf, m_rec0, m_part_info, &part_id)))
{
DBUG_RETURN(error);
}
- m_last_part= part_id;
+ /*
+ The protocol for deleting a row is:
+ 1) position the handler (cursor) on the row to be deleted,
+ either through the last read row (rnd or index) or by rnd_pos.
+ 2) call delete_row with the full record as argument.
+
+ This means that m_last_part should already be set to actual partition
+ where the row was read from. And if that is not the same as the
+ calculated part_id we found a misplaced row, we return an error to
+ notify the user that something is broken in the row distribution
+ between partitions! Since we don't check all rows on read, we return an
+ error instead of forwarding the delete to the correct (m_last_part)
+ partition!
+ TODO: change the assert in InnoDB into an error instead and make this one
+ an assert instead and remove the get_part_for_delete()!
+ */
+ if (part_id != m_last_part)
+ {
+ m_err_rec= buf;
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+ }
+
tmp_disable_binlog(thd);
error= m_file[part_id]->ha_delete_row(buf);
reenable_binlog(thd);
@@ -4528,7 +4590,6 @@ int ha_partition::index_init(uint inx, bool sorted)
file= m_file;
do
{
- /* TODO RONM: Change to index_init() when code is stable */
if (bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
if ((error= (*file)->ha_index_init(inx, sorted)))
{
@@ -6981,6 +7042,57 @@ enum row_type ha_partition::get_row_type() const
}
+void ha_partition::append_row_to_str(String &str)
+{
+ Field **field_ptr;
+ const uchar *rec;
+ bool is_rec0= !m_err_rec || m_err_rec == table->record[0];
+ if (is_rec0)
+ rec= table->record[0];
+ else
+ rec= m_err_rec;
+ // If PK, use full PK instead of full part field array!
+ if (table->s->primary_key != MAX_KEY)
+ {
+ KEY *key= table->key_info + table->s->primary_key;
+ KEY_PART_INFO *key_part= key->key_part;
+ KEY_PART_INFO *key_part_end= key_part + key->key_parts;
+ if (!is_rec0)
+ set_key_field_ptr(key, rec, table->record[0]);
+ for (; key_part != key_part_end; key_part++)
+ {
+ Field *field= key_part->field;
+ str.append(" ");
+ str.append(field->field_name);
+ str.append(":");
+ field_unpack(&str, field, rec, 0, false);
+ }
+ if (!is_rec0)
+ set_key_field_ptr(key, table->record[0], rec);
+ }
+ else
+ {
+ if (!is_rec0)
+ set_field_ptr(m_part_info->full_part_field_array, rec,
+ table->record[0]);
+ /* No primary key, use full partition field array. */
+ for (field_ptr= m_part_info->full_part_field_array;
+ *field_ptr;
+ field_ptr++)
+ {
+ Field *field= *field_ptr;
+ str.append(" ");
+ str.append(field->field_name);
+ str.append(":");
+ field_unpack(&str, field, rec, 0, false);
+ }
+ if (!is_rec0)
+ set_field_ptr(m_part_info->full_part_field_array, table->record[0],
+ rec);
+ }
+}
+
+
void ha_partition::print_error(int error, myf errflag)
{
THD *thd= ha_thd();
@@ -6989,24 +7101,72 @@ void ha_partition::print_error(int error, myf errflag)
/* Should probably look for my own errors first */
DBUG_PRINT("enter", ("error: %d", error));
- if ((error == HA_ERR_NO_PARTITION_FOUND) &&
- ! (thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
- m_part_info->print_no_partition_found(table);
- else
+ if (error == HA_ERR_NO_PARTITION_FOUND)
{
- /* In case m_file has not been initialized, like in bug#42438 */
- if (m_file)
+ switch(thd_sql_command(thd))
{
- if (m_last_part >= m_tot_parts)
+ case SQLCOM_DELETE:
+ case SQLCOM_DELETE_MULTI:
+ case SQLCOM_UPDATE:
+ case SQLCOM_UPDATE_MULTI:
+ if (m_err_rec)
{
- DBUG_ASSERT(0);
- m_last_part= 0;
+ uint max_length;
+ char buf[MAX_KEY_LENGTH];
+ const char *msg= "Found a row in wrong partition (";
+ String str(buf,sizeof(buf),system_charset_info);
+ uint32 part_id;
+ /* Should only happen on DELETE or UPDATE! */
+ str.length(0);
+ str.append_ulonglong(m_last_part);
+ str.append(" != ");
+ if (!get_part_for_delete(m_err_rec, m_rec0, m_part_info, &part_id))
+ {
+ str.append_ulonglong(part_id);
+ }
+ str.append(")");
+ append_row_to_str(str);
+ /* Log this error, so the DBA can notice it and fix it! */
+ sql_print_error("Table '%-192s' corrupted: %s%s\n"
+ "Please CHECK and REPAIR the table!",
+ table->s->table_name.str, msg, str.c_ptr_safe());
+
+ max_length= (MYSQL_ERRMSG_SIZE-
+ (uint) strlen(msg));
+ if (str.length() >= max_length)
+ {
+ str.length(max_length-4);
+ str.append(STRING_WITH_LEN("..."));
+ }
+ my_printf_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, "%s%s", MYF(0),
+ msg, str.c_ptr_safe());
+ m_err_rec= NULL;
+ DBUG_VOID_RETURN;
+ }
+ default:
+ {
+ if (!(thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
+ {
+ m_part_info->print_no_partition_found(table);
+ DBUG_VOID_RETURN;
+ }
}
- m_file[m_last_part]->print_error(error, errflag);
+ /* fall through to generic error handling. */
}
- else
- handler::print_error(error, errflag);
}
+
+ /* In case m_file has not been initialized, like in bug#42438 */
+ if (m_file)
+ {
+ if (m_last_part >= m_tot_parts)
+ {
+ DBUG_ASSERT(0);
+ m_last_part= 0;
+ }
+ m_file[m_last_part]->print_error(error, errflag);
+ }
+ else
+ handler::print_error(error, errflag);
DBUG_VOID_RETURN;
}
@@ -7700,6 +7860,288 @@ int ha_partition::indexes_are_disabled(void)
}
+/**
+ Check/fix misplaced rows.
+
+ @param read_part_id Partition to check/fix.
+ @param repair If true, move misplaced rows to correct partition.
+
+ @return Operation status.
+ @retval 0 Success
+ @retval != 0 Error
+*/
+
+int ha_partition::check_misplaced_rows(uint read_part_id, bool repair)
+{
+ int result= 0;
+ uint32 correct_part_id;
+ longlong func_value;
+ longlong num_misplaced_rows= 0;
+
+ DBUG_ENTER("ha_partition::check_misplaced_rows");
+
+ DBUG_ASSERT(m_file);
+
+ if (repair)
+ {
+ /* We must read the full row, if we need to move it! */
+ bitmap_set_all(table->read_set);
+ bitmap_set_all(table->write_set);
+ }
+ else
+ {
+ /* Only need to read the partitioning fields. */
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
+ }
+
+ if ((result= m_file[read_part_id]->ha_rnd_init(1)))
+ DBUG_RETURN(result);
+
+ while (true)
+ {
+ if ((result= m_file[read_part_id]->rnd_next(m_rec0)))
+ {
+ if (result == HA_ERR_RECORD_DELETED)
+ continue;
+ if (result != HA_ERR_END_OF_FILE)
+ break;
+
+ if (num_misplaced_rows > 0)
+ {
+ print_admin_msg(ha_thd(), "warning", table_share->db.str, table->alias,
+ opt_op_name[REPAIR_PARTS],
+ "Moved %lld misplaced rows",
+ num_misplaced_rows);
+ }
+ /* End-of-file reached, all rows are now OK, reset result and break. */
+ result= 0;
+ break;
+ }
+
+ result= m_part_info->get_partition_id(m_part_info, &correct_part_id,
+ &func_value);
+ if (result)
+ break;
+
+ if (correct_part_id != read_part_id)
+ {
+ num_misplaced_rows++;
+ if (!repair)
+ {
+ /* Check. */
+ print_admin_msg(ha_thd(), "error", table_share->db.str, table->alias,
+ opt_op_name[CHECK_PARTS],
+ "Found a misplaced row");
+ /* Break on first misplaced row! */
+ result= HA_ADMIN_NEEDS_UPGRADE;
+ break;
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Moving row from partition %d to %d",
+ read_part_id, correct_part_id));
+
+ /*
+ Insert row into correct partition. Notice that there are no commit
+ for every N row, so the repair will be one large transaction!
+ */
+ if ((result= m_file[correct_part_id]->ha_write_row(m_rec0)))
+ {
+ /*
+ We have failed to insert a row, it might have been a duplicate!
+ */
+ char buf[MAX_KEY_LENGTH];
+ String str(buf,sizeof(buf),system_charset_info);
+ str.length(0);
+ if (result == HA_ERR_FOUND_DUPP_KEY)
+ {
+ str.append("Duplicate key found, "
+ "please update or delete the record:\n");
+ result= HA_ADMIN_CORRUPT;
+ }
+ m_err_rec= NULL;
+ append_row_to_str(str);
+
+ /*
+ If the engine supports transactions, the failure will be
+ rollbacked.
+ */
+ if (!m_file[correct_part_id]->has_transactions())
+ {
+ /* Log this error, so the DBA can notice it and fix it! */
+ sql_print_error("Table '%-192s' failed to move/insert a row"
+ " from part %d into part %d:\n%s",
+ table->s->table_name.str,
+ read_part_id,
+ correct_part_id,
+ str.c_ptr_safe());
+ }
+ print_admin_msg(ha_thd(), "error", table_share->db.str, table->alias,
+ opt_op_name[REPAIR_PARTS],
+ "Failed to move/insert a row"
+ " from part %d into part %d:\n%s",
+ read_part_id,
+ correct_part_id,
+ str.c_ptr_safe());
+ break;
+ }
+
+ /* Delete row from wrong partition. */
+ if ((result= m_file[read_part_id]->ha_delete_row(m_rec0)))
+ {
+ if (m_file[correct_part_id]->has_transactions())
+ break;
+ /*
+ We have introduced a duplicate, since we failed to remove it
+ from the wrong partition.
+ */
+ char buf[MAX_KEY_LENGTH];
+ String str(buf,sizeof(buf),system_charset_info);
+ str.length(0);
+ m_err_rec= NULL;
+ append_row_to_str(str);
+
+ /* Log this error, so the DBA can notice it and fix it! */
+ sql_print_error("Table '%-192s': Delete from part %d failed with"
+ " error %d. But it was already inserted into"
+ " part %d, when moving the misplaced row!"
+ "\nPlease manually fix the duplicate row:\n%s",
+ table->s->table_name.str,
+ read_part_id,
+ result,
+ correct_part_id,
+ str.c_ptr_safe());
+ break;
+ }
+ }
+ }
+ }
+
+ int tmp_result= m_file[read_part_id]->ha_rnd_end();
+ DBUG_RETURN(result ? result : tmp_result);
+}
+
+
+#define KEY_PARTITIONING_CHANGED_STR \
+ "KEY () partitioning changed, please run:\nALTER TABLE %s.%s %s"
+
+int ha_partition::check_for_upgrade(HA_CHECK_OPT *check_opt)
+{
+ int error= HA_ADMIN_NEEDS_CHECK;
+ DBUG_ENTER("ha_partition::check_for_upgrade");
+
+ /*
+ This is called even without FOR UPGRADE,
+ if the .frm version is lower than the current version.
+ In that case return that it needs checking!
+ */
+ if (!(check_opt->sql_flags & TT_FOR_UPGRADE))
+ DBUG_RETURN(error);
+
+ /*
+ Partitions will be checked for during their ha_check!
+
+ Check if KEY (sub)partitioning was used and any field's hash calculation
+ differs from 5.1, see bug#14521864.
+ */
+ if (table->s->mysql_version < 50503 && // 5.1 table (<5.5.3)
+ ((m_part_info->part_type == HASH_PARTITION && // KEY partitioned
+ m_part_info->list_of_part_fields) ||
+ (m_is_sub_partitioned && // KEY subpartitioned
+ m_part_info->list_of_subpart_fields)))
+ {
+ Field **field;
+ if (m_is_sub_partitioned)
+ {
+ field= m_part_info->subpart_field_array;
+ }
+ else
+ {
+ field= m_part_info->part_field_array;
+ }
+ for (; *field; field++)
+ {
+ switch ((*field)->real_type()) {
+ case MYSQL_TYPE_TINY:
+ case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_FLOAT:
+ case MYSQL_TYPE_DOUBLE:
+ case MYSQL_TYPE_NEWDECIMAL:
+ case MYSQL_TYPE_TIMESTAMP:
+ case MYSQL_TYPE_LONGLONG:
+ case MYSQL_TYPE_INT24:
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_YEAR:
+ case MYSQL_TYPE_NEWDATE:
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_SET:
+ {
+ THD *thd= ha_thd();
+ char *part_buf;
+ String db_name, table_name;
+ uint part_buf_len;
+ bool skip_generation= false;
+ partition_info::enum_key_algorithm old_algorithm;
+ old_algorithm= m_part_info->key_algorithm;
+ error= HA_ADMIN_FAILED;
+ append_identifier(ha_thd(), &db_name, table_share->db.str,
+ table_share->db.length);
+ append_identifier(ha_thd(), &table_name, table_share->table_name.str,
+ table_share->table_name.length);
+ if (m_part_info->key_algorithm != partition_info::KEY_ALGORITHM_NONE)
+ {
+ /*
+ Only possible when someone tampered with .frm files,
+ like during tests :)
+ */
+ skip_generation= true;
+ }
+ m_part_info->key_algorithm= partition_info::KEY_ALGORITHM_51;
+ if (skip_generation ||
+ !(part_buf= generate_partition_syntax(m_part_info,
+ &part_buf_len,
+ true,
+ true,
+ NULL,
+ NULL,
+ NULL)) ||
+ /* Also check that the length is smaller than the output field! */
+ (part_buf_len + db_name.length() + table_name.length()) >=
+ (SQL_ADMIN_MSG_TEXT_SIZE -
+ (strlen(KEY_PARTITIONING_CHANGED_STR) - 3)))
+ {
+ print_admin_msg(thd, "error", table_share->db.str, table->alias,
+ opt_op_name[CHECK_PARTS],
+ KEY_PARTITIONING_CHANGED_STR,
+ db_name.c_ptr_safe(), table_name.c_ptr_safe(),
+ "<old partition clause>, but add ALGORITHM = 1"
+ " between 'KEY' and '(' to change the metadata"
+ " without the need of a full table rebuild.");
+ }
+ else
+ {
+ print_admin_msg(thd, "error", table_share->db.str, table->alias,
+ opt_op_name[CHECK_PARTS],
+ KEY_PARTITIONING_CHANGED_STR,
+ db_name.c_ptr_safe(), table_name.c_ptr_safe(),
+ part_buf);
+ }
+ m_part_info->key_algorithm= old_algorithm;
+ DBUG_RETURN(error);
+ }
+ default:
+ /* Not affected! */
+ ;
+ }
+ }
+ }
+
+ DBUG_RETURN(error);
+}
+
+
struct st_mysql_storage_engine partition_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 01b77e3f092..dce59ee9f2d 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -2,7 +2,7 @@
#define HA_PARTITION_INCLUDED
/*
- Copyright (c) 2005, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2005, 2013, Oracle and/or its affiliates.
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
@@ -25,13 +25,15 @@
#include "queues.h" /* QUEUE */
enum partition_keywords
-{
+{
PKW_HASH= 0, PKW_RANGE, PKW_LIST, PKW_KEY, PKW_MAXVALUE, PKW_LINEAR,
- PKW_COLUMNS
+ PKW_COLUMNS, PKW_ALGORITHM
};
#define PARTITION_BYTES_IN_POS 2
-#define PARTITION_ENABLED_TABLE_FLAGS (HA_FILE_BASED | HA_REC_NOT_IN_SEQ)
+#define PARTITION_ENABLED_TABLE_FLAGS (HA_FILE_BASED | \
+ HA_REC_NOT_IN_SEQ | \
+ HA_CAN_REPAIR)
#define PARTITION_DISABLED_TABLE_FLAGS (HA_CAN_GEOMETRY | \
HA_CAN_FULLTEXT | \
HA_DUPLICATE_POS | \
@@ -84,6 +86,7 @@ private:
*/
KEY *m_curr_key_info[3]; // Current index
uchar *m_rec0; // table->record[0]
+ const uchar *m_err_rec; // record which gave error
QUEUE m_queue; // Prio queue used by sorted read
/*
Since the partition handler is a handler on top of other handlers, it
@@ -1087,9 +1090,18 @@ public:
virtual bool check_and_repair(THD *thd);
virtual bool auto_repair(int error) const;
virtual bool is_crashed() const;
+ virtual int check_for_upgrade(HA_CHECK_OPT *check_opt);
private:
int handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, uint flags);
+ int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, uint part_id,
+ uint flag);
+ /**
+ Check if the rows are placed in the correct partition. If the given
+ argument is true, then move the rows to the correct partition.
+ */
+ int check_misplaced_rows(uint read_part_id, bool repair);
+ void append_row_to_str(String &str);
public:
/*
-------------------------------------------------------------------------
diff --git a/sql/handler.cc b/sql/handler.cc
index 2061b92c4e4..660697cd74b 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009-2011 Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, 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
@@ -43,6 +43,7 @@
#include "myisam.h"
#include "probes_mysql.h"
#include "debug_sync.h" // DEBUG_SYNC
+#include "sql_audit.h"
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
@@ -275,7 +276,8 @@ handler *get_ha_partition(partition_info *part_info)
}
else
{
- my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(ha_partition)));
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR),
+ static_cast<int>(sizeof(ha_partition)));
}
DBUG_RETURN(((handler*) partition));
}
@@ -2193,7 +2195,7 @@ handle_condition(THD *,
{
*cond_hdl= NULL;
/* Grab the error message */
- strmake(buff, msg, sizeof(buff)-1);
+ strmake_buf(buff, msg);
return TRUE;
}
@@ -3552,6 +3554,9 @@ int handler::ha_check(THD *thd, HA_CHECK_OPT *check_opt)
}
if ((error= check(thd, check_opt)))
return error;
+ /* Skip updating frm version if not main handler. */
+ if (table->file != this)
+ return error;
return update_frm_version(table);
}
@@ -3804,7 +3809,6 @@ int
handler::ha_delete_table(const char *name)
{
mark_trx_read_write();
-
return delete_table(name);
}
@@ -3837,8 +3841,11 @@ int
handler::ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info)
{
mark_trx_read_write();
-
- return create(name, form, info);
+ int error= create(name, form, info);
+ if (!error &&
+ !(info->options & (HA_LEX_CREATE_TMP_TABLE | HA_CREATE_TMP_ALTER)))
+ mysql_audit_create_table(form);
+ return error;
}
@@ -5333,7 +5340,11 @@ int handler::ha_external_lock(THD *thd, int lock_type)
int error= external_lock(thd, lock_type);
if (error == 0)
+ {
cached_table_flags= table_flags();
+ if (table_share->tmp_table == NO_TMP_TABLE)
+ mysql_audit_external_lock(thd, table_share, lock_type);
+ }
if (MYSQL_HANDLER_RDLOCK_DONE_ENABLED() ||
MYSQL_HANDLER_WRLOCK_DONE_ENABLED() ||
@@ -5388,6 +5399,8 @@ int handler::ha_write_row(uchar *buf)
Log_func *log_func= Write_rows_log_event::binlog_row_logging_function;
DBUG_ENTER("handler::ha_write_row");
DEBUG_SYNC_C("ha_write_row_start");
+ DBUG_EXECUTE_IF("inject_error_ha_write_row",
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR); );
MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
@@ -5416,6 +5429,7 @@ int handler::ha_update_row(const uchar *old_data, uchar *new_data)
(and the old record is in record[1]).
*/
DBUG_ASSERT(new_data == table->record[0]);
+ DBUG_ASSERT(old_data == table->record[1]);
MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
@@ -5435,6 +5449,13 @@ int handler::ha_delete_row(const uchar *buf)
{
int error;
Log_func *log_func= Delete_rows_log_event::binlog_row_logging_function;
+ /*
+ Normally table->record[0] is used, but sometimes table->record[1] is used.
+ */
+ DBUG_ASSERT(buf == table->record[0] ||
+ buf == table->record[1]);
+ DBUG_EXECUTE_IF("inject_error_ha_delete_row",
+ return HA_ERR_INTERNAL_ERROR; );
MYSQL_DELETE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
diff --git a/sql/handler.h b/sql/handler.h
index 18639b6a8a4..c6a044085b0 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -286,7 +286,7 @@
(yes, the sum is deliberately inaccurate)
TODO remove the limit, use dynarrays
*/
-#define MAX_HA 15
+#define MAX_HA 64
/*
Use this instead of 0 as the initial value for the slot number of
@@ -319,6 +319,7 @@
#define HA_LEX_CREATE_TMP_TABLE 1
#define HA_LEX_CREATE_IF_NOT_EXISTS 2
#define HA_LEX_CREATE_TABLE_LIKE 4
+#define HA_CREATE_TMP_ALTER 8
#define HA_MAX_REC_LENGTH 65535
/* Table caching type */
diff --git a/sql/item.cc b/sql/item.cc
index 90a652e92c7..3bd489dbb3f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -513,7 +513,7 @@ Item::Item(THD *thd, Item *item):
with_field(item->with_field),
fixed(item->fixed),
is_autogenerated_name(item->is_autogenerated_name),
- with_subselect(item->with_subselect),
+ with_subselect(item->has_subquery()),
collation(item->collation),
cmp_context(item->cmp_context)
{
@@ -4418,7 +4418,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
if (db_name && lower_case_table_names)
{
/* Convert database to lower case for comparison */
- strmake(name_buff, db_name, sizeof(name_buff)-1);
+ strmake_buf(name_buff, db_name);
my_casedn_str(files_charset_info, name_buff);
db_name= name_buff;
}
@@ -6130,17 +6130,8 @@ inline uint char_val(char X)
X-'a'+10);
}
-Item_hex_string::Item_hex_string()
-{
- hex_string_init("", 0);
-}
-
-Item_hex_string::Item_hex_string(const char *str, uint str_length)
-{
- hex_string_init(str, str_length);
-}
-void Item_hex_string::hex_string_init(const char *str, uint str_length)
+void Item_hex_constant::hex_string_init(const char *str, uint str_length)
{
max_length=(str_length+1)/2;
char *ptr=(char*) sql_alloc(max_length+1);
@@ -6164,7 +6155,7 @@ void Item_hex_string::hex_string_init(const char *str, uint str_length)
unsigned_flag= 1;
}
-longlong Item_hex_string::val_int()
+longlong Item_hex_hybrid::val_int()
{
// following assert is redundant, because fixed=1 assigned in constructor
DBUG_ASSERT(fixed == 1);
@@ -6178,17 +6169,7 @@ longlong Item_hex_string::val_int()
}
-my_decimal *Item_hex_string::val_decimal(my_decimal *decimal_value)
-{
- // following assert is redundant, because fixed=1 assigned in constructor
- DBUG_ASSERT(fixed == 1);
- ulonglong value= (ulonglong)val_int();
- int2my_decimal(E_DEC_FATAL_ERROR, value, TRUE, decimal_value);
- return (decimal_value);
-}
-
-
-int Item_hex_string::save_in_field(Field *field, bool no_conversions)
+int Item_hex_hybrid::save_in_field(Field *field, bool no_conversions)
{
field->set_notnull();
if (field->result_type() == STRING_RESULT)
@@ -6221,22 +6202,27 @@ warn:
}
-void Item_hex_string::print(String *str, enum_query_type query_type)
+void Item_hex_hybrid::print(String *str, enum_query_type query_type)
{
- char *end= (char*) str_value.ptr() + str_value.length(),
- *ptr= end - min(str_value.length(), sizeof(longlong));
+ uint32 len= min(str_value.length(), sizeof(longlong));
+ const char *ptr= str_value.ptr() + str_value.length() - len;
str->append("0x");
- for (; ptr != end ; ptr++)
- {
- str->append(_dig_vec_lower[((uchar) *ptr) >> 4]);
- str->append(_dig_vec_lower[((uchar) *ptr) & 0x0F]);
- }
+ str->append_hex(ptr, len);
}
-bool Item_hex_string::eq(const Item *arg, bool binary_cmp) const
+void Item_hex_string::print(String *str, enum_query_type query_type)
{
- if (arg->basic_const_item() && arg->type() == type())
+ str->append("X'");
+ str->append_hex(str_value.ptr(), str_value.length());
+ str->append("'");
+}
+
+
+bool Item_hex_constant::eq(const Item *arg, bool binary_cmp) const
+{
+ if (arg->basic_const_item() && arg->type() == type() &&
+ arg->cast_to_int_type() == cast_to_int_type())
{
if (binary_cmp)
return !stringcmp(&str_value, &arg->str_value);
@@ -6246,7 +6232,7 @@ bool Item_hex_string::eq(const Item *arg, bool binary_cmp) const
}
-Item *Item_hex_string::safe_charset_converter(CHARSET_INFO *tocs)
+Item *Item_hex_constant::safe_charset_converter(CHARSET_INFO *tocs)
{
Item_string *conv;
String tmp, *str= val_str(&tmp);
diff --git a/sql/item.h b/sql/item.h
index d8ae051b4b5..49850fbcc97 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1,8 +1,8 @@
#ifndef SQL_ITEM_INCLUDED
#define SQL_ITEM_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013 Monty Program Ab
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013 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
@@ -384,6 +384,12 @@ struct Name_resolution_context: Sql_alloc
{
(*error_processor)(thd, error_processor_data);
}
+ st_select_lex *outer_select()
+ {
+ return (outer_context ?
+ outer_context->select_lex :
+ NULL);
+ }
};
@@ -1466,6 +1472,12 @@ public:
Return TRUE if the item points to a column of an outer-joined table.
*/
virtual bool is_outer_field() const { DBUG_ASSERT(fixed); return FALSE; }
+
+ /**
+ Checks if this item or any of its decendents contains a subquery.
+ */
+ virtual bool has_subquery() const { return with_subselect; }
+
Item* set_expr_cache(THD *thd);
virtual Item_equal *get_item_equal() { return NULL; }
@@ -2755,36 +2767,112 @@ public:
};
-class Item_hex_string: public Item_basic_constant
+/**
+ Item_hex_constant -- a common class for hex literals: X'HHHH' and 0xHHHH
+*/
+class Item_hex_constant: public Item_basic_constant
{
+private:
+ void hex_string_init(const char *str, uint str_length);
public:
- Item_hex_string();
- Item_hex_string(const char *str,uint str_length);
+ Item_hex_constant()
+ {
+ hex_string_init("", 0);
+ }
+ Item_hex_constant(const char *str, uint str_length)
+ {
+ hex_string_init(str, str_length);
+ }
enum Type type() const { return VARBIN_ITEM; }
+ enum Item_result result_type () const { return STRING_RESULT; }
+ enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
+ virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
+ bool check_vcol_func_processor(uchar *arg) { return FALSE;}
+ bool basic_const_item() const { return 1; }
+ bool eq(const Item *item, bool binary_cmp) const;
+ String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; }
+};
+
+
+/**
+ Item_hex_hybrid -- is a class implementing 0xHHHH literals, e.g.:
+ SELECT 0x3132;
+ They can behave as numbers and as strings depending on context.
+*/
+class Item_hex_hybrid: public Item_hex_constant
+{
+public:
+ Item_hex_hybrid(): Item_hex_constant() {}
+ Item_hex_hybrid(const char *str, uint str_length):
+ Item_hex_constant(str, str_length) {}
double val_real()
{
DBUG_ASSERT(fixed == 1);
- return (double) (ulonglong) Item_hex_string::val_int();
+ return (double) (ulonglong) Item_hex_hybrid::val_int();
}
longlong val_int();
- bool basic_const_item() const { return 1; }
- String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; }
- my_decimal *val_decimal(my_decimal *);
+ my_decimal *val_decimal(my_decimal *decimal_value)
+ {
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
+ ulonglong value= (ulonglong) Item_hex_hybrid::val_int();
+ int2my_decimal(E_DEC_FATAL_ERROR, value, TRUE, decimal_value);
+ return decimal_value;
+ }
int save_in_field(Field *field, bool no_conversions);
- enum Item_result result_type () const { return STRING_RESULT; }
enum Item_result cast_to_int_type() const { return INT_RESULT; }
- enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
- virtual void print(String *str, enum_query_type query_type);
- bool eq(const Item *item, bool binary_cmp) const;
- virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
- bool check_vcol_func_processor(uchar *arg) { return FALSE;}
-private:
- void hex_string_init(const char *str, uint str_length);
+ void print(String *str, enum_query_type query_type);
+};
+
+
+/**
+ Item_hex_string -- is a class implementing X'HHHH' literals, e.g.:
+ SELECT X'3132';
+ Unlike Item_hex_hybrid, X'HHHH' literals behave as strings in all contexts.
+ X'HHHH' are also used in replication of string constants in case of
+ "dangerous" charsets (sjis, cp932, big5, gbk) who can have backslash (0x5C)
+ as the second byte of a multi-byte character, so using '\' escaping for
+ these charsets is not desirable.
+*/
+class Item_hex_string: public Item_hex_constant
+{
+public:
+ Item_hex_string(): Item_hex_constant() {}
+ Item_hex_string(const char *str, uint str_length):
+ Item_hex_constant(str, str_length) {}
+ longlong val_int()
+ {
+ DBUG_ASSERT(fixed == 1);
+ return longlong_from_string_with_check(str_value.charset(),
+ str_value.ptr(),
+ str_value.ptr()+
+ str_value.length());
+ }
+ double val_real()
+ {
+ DBUG_ASSERT(fixed == 1);
+ return double_from_string_with_check(str_value.charset(),
+ str_value.ptr(),
+ str_value.ptr() +
+ str_value.length());
+ }
+ my_decimal *val_decimal(my_decimal *decimal_value)
+ {
+ return val_decimal_from_string(decimal_value);
+ }
+ int save_in_field(Field *field, bool no_conversions)
+ {
+ field->set_notnull();
+ return field->store(str_value.ptr(), str_value.length(),
+ collation.collation);
+ }
+ enum Item_result cast_to_int_type() const { return STRING_RESULT; }
+ void print(String *str, enum_query_type query_type);
};
-class Item_bin_string: public Item_hex_string
+class Item_bin_string: public Item_hex_hybrid
{
public:
Item_bin_string(const char *str,uint str_length);
@@ -2988,6 +3076,14 @@ public:
DBUG_ASSERT(ref);
return (*ref)->is_outer_field();
}
+
+ /**
+ Checks if the item tree that ref points to contains a subquery.
+ */
+ virtual bool has_subquery() const
+ {
+ return (*ref)->has_subquery();
+ }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 7ca85a72cfa..5f62ee946a5 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -4352,7 +4352,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
with_sum_func= with_sum_func || item->with_sum_func;
with_field= with_field || item->with_field;
- with_subselect|= item->with_subselect;
+ with_subselect|= item->has_subquery();
if (item->maybe_null)
maybe_null=1;
}
@@ -5052,7 +5052,7 @@ Item_func_regex::fix_fields(THD *thd, Item **ref)
return TRUE; /* purecov: inspected */
with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func;
with_field= args[0]->with_field || args[1]->with_field;
- with_subselect|= args[0]->with_subselect | args[1]->with_subselect;
+ with_subselect= args[0]->has_subquery() || args[1]->has_subquery();
max_length= 1;
decimals= 0;
diff --git a/sql/item_func.cc b/sql/item_func.cc
index aa574eabf8c..a064c8bbde2 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -225,7 +225,7 @@ Item_func::fix_fields(THD *thd, Item **ref)
with_field= with_field || item->with_field;
used_tables_cache|= item->used_tables();
const_item_cache&= item->const_item();
- with_subselect|= item->with_subselect;
+ with_subselect|= item->has_subquery();
}
}
fix_length_and_dec();
@@ -5469,7 +5469,7 @@ enum Item_result Item_func_get_user_var::result_type() const
void Item_func_get_user_var::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN("(@"));
- str->append(name.str,name.length);
+ append_identifier(current_thd, str, name.str, name.length);
str->append(')');
}
diff --git a/sql/item_func.h b/sql/item_func.h
index ab6ec706248..bdf91810d81 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -552,12 +552,18 @@ public:
class Item_func_signed :public Item_int_func
{
public:
- Item_func_signed(Item *a) :Item_int_func(a) {}
+ Item_func_signed(Item *a) :Item_int_func(a)
+ {
+ unsigned_flag= 0;
+ }
const char *func_name() const { return "cast_as_signed"; }
longlong val_int();
longlong val_int_from_str(int *error);
void fix_length_and_dec()
- { fix_char_length(args[0]->max_char_length()); unsigned_flag=0; }
+ {
+ fix_char_length(min(args[0]->max_char_length(),
+ MY_INT64_NUM_DECIMAL_DIGITS));
+ }
virtual void print(String *str, enum_query_type query_type);
uint decimal_precision() const { return args[0]->decimal_precision(); }
};
@@ -566,14 +572,11 @@ public:
class Item_func_unsigned :public Item_func_signed
{
public:
- Item_func_unsigned(Item *a) :Item_func_signed(a) {}
- const char *func_name() const { return "cast_as_unsigned"; }
- void fix_length_and_dec()
+ Item_func_unsigned(Item *a) :Item_func_signed(a)
{
- fix_char_length(min(args[0]->max_char_length(),
- DECIMAL_MAX_PRECISION + 2));
- unsigned_flag=1;
+ unsigned_flag= 1;
}
+ const char *func_name() const { return "cast_as_unsigned"; }
longlong val_int();
virtual void print(String *str, enum_query_type query_type);
};
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 15b1cedf346..7401372eb33 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -62,6 +62,8 @@ C_MODE_END
#include <sql_repl.h>
#include "sql_statistics.h"
+size_t username_char_length= 16;
+
/**
@todo Remove this. It is not safe to use a shared String object.
*/
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 169da25e826..9daddf94c0b 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -25,6 +25,8 @@
#pragma interface /* gcc class implementation */
#endif
+extern size_t username_char_length;
+
class MY_LOCALE;
class Item_str_func :public Item_func
@@ -510,8 +512,8 @@ public:
bool fix_fields(THD *thd, Item **ref);
void fix_length_and_dec()
{
- max_length= (USERNAME_LENGTH +
- (HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN);
+ max_length= (username_char_length +
+ HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN;
}
const char *func_name() const { return "user"; }
const char *fully_qualified_func_name() const { return "user()"; }
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 03afd1a4365..d441653c82b 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -65,7 +65,15 @@ ulonglong Item_sum::ram_limitation(THD *thd)
bool Item_sum::init_sum_func_check(THD *thd)
{
- if (!thd->lex->allow_sum_func)
+ SELECT_LEX *curr_sel= thd->lex->current_select;
+ if (!curr_sel->name_visibility_map)
+ {
+ for (SELECT_LEX *sl= curr_sel; sl; sl= sl->context.outer_select())
+ {
+ curr_sel->name_visibility_map|= (1 << sl-> nest_level);
+ }
+ }
+ if (!(thd->lex->allow_sum_func & curr_sel->name_visibility_map))
{
my_message(ER_INVALID_GROUP_FUNC_USE, ER(ER_INVALID_GROUP_FUNC_USE),
MYF(0));
@@ -136,8 +144,11 @@ bool Item_sum::init_sum_func_check(THD *thd)
bool Item_sum::check_sum_func(THD *thd, Item **ref)
{
+ SELECT_LEX *curr_sel= thd->lex->current_select;
+ nesting_map allow_sum_func= (thd->lex->allow_sum_func &
+ curr_sel->name_visibility_map);
bool invalid= FALSE;
- nesting_map allow_sum_func= thd->lex->allow_sum_func;
+ DBUG_ASSERT(curr_sel->name_visibility_map); // should be set already
/*
The value of max_arg_level is updated if an argument of the set function
contains a column reference resolved against a subquery whose level is
@@ -172,7 +183,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
if (!invalid && aggr_level < 0)
{
aggr_level= nest_level;
- aggr_sel= thd->lex->current_select;
+ aggr_sel= curr_sel;
}
/*
By this moment we either found a subquery where the set function is
@@ -309,9 +320,9 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref)
{
SELECT_LEX *sl;
nesting_map allow_sum_func= thd->lex->allow_sum_func;
- for (sl= thd->lex->current_select->master_unit()->outer_select() ;
+ for (sl= thd->lex->current_select->context.outer_select() ;
sl && sl->nest_level > max_arg_level;
- sl= sl->master_unit()->outer_select() )
+ sl= sl->context.outer_select())
{
if (aggr_level < 0 &&
(allow_sum_func & ((nesting_map)1 << sl->nest_level)))
diff --git a/sql/key.cc b/sql/key.cc
index dd7818119c8..0d3db2d5bf5 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -335,6 +335,70 @@ bool key_cmp_if_same(TABLE *table,const uchar *key,uint idx,uint key_length)
return 0;
}
+
+/**
+ Unpack a field and append it.
+
+ @param[inout] to String to append the field contents to.
+ @param field Field to unpack.
+ @param rec Record which contains the field data.
+ @param max_length Maximum length of field to unpack
+ or 0 for unlimited.
+ @param prefix_key The field is used as a prefix key.
+*/
+
+void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
+ bool prefix_key)
+{
+ String tmp;
+ DBUG_ENTER("field_unpack");
+ if (!max_length)
+ max_length= field->pack_length();
+ if (field)
+ {
+ if (field->is_null())
+ {
+ to->append(STRING_WITH_LEN("NULL"));
+ DBUG_VOID_RETURN;
+ }
+ CHARSET_INFO *cs= field->charset();
+ field->val_str(&tmp);
+ /*
+ For BINARY(N) strip trailing zeroes to make
+ the error message nice-looking
+ */
+ if (field->binary() && field->type() == MYSQL_TYPE_STRING && tmp.length())
+ {
+ const char *tmp_end= tmp.ptr() + tmp.length();
+ while (tmp_end > tmp.ptr() && !*--tmp_end) ;
+ tmp.length(tmp_end - tmp.ptr() + 1);
+ }
+ if (cs->mbmaxlen > 1 && prefix_key)
+ {
+ /*
+ Prefix key, multi-byte charset.
+ For the columns of type CHAR(N), the above val_str()
+ call will return exactly "key_part->length" bytes,
+ which can break a multi-byte characters in the middle.
+ Align, returning not more than "char_length" characters.
+ */
+ uint charpos, char_length= max_length / cs->mbmaxlen;
+ if ((charpos= my_charpos(cs, tmp.ptr(),
+ tmp.ptr() + tmp.length(),
+ char_length)) < tmp.length())
+ tmp.length(charpos);
+ }
+ if (max_length < field->pack_length())
+ tmp.length(min(tmp.length(),max_length));
+ ErrConvString err(&tmp);
+ to->append(err.ptr());
+ }
+ else
+ to->append(STRING_WITH_LEN("???"));
+ DBUG_VOID_RETURN;
+}
+
+
/*
unpack key-fields from record to some buffer.
@@ -352,8 +416,6 @@ bool key_cmp_if_same(TABLE *table,const uchar *key,uint idx,uint key_length)
void key_unpack(String *to,TABLE *table,uint idx)
{
KEY_PART_INFO *key_part,*key_part_end;
- Field *field;
- String tmp;
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
DBUG_ENTER("key_unpack");
@@ -369,47 +431,13 @@ void key_unpack(String *to,TABLE *table,uint idx)
{
if (table->record[0][key_part->null_offset] & key_part->null_bit)
{
- to->append(STRING_WITH_LEN("NULL"));
- continue;
- }
- }
- if ((field=key_part->field))
- {
- CHARSET_INFO *cs= field->charset();
- field->val_str(&tmp);
- /*
- For BINARY(N) strip trailing zeroes to make
- the error message nice-looking
- */
- if (field->binary() && field->type() == MYSQL_TYPE_STRING && tmp.length())
- {
- const char *tmp_end= tmp.ptr() + tmp.length();
- while (tmp_end > tmp.ptr() && !*--tmp_end) ;
- tmp.length(tmp_end - tmp.ptr() + 1);
- }
- if (cs->mbmaxlen > 1 && (key_part->key_part_flag & HA_PART_KEY_SEG))
- {
- /*
- Prefix key, multi-byte charset.
- For the columns of type CHAR(N), the above val_str()
- call will return exactly "key_part->length" bytes,
- which can break a multi-byte characters in the middle.
- Align, returning not more than "char_length" characters.
- */
- uint charpos, char_length= key_part->length / cs->mbmaxlen;
- if ((charpos= my_charpos(cs, tmp.ptr(),
- tmp.ptr() + tmp.length(),
- char_length)) < tmp.length())
- tmp.length(charpos);
+ to->append(STRING_WITH_LEN("NULL"));
+ continue;
}
- if (key_part->length < field->pack_length())
- tmp.length(min(tmp.length(),key_part->length));
- ErrConvString err(&tmp);
- to->append(err.ptr());
}
- else
- to->append(STRING_WITH_LEN("???"));
- }
+ field_unpack(to, key_part->field, table->record[0], key_part->length,
+ test(key_part->key_part_flag & HA_PART_KEY_SEG));
+ }
dbug_tmp_restore_column_map(table->read_set, old_map);
DBUG_VOID_RETURN;
}
diff --git a/sql/key.h b/sql/key.h
index 8bf6f88fa04..0eeda58cd17 100644
--- a/sql/key.h
+++ b/sql/key.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -33,6 +33,8 @@ void key_restore(uchar *to_record, uchar *from_key, KEY *key_info,
uint key_length);
bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
void key_unpack(String *to,TABLE *form,uint index);
+void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
+ bool prefix_key);
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key);
diff --git a/sql/log.cc b/sql/log.cc
index c3ea089af69..19fc3cc7b6f 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -186,7 +186,7 @@ Silence_log_table_errors::handle_condition(THD *,
MYSQL_ERROR ** cond_hdl)
{
*cond_hdl= NULL;
- strmake(m_message, msg, sizeof(m_message)-1);
+ strmake_buf(m_message, msg);
return TRUE;
}
@@ -3372,8 +3372,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
mysql_file_sync(log_file.file, MYF(MY_WME|MY_SYNC_FILESIZE)))
goto err;
mysql_mutex_lock(&LOCK_commit_ordered);
- strmake(last_commit_pos_file, log_file_name,
- sizeof(last_commit_pos_file)-1);
+ strmake_buf(last_commit_pos_file, log_file_name);
last_commit_pos_offset= my_b_tell(&log_file);
mysql_mutex_unlock(&LOCK_commit_ordered);
@@ -3461,7 +3460,7 @@ int MYSQL_BIN_LOG::get_current_log(LOG_INFO* linfo)
int MYSQL_BIN_LOG::raw_get_current_log(LOG_INFO* linfo)
{
- strmake(linfo->log_file_name, log_file_name, sizeof(linfo->log_file_name)-1);
+ strmake_buf(linfo->log_file_name, log_file_name);
linfo->pos = my_b_tell(&log_file);
return 0;
}
@@ -3982,8 +3981,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
Reset rli's coordinates to the current log.
*/
rli->event_relay_log_pos= BIN_LOG_HEADER_SIZE;
- strmake(rli->event_relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->event_relay_log_name)-1);
+ strmake_buf(rli->event_relay_log_name,rli->linfo.log_file_name);
/*
If we removed the rli->group_relay_log_name file,
@@ -3993,8 +3991,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
if (included)
{
rli->group_relay_log_pos = BIN_LOG_HEADER_SIZE;
- strmake(rli->group_relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->group_relay_log_name)-1);
+ strmake_buf(rli->group_relay_log_name,rli->linfo.log_file_name);
rli->notify_group_relay_log_name_update();
}
@@ -4502,9 +4499,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
else
{
if (stat_area.st_mtime < purge_time)
- strmake(to_log,
- log_info.log_file_name,
- sizeof(log_info.log_file_name) - 1);
+ strmake_buf(to_log, log_info.log_file_name);
else
break;
}
@@ -5146,8 +5141,7 @@ binlog_start_consistent_snapshot(handlerton *hton, THD *thd)
binlog_cache_mngr *const cache_mngr= thd->binlog_setup_trx_data();
/* Server layer calls us with LOCK_commit_ordered locked, so this is safe. */
- strmake(cache_mngr->last_commit_pos_file, mysql_bin_log.last_commit_pos_file,
- sizeof(cache_mngr->last_commit_pos_file)-1);
+ strmake_buf(cache_mngr->last_commit_pos_file, mysql_bin_log.last_commit_pos_file);
cache_mngr->last_commit_pos_offset= mysql_bin_log.last_commit_pos_offset;
trans_register_ha(thd, TRUE, hton);
@@ -6729,8 +6723,8 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
if ((current->error= write_transaction_or_stmt(current)))
current->commit_errno= errno;
- strmake(cache_mngr->last_commit_pos_file, log_file_name,
- sizeof(cache_mngr->last_commit_pos_file)-1);
+
+ strmake_buf(cache_mngr->last_commit_pos_file, log_file_name);
commit_offset= my_b_write_tell(&log_file);
cache_mngr->last_commit_pos_offset= commit_offset;
if (cache_mngr->using_xa && cache_mngr->xa_xid)
@@ -8250,7 +8244,7 @@ int TC_LOG_BINLOG::open(const char *opt_name)
do
{
- strmake(log_name, log_info.log_file_name, sizeof(log_name)-1);
+ strmake_buf(log_name, log_info.log_file_name);
} while (!(error= find_next_log(&log_info, 1)));
if (error != LOG_INFO_EOF)
@@ -8976,7 +8970,7 @@ static void
set_binlog_snapshot_file(const char *src)
{
int dir_len = dirname_length(src);
- strmake(binlog_snapshot_file, src + dir_len, sizeof(binlog_snapshot_file)-1);
+ strmake_buf(binlog_snapshot_file, src + dir_len);
}
/*
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 0a21ae6d279..3076cbb1766 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -672,16 +672,18 @@ static inline int read_str(const char **buf, const char *buf_end,
/**
- Transforms a string into "" or its expression in 0x... form.
+ Transforms a string into "" or its expression in X'HHHH' form.
*/
char *str_to_hex(char *to, const char *from, uint len)
{
if (len)
{
- *to++= '0';
- *to++= 'x';
+ *to++= 'X';
+ *to++= '\'';
to= octet2hex(to, from, len);
+ *to++= '\'';
+ *to= '\0';
}
else
to= strmov(to, "\"\"");
@@ -702,7 +704,7 @@ append_query_string(THD *thd, CHARSET_INFO *csinfo,
{
char *beg, *ptr;
uint32 const orig_len= to->length();
- if (to->reserve(orig_len + from->length()*2+3))
+ if (to->reserve(orig_len + from->length() * 2 + 4))
return 1;
beg= (char*) to->ptr() + to->length();
@@ -1270,7 +1272,9 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
int Log_event::read_log_event(IO_CACHE* file, String* packet,
mysql_mutex_t* log_lock,
- uint8 checksum_alg_arg)
+ uint8 checksum_alg_arg,
+ const char *log_file_name_arg,
+ bool* is_binlog_active)
{
ulong data_len;
int result=0;
@@ -1280,6 +1284,10 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
if (log_lock)
mysql_mutex_lock(log_lock);
+
+ if (log_file_name_arg)
+ *is_binlog_active= mysql_bin_log.is_active(log_file_name_arg);
+
if (my_b_read(file, (uchar*) buf, sizeof(buf)))
{
/*
@@ -7048,7 +7056,7 @@ void User_var_log_event::pack_info(THD *thd, Protocol* protocol)
buf.append(" "))
return;
old_len= buf.length();
- if (buf.reserve(old_len + val_len*2 + 2 + sizeof(" COLLATE ") +
+ if (buf.reserve(old_len + val_len * 2 + 3 + sizeof(" COLLATE ") +
MY_CS_NAME_SIZE))
return;
beg= const_cast<char *>(buf.ptr()) + old_len;
@@ -7091,10 +7099,9 @@ User_var_log_event(const char* buf, uint event_len,
/*
We don't know yet is_null value, so we must assume that name_len
may have the bigger value possible, is_null= True and there is no
- payload for val.
+ payload for val, or even that name_len is 0.
*/
- if (0 == name_len ||
- !valid_buffer_range<uint>(name_len, buf_start, name,
+ if (!valid_buffer_range<uint>(name_len, buf_start, name,
event_len - UV_VAL_IS_NULL))
{
error= true;
@@ -7317,7 +7324,8 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
char *hex_str;
CHARSET_INFO *cs;
- hex_str= (char *)my_malloc(2*val_len+1+2,MYF(MY_WME)); // 2 hex digits / byte
+ // 2 hex digits / byte
+ hex_str= (char *) my_malloc(2 * val_len + 1 + 3, MYF(MY_WME));
if (!hex_str)
return;
str_to_hex(hex_str, val, val_len);
@@ -10255,6 +10263,7 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
table_list->updating= 1;
+ table_list->required_type= FRMTYPE_TABLE;
DBUG_PRINT("debug", ("table: %s is mapped to %u", table_list->table_name, table_list->table_id));
enum_tbl_map_status tblmap_status= check_table_map(rli, table_list);
if (tblmap_status == OK_TO_PROCESS)
diff --git a/sql/log_event.h b/sql/log_event.h
index b5b488f320d..b54e2028ef2 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -1121,8 +1121,35 @@ public:
const Format_description_log_event
*description_event,
my_bool crc_check);
+
+ /**
+ Reads an event from a binlog or relay log. Used by the dump thread
+ this method reads the event into a raw buffer without parsing it.
+
+ @Note If mutex is 0, the read will proceed without mutex.
+
+ @Note If a log name is given than the method will check if the
+ given binlog is still active.
+
+ @param[in] file log file to be read
+ @param[out] packet packet to hold the event
+ @param[in] lock the lock to be used upon read
+ @param[in] log_file_name_arg the log's file name
+ @param[out] is_binlog_active is the current log still active
+
+ @retval 0 success
+ @retval LOG_READ_EOF end of file, nothing was read
+ @retval LOG_READ_BOGUS malformed event
+ @retval LOG_READ_IO io error while reading
+ @retval LOG_READ_MEM packet memory allocation failed
+ @retval LOG_READ_TRUNC only a partial event could be read
+ @retval LOG_READ_TOO_LARGE event too large
+ */
static int read_log_event(IO_CACHE* file, String* packet,
- mysql_mutex_t* log_lock, uint8 checksum_alg_arg);
+ mysql_mutex_t* log_lock,
+ uint8 checksum_alg_arg,
+ const char *log_file_name_arg = NULL,
+ bool* is_binlog_active = NULL);
/*
init_show_field_list() prepares the column names and types for the
output of SHOW BINLOG EVENTS; it is used only by SHOW BINLOG
diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc
index 6e2c6ec07f3..9c1a234241f 100644
--- a/sql/mysql_install_db.cc
+++ b/sql/mysql_install_db.cc
@@ -54,6 +54,7 @@ static char *opt_os_password;
static my_bool opt_default_user;
static my_bool opt_allow_remote_root_access;
static my_bool opt_skip_networking;
+static my_bool opt_verbose_bootstrap;
static my_bool verbose_errors;
@@ -83,6 +84,8 @@ static struct my_option my_long_options[]=
0, 0},
{"silent", 's', "Print less information", &opt_silent,
&opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose-bootstrap", 'o', "Include mysqld bootstrap output",&opt_verbose_bootstrap,
+ &opt_verbose_bootstrap, 0, GET_BOOL, 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}
};
@@ -244,11 +247,12 @@ static char *init_bootstrap_command_line(char *cmdline, size_t size)
get_basedir(basedir, sizeof(basedir), mysqld_path);
my_snprintf(cmdline, size-1,
- "\"\"%s\" --no-defaults --bootstrap"
- " \"--language=%s\\share\\english\""
+ "\"\"%s\" --no-defaults %s --bootstrap"
+ " \"--lc-messages-dir=%s/share\""
" --basedir=. --datadir=. --default-storage-engine=myisam"
" --max_allowed_packet=9M --loose-skip-innodb"
- " --net-buffer-length=16k\"", mysqld_path, basedir);
+ " --net-buffer-length=16k\"", mysqld_path,
+ opt_verbose_bootstrap?"--console":"", basedir );
return cmdline;
}
@@ -377,7 +381,7 @@ static int register_service()
static void clean_directory(const char *dir)
{
char dir2[MAX_PATH+2];
- *(strmake(dir2, dir, MAX_PATH+1)+1)= 0;
+ *(strmake_buf(dir2, dir)+1)= 0;
SHFILEOPSTRUCT fileop;
fileop.hwnd= NULL; /* no status display */
@@ -552,7 +556,9 @@ static int create_db_instance()
/* Do mysqld --bootstrap. */
init_bootstrap_command_line(cmdline, sizeof(cmdline));
- /* verbose("Executing %s", cmdline); */
+
+ if(opt_verbose_bootstrap)
+ printf("Executing %s\n", cmdline);
in= popen(cmdline, "wt");
if (!in)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index eb102696f64..d5af1634a8a 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3321,14 +3321,25 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]);
#ifndef EMBEDDED_LIBRARY
-static
-int
-check_enough_stack_size()
+/**
+ This function is used to check for stack overrun for pathological
+ cases of regular expressions and 'like' expressions.
+ The call to current_thd is quite expensive, so we try to avoid it
+ for the normal cases.
+ The size of each stack frame for the wildcmp() routines is ~128 bytes,
+ so checking *every* recursive call is not necessary.
+ */
+extern "C" int
+check_enough_stack_size(int recurse_level)
{
uchar stack_top;
+ if (recurse_level % 16 != 0)
+ return 0;
- return check_stack_overrun(current_thd, STACK_MIN_SIZE,
- &stack_top);
+ THD *my_thd= current_thd;
+ if (my_thd != NULL)
+ return check_stack_overrun(my_thd, STACK_MIN_SIZE * 2, &stack_top);
+ return 0;
}
#endif
@@ -3627,7 +3638,7 @@ static int init_common_variables()
WideCharToMultiByte(CP_UTF8,0, wtz_name, -1, system_time_zone,
sizeof(system_time_zone) - 1, NULL, NULL);
#else
- strmake(system_time_zone, tz_name, sizeof(system_time_zone)-1);
+ strmake_buf(system_time_zone, tz_name);
#endif /* _WIN32 */
#endif /* HAVE_TZNAME */
@@ -3892,6 +3903,7 @@ static int init_common_variables()
item_init();
#ifndef EMBEDDED_LIBRARY
my_regex_init(&my_charset_latin1, check_enough_stack_size);
+ my_string_stack_guard= check_enough_stack_size;
#else
my_regex_init(&my_charset_latin1, NULL);
#endif
@@ -4404,11 +4416,13 @@ will be ignored as the --log-bin option is not defined.");
}
#endif
+ DBUG_ASSERT(!opt_bin_log || opt_bin_logname);
+
if (opt_bin_log)
{
/* Reports an error and aborts, if the --log-bin's path
is a directory.*/
- if (opt_bin_logname &&
+ if (opt_bin_logname[0] &&
opt_bin_logname[strlen(opt_bin_logname) - 1] == FN_LIBCHAR)
{
sql_print_error("Path '%s' is a directory name, please specify \
@@ -4430,7 +4444,7 @@ a file name for --log-bin-index option", opt_binlog_index_name);
char buf[FN_REFLEN];
const char *ln;
ln= mysql_bin_log.generate_name(opt_bin_logname, "-bin", 1, buf);
- if (!opt_bin_logname && !opt_binlog_index_name)
+ if (!opt_bin_logname[0] && !opt_binlog_index_name)
{
/*
User didn't give us info to name the binlog index file.
@@ -7531,8 +7545,8 @@ static int mysql_init_variables(void)
/* Set directory paths */
mysql_real_data_home_len=
- strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR),
- sizeof(mysql_real_data_home)-1) - mysql_real_data_home;
+ strmake_buf(mysql_real_data_home,
+ get_relative_path(MYSQL_DATADIR)) - mysql_real_data_home;
/* Replication parameters */
master_info_file= (char*) "master.info",
relay_log_info_file= (char*) "relay-log.info";
@@ -7641,7 +7655,7 @@ static int mysql_init_variables(void)
const char *tmpenv;
if (!(tmpenv = getenv("MY_BASEDIR_VERSION")))
tmpenv = DEFAULT_MYSQL_HOME;
- (void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1);
+ strmake_buf(mysql_home, tmpenv);
#endif
return 0;
}
@@ -7680,7 +7694,7 @@ mysqld_get_one_option(int optid,
global_system_variables.tx_isolation= ISO_SERIALIZABLE;
break;
case 'b':
- strmake(mysql_home,argument,sizeof(mysql_home)-1);
+ strmake_buf(mysql_home, argument);
break;
case 'C':
if (default_collation_name == compiled_default_collation_name)
@@ -7691,7 +7705,7 @@ mysqld_get_one_option(int optid,
opt_log=1;
break;
case 'h':
- strmake(mysql_real_data_home,argument, sizeof(mysql_real_data_home)-1);
+ strmake_buf(mysql_real_data_home, argument);
/* Correct pointer set by my_getopt (for embedded library) */
mysql_real_data_home_ptr= mysql_real_data_home;
break;
@@ -7702,7 +7716,7 @@ mysqld_get_one_option(int optid,
sql_print_warning("Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", argument, mysqld_user);
break;
case 'L':
- strmake(lc_messages_dir, argument, sizeof(lc_messages_dir)-1);
+ strmake_buf(lc_messages_dir, argument);
break;
case OPT_BINLOG_FORMAT:
binlog_format_used= true;
@@ -8426,7 +8440,7 @@ static int fix_paths(void)
char *sharedir=get_relative_path(SHAREDIR);
if (test_if_hard_path(sharedir))
- strmake(buff,sharedir,sizeof(buff)-1); /* purecov: tested */
+ strmake_buf(buff, sharedir); /* purecov: tested */
else
strxnmov(buff,sizeof(buff)-1,mysql_home,sharedir,NullS);
convert_dirname(buff,buff,NullS);
@@ -8434,7 +8448,7 @@ static int fix_paths(void)
/* If --character-sets-dir isn't given, use shared library dir */
if (charsets_dir)
- strmake(mysql_charsets_dir, charsets_dir, sizeof(mysql_charsets_dir)-1);
+ strmake_buf(mysql_charsets_dir, charsets_dir);
else
strxnmov(mysql_charsets_dir, sizeof(mysql_charsets_dir)-1, buff,
CHARSET_DIR, NullS);
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 85c9c9fd394..0373c582207 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -7689,6 +7689,14 @@ static SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
param->current_table);
DBUG_ENTER("get_full_func_mm_tree");
+#ifdef HAVE_SPATIAL
+ if (field_item->field->type() == MYSQL_TYPE_GEOMETRY)
+ {
+ /* We have to be able to store all sorts of spatial features here */
+ ((Field_geom*) field_item->field)->geom_type= Field::GEOM_GEOMETRY;
+ }
+#endif /*HAVE_SPATIAL*/
+
for (uint i= 0; i < cond_func->arg_count; i++)
{
Item *arg= cond_func->arguments()[i]->real_item();
@@ -11248,9 +11256,13 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
do
{
+ DBUG_EXECUTE_IF("innodb_quick_report_deadlock",
+ DBUG_SET("+d,innodb_report_deadlock"););
if ((error= quick->get_next()))
{
- quick_with_last_rowid->file->unlock_row();
+ /* On certain errors like deadlock, trx might be rolled back.*/
+ if (!current_thd->transaction_rollback_request)
+ quick_with_last_rowid->file->unlock_row();
DBUG_RETURN(error);
}
quick->file->position(quick->record);
@@ -11276,7 +11288,9 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
quick->file->unlock_row(); /* row not in range; unlock */
if ((error= quick->get_next()))
{
- quick_with_last_rowid->file->unlock_row();
+ /* On certain errors like deadlock, trx might be rolled back.*/
+ if (!current_thd->transaction_rollback_request)
+ quick_with_last_rowid->file->unlock_row();
DBUG_RETURN(error);
}
}
@@ -12161,13 +12175,15 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
NGA1.If in the index I there is a gap between the last GROUP attribute G_k,
and the MIN/MAX attribute C, then NGA must consist of exactly the
index attributes that constitute the gap. As a result there is a
- permutation of NGA that coincides with the gap in the index
- <B_1, ..., B_m>.
+ permutation of NGA, BA=<B_1,...,B_m>, that coincides with the gap
+ in the index.
NGA2.If BA <> {}, then the WHERE clause must contain a conjunction EQ of
equality conditions for all NG_i of the form (NG_i = const) or
(const = NG_i), such that each NG_i is referenced in exactly one
conjunct. Informally, the predicates provide constants to fill the
gap in the index.
+ NGA3.If BA <> {}, there can only be one range. TODO: This is a code
+ limitation and is not strictly needed. See BUG#15947433
WA1. There are no other attributes in the WHERE clause except the ones
referenced in predicates RNG, PA, PC, EQ defined above. Therefore
WA is subset of (GA union NGA union C) for GA,NGA,C that pass the
@@ -12910,6 +12926,74 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item,
/*
+ Get SEL_ARG tree, if any, for the keypart covering non grouping
+ attribute (NGA) field 'nga_field'.
+
+ This function enforces the NGA3 test: If 'keypart_tree' contains a
+ condition for 'nga_field', there can only be one range. In the
+ opposite case, this function returns with error and 'cur_range'
+ should not be used.
+
+ Note that the NGA1 and NGA2 requirements, like whether or not the
+ range predicate for 'nga_field' is equality, is not tested by this
+ function.
+
+ @param[in] nga_field The NGA field we want the SEL_ARG tree for
+ @param[in] keypart_tree Root node of the SEL_ARG* tree for the index
+ @param[out] cur_range The SEL_ARG tree, if any, for the keypart
+ covering field 'keypart_field'
+ @retval true 'keypart_tree' contained a predicate for 'nga_field' but
+ multiple ranges exists. 'cur_range' should not be used.
+ @retval false otherwise
+*/
+
+static bool
+get_sel_arg_for_keypart(Field *nga_field,
+ SEL_ARG *keypart_tree,
+ SEL_ARG **cur_range)
+{
+ if(keypart_tree == NULL)
+ return false;
+ if(keypart_tree->field->eq(nga_field))
+ {
+ /*
+ Enforce NGA3: If a condition for nga_field has been found, only
+ a single range is allowed.
+ */
+ if (keypart_tree->prev || keypart_tree->next)
+ return true; // There are multiple ranges
+
+ *cur_range= keypart_tree;
+ return false;
+ }
+
+ SEL_ARG *found_tree= NULL;
+ SEL_ARG *first_kp= keypart_tree->first();
+
+ for (SEL_ARG *cur_kp= first_kp; cur_kp && !found_tree;
+ cur_kp= cur_kp->next)
+ {
+ if (cur_kp->next_key_part)
+ {
+ if (get_sel_arg_for_keypart(nga_field,
+ cur_kp->next_key_part,
+ &found_tree))
+ return true;
+
+ }
+ /*
+ Enforce NGA3: If a condition for nga_field has been found,only
+ a single range is allowed.
+ */
+ if (found_tree && first_kp->next)
+ return true; // There are multiple ranges
+ }
+ *cur_range= found_tree;
+ return false;
+}
+
+
+/*
Extract a sequence of constants from a conjunction of equality predicates.
SYNOPSIS
@@ -12923,12 +13007,13 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item,
key_infix [out] Infix of constants to be used for index lookup
key_infix_len [out] Lenghth of the infix
first_non_infix_part [out] The first keypart after the infix (if any)
-
+
DESCRIPTION
- Test conditions (NGA1, NGA2) from get_best_group_min_max(). Namely,
- for each keypart field NGF_i not in GROUP-BY, check that there is a
- constant equality predicate among conds with the form (NGF_i = const_ci) or
- (const_ci = NGF_i).
+ Test conditions (NGA1, NGA2, NGA3) from get_best_group_min_max(). Namely,
+ for each keypart field NG_i not in GROUP-BY, check that there is exactly one
+ constant equality predicate among conds with the form (NG_i = const_ci) or
+ (const_ci = NG_i).. In addition, there can only be one range when there is
+ such a gap.
Thus all the NGF_i attributes must fill the 'gap' between the last group-by
attribute and the MIN/MAX attribute in the index (if present). If these
conditions hold, copy each constant from its corresponding predicate into
@@ -12957,17 +13042,14 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
uchar *key_ptr= key_infix;
for (cur_part= first_non_group_part; cur_part != end_part; cur_part++)
{
+ cur_range= NULL;
/*
Find the range tree for the current keypart. We assume that
- index_range_tree points to the leftmost keypart in the index.
+ index_range_tree points to the first keypart in the index.
*/
- for (cur_range= index_range_tree;
- cur_range && cur_range->type == SEL_ARG::KEY_RANGE;
- cur_range= cur_range->next_key_part)
- {
- if (cur_range->field->eq(cur_part->field))
- break;
- }
+ if(get_sel_arg_for_keypart(cur_part->field, index_range_tree, &cur_range))
+ return false;
+
if (!cur_range || cur_range->type != SEL_ARG::KEY_RANGE)
{
if (min_max_arg_part)
@@ -12979,9 +13061,6 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
}
}
- /* Check that the current range tree is a single point interval. */
- if (cur_range->prev || cur_range->next)
- return FALSE; /* This is not the only range predicate for the field. */
if ((cur_range->min_flag & NO_MIN_RANGE) ||
(cur_range->max_flag & NO_MAX_RANGE) ||
(cur_range->min_flag & NEAR_MIN) || (cur_range->max_flag & NEAR_MAX))
diff --git a/sql/partition_element.h b/sql/partition_element.h
index 87f3d00e68c..4f03d91035a 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -1,7 +1,7 @@
#ifndef PARTITION_ELEMENT_INCLUDED
#define PARTITION_ELEMENT_INCLUDED
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -107,9 +107,8 @@ public:
enum partition_state part_state;
uint16 nodegroup_id;
bool has_null_value;
- /* signed_flag and max_value only relevant for subpartitions */
- bool signed_flag;
- bool max_value;
+ bool signed_flag; // Range value signed
+ bool max_value; // MAXVALUE range
partition_element()
: part_max_rows(0), part_min_rows(0), range_value(0),
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 934f4e970cb..34e47331664 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -1,5 +1,4 @@
-/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2006, 2013, Oracle and/or its affiliates.
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
@@ -2173,9 +2172,36 @@ int partition_info::fix_parser_data(THD *thd)
if (!(part_type == RANGE_PARTITION ||
part_type == LIST_PARTITION))
{
- /* Nothing to do for HASH/KEY partitioning */
+ if (part_type == HASH_PARTITION && list_of_part_fields)
+ {
+ /* KEY partitioning, check ALGORITHM = N. Should not pass the parser! */
+ if (key_algorithm > KEY_ALGORITHM_55)
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ DBUG_RETURN(true);
+ }
+ /* If not set, use DEFAULT = 2 for CREATE and ALTER! */
+ if ((thd_sql_command(thd) == SQLCOM_CREATE_TABLE ||
+ thd_sql_command(thd) == SQLCOM_ALTER_TABLE) &&
+ key_algorithm == KEY_ALGORITHM_NONE)
+ key_algorithm= KEY_ALGORITHM_55;
+ }
DBUG_RETURN(FALSE);
}
+ if (is_sub_partitioned() && list_of_subpart_fields)
+ {
+ /* KEY subpartitioning, check ALGORITHM = N. Should not pass the parser! */
+ if (key_algorithm > KEY_ALGORITHM_55)
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ DBUG_RETURN(true);
+ }
+ /* If not set, use DEFAULT = 2 for CREATE and ALTER! */
+ if ((thd_sql_command(thd) == SQLCOM_CREATE_TABLE ||
+ thd_sql_command(thd) == SQLCOM_ALTER_TABLE) &&
+ key_algorithm == KEY_ALGORITHM_NONE)
+ key_algorithm= KEY_ALGORITHM_55;
+ }
do
{
part_elem= it++;
@@ -2224,6 +2250,263 @@ int partition_info::fix_parser_data(THD *thd)
DBUG_RETURN(FALSE);
}
+
+/**
+ helper function to compare strings that can also be
+ a NULL pointer.
+
+ @param a char pointer (can be NULL).
+ @param b char pointer (can be NULL).
+
+ @return false if equal
+ @retval true strings differs
+ @retval false strings is equal
+*/
+
+static bool strcmp_null(const char *a, const char *b)
+{
+ if (!a && !b)
+ return false;
+ if (a && b && !strcmp(a, b))
+ return false;
+ return true;
+}
+
+
+/**
+ Check if the new part_info has the same partitioning.
+
+ @param new_part_info New partition definition to compare with.
+
+ @return True if not considered to have changed the partitioning.
+ @retval true Allowed change (only .frm change, compatible distribution).
+ @retval false Different partitioning, will need redistribution of rows.
+
+ @note Currently only used to allow changing from non-set key_algorithm
+ to a specified key_algorithm, to avoid rebuild when upgrading from 5.1 of
+ such partitioned tables using numeric colums in the partitioning expression.
+ For more info see bug#14521864.
+ Does not check if columns etc has changed, i.e. only for
+ alter_info->flags == ALTER_PARTITION.
+*/
+
+bool partition_info::has_same_partitioning(partition_info *new_part_info)
+{
+ DBUG_ENTER("partition_info::has_same_partitioning");
+
+ DBUG_ASSERT(part_field_array && part_field_array[0]);
+
+ /*
+ Only consider pre 5.5.3 .frm's to have same partitioning as
+ a new one with KEY ALGORITHM = 1 ().
+ */
+
+ if (part_field_array[0]->table->s->mysql_version >= 50503)
+ DBUG_RETURN(false);
+
+ if (!new_part_info ||
+ part_type != new_part_info->part_type ||
+ num_parts != new_part_info->num_parts ||
+ use_default_partitions != new_part_info->use_default_partitions ||
+ new_part_info->is_sub_partitioned() != is_sub_partitioned())
+ DBUG_RETURN(false);
+
+ if (part_type != HASH_PARTITION)
+ {
+ /*
+ RANGE or LIST partitioning, check if KEY subpartitioned.
+ Also COLUMNS partitioning was added in 5.5, so treat that as different.
+ */
+ if (!is_sub_partitioned() ||
+ !new_part_info->is_sub_partitioned() ||
+ column_list ||
+ new_part_info->column_list ||
+ !list_of_subpart_fields ||
+ !new_part_info->list_of_subpart_fields ||
+ new_part_info->num_subparts != num_subparts ||
+ new_part_info->subpart_field_list.elements !=
+ subpart_field_list.elements ||
+ new_part_info->use_default_subpartitions !=
+ use_default_subpartitions)
+ DBUG_RETURN(false);
+ }
+ else
+ {
+ /* Check if KEY partitioned. */
+ if (!new_part_info->list_of_part_fields ||
+ !list_of_part_fields ||
+ new_part_info->part_field_list.elements != part_field_list.elements)
+ DBUG_RETURN(false);
+ }
+
+ /* Check that it will use the same fields in KEY (fields) list. */
+ List_iterator<char> old_field_name_it(part_field_list);
+ List_iterator<char> new_field_name_it(new_part_info->part_field_list);
+ char *old_name, *new_name;
+ while ((old_name= old_field_name_it++))
+ {
+ new_name= new_field_name_it++;
+ if (!new_name || my_strcasecmp(system_charset_info,
+ new_name,
+ old_name))
+ DBUG_RETURN(false);
+ }
+
+ if (is_sub_partitioned())
+ {
+ /* Check that it will use the same fields in KEY subpart fields list. */
+ List_iterator<char> old_field_name_it(subpart_field_list);
+ List_iterator<char> new_field_name_it(new_part_info->subpart_field_list);
+ char *old_name, *new_name;
+ while ((old_name= old_field_name_it++))
+ {
+ new_name= new_field_name_it++;
+ if (!new_name || my_strcasecmp(system_charset_info,
+ new_name,
+ old_name))
+ DBUG_RETURN(false);
+ }
+ }
+
+ if (!use_default_partitions)
+ {
+ /*
+ Loop over partitions/subpartition to verify that they are
+ the same, including state and name.
+ */
+ List_iterator<partition_element> part_it(partitions);
+ List_iterator<partition_element> new_part_it(new_part_info->partitions);
+ uint i= 0;
+ do
+ {
+ partition_element *part_elem= part_it++;
+ partition_element *new_part_elem= new_part_it++;
+ /*
+ The following must match:
+ partition_name, tablespace_name, data_file_name, index_file_name,
+ engine_type, part_max_rows, part_min_rows, nodegroup_id.
+ (max_value, signed_flag, has_null_value only on partition level,
+ RANGE/LIST)
+ The following can differ:
+ - part_comment
+ part_state must be PART_NORMAL!
+ */
+ if (!part_elem || !new_part_elem ||
+ strcmp(part_elem->partition_name,
+ new_part_elem->partition_name) ||
+ part_elem->part_state != PART_NORMAL ||
+ new_part_elem->part_state != PART_NORMAL ||
+ part_elem->max_value != new_part_elem->max_value ||
+ part_elem->signed_flag != new_part_elem->signed_flag ||
+ part_elem->has_null_value != new_part_elem->has_null_value)
+ DBUG_RETURN(false);
+
+ /* new_part_elem may not have engine_type set! */
+ if (new_part_elem->engine_type &&
+ part_elem->engine_type != new_part_elem->engine_type)
+ DBUG_RETURN(false);
+
+ if (is_sub_partitioned())
+ {
+ /*
+ Check that both old and new partition has the same definition
+ (VALUES IN/VALUES LESS THAN) (No COLUMNS partitioning, see above)
+ */
+ if (part_type == LIST_PARTITION)
+ {
+ List_iterator<part_elem_value> list_vals(part_elem->list_val_list);
+ List_iterator<part_elem_value>
+ new_list_vals(new_part_elem->list_val_list);
+ part_elem_value *val;
+ part_elem_value *new_val;
+ while ((val= list_vals++))
+ {
+ new_val= new_list_vals++;
+ if (!new_val)
+ DBUG_RETURN(false);
+ if ((!val->null_value && !new_val->null_value) &&
+ val->value != new_val->value)
+ DBUG_RETURN(false);
+ }
+ if (new_list_vals++)
+ DBUG_RETURN(false);
+ }
+ else
+ {
+ DBUG_ASSERT(part_type == RANGE_PARTITION);
+ if (new_part_elem->range_value != part_elem->range_value)
+ DBUG_RETURN(false);
+ }
+
+ if (!use_default_subpartitions)
+ {
+ List_iterator<partition_element>
+ sub_part_it(part_elem->subpartitions);
+ List_iterator<partition_element>
+ new_sub_part_it(new_part_elem->subpartitions);
+ uint j= 0;
+ do
+ {
+ partition_element *sub_part_elem= sub_part_it++;
+ partition_element *new_sub_part_elem= new_sub_part_it++;
+ /* new_part_elem may not have engine_type set! */
+ if (new_sub_part_elem->engine_type &&
+ sub_part_elem->engine_type != new_part_elem->engine_type)
+ DBUG_RETURN(false);
+
+ if (strcmp(sub_part_elem->partition_name,
+ new_sub_part_elem->partition_name) ||
+ sub_part_elem->part_state != PART_NORMAL ||
+ new_sub_part_elem->part_state != PART_NORMAL ||
+ sub_part_elem->part_min_rows !=
+ new_sub_part_elem->part_min_rows ||
+ sub_part_elem->part_max_rows !=
+ new_sub_part_elem->part_max_rows ||
+ sub_part_elem->nodegroup_id !=
+ new_sub_part_elem->nodegroup_id)
+ DBUG_RETURN(false);
+
+ if (strcmp_null(sub_part_elem->data_file_name,
+ new_sub_part_elem->data_file_name) ||
+ strcmp_null(sub_part_elem->index_file_name,
+ new_sub_part_elem->index_file_name) ||
+ strcmp_null(sub_part_elem->tablespace_name,
+ new_sub_part_elem->tablespace_name))
+ DBUG_RETURN(false);
+
+ } while (++j < num_subparts);
+ }
+ }
+ else
+ {
+ if (part_elem->part_min_rows != new_part_elem->part_min_rows ||
+ part_elem->part_max_rows != new_part_elem->part_max_rows ||
+ part_elem->nodegroup_id != new_part_elem->nodegroup_id)
+ DBUG_RETURN(false);
+
+ if (strcmp_null(part_elem->data_file_name,
+ new_part_elem->data_file_name) ||
+ strcmp_null(part_elem->index_file_name,
+ new_part_elem->index_file_name) ||
+ strcmp_null(part_elem->tablespace_name,
+ new_part_elem->tablespace_name))
+ DBUG_RETURN(false);
+ }
+ } while (++i < num_parts);
+ }
+
+ /*
+ Only if key_algorithm was not specified before and it is now set,
+ consider this as nothing was changed, and allow change without rebuild!
+ */
+ if (key_algorithm != partition_info::KEY_ALGORITHM_NONE ||
+ new_part_info->key_algorithm == partition_info::KEY_ALGORITHM_NONE)
+ DBUG_RETURN(false);
+
+ DBUG_RETURN(true);
+}
+
+
void partition_info::print_debug(const char *str, uint *value)
{
DBUG_ENTER("print_debug");
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 2fbdfff6636..17c9cb383ee 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -1,7 +1,7 @@
#ifndef PARTITION_INFO_INCLUDED
#define PARTITION_INFO_INCLUDED
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -192,6 +192,19 @@ public:
but mainly of use to handlers supporting partitioning.
*/
uint16 linear_hash_mask;
+ /*
+ PARTITION BY KEY ALGORITHM=N
+ Which algorithm to use for hashing the fields.
+ N = 1 - Use 5.1 hashing (numeric fields are hashed as binary)
+ N = 2 - Use 5.5 hashing (numeric fields are hashed like latin1 bytes)
+ */
+ enum enum_key_algorithm
+ {
+ KEY_ALGORITHM_NONE= 0,
+ KEY_ALGORITHM_51= 1,
+ KEY_ALGORITHM_55= 2
+ };
+ enum_key_algorithm key_algorithm;
bool use_default_partitions;
bool use_default_num_partitions;
@@ -232,6 +245,7 @@ public:
count_curr_subparts(0), part_error_code(0),
num_list_values(0), num_part_fields(0), num_subpart_fields(0),
num_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0),
+ key_algorithm(KEY_ALGORITHM_NONE),
use_default_partitions(TRUE), use_default_num_partitions(TRUE),
use_default_subpartitions(TRUE), use_default_num_subpartitions(TRUE),
default_partitions_setup(FALSE), defined_max_value(FALSE),
@@ -298,6 +312,7 @@ public:
bool add_column_list_value(THD *thd, Item *item);
void set_show_version_string(String *packet);
void report_part_expr_error(bool use_subpart_expr);
+ bool has_same_partitioning(partition_info *new_part_info);
private:
static int list_part_cmp(const void* a, const void* b);
bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info,
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index 38daed0e260..fe9005df3ef 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -79,7 +79,7 @@ class Master_info : public Slave_reporting_capability
/* the variables below are needed because we can change masters on the fly */
char master_log_name[FN_REFLEN+6]; /* Room for multi-*/
char host[HOSTNAME_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
- char user[USERNAME_LENGTH*+1];
+ char user[USERNAME_LENGTH+1];
char password[MAX_PASSWORD_LENGTH*SYSTEM_CHARSET_MBMAXLEN+1];
LEX_STRING connection_name; /* User supplied connection name */
LEX_STRING cmp_connection_name; /* Connection name in lower case */
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 9cb210f398f..12c38f95575 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -326,8 +326,7 @@ Failed to open the existing relay log info file '%s' (errno %d)",
msg="Error reading slave log configuration";
goto err;
}
- strmake(rli->event_relay_log_name,rli->group_relay_log_name,
- sizeof(rli->event_relay_log_name)-1);
+ strmake_buf(rli->event_relay_log_name,rli->group_relay_log_name);
rli->group_relay_log_pos= rli->event_relay_log_pos= relay_log_pos;
rli->group_master_log_pos= master_log_pos;
@@ -545,10 +544,8 @@ int init_relay_log_pos(Relay_log_info* rli,const char* log,
*errmsg="Could not find target log during relay log initialization";
goto err;
}
- strmake(rli->group_relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->group_relay_log_name)-1);
- strmake(rli->event_relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->event_relay_log_name)-1);
+ strmake_buf(rli->group_relay_log_name,rli->linfo.log_file_name);
+ strmake_buf(rli->event_relay_log_name,rli->linfo.log_file_name);
if (rli->relay_log.is_active(rli->linfo.log_file_name))
{
/*
@@ -888,8 +885,7 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
mysql_mutex_lock(&data_lock);
inc_event_relay_log_pos();
group_relay_log_pos= event_relay_log_pos;
- strmake(group_relay_log_name,event_relay_log_name,
- sizeof(group_relay_log_name)-1);
+ strmake_buf(group_relay_log_name,event_relay_log_name);
notify_group_relay_log_name_update();
@@ -1024,10 +1020,8 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
if (!just_reset)
{
/* Save name of used relay log file */
- strmake(rli->group_relay_log_name, rli->relay_log.get_log_fname(),
- sizeof(rli->group_relay_log_name)-1);
- strmake(rli->event_relay_log_name, rli->relay_log.get_log_fname(),
- sizeof(rli->event_relay_log_name)-1);
+ strmake_buf(rli->group_relay_log_name, rli->relay_log.get_log_fname());
+ strmake_buf(rli->event_relay_log_name, rli->relay_log.get_log_fname());
rli->group_relay_log_pos= rli->event_relay_log_pos= BIN_LOG_HEADER_SIZE;
rli->log_space_total= 0;
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 1be97b34204..6bbe998a624 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -1173,6 +1173,7 @@ void Deferred_log_events::rewind()
Log_event *ev= *(Log_event **) dynamic_array_ptr(&array, i);
delete ev;
}
+ last_added= NULL;
if (array.elements > array.max_element)
freeze_size(&array);
reset_dynamic(&array);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 97545778f18..4473ed54c46 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
+ Copyright (c) 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
@@ -255,16 +255,14 @@ uchar *sys_var::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
return session_value_ptr(thd, base);
}
-bool sys_var::set_default(THD *thd, enum_var_type type)
+bool sys_var::set_default(THD *thd, set_var* var)
{
- set_var var(type, this, &null_lex_str, 0);
-
- if (type == OPT_GLOBAL || scope() == GLOBAL)
- global_save_default(thd, &var);
+ if (var->type == OPT_GLOBAL || scope() == GLOBAL)
+ global_save_default(thd, var);
else
- session_save_default(thd, &var);
+ session_save_default(thd, var);
- return check(thd, &var) || update(thd, &var);
+ return check(thd, var) || update(thd, var);
}
@@ -774,7 +772,7 @@ int set_var::light_check(THD *thd)
*/
int set_var::update(THD *thd)
{
- return value ? var->update(thd, this) : var->set_default(thd, type);
+ return value ? var->update(thd, this) : var->set_default(thd, this);
}
diff --git a/sql/set_var.h b/sql/set_var.h
index 6cb0cd33f87..87a2988bc3d 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -1,6 +1,6 @@
#ifndef SET_VAR_INCLUDED
#define SET_VAR_INCLUDED
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
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
@@ -105,7 +105,13 @@ public:
bool check(THD *thd, set_var *var);
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
- bool set_default(THD *thd, enum_var_type type);
+
+ /**
+ Update the system variable with the default value from either
+ session or global scope. The default value is stored in the
+ 'var' argument. Return false when successful.
+ */
+ bool set_default(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
longlong val_int(bool *is_null, THD *thd, enum_var_type type, LEX_STRING *base);
diff --git a/sql/slave.cc b/sql/slave.cc
index 38ff94bcea0..27feb618a43 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -444,16 +444,13 @@ int init_recovery(Master_info* mi, const char** errmsg)
{
mi->master_log_pos= max(BIN_LOG_HEADER_SIZE,
rli->group_master_log_pos);
- strmake(mi->master_log_name, rli->group_master_log_name,
- sizeof(mi->master_log_name)-1);
+ strmake_buf(mi->master_log_name, rli->group_master_log_name);
sql_print_warning("Recovery from master pos %ld and file %s.",
(ulong) mi->master_log_pos, mi->master_log_name);
- strmake(rli->group_relay_log_name, rli->relay_log.get_log_fname(),
- sizeof(rli->group_relay_log_name)-1);
- strmake(rli->event_relay_log_name, rli->relay_log.get_log_fname(),
- sizeof(mi->rli.event_relay_log_name)-1);
+ strmake_buf(rli->group_relay_log_name, rli->relay_log.get_log_fname());
+ strmake_buf(rli->event_relay_log_name, rli->relay_log.get_log_fname());
rli->group_relay_log_pos= rli->event_relay_log_pos= BIN_LOG_HEADER_SIZE;
}
@@ -4154,8 +4151,8 @@ log '%s' at position %s, relay log '%s' position: %s%s", RPL_LOG_NAME,
mysql_mutex_lock(&rli->data_lock);
if (rli->slave_skip_counter)
{
- strmake(saved_log_name, rli->group_relay_log_name, FN_REFLEN - 1);
- strmake(saved_master_log_name, rli->group_master_log_name, FN_REFLEN - 1);
+ strmake_buf(saved_log_name, rli->group_relay_log_name);
+ strmake_buf(saved_master_log_name, rli->group_master_log_name);
saved_log_pos= rli->group_relay_log_pos;
saved_master_log_pos= rli->group_master_log_pos;
saved_skip= rli->slave_skip_counter;
@@ -6004,8 +6001,7 @@ static Log_event* next_event(Relay_log_info* rli)
goto err;
}
rli->event_relay_log_pos = BIN_LOG_HEADER_SIZE;
- strmake(rli->event_relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->event_relay_log_name)-1);
+ strmake_buf(rli->event_relay_log_name,rli->linfo.log_file_name);
flush_relay_log_info(rli);
}
diff --git a/sql/sp.cc b/sql/sp.cc
index 2aec9d19869..56565f1d11e 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -114,7 +114,7 @@ TABLE_FIELD_TYPE proc_table_fields[MYSQL_PROC_FIELD_COUNT] =
},
{
{ C_STRING_WITH_LEN("definer") },
- { C_STRING_WITH_LEN("char(77)") },
+ { C_STRING_WITH_LEN("char(") },
{ C_STRING_WITH_LEN("utf8") }
},
{
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index f0a87673857..3a761897e90 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1161,8 +1161,9 @@ find_handler_after_execution(THD *thd, sp_rcontext *ctx)
MYSQL_ERROR *err;
while ((err= it++))
{
- if (err->get_level() != MYSQL_ERROR::WARN_LEVEL_WARN &&
- err->get_level() != MYSQL_ERROR::WARN_LEVEL_NOTE)
+ if ((err->get_level() != MYSQL_ERROR::WARN_LEVEL_WARN &&
+ err->get_level() != MYSQL_ERROR::WARN_LEVEL_NOTE) ||
+ err->handled())
continue;
if (ctx->find_handler(thd,
@@ -1171,6 +1172,7 @@ find_handler_after_execution(THD *thd, sp_rcontext *ctx)
err->get_level(),
err->get_message_text()))
{
+ err->mark_handled();
break;
}
}
@@ -1420,6 +1422,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
Will write this SP statement into binlog separately.
TODO: consider changing the condition to "not inside event union".
*/
+ MEM_ROOT *user_var_events_alloc_saved= thd->user_var_events_alloc;
if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
thd->user_var_events_alloc= thd->mem_root;
@@ -1435,7 +1438,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
{
reset_dynamic(&thd->user_var_events);
- thd->user_var_events_alloc= NULL;//DEBUG
+ thd->user_var_events_alloc= user_var_events_alloc_saved;
}
/* we should cleanup free_list and memroot, used by instruction */
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 69290a64a29..05f6a6df7ab 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -70,7 +70,7 @@ TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
},
{
{ C_STRING_WITH_LEN("User") },
- { C_STRING_WITH_LEN("char(16)") },
+ { C_STRING_WITH_LEN("char(") },
{NULL, 0}
},
{
@@ -828,6 +828,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
table->use_all_columns();
(void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER), 50, 100, MYF(0));
+ username_char_length= min(table->field[1]->char_length(), USERNAME_CHAR_LENGTH);
password_length= table->field[2]->field_length /
table->field[2]->charset()->mbmaxlen;
if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
@@ -1435,12 +1436,12 @@ bool acl_getroot(Security_context *sctx, char *user, char *host,
sctx->master_access= acl_user->access;
if (acl_user->user)
- strmake(sctx->priv_user, user, USERNAME_LENGTH);
+ strmake_buf(sctx->priv_user, user);
else
*sctx->priv_user= 0;
if (acl_user->host.hostname)
- strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME - 1);
+ strmake_buf(sctx->priv_host, acl_user->host.hostname);
else
*sctx->priv_host= 0;
}
@@ -8152,6 +8153,12 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
cs->coll->hash_sort(cs, (uchar*) sctx->user, strlen(sctx->user), &nr1, &nr2);
mysql_mutex_lock(&acl_cache->lock);
+ if (!acl_users.elements)
+ {
+ mysql_mutex_unlock(&acl_cache->lock);
+ login_failed_error(mpvio->thd);
+ DBUG_RETURN(1);
+ }
uint i= nr1 % acl_users.elements;
ACL_USER *acl_user_tmp= dynamic_element(&acl_users, i, ACL_USER*);
mpvio->acl_user= acl_user_tmp->copy(mpvio->thd->mem_root);
@@ -8177,10 +8184,9 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
mpvio->auth_info.user_name= sctx->user;
mpvio->auth_info.user_name_length= strlen(sctx->user);
mpvio->auth_info.auth_string= mpvio->acl_user->auth_string.str;
- mpvio->auth_info.auth_string_length=
- (unsigned long) mpvio->acl_user->auth_string.length;
- strmake(mpvio->auth_info.authenticated_as, mpvio->acl_user->user ?
- mpvio->acl_user->user : "", USERNAME_LENGTH);
+ mpvio->auth_info.auth_string_length= (unsigned long) mpvio->acl_user->auth_string.length;
+ strmake_buf(mpvio->auth_info.authenticated_as, mpvio->acl_user->user ?
+ mpvio->acl_user->user : "");
DBUG_PRINT("info", ("exit: user=%s, auth_string=%s, authenticated as=%s"
"plugin=%s",
@@ -8264,7 +8270,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
/* Clear variables that are allocated */
thd->user_connect= 0;
- strmake(sctx->priv_user, sctx->user, USERNAME_LENGTH);
+ strmake_buf(sctx->priv_user, sctx->user);
if (thd->make_lex_string(&mpvio->db, db_buff, db_len) == 0)
DBUG_RETURN(1); /* The error is set by make_lex_string(). */
@@ -8479,14 +8485,15 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
/*
Clip username to allowed length in characters (not bytes). This is
- mostly for backward compatibility.
+ mostly for backward compatibility (to truncate long usernames, as
+ old 5.1 did)
*/
{
CHARSET_INFO *cs= system_charset_info;
int err;
user_len= (uint) cs->cset->well_formed_len(cs, user, user + user_len,
- USERNAME_CHAR_LENGTH, &err);
+ username_char_length, &err);
user[user_len]= '\0';
}
@@ -9081,12 +9088,12 @@ bool acl_authenticate(THD *thd, uint connect_errors,
sctx->master_access= acl_user->access;
if (acl_user->user)
- strmake(sctx->priv_user, acl_user->user, USERNAME_LENGTH - 1);
+ strmake_buf(sctx->priv_user, acl_user->user);
else
*sctx->priv_user= 0;
if (acl_user->host.hostname)
- strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME - 1);
+ strmake_buf(sctx->priv_host, acl_user->host.hostname);
else
*sctx->priv_host= 0;
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 9e3ea46f526..0b2a939d0ba 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -329,7 +329,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
item->maybe_null = 1;
field_list.push_back(item = new Item_empty_string("Msg_type", 10));
item->maybe_null = 1;
- field_list.push_back(item = new Item_empty_string("Msg_text", 255));
+ field_list.push_back(item = new Item_empty_string("Msg_text",
+ SQL_ADMIN_MSG_TEXT_SIZE));
item->maybe_null = 1;
if (protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
diff --git a/sql/sql_admin.h b/sql/sql_admin.h
index f7ec76efd5e..5398e3019f1 100644
--- a/sql/sql_admin.h
+++ b/sql/sql_admin.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -16,6 +16,8 @@
#ifndef SQL_TABLE_MAINTENANCE_H
#define SQL_TABLE_MAINTENANCE_H
+/* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */
+#define SQL_ADMIN_MSG_TEXT_SIZE 128 * 1024
bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
LEX_STRING *key_cache_name);
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 793eead9869..07a5243e836 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -31,8 +31,7 @@ unsigned long mysql_global_audit_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
static mysql_mutex_t LOCK_audit_mask;
-static void event_class_dispatch(THD *thd, unsigned int event_class,
- const void *event);
+static void event_class_dispatch(THD *, unsigned int, const void *);
static inline
@@ -111,9 +110,36 @@ static void connection_class_handler(THD *thd, uint event_subclass, va_list ap)
}
+static void table_class_handler(THD *thd, uint event_subclass, va_list ap)
+{
+ mysql_event_table event;
+ event.event_subclass= event_subclass;
+ event.read_only= va_arg(ap, int);
+ event.thread_id= va_arg(ap, unsigned long);
+ event.user= va_arg(ap, const char *);
+ event.priv_user= va_arg(ap, const char *);
+ event.priv_host= va_arg(ap, const char *);
+ event.external_user= va_arg(ap, const char *);
+ event.proxy_user= va_arg(ap, const char *);
+ event.host= va_arg(ap, const char *);
+ event.ip= va_arg(ap, const char *);
+ event.database= va_arg(ap, const char *);
+ event.database_length= va_arg(ap, unsigned int);
+ event.table= va_arg(ap, const char *);
+ event.table_length= va_arg(ap, unsigned int);
+ event.new_database= va_arg(ap, const char *);
+ event.new_database_length= va_arg(ap, unsigned int);
+ event.new_table= va_arg(ap, const char *);
+ event.new_table_length= va_arg(ap, unsigned int);
+ event_class_dispatch(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
+}
+
+
static audit_handler_t audit_handlers[] =
{
- general_class_handler, connection_class_handler
+ general_class_handler, connection_class_handler,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0, /* placeholders */
+ table_class_handler
};
static const uint audit_handlers_count=
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index a651ce61374..22fdd221e62 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -48,18 +48,24 @@ static inline bool mysql_audit_connection_enabled()
return mysql_global_audit_mask[0] & MYSQL_AUDIT_CONNECTION_CLASSMASK;
}
+static inline bool mysql_audit_table_enabled()
+{
+ return mysql_global_audit_mask[0] & MYSQL_AUDIT_TABLE_CLASSMASK;
+}
+
#else
static inline void mysql_audit_notify(THD *thd, uint event_class,
uint event_subtype, ...) { }
#define mysql_audit_general_enabled() 0
#define mysql_audit_connection_enabled() 0
+#define mysql_audit_table_enabled() 0
#endif
extern void mysql_audit_release(THD *thd);
#define MAX_USER_HOST_SIZE 512
static inline uint make_user_name(THD *thd, char *buf)
{
- Security_context *sctx= thd->security_ctx;
+ const Security_context *sctx= thd->security_ctx;
return strxnmov(buf, MAX_USER_HOST_SIZE,
sctx->priv_user[0] ? sctx->priv_user : "", "[",
sctx->user ? sctx->user : "", "] @ ",
@@ -197,4 +203,87 @@ void mysql_audit_notify_connection_change_user(THD *thd)
}
}
+static inline
+void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
+{
+ if (lock != F_UNLCK && mysql_audit_table_enabled())
+ {
+ const Security_context *sctx= thd->security_ctx;
+ mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, MYSQL_AUDIT_TABLE_LOCK,
+ (int)(lock == F_RDLCK), (ulong)thd->thread_id,
+ sctx->user, sctx->priv_user, sctx->priv_host,
+ sctx->external_user, sctx->proxy_user, sctx->host,
+ sctx->ip, share->db.str, (uint)share->db.length,
+ share->table_name.str, (uint)share->table_name.length,
+ 0,0,0,0);
+ }
+}
+
+static inline
+void mysql_audit_create_table(TABLE *table)
+{
+ if (mysql_audit_table_enabled())
+ {
+ THD *thd= table->in_use;
+ const TABLE_SHARE *share= table->s;
+ const Security_context *sctx= thd->security_ctx;
+ mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, MYSQL_AUDIT_TABLE_CREATE,
+ 0, (ulong)thd->thread_id,
+ sctx->user, sctx->priv_user, sctx->priv_host,
+ sctx->external_user, sctx->proxy_user, sctx->host,
+ sctx->ip, share->db.str, (uint)share->db.length,
+ share->table_name.str, (uint)share->table_name.length,
+ 0,0,0,0);
+ }
+}
+
+static inline
+void mysql_audit_drop_table(THD *thd, TABLE_LIST *table)
+{
+ if (mysql_audit_table_enabled())
+ {
+ const Security_context *sctx= thd->security_ctx;
+ mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, MYSQL_AUDIT_TABLE_DROP,
+ 0, (ulong)thd->thread_id,
+ sctx->user, sctx->priv_user, sctx->priv_host,
+ sctx->external_user, sctx->proxy_user, sctx->host,
+ sctx->ip, table->db, (uint)table->db_length,
+ table->table_name, (uint)table->table_name_length,
+ 0,0,0,0);
+ }
+}
+
+static inline
+void mysql_audit_rename_table(THD *thd, const char *old_db, const char *old_tb,
+ const char *new_db, const char *new_tb)
+{
+ if (mysql_audit_table_enabled())
+ {
+ const Security_context *sctx= thd->security_ctx;
+ mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, MYSQL_AUDIT_TABLE_RENAME,
+ 0, (ulong)thd->thread_id,
+ sctx->user, sctx->priv_user, sctx->priv_host,
+ sctx->external_user, sctx->proxy_user, sctx->host,
+ sctx->ip,
+ old_db, (uint)strlen(old_db), old_tb, (uint)strlen(old_tb),
+ new_db, (uint)strlen(new_db), new_tb, (uint)strlen(new_tb));
+ }
+}
+
+static inline
+void mysql_audit_alter_table(THD *thd, TABLE_LIST *table)
+{
+ if (mysql_audit_table_enabled())
+ {
+ const Security_context *sctx= thd->security_ctx;
+ mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, MYSQL_AUDIT_TABLE_ALTER,
+ 0, (ulong)thd->thread_id,
+ sctx->user, sctx->priv_user, sctx->priv_host,
+ sctx->external_user, sctx->proxy_user, sctx->host,
+ sctx->ip, table->db, (uint)table->db_length,
+ table->table_name, (uint)table->table_name_length,
+ 0,0,0,0);
+ }
+}
+
#endif /* SQL_AUDIT_INCLUDED */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index dd92c3d6750..109a4ef41e9 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -6798,7 +6798,7 @@ find_field_in_tables(THD *thd, Item_ident *item,
We can't do this in Item_field as this would change the
'name' of the item which may be used in the select list
*/
- strmake(name_buff, db, sizeof(name_buff)-1);
+ strmake_buf(name_buff, db);
my_casedn_str(files_charset_info, name_buff);
db= name_buff;
}
@@ -8371,7 +8371,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
We can't do this in Item_field as this would change the
'name' of the item which may be used in the select list
*/
- strmake(name_buff, db_name, sizeof(name_buff)-1);
+ strmake_buf(name_buff, db_name);
my_casedn_str(files_charset_info, name_buff);
db_name= name_buff;
}
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index a4664da2bf6..3bb5deab406 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -107,7 +107,7 @@ void mysql_client_binlog_statement(THD* thd)
rli->relay_log.description_event_for_exec &&
buf))
{
- my_error(ER_OUTOFMEMORY, MYF(0), 1); /* needed 1 bytes */
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR), 1); /* needed 1 bytes */
goto end;
}
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 33b938225c0..2f4efab2cb8 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -466,6 +466,8 @@ static void make_base_query(String *new_query,
/* The following is guaranteed by the query_cache interface */
DBUG_ASSERT(query[query_length] == 0);
DBUG_ASSERT(!is_white_space(query[0]));
+ /* We do not support UCS2, UTF16, UTF32 as a client character set */
+ DBUG_ASSERT(current_thd->variables.character_set_client->mbminlen == 1);
new_query->length(0); // Don't copy anything from old buffer
if (new_query->realloc(query_length + additional_length))
@@ -2430,7 +2432,28 @@ void Query_cache::init()
m_cache_status= Query_cache::OK;
m_requests_in_progress= 0;
initialized = 1;
- query_state_map= default_charset_info->state_map;
+ /*
+ Using state_map from latin1 should be fine in all cases:
+ 1. We do not support UCS2, UTF16, UTF32 as a client character set.
+ 2. The other character sets are compatible on the lower ASCII-range
+ 0x00-0x20, and have the following characters marked as spaces:
+
+ 0x09 TAB
+ 0x0A LINE FEED
+ 0x0B VERTICAL TAB
+ 0x0C FORM FEED
+ 0x0D CARRIAGE RETUR
+ 0x20 SPACE
+
+ Additionally, only some of the ASCII-compatible character sets
+ (including latin1) can have 0xA0 mapped to "NON-BREAK SPACE"
+ and thus marked as space.
+ That should not be a problem for those charsets that map 0xA0
+ to something else: the parser will just return syntax error
+ if this character appears straight in the query
+ (i.e. not inside a string literal or comment).
+ */
+ query_state_map= my_charset_latin1.state_map;
/*
If we explicitly turn off query cache from the command line query
cache will be disabled for the reminder of the server life
@@ -3963,6 +3986,18 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used,
/*
+In non-embedded QC intercepts result in net_real_write
+but if we have no net.vio then net_real_write
+will not be called, so QC can't get results of the query
+*/
+#ifdef EMBEDDED_LIBRARY
+#define qc_is_able_to_intercept_result(T) 1
+#else
+#define qc_is_able_to_intercept_result(T) ((T)->net.vio)
+#endif
+
+
+/*
If query is cacheable return number tables in query
(query without tables are not cached)
*/
@@ -3977,7 +4012,8 @@ Query_cache::is_cacheable(THD *thd, LEX *lex,
if (thd->lex->safe_to_cache_query &&
(thd->variables.query_cache_type == 1 ||
(thd->variables.query_cache_type == 2 && (lex->select_lex.options &
- OPTION_TO_QUERY_CACHE))))
+ OPTION_TO_QUERY_CACHE))) &&
+ qc_is_able_to_intercept_result(thd))
{
DBUG_PRINT("qcache", ("options: %lx %lx type: %u",
(long) OPTION_TO_QUERY_CACHE,
@@ -3999,11 +4035,12 @@ Query_cache::is_cacheable(THD *thd, LEX *lex,
}
DBUG_PRINT("qcache",
- ("not interesting query: %d or not cacheable, options %lx %lx type: %u",
+ ("not interesting query: %d or not cacheable, options %lx %lx type: %u net->vio present: %u",
(int) lex->sql_command,
(long) OPTION_TO_QUERY_CACHE,
(long) lex->select_lex.options,
- (int) thd->variables.query_cache_type));
+ (int) thd->variables.query_cache_type,
+ (uint) test(qc_is_able_to_intercept_result(thd))));
DBUG_RETURN(0);
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 413f921a16f..8e91c4d7901 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1151,10 +1151,16 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno,
query_cache_abort(&query_cache_tls);
- /* When simulating OOM, skip writing to error log to avoid mtr errors */
- DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_RETURN(NULL););
-
- cond= warning_info->push_warning(this, sql_errno, sqlstate, level, msg);
+ /*
+ Avoid pushing a condition for fatal out of memory errors as this will
+ require memory allocation and therefore might fail. Non fatal out of
+ memory errors can occur if raised by SIGNAL/RESIGNAL statement.
+ */
+ if (!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY ||
+ sql_errno == ER_OUTOFMEMORY)))
+ {
+ cond= warning_info->push_warning(this, sql_errno, sqlstate, level, msg);
+ }
DBUG_RETURN(cond);
}
@@ -2065,7 +2071,7 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length)
key_length + 1);
if (!new_table)
{
- my_error(EE_OUTOFMEMORY, MYF(ME_BELL),
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_FATALERROR),
ALIGN_SIZE(sizeof(TABLE_LIST)) + key_length + 1);
killed= KILL_CONNECTION;
return 0;
@@ -2531,7 +2537,7 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
bool string_results= FALSE, non_string_results= FALSE;
unit= u;
if ((uint) strlen(exchange->file_name) + NAME_LEN >= FN_REFLEN)
- strmake(path,exchange->file_name,FN_REFLEN-1);
+ strmake_buf(path,exchange->file_name);
write_cs= exchange->cs ? exchange->cs : &my_charset_bin;
@@ -2669,7 +2675,7 @@ int select_export::send_data(List<Item> &items)
set_if_smaller(estimated_bytes, UINT_MAX32);
if (cvt_str.realloc((uint32) estimated_bytes))
{
- my_error(ER_OUTOFMEMORY, MYF(0), (uint32) estimated_bytes);
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR), (uint32) estimated_bytes);
goto err;
}
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 17e75f15adf..e7bea820c6e 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -435,7 +435,7 @@ void init_user_stats(USER_STATS *user_stats,
memcpy(user_stats->user, user, user_length);
user_stats->user[user_length]= 0;
user_stats->user_name_length= user_length;
- strmake(user_stats->priv_user, priv_user, sizeof(user_stats->priv_user)-1);
+ strmake_buf(user_stats->priv_user, priv_user);
user_stats->total_connections= total_connections;
user_stats->concurrent_connections= concurrent_connections;
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 4bcb62ef764..32215e91225 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -682,7 +682,7 @@ multi_delete::initialize_tables(JOIN *join)
tab;
tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS))
{
- if (tab->table->map & tables_to_delete_from)
+ if (!tab->bush_children && tab->table->map & tables_to_delete_from)
{
/* We are going to delete from this table */
TABLE *tbl=walk->table=tab->table;
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 23a60267737..8cfc304e0e7 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -185,6 +185,7 @@ MYSQL_ERROR::MYSQL_ERROR()
m_cursor_name((const char*) NULL, 0, & my_charset_utf8_bin),
m_message_text(),
m_sql_errno(0),
+ m_handled(0),
m_level(MYSQL_ERROR::WARN_LEVEL_ERROR),
m_mem_root(NULL)
{
@@ -212,6 +213,7 @@ void MYSQL_ERROR::clear()
m_cursor_name.length(0);
m_message_text.length(0);
m_sql_errno= 0;
+ m_handled= 0;
m_level= MYSQL_ERROR::WARN_LEVEL_ERROR;
}
@@ -229,6 +231,7 @@ MYSQL_ERROR::MYSQL_ERROR(MEM_ROOT *mem_root)
m_cursor_name((const char*) NULL, 0, & my_charset_utf8_bin),
m_message_text(),
m_sql_errno(0),
+ m_handled(0),
m_level(MYSQL_ERROR::WARN_LEVEL_ERROR),
m_mem_root(mem_root)
{
@@ -267,6 +270,7 @@ MYSQL_ERROR::copy_opt_attributes(const MYSQL_ERROR *cond)
copy_string(m_mem_root, & m_table_name, & cond->m_table_name);
copy_string(m_mem_root, & m_column_name, & cond->m_column_name);
copy_string(m_mem_root, & m_cursor_name, & cond->m_cursor_name);
+ m_handled= cond->m_handled;
}
void
@@ -367,7 +371,7 @@ Diagnostics_area::set_ok_status(THD *thd, ulonglong affected_rows_arg,
m_affected_rows= affected_rows_arg;
m_last_insert_id= last_insert_id_arg;
if (message_arg)
- strmake(m_message, message_arg, sizeof(m_message) - 1);
+ strmake_buf(m_message, message_arg);
else
m_message[0]= '\0';
m_status= DA_OK;
@@ -435,7 +439,7 @@ Diagnostics_area::set_error_status(THD *thd, uint sql_errno_arg,
m_sql_errno= sql_errno_arg;
memcpy(m_sqlstate, sqlstate, SQLSTATE_LENGTH);
m_sqlstate[SQLSTATE_LENGTH]= '\0';
- strmake(m_message, message_arg, sizeof(m_message)-1);
+ strmake_buf(m_message, message_arg);
m_status= DA_ERROR;
DBUG_VOID_RETURN;
diff --git a/sql/sql_error.h b/sql/sql_error.h
index f018387eb3b..05a92a17f96 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -191,6 +191,17 @@ public:
MYSQL_ERROR::enum_warning_level get_level() const
{ return m_level; }
+ /** check if condition was handled by a condition handler */
+ bool handled() const
+ {
+ return m_handled;
+ }
+ /** mark that condition was handled */
+ void mark_handled()
+ {
+ m_handled= 1;
+ }
+
private:
/*
The interface of MYSQL_ERROR is mostly private, by design,
@@ -306,6 +317,9 @@ private:
/** MySQL extension, MYSQL_ERRNO condition item. */
uint m_sql_errno;
+ /** Marker if error/warning was handled by a continue handler */
+ bool m_handled;
+
/**
SQL RETURNED_SQLSTATE condition item.
This member is always NUL terminated.
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index d1e5d731183..06efaea8a5b 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates.
- Copyright (c) 2011 Monty Program Ab
+/* Copyright (c) 2001, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2013, 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
@@ -1010,11 +1010,13 @@ static SQL_HANDLER *mysql_ha_find_match(THD *thd, TABLE_LIST *tables)
for (tables= first; tables; tables= tables->next_local)
{
+ if (tables->is_anonymous_derived_table())
+ continue;
if ((! *tables->db ||
! my_strcasecmp(&my_charset_latin1, hash_tables->db.str,
- tables->db)) &&
+ tables->get_db_name())) &&
! my_strcasecmp(&my_charset_latin1, hash_tables->table_name.str,
- tables->table_name))
+ tables->get_table_name()))
{
/* Link into hash_tables list */
hash_tables->next= head;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 844725c5da7..511296f3e4b 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1992,8 +1992,7 @@ public:
DBUG_ENTER("Delayed_insert constructor");
thd.security_ctx->user=(char*) delayed_user;
thd.security_ctx->host=(char*) my_localhost;
- strmake(thd.security_ctx->priv_user, thd.security_ctx->user,
- USERNAME_LENGTH);
+ strmake_buf(thd.security_ctx->priv_user, thd.security_ctx->user);
thd.current_tablenr=0;
thd.command=COM_DELAYED_INSERT;
thd.lex->current_select= 0; // for my_message_sql
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c1a138ec3ee..1114723079d 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1416,7 +1416,7 @@ int lex_one_token(void *arg, void *yythd)
yylval->lex_str=get_token(lip,
2, // skip x'
length-3); // don't count x' and last '
- return (HEX_NUM);
+ return HEX_STRING;
case MY_LEX_BIN_NUMBER: // Found b'bin-string'
lip->yySkip(); // Accept opening '
@@ -1932,6 +1932,7 @@ void st_select_lex::init_select()
merged_into= 0;
m_non_agg_field_used= false;
m_agg_func_used= false;
+ name_visibility_map= 0;
}
/*
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index f654c00810e..14904607122 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -910,6 +910,9 @@ public:
*/
List<String> *prev_join_using;
+ /* namp of nesting SELECT visibility (for aggregate functions check) */
+ nesting_map name_visibility_map;
+
void init_query();
void init_select();
st_select_lex_unit* master_unit();
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4625a61f22c..3a499145a63 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1525,7 +1525,8 @@ void log_slow_statement(THD *thd)
/* Follow the slow log filter configuration. */
if (!thd->enable_slow_log ||
- !(thd->variables.log_slow_filter & thd->query_plan_flags))
+ (thd->variables.log_slow_filter
+ && !(thd->variables.log_slow_filter & thd->query_plan_flags)))
DBUG_VOID_RETURN;
if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index b2e2016b47d..2bcefce1212 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -87,7 +87,9 @@ const LEX_STRING partition_keywords[]=
{ C_STRING_WITH_LEN("KEY") },
{ C_STRING_WITH_LEN("MAXVALUE") },
{ C_STRING_WITH_LEN("LINEAR ") },
- { C_STRING_WITH_LEN(" COLUMNS") }
+ { C_STRING_WITH_LEN(" COLUMNS") },
+ { C_STRING_WITH_LEN("ALGORITHM") }
+
};
static const char *part_str= "PARTITION";
static const char *sub_str= "SUB";
@@ -368,7 +370,7 @@ int get_parts_for_update(const uchar *old_data, uchar *new_data,
longlong old_func_value;
DBUG_ENTER("get_parts_for_update");
- DBUG_ASSERT(new_data == rec0);
+ DBUG_ASSERT(new_data == rec0); // table->record[0]
set_field_ptr(part_field_array, old_data, rec0);
error= part_info->get_partition_id(part_info, old_part_id,
&old_func_value);
@@ -526,12 +528,12 @@ static bool set_up_field_array(TABLE *table,
}
if (num_fields > MAX_REF_PARTS)
{
- char *ptr;
+ char *err_str;
if (is_sub_part)
- ptr= (char*)"subpartition function";
+ err_str= (char*)"subpartition function";
else
- ptr= (char*)"partition function";
- my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), ptr);
+ err_str= (char*)"partition function";
+ my_error(ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, MYF(0), err_str);
DBUG_RETURN(TRUE);
}
if (num_fields == 0)
@@ -2339,6 +2341,58 @@ end:
return err;
}
+
+/**
+ Add 'KEY' word, with optional 'ALGORTIHM = N'.
+
+ @param fptr File to write to.
+ @param part_info partition_info holding the used key_algorithm
+ @param current_comment_start NULL, or comment string encapsulating the
+ PARTITION BY clause.
+
+ @return Operation status.
+ @retval 0 Success
+ @retval != 0 Failure
+*/
+
+static int add_key_with_algorithm(File fptr, partition_info *part_info,
+ const char *current_comment_start)
+{
+ int err= 0;
+ err+= add_part_key_word(fptr, partition_keywords[PKW_KEY].str);
+
+ /*
+ current_comment_start is given when called from SHOW CREATE TABLE,
+ Then only add ALGORITHM = 1, not the default 2 or non-set 0!
+ For .frm current_comment_start is NULL, then add ALGORITHM if != 0.
+ */
+ if (part_info->key_algorithm == partition_info::KEY_ALGORITHM_51 || // SHOW
+ (!current_comment_start && // .frm
+ (part_info->key_algorithm != partition_info::KEY_ALGORITHM_NONE)))
+ {
+ /* If we already are within a comment, end that comment first. */
+ if (current_comment_start)
+ err+= add_string(fptr, "*/ ");
+ err+= add_string(fptr, "/*!50531 ");
+ err+= add_part_key_word(fptr, partition_keywords[PKW_ALGORITHM].str);
+ err+= add_equal(fptr);
+ err+= add_space(fptr);
+ err+= add_int(fptr, part_info->key_algorithm);
+ err+= add_space(fptr);
+ err+= add_string(fptr, "*/ ");
+ if (current_comment_start)
+ {
+ /* Skip new line. */
+ if (current_comment_start[0] == '\n')
+ current_comment_start++;
+ err+= add_string(fptr, current_comment_start);
+ err+= add_space(fptr);
+ }
+ }
+ return err;
+}
+
+
/*
Generate the partition syntax from the partition data structure.
Useful for support of generating defaults, SHOW CREATE TABLES
@@ -2383,7 +2437,8 @@ char *generate_partition_syntax(partition_info *part_info,
bool use_sql_alloc,
bool show_partition_options,
HA_CREATE_INFO *create_info,
- Alter_info *alter_info)
+ Alter_info *alter_info,
+ const char *current_comment_start)
{
uint i,j, tot_num_parts, num_subparts;
partition_element *part_elem;
@@ -2417,7 +2472,8 @@ char *generate_partition_syntax(partition_info *part_info,
err+= add_string(fptr, partition_keywords[PKW_LINEAR].str);
if (part_info->list_of_part_fields)
{
- err+= add_part_key_word(fptr, partition_keywords[PKW_KEY].str);
+ err+= add_key_with_algorithm(fptr, part_info,
+ current_comment_start);
err+= add_part_field_list(fptr, part_info->part_field_list);
}
else
@@ -2457,8 +2513,9 @@ char *generate_partition_syntax(partition_info *part_info,
err+= add_string(fptr, partition_keywords[PKW_LINEAR].str);
if (part_info->list_of_subpart_fields)
{
- add_part_key_word(fptr, partition_keywords[PKW_KEY].str);
- add_part_field_list(fptr, part_info->subpart_field_list);
+ err+= add_key_with_algorithm(fptr, part_info,
+ current_comment_start);
+ err+= add_part_field_list(fptr, part_info->subpart_field_list);
}
else
err+= add_part_key_word(fptr, partition_keywords[PKW_HASH].str);
@@ -2667,10 +2724,82 @@ static uint32 calculate_key_value(Field **field_array)
{
ulong nr1= 1;
ulong nr2= 4;
+ bool use_51_hash;
+ use_51_hash= test((*field_array)->table->part_info->key_algorithm ==
+ partition_info::KEY_ALGORITHM_51);
do
{
Field *field= *field_array;
+ if (use_51_hash)
+ {
+ switch (field->real_type()) {
+ case MYSQL_TYPE_TINY:
+ case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_FLOAT:
+ case MYSQL_TYPE_DOUBLE:
+ case MYSQL_TYPE_NEWDECIMAL:
+ case MYSQL_TYPE_TIMESTAMP:
+ case MYSQL_TYPE_LONGLONG:
+ case MYSQL_TYPE_INT24:
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_YEAR:
+ case MYSQL_TYPE_NEWDATE:
+ {
+ if (field->is_null())
+ {
+ nr1^= (nr1 << 1) | 1;
+ continue;
+ }
+ /* Force this to my_hash_sort_bin, which was used in 5.1! */
+ uint len= field->pack_length();
+ my_charset_bin.coll->hash_sort(&my_charset_bin, field->ptr, len,
+ &nr1, &nr2);
+ /* Done with this field, continue with next one. */
+ continue;
+ }
+ case MYSQL_TYPE_STRING:
+ case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_BIT:
+ /* Not affected, same in 5.1 and 5.5 */
+ break;
+ /*
+ ENUM/SET uses my_hash_sort_simple in 5.1 (i.e. my_charset_latin1)
+ and my_hash_sort_bin in 5.5!
+ */
+ case MYSQL_TYPE_ENUM:
+ case MYSQL_TYPE_SET:
+ {
+ if (field->is_null())
+ {
+ nr1^= (nr1 << 1) | 1;
+ continue;
+ }
+ /* Force this to my_hash_sort_bin, which was used in 5.1! */
+ uint len= field->pack_length();
+ my_charset_latin1.coll->hash_sort(&my_charset_latin1, field->ptr,
+ len, &nr1, &nr2);
+ continue;
+ }
+ /* These types should not be allowed for partitioning! */
+ case MYSQL_TYPE_NULL:
+ case MYSQL_TYPE_DECIMAL:
+ case MYSQL_TYPE_DATE:
+ case MYSQL_TYPE_TINY_BLOB:
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ case MYSQL_TYPE_LONG_BLOB:
+ case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_VAR_STRING:
+ case MYSQL_TYPE_GEOMETRY:
+ /* fall through. */
+ default:
+ DBUG_ASSERT(0); // New type?
+ /* Fall through for default hashing (5.5). */
+ }
+ /* fall through, use collation based hashing. */
+ }
field->hash(&nr1, &nr2);
} while (*(++field_array));
return (uint32) nr1;
@@ -5411,14 +5540,25 @@ the generated partition syntax in a correct manner.
Need to cater for engine types that can handle partition without
using the partition handler.
*/
- if (thd->work_part_info != table->part_info)
+ if (part_info != table->part_info)
{
- DBUG_PRINT("info", ("partition changed"));
- *partition_changed= TRUE;
- if (thd->work_part_info->fix_parser_data(thd))
+ if (part_info->fix_parser_data(thd))
{
goto err;
}
+ /*
+ Compare the old and new part_info. If only key_algorithm
+ change is done, don't consider it as changed partitioning (to avoid
+ rebuild). This is to handle KEY (numeric_cols) partitioned tables
+ created in 5.1. For more info, see bug#14521864.
+ */
+ if (alter_info->flags != ALTER_PARTITION ||
+ !table->part_info ||
+ !table->part_info->has_same_partitioning(part_info))
+ {
+ DBUG_PRINT("info", ("partition changed"));
+ *partition_changed= true;
+ }
}
/*
Set up partition default_engine_type either from the create_info
@@ -6970,7 +7110,8 @@ void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
void mem_alloc_error(size_t size)
{
- my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(size));
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR),
+ static_cast<int>(size));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -7057,12 +7198,12 @@ void make_used_partitions_str(partition_info *part_info, String *parts_str)
definition)
IMPLEMENTATION
- There are two available interval analyzer functions:
- (1) get_part_iter_for_interval_via_mapping
+ There are three available interval analyzer functions:
+ (1) get_part_iter_for_interval_via_mapping
(2) get_part_iter_for_interval_cols_via_map
(3) get_part_iter_for_interval_via_walking
- They both have limited applicability:
+ They all have limited applicability:
(1) is applicable for "PARTITION BY <RANGE|LIST>(func(t.field))", where
func is a monotonic function.
@@ -7435,6 +7576,9 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
get_endpoint_func UNINIT_VAR(get_endpoint);
bool can_match_multiple_values; /* is not '=' */
uint field_len= field->pack_length_in_rec();
+ MYSQL_TIME start_date;
+ bool check_zero_dates= false;
+ bool zero_in_start_date= true;
DBUG_ENTER("get_part_iter_for_interval_via_mapping");
DBUG_ASSERT(!is_subpart);
(void) store_length_array;
@@ -7491,6 +7635,7 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
{
/* col is NOT NULL, but F(col) can return NULL, add NULL partition */
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
+ check_zero_dates= true;
}
}
@@ -7534,6 +7679,19 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
DBUG_RETURN(1);
}
part_iter->part_nums.cur= part_iter->part_nums.start;
+ if (check_zero_dates && !part_info->part_expr->null_value)
+ {
+ if (!(flags & NO_MAX_RANGE) &&
+ (field->type() == MYSQL_TYPE_DATE ||
+ field->type() == MYSQL_TYPE_DATETIME))
+ {
+ /* Monotonic, but return NULL for dates with zeros in month/day. */
+ zero_in_start_date= field->get_date(&start_date, 0);
+ DBUG_PRINT("info", ("zero start %u %04d-%02d-%02d",
+ zero_in_start_date, start_date.year,
+ start_date.month, start_date.day));
+ }
+ }
if (part_iter->part_nums.start == max_endpoint_val)
DBUG_RETURN(0); /* No partitions */
}
@@ -7547,6 +7705,29 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
store_key_image_to_rec(field, max_value, field_len);
bool include_endp= !test(flags & NEAR_MAX);
part_iter->part_nums.end= get_endpoint(part_info, 0, include_endp);
+ if (check_zero_dates &&
+ !zero_in_start_date &&
+ !part_info->part_expr->null_value)
+ {
+ MYSQL_TIME end_date;
+ bool zero_in_end_date= field->get_date(&end_date, 0);
+ /*
+ This is an optimization for TO_DAYS()/TO_SECONDS() to avoid scanning
+ the NULL partition for ranges that cannot include a date with 0 as
+ month/day.
+ */
+ DBUG_PRINT("info", ("zero end %u %04d-%02d-%02d",
+ zero_in_end_date,
+ end_date.year, end_date.month, end_date.day));
+ DBUG_ASSERT(!memcmp(((Item_func*) part_info->part_expr)->func_name(),
+ "to_days", 7) ||
+ !memcmp(((Item_func*) part_info->part_expr)->func_name(),
+ "to_seconds", 10));
+ if (!zero_in_end_date &&
+ start_date.month == end_date.month &&
+ start_date.year == end_date.year)
+ part_iter->ret_null_part= part_iter->ret_null_part_orig= false;
+ }
if (part_iter->part_nums.start >= part_iter->part_nums.end &&
!part_iter->ret_null_part)
DBUG_RETURN(0); /* No partitions */
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index 8db07f836b0..cf532c45c66 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -1,8 +1,7 @@
#ifndef SQL_PARTITION_INCLUDED
#define SQL_PARTITION_INCLUDED
-/*
- Copyright (c) 2006, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2006, 2013, Oracle and/or its affiliates.
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
@@ -267,7 +266,8 @@ char *generate_partition_syntax(partition_info *part_info,
uint *buf_length, bool use_sql_alloc,
bool show_partition_options,
HA_CREATE_INFO *create_info,
- Alter_info *alter_info);
+ Alter_info *alter_info,
+ const char *current_comment_start);
bool partition_key_modified(TABLE *table, const MY_BITMAP *fields);
#else
#define partition_key_modified(X,Y) 0
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 4edd47de855..b9bf3dbc217 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -141,7 +141,9 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd)
TODO: Add support for TRUNCATE PARTITION for NDB and other
engines supporting native partitioning.
*/
- if (first_table->table->s->db_type() != partition_hton)
+
+ if (!first_table->table || first_table->view ||
+ first_table->table->s->db_type() != partition_hton)
{
my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
DBUG_RETURN(TRUE);
diff --git a/sql/sql_plugin_compat.h b/sql/sql_plugin_compat.h
index 8c6014f8dc6..5c7bb620575 100644
--- a/sql/sql_plugin_compat.h
+++ b/sql/sql_plugin_compat.h
@@ -16,9 +16,9 @@
/* old plugin api structures, used for backward compatibility */
#define upgrade_var(X) latest->X= X
-#define upgrade_str(X) strmake(latest->X, X, sizeof(X))
+#define upgrade_str(X) strmake_buf(latest->X, X)
#define downgrade_var(X) X= latest->X
-#define downgrade_str(X) strmake(X, latest->X, sizeof(X)-1)
+#define downgrade_str(X) strmake_buf(X, latest->X)
/**************************************************************/
/* Authentication API, version 0x0100 *************************/
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 71b4a0cf817..4a728d30f25 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -879,7 +879,7 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
if (param->state == Item_param::NO_VALUE)
DBUG_RETURN(1);
- if (param->limit_clause_param && param->item_type != Item::INT_ITEM)
+ if (param->limit_clause_param)
{
param->set_int(param->val_int(), MY_INT64_NUM_DECIMAL_DIGITS);
param->item_type= Item::INT_ITEM;
@@ -1503,7 +1503,8 @@ static int mysql_test_select(Prepared_statement *stmt,
if (!lex->result && !(lex->result= new (stmt->mem_root) select_send))
{
- my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(select_send)));
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR),
+ static_cast<int>(sizeof(select_send)));
goto error;
}
@@ -1877,7 +1878,7 @@ static bool mysql_test_multidelete(Prepared_statement *stmt,
stmt->thd->lex->current_select= &stmt->thd->lex->select_lex;
if (add_item_to_list(stmt->thd, new Item_null()))
{
- my_error(ER_OUTOFMEMORY, MYF(0), 0);
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR), 0);
goto error;
}
@@ -3863,7 +3864,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
alloc_query(thd, (char*) expanded_query->ptr(),
expanded_query->length()))
{
- my_error(ER_OUTOFMEMORY, 0, expanded_query->length());
+ my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR), expanded_query->length());
goto error;
}
/*
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index d8aebbde8dc..1afe5addf0e 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2008, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -1821,6 +1821,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
uint8 current_checksum_alg= BINLOG_CHECKSUM_ALG_UNDEF;
int old_max_allowed_packet= thd->variables.max_allowed_packet;
+
#ifndef DBUG_OFF
int left_events = max_binlog_dump_events;
uint dbug_reconnect_counter= 0;
@@ -2147,9 +2148,12 @@ impossible position";
if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
goto err;
+ bool is_active_binlog= false;
while (!(killed= thd->killed) &&
!(error = Log_event::read_log_event(&log, packet, log_lock,
- current_checksum_alg)))
+ current_checksum_alg,
+ log_file_name,
+ &is_active_binlog)))
{
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
@@ -2263,6 +2267,13 @@ impossible position";
if (killed)
goto end;
+ DBUG_EXECUTE_IF("wait_after_binlog_EOF",
+ {
+ const char act[]= "now wait_for signal.rotate_finished";
+ DBUG_ASSERT(!debug_sync_set_action(current_thd,
+ STRING_WITH_LEN(act)));
+ };);
+
/*
TODO: now that we are logging the offset, check to make sure
the recorded offset and the actual match.
@@ -2273,8 +2284,11 @@ impossible position";
if (test_for_non_eof_log_read_errors(error, &errmsg))
goto err;
- if (!(flags & BINLOG_DUMP_NON_BLOCK) &&
- mysql_bin_log.is_active(log_file_name))
+ /*
+ We should only move to the next binlog when the last read event
+ came from a already deactivated binlog.
+ */
+ if (!(flags & BINLOG_DUMP_NON_BLOCK) && is_active_binlog)
{
/*
Block until there is more data in the log
@@ -2328,7 +2342,8 @@ impossible position";
mysql_mutex_unlock(log_lock);
read_packet = 1;
p_coord->pos= uint4korr(packet->ptr() + ev_offset + LOG_POS_OFFSET);
- event_type= (Log_event_type)((*packet)[LOG_EVENT_OFFSET+ev_offset]);
+ event_type=
+ (Log_event_type)((uchar)(*packet)[LOG_EVENT_OFFSET+ev_offset]);
break;
case LOG_READ_EOF:
@@ -2658,8 +2673,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
We don't check thd->lex->mi.log_file_name for NULL here
since it is checked in sql_yacc.yy
*/
- strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name,
- sizeof(mi->rli.until_log_name)-1);
+ strmake_buf(mi->rli.until_log_name, thd->lex->mi.log_file_name);
}
else if (thd->lex->mi.relay_log_pos)
{
@@ -2667,8 +2681,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
slave_errno=ER_BAD_SLAVE_UNTIL_COND;
mi->rli.until_condition= Relay_log_info::UNTIL_RELAY_POS;
mi->rli.until_log_pos= thd->lex->mi.relay_log_pos;
- strmake(mi->rli.until_log_name, thd->lex->mi.relay_log_name,
- sizeof(mi->rli.until_log_name)-1);
+ strmake_buf(mi->rli.until_log_name, thd->lex->mi.relay_log_name);
}
else if (thd->lex->mi.gtid_pos_str.str)
{
@@ -2976,14 +2989,15 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
*/
static bool get_string_parameter(char *to, const char *from, size_t length,
- const char *name)
+ const char *name, CHARSET_INFO *cs)
{
if (from) // Empty paramaters allowed
{
- size_t from_length;
- if ((from_length= strlen(from)) > length)
+ size_t from_length= strlen(from);
+ uint from_numchars= cs->cset->numchars(cs, from, from + from_length);
+ if (from_numchars > length / cs->mbmaxlen)
{
- my_error(ER_WRONG_STRING_LENGTH, MYF(0), from, name, (int) length);
+ my_error(ER_WRONG_STRING_LENGTH, MYF(0), from, name, length / cs->mbmaxlen);
return 1;
}
memcpy(to, from, from_length+1);
@@ -3103,9 +3117,9 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
/*
Before processing the command, save the previous state.
*/
- strmake(saved_host, mi->host, HOSTNAME_LENGTH);
+ strmake_buf(saved_host, mi->host);
saved_port= mi->port;
- strmake(saved_log_name, mi->master_log_name, FN_REFLEN - 1);
+ strmake_buf(saved_log_name, mi->master_log_name);
saved_log_pos= mi->master_log_pos;
saved_using_gtid= mi->using_gtid;
@@ -3121,8 +3135,7 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
}
if (lex_mi->log_file_name)
- strmake(mi->master_log_name, lex_mi->log_file_name,
- sizeof(mi->master_log_name)-1);
+ strmake_buf(mi->master_log_name, lex_mi->log_file_name);
if (lex_mi->pos)
{
mi->master_log_pos= lex_mi->pos;
@@ -3130,11 +3143,12 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
if (get_string_parameter(mi->host, lex_mi->host, sizeof(mi->host)-1,
- "MASTER_HOST") ||
+ "MASTER_HOST", system_charset_info) ||
get_string_parameter(mi->user, lex_mi->user, sizeof(mi->user)-1,
- "MASTER_USER") ||
+ "MASTER_USER", system_charset_info) ||
get_string_parameter(mi->password, lex_mi->password,
- sizeof(mi->password)-1, "MASTER_PASSWORD"))
+ sizeof(mi->password)-1, "MASTER_PASSWORD",
+ &my_charset_bin))
{
ret= TRUE;
goto err;
@@ -3186,15 +3200,15 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
(lex_mi->ssl_verify_server_cert == LEX_MASTER_INFO::LEX_MI_ENABLE);
if (lex_mi->ssl_ca)
- strmake(mi->ssl_ca, lex_mi->ssl_ca, sizeof(mi->ssl_ca)-1);
+ strmake_buf(mi->ssl_ca, lex_mi->ssl_ca);
if (lex_mi->ssl_capath)
- strmake(mi->ssl_capath, lex_mi->ssl_capath, sizeof(mi->ssl_capath)-1);
+ strmake_buf(mi->ssl_capath, lex_mi->ssl_capath);
if (lex_mi->ssl_cert)
- strmake(mi->ssl_cert, lex_mi->ssl_cert, sizeof(mi->ssl_cert)-1);
+ strmake_buf(mi->ssl_cert, lex_mi->ssl_cert);
if (lex_mi->ssl_cipher)
- strmake(mi->ssl_cipher, lex_mi->ssl_cipher, sizeof(mi->ssl_cipher)-1);
+ strmake_buf(mi->ssl_cipher, lex_mi->ssl_cipher);
if (lex_mi->ssl_key)
- strmake(mi->ssl_key, lex_mi->ssl_key, sizeof(mi->ssl_key)-1);
+ strmake_buf(mi->ssl_key, lex_mi->ssl_key);
#ifndef HAVE_OPENSSL
if (lex_mi->ssl || lex_mi->ssl_ca || lex_mi->ssl_capath ||
lex_mi->ssl_cert || lex_mi->ssl_cipher || lex_mi->ssl_key ||
@@ -3208,10 +3222,8 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
need_relay_log_purge= 0;
char relay_log_name[FN_REFLEN];
mi->rli.relay_log.make_log_name(relay_log_name, lex_mi->relay_log_name);
- strmake(mi->rli.group_relay_log_name, relay_log_name,
- sizeof(mi->rli.group_relay_log_name)-1);
- strmake(mi->rli.event_relay_log_name, relay_log_name,
- sizeof(mi->rli.event_relay_log_name)-1);
+ strmake_buf(mi->rli.group_relay_log_name, relay_log_name);
+ strmake_buf(mi->rli.event_relay_log_name, relay_log_name);
}
if (lex_mi->relay_log_pos)
@@ -3256,8 +3268,7 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
*/
mi->master_log_pos = max(BIN_LOG_HEADER_SIZE,
mi->rli.group_master_log_pos);
- strmake(mi->master_log_name, mi->rli.group_master_log_name,
- sizeof(mi->master_log_name)-1);
+ strmake_buf(mi->master_log_name, mi->rli.group_master_log_name);
}
/*
@@ -3321,8 +3332,7 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
*/
mi->rli.group_master_log_pos= mi->master_log_pos;
DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
- strmake(mi->rli.group_master_log_name,mi->master_log_name,
- sizeof(mi->rli.group_master_log_name)-1);
+ strmake_buf(mi->rli.group_master_log_name,mi->master_log_name);
if (!mi->rli.group_master_log_name[0]) // uninitialized case
mi->rli.group_master_log_pos=0;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a48eff66386..64128dacc29 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2499,7 +2499,12 @@ void JOIN::exec_inner()
List<Item> *curr_all_fields= &all_fields;
List<Item> *curr_fields_list= &fields_list;
TABLE *curr_tmp_table= 0;
- bool tmp_having_used_tables_updated= FALSE;
+ /*
+ curr_join->join_free() will call JOIN::cleanup(full=TRUE). It will not
+ be safe to call update_used_tables() after that.
+ */
+ if (curr_join->tmp_having)
+ curr_join->tmp_having->update_used_tables();
/*
Initialize examined rows here because the values from all join parts
@@ -2755,16 +2760,6 @@ void JOIN::exec_inner()
curr_join->select_distinct=0; /* Each row is unique */
- /*
- curr_join->join_free() will call JOIN::cleanup(full=TRUE). It will not
- be safe to call update_used_tables() after that.
- */
- if (curr_join->tmp_having)
- {
- curr_join->tmp_having->update_used_tables();
- tmp_having_used_tables_updated= TRUE;
- }
-
curr_join->join_free(); /* Free quick selects */
if (curr_join->select_distinct && ! curr_join->group_list)
@@ -2845,9 +2840,6 @@ void JOIN::exec_inner()
if (curr_join->tmp_having && ! curr_join->group_list &&
! curr_join->sort_and_group)
{
- // Some tables may have been const
- if (!tmp_having_used_tables_updated)
- curr_join->tmp_having->update_used_tables();
JOIN_TAB *curr_table= &curr_join->join_tab[curr_join->const_tables];
table_map used_tables= (curr_join->const_table_map |
curr_table->table->map);
@@ -3696,9 +3688,16 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
!table->fulltext_searched &&
(!embedding || (embedding->sj_on_expr && !embedding->embedding)))
{
+ key_map base_part, base_const_ref, base_eq_part;
+ base_part.set_prefix(keyinfo->key_parts);
+ base_const_ref= const_ref;
+ base_const_ref.intersect(base_part);
+ base_eq_part= eq_part;
+ base_eq_part.intersect(base_part);
if (table->actual_key_flags(keyinfo) & HA_NOSAME)
{
- if (const_ref == eq_part &&
+
+ if (base_const_ref == base_eq_part &&
!has_expensive_keyparts &&
!((outer_join & table->map) &&
(*s->on_expr_ref)->is_expensive()))
@@ -3724,7 +3723,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
else
found_ref|= refs; // Table is const if all refs are const
}
- else if (const_ref == eq_part)
+ else if (base_const_ref == base_eq_part)
s->const_keys.set_bit(key);
}
}
@@ -11420,7 +11419,7 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
*simple_order=0; // Must do a temp table to sort
else if (!(order_tables & not_const_tables))
{
- if (order->item[0]->with_subselect)
+ if (order->item[0]->has_subquery())
{
/*
Delay the evaluation of constant ORDER and/or GROUP expressions that
@@ -13739,13 +13738,13 @@ static void restore_prev_nj_state(JOIN_TAB *last)
bool was_fully_covered= nest->is_fully_covered();
+ join->cur_embedding_map|= nest->nj_map;
+
if (--nest->counter == 0)
join->cur_embedding_map&= ~nest->nj_map;
if (!was_fully_covered)
break;
-
- join->cur_embedding_map|= nest->nj_map;
}
}
}
@@ -13965,7 +13964,27 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
if (new_item_and_list->is_empty())
li.remove();
else
+ {
+ Item *list_item;
+ Item *new_list_item;
+ uint cnt= new_item_and_list->elements;
+ List_iterator<Item> it(*new_item_and_list);
+ while ((list_item= it++))
+ {
+ uchar* is_subst_valid= (uchar *) Item::ANY_SUBST;
+ new_list_item=
+ list_item->compile(&Item::subst_argument_checker,
+ &is_subst_valid,
+ &Item::equal_fields_propagator,
+ (uchar *) &cond_and->cond_equal);
+ if (new_list_item != list_item)
+ it.replace(new_list_item);
+ new_list_item->update_used_tables();
+ }
li.replace(*new_item_and_list);
+ for (cnt--; cnt; cnt--)
+ item= li++;
+ }
cond_and_list->concat((List<Item>*) cond_equal_items);
}
else if (new_item->type() == Item::FUNC_ITEM &&
@@ -13985,7 +14004,13 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
if (new_item->type() == Item::COND_ITEM &&
((Item_cond*) new_item)->functype() ==
((Item_cond*) cond)->functype())
- li.replace(*((Item_cond*) new_item)->argument_list());
+ {
+ List<Item> *arg_list= ((Item_cond*) new_item)->argument_list();
+ uint cnt= arg_list->elements;
+ li.replace(*arg_list);
+ for ( cnt--; cnt; cnt--)
+ item= li++;
+ }
else
li.replace(new_item);
}
@@ -19363,7 +19388,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
!(table->file->index_flags(best_key, 0, 1) & HA_CLUSTERED_INDEX)))
goto use_filesort;
- if (table->quick_keys.is_set(best_key) && best_key != ref_key)
+ if (select &&
+ table->quick_keys.is_set(best_key) && best_key != ref_key)
{
key_map map;
map.clear_all(); // Force the creation of quick select
@@ -19941,7 +19967,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
}
if (copy_blobs(first_field))
{
- my_message(ER_OUTOFMEMORY, ER(ER_OUTOFMEMORY), MYF(0));
+ my_message(ER_OUTOFMEMORY, ER(ER_OUTOFMEMORY), MYF(ME_FATALERROR));
error=0;
goto err;
}
@@ -19974,7 +20000,8 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
if (!found)
break; // End of file
/* Restart search on saved row */
- error=file->restart_rnd_next(record);
+ if ((error= file->restart_rnd_next(record)))
+ goto err;
}
file->extra(HA_EXTRA_NO_CACHE);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index b448e5a64b9..ae0360b7ed0 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -1561,6 +1561,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
MODE_MYSQL323 |
MODE_MYSQL40)) != 0;
my_bitmap_map *old_map;
+ int error= 0;
DBUG_ENTER("store_create_info");
DBUG_PRINT("enter",("table: %s", table->s->table_name.str));
@@ -1924,28 +1925,35 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
{
- /*
- Partition syntax for CREATE TABLE is at the end of the syntax.
- */
- uint part_syntax_len;
- char *part_syntax;
if (table->part_info &&
- (!table->part_info->is_auto_partitioned) &&
- ((part_syntax= generate_partition_syntax(table->part_info,
+ !((table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION) &&
+ table->part_info->is_auto_partitioned))
+ {
+ /*
+ Partition syntax for CREATE TABLE is at the end of the syntax.
+ */
+ uint part_syntax_len;
+ char *part_syntax;
+ String comment_start;
+ table->part_info->set_show_version_string(&comment_start);
+ if ((part_syntax= generate_partition_syntax(table->part_info,
&part_syntax_len,
FALSE,
show_table_options,
- NULL, NULL))))
- {
- table->part_info->set_show_version_string(packet);
- packet->append(part_syntax, part_syntax_len);
- packet->append(STRING_WITH_LEN(" */"));
- my_free(part_syntax);
+ NULL, NULL,
+ comment_start.c_ptr())))
+ {
+ packet->append(comment_start);
+ if (packet->append(part_syntax, part_syntax_len) ||
+ packet->append(STRING_WITH_LEN(" */")))
+ error= 1;
+ my_free(part_syntax);
+ }
}
}
#endif
tmp_restore_column_map(table->read_set, old_map);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
@@ -2185,7 +2193,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
DBUG_ENTER("mysqld_list_processes");
field_list.push_back(new Item_int("Id", 0, MY_INT32_NUM_DECIMAL_DIGITS));
- field_list.push_back(new Item_empty_string("User",16));
+ field_list.push_back(new Item_empty_string("User", USERNAME_CHAR_LENGTH));
field_list.push_back(new Item_empty_string("Host",LIST_PROCESS_HOST_LEN));
field_list.push_back(field=new Item_empty_string("db",NAME_CHAR_LEN));
field->maybe_null=1;
@@ -7251,7 +7259,7 @@ struct schema_table_ref
ST_FIELD_INFO user_stats_fields_info[]=
{
- {"USER", USERNAME_LENGTH, MYSQL_TYPE_STRING, 0, 0, "User", SKIP_OPEN_TABLE},
+ {"USER", USERNAME_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "User", SKIP_OPEN_TABLE},
{"TOTAL_CONNECTIONS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections",SKIP_OPEN_TABLE},
{"CONCURRENT_CONNECTIONS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections",SKIP_OPEN_TABLE},
{"CONNECTED_TIME", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time",SKIP_OPEN_TABLE},
@@ -8622,7 +8630,8 @@ ST_FIELD_INFO variables_fields_info[]=
ST_FIELD_INFO processlist_fields_info[]=
{
{"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", SKIP_OPEN_TABLE},
- {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User", SKIP_OPEN_TABLE},
+ {"USER", USERNAME_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "User",
+ SKIP_OPEN_TABLE},
{"HOST", LIST_PROCESS_HOST_LEN, MYSQL_TYPE_STRING, 0, 0, "Host",
SKIP_OPEN_TABLE},
{"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db", SKIP_OPEN_TABLE},
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 095c557c531..4c1e4af5ff5 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -758,7 +758,7 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
{
if (from->Alloced_length >= from_length)
return from;
- if (from->alloced || !to || from == to)
+ if ((from->alloced && (from->Alloced_length != 0)) || !to || from == to)
{
(void) from->realloc(from_length);
return from;
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 58cda343dac..9367a25b6be 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -378,6 +378,16 @@ public:
}
return 0;
}
+ bool append_hex(const char *src, uint32 srclen)
+ {
+ for (const char *end= src + srclen ; src != end ; src++)
+ {
+ if (append(_dig_vec_lower[((uchar) *src) >> 4]) ||
+ append(_dig_vec_lower[((uchar) *src) & 0x0F]))
+ return true;
+ }
+ return false;
+ }
bool fill(uint32 max_length,char fill);
void strip_sp();
friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 9079bca7c1d..20e19484aa7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
@@ -53,6 +53,7 @@
#include "sql_parse.h"
#include "sql_show.h"
#include "transaction.h"
+#include "sql_audit.h"
#ifdef __WIN__
#include <io.h>
@@ -1686,7 +1687,8 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
&syntax_len,
TRUE, TRUE,
lpt->create_info,
- lpt->alter_info)))
+ lpt->alter_info,
+ NULL)))
{
DBUG_RETURN(TRUE);
}
@@ -1789,7 +1791,8 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
&syntax_len,
TRUE, TRUE,
lpt->create_info,
- lpt->alter_info)))
+ lpt->alter_info,
+ NULL)))
{
error= 1;
goto err;
@@ -2370,6 +2373,10 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables.append(',');
wrong_tables.append(String(table->table_name,system_charset_info));
}
+ else
+ {
+ mysql_audit_drop_table(thd, table);
+ }
DBUG_PRINT("table", ("table: 0x%lx s: 0x%lx", (long) table->table,
table->table ? (long) table->table->s : (long) -1));
@@ -4194,7 +4201,8 @@ handler *mysql_create_frm_image(THD *thd,
&syntax_len,
TRUE, TRUE,
create_info,
- alter_info)))
+ alter_info,
+ NULL)))
goto err;
part_info->part_info_string= part_syntax_buf;
part_info->part_info_len= syntax_len;
@@ -4666,6 +4674,8 @@ mysql_rename_table(handlerton *base, const char *old_db,
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "ALTER TABLE");
else if (error)
my_error(ER_ERROR_ON_RENAME, MYF(0), from, to, error);
+ else if (!(flags & FN_IS_TMP))
+ mysql_audit_rename_table(thd, old_db, old_name, new_db, new_name);
DBUG_RETURN(error != 0);
}
@@ -6321,6 +6331,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
mysql_ha_rm_tables(thd, table_list);
+ mysql_audit_alter_table(thd, table_list);
+
/* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */
if (alter_info->tablespace_op != NO_TABLESPACE_OP)
/* Conditionally writes to binlog. */
@@ -6990,6 +7002,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
HA_OPTION_PACK_RECORD));
}
tmp_disable_binlog(thd);
+ create_info->options|=HA_CREATE_TMP_ALTER;
error= mysql_create_table_no_lock(thd, new_db, tmp_name, create_info,
alter_info, NULL, create_table_mode);
reenable_binlog(thd);
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 5b3286d77b0..93b35b4918f 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -629,7 +629,7 @@ Max used alarms: %u\n\
Next alarm time: %lu\n",
alarm_info.active_alarms,
alarm_info.max_used_alarms,
- alarm_info.next_alarm_time);
+ (ulong)alarm_info.next_alarm_time);
#endif
display_table_locks();
fflush(stdout);
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 37f6af13bb7..c4aa0dc84e9 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1152,9 +1152,10 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
TODO: when VIEWs will be stored in cache, table mem_root should
be used here
*/
- if (parser->parse((uchar*)table, thd->mem_root, view_parameters,
- required_view_parameters, &file_parser_dummy_hook))
- goto err;
+ if ((result= parser->parse((uchar*)table, thd->mem_root,
+ view_parameters, required_view_parameters,
+ &file_parser_dummy_hook)))
+ goto end;
/*
check old format view .frm
@@ -1217,6 +1218,11 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
now Lex placed in statement memory
*/
table->view= lex= thd->lex= (LEX*) new(thd->mem_root) st_lex_local;
+ if (!table->view)
+ {
+ result= true;
+ goto end;
+ }
{
char old_db_buf[SAFE_NAME_LEN+1];
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index d02f87c6bab..2634470d916 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2010, 2011 Monty Program Ab
+ Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2010, 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
@@ -1023,6 +1023,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token HAVING /* SQL-2003-R */
%token HELP_SYM
%token HEX_NUM
+%token HEX_STRING
%token HIGH_PRIORITY
%token HOST_SYM
%token HOSTS_SYM
@@ -1454,7 +1455,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%left INTERVAL_SYM
%type <lex_str>
- IDENT IDENT_QUOTED TEXT_STRING DECIMAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM
+ IDENT IDENT_QUOTED TEXT_STRING DECIMAL_NUM FLOAT_NUM NUM LONG_NUM
+ HEX_NUM HEX_STRING hex_num_or_string
LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text
IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
NCHAR_STRING opt_component key_cache_name
@@ -4464,7 +4466,7 @@ partition:
;
part_type_def:
- opt_linear KEY_SYM '(' part_field_list ')'
+ opt_linear KEY_SYM opt_key_algo '(' part_field_list ')'
{
partition_info *part_info= Lex->part_info;
part_info->list_of_part_fields= TRUE;
@@ -4490,6 +4492,25 @@ opt_linear:
{ Lex->part_info->linear_hash_ind= TRUE;}
;
+opt_key_algo:
+ /* empty */
+ { Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_NONE;}
+ | ALGORITHM_SYM EQ real_ulong_num
+ {
+ switch ($3) {
+ case 1:
+ Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_51;
+ break;
+ case 2:
+ Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_55;
+ break;
+ default:
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+ }
+ }
+ ;
+
part_field_list:
/* empty */ {}
| part_field_item_list {}
@@ -4571,7 +4592,7 @@ opt_sub_part:
| SUBPARTITION_SYM BY opt_linear HASH_SYM sub_part_func
{ Lex->part_info->subpart_type= HASH_PARTITION; }
opt_num_subparts {}
- | SUBPARTITION_SYM BY opt_linear KEY_SYM
+ | SUBPARTITION_SYM BY opt_linear KEY_SYM opt_key_algo
'(' sub_part_field_list ')'
{
partition_info *part_info= Lex->part_info;
@@ -6032,6 +6053,11 @@ now_or_signed_literal:
{ $$=$1; }
;
+hex_num_or_string:
+ HEX_NUM {}
+ | HEX_STRING {}
+ ;
+
charset:
CHAR_SYM SET {}
| CHARSET {}
@@ -12475,7 +12501,7 @@ text_string:
}
| HEX_NUM
{
- Item *tmp= new (YYTHD->mem_root) Item_hex_string($1.str, $1.length);
+ Item *tmp= new (YYTHD->mem_root) Item_hex_hybrid($1.str, $1.length);
if (tmp == NULL)
MYSQL_YYABORT;
/*
@@ -12485,6 +12511,14 @@ text_string:
tmp->quick_fix_field();
$$= tmp->val_str((String*) 0);
}
+ | HEX_STRING
+ {
+ Item *tmp= new (YYTHD->mem_root) Item_hex_string($1.str, $1.length);
+ if (tmp == NULL)
+ MYSQL_YYABORT;
+ tmp->quick_fix_field();
+ $$= tmp->val_str((String*) 0);
+ }
| BIN_NUM
{
Item *tmp= new (YYTHD->mem_root) Item_bin_string($1.str, $1.length);
@@ -12554,6 +12588,12 @@ literal:
}
| HEX_NUM
{
+ $$ = new (YYTHD->mem_root) Item_hex_hybrid($1.str, $1.length);
+ if ($$ == NULL)
+ MYSQL_YYABORT;
+ }
+ | HEX_STRING
+ {
$$ = new (YYTHD->mem_root) Item_hex_string($1.str, $1.length);
if ($$ == NULL)
MYSQL_YYABORT;
@@ -12564,7 +12604,7 @@ literal:
if ($$ == NULL)
MYSQL_YYABORT;
}
- | UNDERSCORE_CHARSET HEX_NUM
+ | UNDERSCORE_CHARSET hex_num_or_string
{
Item *tmp= new (YYTHD->mem_root) Item_hex_string($2.str, $2.length);
if (tmp == NULL)
@@ -13120,7 +13160,7 @@ user:
$$->auth= empty_lex_str;
if (check_string_char_length(&$$->user, ER(ER_USERNAME),
- USERNAME_CHAR_LENGTH,
+ username_char_length,
system_charset_info, 0))
MYSQL_YYABORT;
}
@@ -13135,7 +13175,7 @@ user:
$$->auth= empty_lex_str;
if (check_string_char_length(&$$->user, ER(ER_USERNAME),
- USERNAME_CHAR_LENGTH,
+ username_char_length,
system_charset_info, 0) ||
check_host_name(&$$->host))
MYSQL_YYABORT;
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index 94251660e37..41fe87e19d3 100644
--- a/sql/threadpool_unix.cc
+++ b/sql/threadpool_unix.cc
@@ -286,6 +286,20 @@ static void *native_event_get_userdata(native_event *event)
}
#elif defined(HAVE_KQUEUE)
+
+/*
+ NetBSD is incompatible with other BSDs , last parameter in EV_SET macro
+ (udata, user data) needs to be intptr_t, whereas it needs to be void*
+ everywhere else.
+*/
+
+#ifdef __NetBSD__
+#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, (intptr_t)g)
+#else
+#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, g)
+#endif
+
+
int io_poll_create()
{
return kqueue();
@@ -294,7 +308,7 @@ int io_poll_create()
int io_poll_start_read(int pollfd, int fd, void *data)
{
struct kevent ke;
- EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT,
+ MY_EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT,
0, 0, data);
return kevent(pollfd, &ke, 1, 0, 0, 0);
}
@@ -303,7 +317,7 @@ int io_poll_start_read(int pollfd, int fd, void *data)
int io_poll_associate_fd(int pollfd, int fd, void *data)
{
struct kevent ke;
- EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT,
+ MY_EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT,
0, 0, data);
return io_poll_start_read(pollfd,fd, data);
}
@@ -312,7 +326,7 @@ int io_poll_associate_fd(int pollfd, int fd, void *data)
int io_poll_disassociate_fd(int pollfd, int fd)
{
struct kevent ke;
- EV_SET(&ke,fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
+ MY_EV_SET(&ke,fd, EVFILT_READ, EV_DELETE, 0, 0, 0);
return kevent(pollfd, &ke, 1, 0, 0, 0);
}
@@ -337,7 +351,7 @@ int io_poll_wait(int pollfd, struct kevent *events, int maxevents, int timeout_m
static void* native_event_get_userdata(native_event *event)
{
- return event->udata;
+ return (void *)event->udata;
}
#elif defined (__sun)
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 5e1e8bec7b3..f5e9182522e 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2559,7 +2559,7 @@ main(int argc, char **argv)
if (argc == 2)
{
- root_name_end= strmake(fullname, argv[1], FN_REFLEN);
+ root_name_end= strmake_buf(fullname, argv[1]);
printf("TRUNCATE TABLE time_zone;\n");
printf("TRUNCATE TABLE time_zone_name;\n");
@@ -2713,7 +2713,7 @@ main(int argc, char **argv)
(int)t, (int)t1);
/* Let us load time zone description */
- str_end= strmake(fullname, TZDIR, FN_REFLEN);
+ str_end= strmake_buf(fullname, TZDIR);
strmake(str_end, "/MET", FN_REFLEN - (str_end - fullname));
if (tz_load(fullname, &tz_info, &tz_storage))
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 872eecff9cd..996dee5dce8 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -587,7 +587,7 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
buf_len= min(table->s->connect_string.length,
FEDERATED_QUERY_BUFFER_SIZE-1);
strmake(buf, table->s->connect_string.str, buf_len);
- my_error(error_num, MYF(0), buf);
+ my_error(error_num, MYF(0), buf, 14);
DBUG_RETURN(error_num);
}
@@ -3225,7 +3225,7 @@ int ha_federated::stash_remote_error()
if (!mysql)
DBUG_RETURN(remote_error_number);
remote_error_number= mysql_errno(mysql);
- strmake(remote_error_buf, mysql_error(mysql), sizeof(remote_error_buf)-1);
+ strmake_buf(remote_error_buf, mysql_error(mysql));
if (remote_error_number == ER_DUP_ENTRY ||
remote_error_number == ER_DUP_KEY)
DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index c3f5e6add73..a7f2d887952 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -527,7 +527,7 @@ static int parse_url_error(FEDERATEDX_SHARE *share, TABLE_SHARE *table_s,
buf_len= min(table_s->connect_string.length,
FEDERATEDX_QUERY_BUFFER_SIZE-1);
strmake(buf, table_s->connect_string.str, buf_len);
- my_error(error_num, MYF(0), buf);
+ my_error(error_num, MYF(0), buf, 14);
DBUG_RETURN(error_num);
}
@@ -587,9 +587,8 @@ int get_connection(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share)
DBUG_RETURN(0);
error:
- sprintf(error_buffer, "server name: '%s' doesn't exist!",
- share->connection_string);
- my_error(error_num, MYF(0), error_buffer);
+ my_printf_error(error_num, "server name: '%s' doesn't exist!",
+ MYF(0), share->connection_string);
DBUG_RETURN(error_num);
}
@@ -3423,7 +3422,7 @@ int ha_federatedx::stash_remote_error()
if (!io)
DBUG_RETURN(remote_error_number);
remote_error_number= io->error_code();
- strmake(remote_error_buf, io->error_str(), sizeof(remote_error_buf)-1);
+ strmake_buf(remote_error_buf, io->error_str());
if (remote_error_number == ER_DUP_ENTRY ||
remote_error_number == ER_DUP_KEY)
DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
index 955be01f032..b48fb705cd8 100644
--- a/storage/innobase/btr/btr0cur.c
+++ b/storage/innobase/btr/btr0cur.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -1248,27 +1248,13 @@ btr_cur_optimistic_insert(
Subtract one byte for the encoded heap_no in the
modification log. */
ulint free_space_zip = page_zip_empty_size(
- cursor->index->n_fields, zip_size) - 1;
+ cursor->index->n_fields, zip_size);
ulint n_uniq = dict_index_get_n_unique_in_tree(index);
ut_ad(dict_table_is_comp(index->table));
- /* There should be enough room for two node pointer
- records on an empty non-leaf page. This prevents
- infinite page splits. */
-
- if (UNIV_LIKELY(entry->n_fields >= n_uniq)
- && UNIV_UNLIKELY(REC_NODE_PTR_SIZE
- + rec_get_converted_size_comp_prefix(
- index, entry->fields, n_uniq,
- NULL)
- /* On a compressed page, there is
- a two-byte entry in the dense
- page directory for every record.
- But there is no record header. */
- - (REC_N_NEW_EXTRA_BYTES - 2)
- > free_space_zip / 2)) {
-
+ if (free_space_zip == 0) {
+too_big:
if (big_rec_vec) {
dtuple_convert_back_big_rec(
index, entry, big_rec_vec);
@@ -1276,6 +1262,27 @@ btr_cur_optimistic_insert(
return(DB_TOO_BIG_RECORD);
}
+
+ /* Subtract one byte for the encoded heap_no in the
+ modification log. */
+ free_space_zip--;
+
+ /* There should be enough room for two node pointer
+ records on an empty non-leaf page. This prevents
+ infinite page splits. */
+
+ if (entry->n_fields >= n_uniq
+ && (REC_NODE_PTR_SIZE
+ + rec_get_converted_size_comp_prefix(
+ index, entry->fields, n_uniq, NULL)
+ /* On a compressed page, there is
+ a two-byte entry in the dense
+ page directory for every record.
+ But there is no record header. */
+ - (REC_N_NEW_EXTRA_BYTES - 2)
+ > free_space_zip / 2)) {
+ goto too_big;
+ }
}
LIMIT_OPTIMISTIC_INSERT_DEBUG(page_get_n_recs(page),
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index 2406980196e..31be914afa0 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -2322,6 +2322,10 @@ loop2:
retries = 0;
} else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
++retries;
+ DBUG_EXECUTE_IF(
+ "innodb_page_corruption_retries",
+ retries = BUF_PAGE_READ_MAX_RETRIES;
+ );
} else {
fprintf(stderr, "InnoDB: Error: Unable"
" to read tablespace %lu page no"
@@ -2359,6 +2363,7 @@ got_block:
/* The page is being read to buffer pool,
but we cannot wait around for the read to
complete. */
+null_exit:
buf_pool_mutex_exit(buf_pool);
return(NULL);
@@ -2373,6 +2378,14 @@ got_block:
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
+ if (mode == BUF_PEEK_IF_IN_POOL) {
+ /* This mode is only used for dropping an
+ adaptive hash index. There cannot be an
+ adaptive hash index for a compressed-only
+ page, so do not bother decompressing the page. */
+ goto null_exit;
+ }
+
bpage = &block->page;
/* Protect bpage->buf_fix_count. */
mutex_enter(&buf_pool->zip_mutex);
diff --git a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
index 40550186191..d12fd3fce31 100644
--- a/storage/innobase/buf/buf0rea.c
+++ b/storage/innobase/buf/buf0rea.c
@@ -177,7 +177,10 @@ buf_read_page_low(
ut_ad(buf_page_in_file(bpage));
- thd_wait_begin(NULL, THD_WAIT_DISKIO);
+ if (sync) {
+ thd_wait_begin(NULL, THD_WAIT_DISKIO);
+ }
+
if (zip_size) {
*err = fil_io(OS_FILE_READ | wake_later,
sync, space, zip_size, offset, 0, zip_size,
@@ -189,7 +192,10 @@ buf_read_page_low(
sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
((buf_block_t*) bpage)->frame, bpage);
}
- thd_wait_end(NULL);
+
+ if (sync) {
+ thd_wait_end(NULL);
+ }
if (*err == DB_TABLESPACE_DELETED) {
buf_read_page_handle_error(bpage);
diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c
index d7373a4b8ef..cb3dbcbe4ac 100644
--- a/storage/innobase/dict/dict0crea.c
+++ b/storage/innobase/dict/dict0crea.c
@@ -42,6 +42,7 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0roll.h"
#include "usr0sess.h"
#include "ut0vec.h"
+#include "ha_prototypes.h"
/*****************************************************************//**
Based on a table object, this function builds the entry to be inserted
@@ -1427,12 +1428,20 @@ dict_create_add_foreign_to_dictionary(
pars_info_t* info = pars_info_create();
if (foreign->id == NULL) {
+ char* stripped_name;
/* Generate a new constraint id */
ulint namelen = strlen(table->name);
char* id = mem_heap_alloc(foreign->heap, namelen + 20);
/* no overflow if number < 1e13 */
sprintf(id, "%s_ibfk_%lu", table->name, (ulong) (*id_nr)++);
foreign->id = id;
+
+ stripped_name = strchr(foreign->id, '/') + 1;
+ if (innobase_check_identifier_length(stripped_name)) {
+ fprintf(stderr, "InnoDB: Generated foreign key "
+ "name (%s) is too long\n", foreign->id);
+ return(DB_IDENTIFIER_TOO_LONG);
+ }
}
pars_info_add_str_literal(info, "id", foreign->id);
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index d5b16d419f1..a887ff0b1ca 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -1466,6 +1466,10 @@ dict_index_too_big_for_tree(
/* maximum allowed size of a node pointer record */
ulint page_ptr_max;
+ DBUG_EXECUTE_IF(
+ "ib_force_create_table",
+ return(FALSE););
+
comp = dict_table_is_comp(table);
zip_size = dict_table_zip_size(table);
@@ -1480,7 +1484,10 @@ dict_index_too_big_for_tree(
number in the page modification log. The maximum
allowed node pointer size is half that. */
page_rec_max = page_zip_empty_size(new_index->n_fields,
- zip_size) - 1;
+ zip_size);
+ if (page_rec_max) {
+ page_rec_max--;
+ }
page_ptr_max = page_rec_max / 2;
/* On a compressed page, there is a two-byte entry in
the dense page directory for every record. But there
@@ -4672,6 +4679,7 @@ dict_print_info_on_foreign_key_in_create_format(
dict_foreign_t* foreign, /*!< in: foreign key constraint */
ibool add_newline) /*!< in: whether to add a newline */
{
+ char constraint_name[MAX_TABLE_NAME_LEN];
const char* stripped_id;
ulint i;
@@ -4693,7 +4701,9 @@ dict_print_info_on_foreign_key_in_create_format(
}
fputs(" CONSTRAINT ", file);
- ut_print_name(file, trx, FALSE, stripped_id);
+ innobase_convert_from_id(&my_charset_filename, constraint_name,
+ stripped_id, MAX_TABLE_NAME_LEN);
+ ut_print_name(file, trx, FALSE, constraint_name);
fputs(" FOREIGN KEY (", file);
for (i = 0;;) {
diff --git a/storage/innobase/dyn/dyn0dyn.c b/storage/innobase/dyn/dyn0dyn.c
index e1275f040f3..d0f50ad0c32 100644
--- a/storage/innobase/dyn/dyn0dyn.c
+++ b/storage/innobase/dyn/dyn0dyn.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -11,8 +11,8 @@ 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
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -35,7 +35,7 @@ UNIV_INTERN
dyn_block_t*
dyn_array_add_block(
/*================*/
- dyn_array_t* arr) /*!< in: dyn array */
+ dyn_array_t* arr) /*!< in/out: dyn array */
{
mem_heap_t* heap;
dyn_block_t* block;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 4d8f1c7398e..4b77936550b 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -1082,6 +1082,8 @@ convert_error_code_to_mysql(
return(HA_ERR_UNDO_REC_TOO_BIG);
case DB_OUT_OF_MEMORY:
return(HA_ERR_OUT_OF_MEM);
+ case DB_IDENTIFIER_TOO_LONG:
+ return(HA_ERR_INTERNAL_ERROR);
}
}
@@ -1162,6 +1164,37 @@ innobase_convert_from_table_id(
strconvert(cs, from, &my_charset_filename, to, (uint) len, &errors);
}
+/**********************************************************************
+Check if the length of the identifier exceeds the maximum allowed.
+The input to this function is an identifier in charset my_charset_filename.
+return true when length of identifier is too long. */
+extern "C" UNIV_INTERN
+my_bool
+innobase_check_identifier_length(
+/*=============================*/
+ const char* id) /* in: identifier to check. it must belong
+ to charset my_charset_filename */
+{
+ char tmp[MAX_TABLE_NAME_LEN + 10];
+ uint errors;
+ uint len;
+ int well_formed_error = 0;
+ CHARSET_INFO* cs1 = &my_charset_filename;
+ CHARSET_INFO* cs2 = thd_charset(current_thd);
+
+ len = strconvert(cs1, id, cs2, tmp, MAX_TABLE_NAME_LEN + 10, &errors);
+
+ uint res = cs2->cset->well_formed_len(cs2, tmp, tmp + len,
+ NAME_CHAR_LEN,
+ &well_formed_error);
+
+ if (well_formed_error || res != len) {
+ my_error(ER_TOO_LONG_IDENT, MYF(0), tmp);
+ return(true);
+ }
+ return(false);
+}
+
/******************************************************************//**
Converts an identifier to UTF-8. */
extern "C" UNIV_INTERN
@@ -5846,6 +5879,8 @@ ha_innobase::unlock_row(void)
{
DBUG_ENTER("ha_innobase::unlock_row");
+ ut_ad(prebuilt->trx->conc_state == TRX_ACTIVE);
+
/* Consistent read does not take any locks, thus there is
nothing to unlock. */
@@ -7815,12 +7850,18 @@ innobase_rename_table(
DEBUG_SYNC_C("innodb_rename_table_ready");
/* Serialize data dictionary operations with dictionary mutex:
- no deadlocks can occur then in these operations */
+ no deadlocks can occur then in these operations. Start the
+ transaction first to avoid a possible deadlock in the server. */
+ trx_start_if_not_started(trx);
if (lock_and_commit) {
row_mysql_lock_data_dictionary(trx);
}
+ /* Flag this transaction as a dictionary operation, so that
+ the data dictionary will be locked in crash recovery. */
+ trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
+
error = row_rename_table_for_mysql(
norm_from, norm_to, trx, lock_and_commit);
@@ -11478,6 +11519,61 @@ innodb_change_buffering_update(
*static_cast<const char*const*>(save);
}
+#ifndef DBUG_OFF
+static char* srv_buffer_pool_evict;
+
+/****************************************************************//**
+Called on SET GLOBAL innodb_buffer_pool_evict=...
+Handles some values specially, to evict pages from the buffer pool.
+SET GLOBAL innodb_buffer_pool_evict='uncompressed'
+evicts all uncompressed page frames of compressed tablespaces. */
+static
+void
+innodb_buffer_pool_evict_update(
+/*============================*/
+ THD* thd, /*!< in: thread handle */
+ struct st_mysql_sys_var*var, /*!< in: pointer to system variable */
+ void* var_ptr,/*!< out: ignored */
+ const void* save) /*!< in: immediate result
+ from check function */
+{
+ if (const char* op = *static_cast<const char*const*>(save)) {
+ if (!strcmp(op, "uncompressed")) {
+ /* Evict all uncompressed pages of compressed
+ tables from the buffer pool. Keep the compressed
+ pages in the buffer pool. */
+
+ for (ulint i = 0; i < srv_buf_pool_instances; i++) {
+ buf_pool_t* buf_pool = &buf_pool_ptr[i];
+
+ buf_pool_mutex_enter(buf_pool);
+
+ for (buf_block_t* block = UT_LIST_GET_LAST(
+ buf_pool->unzip_LRU);
+ block != NULL; ) {
+
+ buf_block_t* prev_block
+ = UT_LIST_GET_PREV(unzip_LRU,
+ block);
+ ut_ad(buf_block_get_state(block)
+ == BUF_BLOCK_FILE_PAGE);
+ ut_ad(block->in_unzip_LRU_list);
+ ut_ad(block->page.in_LRU_list);
+
+ mutex_enter(&block->mutex);
+ buf_LRU_free_block(&block->page,
+ FALSE);
+ mutex_exit(&block->mutex);
+ block = prev_block;
+ }
+
+ buf_pool_mutex_exit(buf_pool);
+ }
+ }
+ }
+}
+#endif /* !DBUG_OFF */
+
static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
{
innodb_export_status();
@@ -11740,6 +11836,13 @@ static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
"Data file autoextend increment in megabytes",
NULL, NULL, 8L, 1L, 1000L, 0);
+#ifndef DBUG_OFF
+static MYSQL_SYSVAR_STR(buffer_pool_evict, srv_buffer_pool_evict,
+ PLUGIN_VAR_RQCMDARG,
+ "Evict pages from the InnoDB buffer pool.",
+ NULL, innodb_buffer_pool_evict_update, "");
+#endif /* !DBUG_OFF */
+
static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
@@ -11927,6 +12030,9 @@ static MYSQL_SYSVAR_BOOL(print_all_deadlocks, srv_print_all_deadlocks,
static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment),
+#ifndef DBUG_OFF
+ MYSQL_SYSVAR(buffer_pool_evict),
+#endif /* !DBUG_OFF */
MYSQL_SYSVAR(buffer_pool_size),
MYSQL_SYSVAR(buffer_pool_instances),
MYSQL_SYSVAR(checksums),
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 59ea065c5c7..38596bc69b5 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -2295,6 +2295,7 @@ i_s_innodb_buffer_stats_fill_table(
buf_pool_info_t* pool_info;
DBUG_ENTER("i_s_innodb_buffer_fill_general");
+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
/* Only allow the PROCESS privilege holder to access the stats */
if (check_global_access(thd, PROCESS_ACL)) {
@@ -2911,6 +2912,7 @@ i_s_innodb_fill_buffer_pool(
mem_heap_t* heap;
DBUG_ENTER("i_s_innodb_fill_buffer_pool");
+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
heap = mem_heap_create(10000);
@@ -3480,6 +3482,7 @@ i_s_innodb_fill_buffer_lru(
ulint lru_len;
DBUG_ENTER("i_s_innodb_fill_buffer_lru");
+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);
/* Obtain buf_pool mutex before allocate info_buffer, since
UT_LIST_GET_LEN(buf_pool->LRU) could change */
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index 70af56b99f2..11505121fa2 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -4685,6 +4685,16 @@ loop:
== page_no);
ut_ad(ibuf_rec_get_space(&mtr, rec) == space);
+ /* Mark the change buffer record processed,
+ so that it will not be merged again in case
+ the server crashes between the following
+ mtr_commit() and the subsequent mtr_commit()
+ of deleting the change buffer record. */
+
+ btr_cur_set_deleted_flag_for_ibuf(
+ btr_pcur_get_rec(&pcur), NULL,
+ TRUE, &mtr);
+
btr_pcur_store_position(&pcur, &mtr);
ibuf_btr_pcur_commit_specify_mtr(&pcur, &mtr);
diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h
index 95ccef16be0..b27bc954940 100644
--- a/storage/innobase/include/db0err.h
+++ b/storage/innobase/include/db0err.h
@@ -114,6 +114,7 @@ enum db_err {
DB_UNDO_RECORD_TOO_BIG, /* the undo log record is too big */
DB_TABLE_IN_FK_CHECK, /* table is being used in foreign
key check */
+ DB_IDENTIFIER_TOO_LONG, /* Identifier name too long */
/* The following are partial failure codes */
DB_FAIL = 1000,
diff --git a/storage/innobase/include/dyn0dyn.h b/storage/innobase/include/dyn0dyn.h
index 121a5946ac7..62ed862e82c 100644
--- a/storage/innobase/include/dyn0dyn.h
+++ b/storage/innobase/include/dyn0dyn.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -11,8 +11,8 @@ 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
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -47,15 +47,17 @@ UNIV_INLINE
dyn_array_t*
dyn_array_create(
/*=============*/
- dyn_array_t* arr); /*!< in: pointer to a memory buffer of
+ dyn_array_t* arr) /*!< in/out memory buffer of
size sizeof(dyn_array_t) */
+ __attribute__((nonnull));
/************************************************************//**
Frees a dynamic array. */
UNIV_INLINE
void
dyn_array_free(
/*===========*/
- dyn_array_t* arr); /*!< in: dyn array */
+ dyn_array_t* arr) /*!< in,own: dyn array */
+ __attribute__((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to a buffer in it.
After copying the elements, the caller must close the buffer using
@@ -66,8 +68,9 @@ byte*
dyn_array_open(
/*===========*/
dyn_array_t* arr, /*!< in: dynamic array */
- ulint size); /*!< in: size in bytes of the buffer; MUST be
+ ulint size) /*!< in: size in bytes of the buffer; MUST be
smaller than DYN_ARRAY_DATA_SIZE! */
+ __attribute__((nonnull, warn_unused_result));
/*********************************************************************//**
Closes the buffer returned by dyn_array_open. */
UNIV_INLINE
@@ -75,7 +78,8 @@ void
dyn_array_close(
/*============*/
dyn_array_t* arr, /*!< in: dynamic array */
- byte* ptr); /*!< in: buffer space from ptr up was not used */
+ const byte* ptr) /*!< in: end of used space */
+ __attribute__((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to
the added element. The caller must copy the element to
@@ -85,8 +89,9 @@ UNIV_INLINE
void*
dyn_array_push(
/*===========*/
- dyn_array_t* arr, /*!< in: dynamic array */
- ulint size); /*!< in: size in bytes of the element */
+ dyn_array_t* arr, /*!< in/out: dynamic array */
+ ulint size) /*!< in: size in bytes of the element */
+ __attribute__((nonnull, warn_unused_result));
/************************************************************//**
Returns pointer to an element in dyn array.
@return pointer to element */
@@ -94,9 +99,10 @@ UNIV_INLINE
void*
dyn_array_get_element(
/*==================*/
- dyn_array_t* arr, /*!< in: dyn array */
- ulint pos); /*!< in: position of element as bytes
- from array start */
+ const dyn_array_t* arr, /*!< in: dyn array */
+ ulint pos) /*!< in: position of element
+ in bytes from array start */
+ __attribute__((nonnull, warn_unused_result));
/************************************************************//**
Returns the size of stored data in a dyn array.
@return data size in bytes */
@@ -104,30 +110,33 @@ UNIV_INLINE
ulint
dyn_array_get_data_size(
/*====================*/
- dyn_array_t* arr); /*!< in: dyn array */
+ const dyn_array_t* arr) /*!< in: dyn array */
+ __attribute__((nonnull, warn_unused_result, pure));
/************************************************************//**
-Gets the first block in a dyn array. */
-UNIV_INLINE
-dyn_block_t*
-dyn_array_get_first_block(
-/*======================*/
- dyn_array_t* arr); /*!< in: dyn array */
+Gets the first block in a dyn array.
+@param arr dyn array
+@return first block */
+#define dyn_array_get_first_block(arr) (arr)
/************************************************************//**
-Gets the last block in a dyn array. */
-UNIV_INLINE
-dyn_block_t*
-dyn_array_get_last_block(
-/*=====================*/
- dyn_array_t* arr); /*!< in: dyn array */
+Gets the last block in a dyn array.
+@param arr dyn array
+@return last block */
+#define dyn_array_get_last_block(arr) \
+ ((arr)->heap ? UT_LIST_GET_LAST((arr)->base) : (arr))
/********************************************************************//**
Gets the next block in a dyn array.
-@return pointer to next, NULL if end of list */
-UNIV_INLINE
-dyn_block_t*
-dyn_array_get_next_block(
-/*=====================*/
- dyn_array_t* arr, /*!< in: dyn array */
- dyn_block_t* block); /*!< in: dyn array block */
+@param arr dyn array
+@param block dyn array block
+@return pointer to next, NULL if end of list */
+#define dyn_array_get_next_block(arr, block) \
+ ((arr)->heap ? UT_LIST_GET_NEXT(list, block) : NULL)
+/********************************************************************//**
+Gets the previous block in a dyn array.
+@param arr dyn array
+@param block dyn array block
+@return pointer to previous, NULL if end of list */
+#define dyn_array_get_prev_block(arr, block) \
+ ((arr)->heap ? UT_LIST_GET_PREV(list, block) : NULL)
/********************************************************************//**
Gets the number of used bytes in a dyn array block.
@return number of bytes used */
@@ -135,7 +144,8 @@ UNIV_INLINE
ulint
dyn_block_get_used(
/*===============*/
- dyn_block_t* block); /*!< in: dyn array block */
+ const dyn_block_t* block) /*!< in: dyn array block */
+ __attribute__((nonnull, warn_unused_result, pure));
/********************************************************************//**
Gets pointer to the start of data in a dyn array block.
@return pointer to data */
@@ -143,16 +153,18 @@ UNIV_INLINE
byte*
dyn_block_get_data(
/*===============*/
- dyn_block_t* block); /*!< in: dyn array block */
+ const dyn_block_t* block) /*!< in: dyn array block */
+ __attribute__((nonnull, warn_unused_result, pure));
/********************************************************//**
Pushes n bytes to a dyn array. */
UNIV_INLINE
void
dyn_push_string(
/*============*/
- dyn_array_t* arr, /*!< in: dyn array */
+ dyn_array_t* arr, /*!< in/out: dyn array */
const byte* str, /*!< in: string to write */
- ulint len); /*!< in: string length */
+ ulint len) /*!< in: string length */
+ __attribute__((nonnull));
/*#################################################################*/
diff --git a/storage/innobase/include/dyn0dyn.ic b/storage/innobase/include/dyn0dyn.ic
index 110e674abff..177877ed1fd 100644
--- a/storage/innobase/include/dyn0dyn.ic
+++ b/storage/innobase/include/dyn0dyn.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -11,8 +11,8 @@ 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
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -35,56 +35,8 @@ UNIV_INTERN
dyn_block_t*
dyn_array_add_block(
/*================*/
- dyn_array_t* arr); /*!< in: dyn array */
-
-
-/************************************************************//**
-Gets the first block in a dyn array. */
-UNIV_INLINE
-dyn_block_t*
-dyn_array_get_first_block(
-/*======================*/
- dyn_array_t* arr) /*!< in: dyn array */
-{
- return(arr);
-}
-
-/************************************************************//**
-Gets the last block in a dyn array. */
-UNIV_INLINE
-dyn_block_t*
-dyn_array_get_last_block(
-/*=====================*/
- dyn_array_t* arr) /*!< in: dyn array */
-{
- if (arr->heap == NULL) {
-
- return(arr);
- }
-
- return(UT_LIST_GET_LAST(arr->base));
-}
-
-/********************************************************************//**
-Gets the next block in a dyn array.
-@return pointer to next, NULL if end of list */
-UNIV_INLINE
-dyn_block_t*
-dyn_array_get_next_block(
-/*=====================*/
- dyn_array_t* arr, /*!< in: dyn array */
- dyn_block_t* block) /*!< in: dyn array block */
-{
- ut_ad(arr && block);
-
- if (arr->heap == NULL) {
- ut_ad(arr == block);
-
- return(NULL);
- }
-
- return(UT_LIST_GET_NEXT(list, block));
-}
+ dyn_array_t* arr) /*!< in/out: dyn array */
+ __attribute__((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of used bytes in a dyn array block.
@@ -93,7 +45,7 @@ UNIV_INLINE
ulint
dyn_block_get_used(
/*===============*/
- dyn_block_t* block) /*!< in: dyn array block */
+ const dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(block);
@@ -107,11 +59,11 @@ UNIV_INLINE
byte*
dyn_block_get_data(
/*===============*/
- dyn_block_t* block) /*!< in: dyn array block */
+ const dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(block);
- return(block->data);
+ return((byte*) block->data);
}
/*********************************************************************//**
@@ -121,7 +73,7 @@ UNIV_INLINE
dyn_array_t*
dyn_array_create(
/*=============*/
- dyn_array_t* arr) /*!< in: pointer to a memory buffer of
+ dyn_array_t* arr) /*!< in/out: memory buffer of
size sizeof(dyn_array_t) */
{
ut_ad(arr);
@@ -132,10 +84,9 @@ dyn_array_create(
arr->heap = NULL;
arr->used = 0;
-#ifdef UNIV_DEBUG
- arr->buf_end = 0;
- arr->magic_n = DYN_BLOCK_MAGIC_N;
-#endif
+ ut_d(arr->buf_end = 0);
+ ut_d(arr->magic_n = DYN_BLOCK_MAGIC_N);
+
return(arr);
}
@@ -151,9 +102,7 @@ dyn_array_free(
mem_heap_free(arr->heap);
}
-#ifdef UNIV_DEBUG
- arr->magic_n = 0;
-#endif
+ ut_d(arr->magic_n = 0);
}
/*********************************************************************//**
@@ -164,7 +113,7 @@ UNIV_INLINE
void*
dyn_array_push(
/*===========*/
- dyn_array_t* arr, /*!< in: dynamic array */
+ dyn_array_t* arr, /*!< in/out: dynamic array */
ulint size) /*!< in: size in bytes of the element */
{
dyn_block_t* block;
@@ -176,24 +125,23 @@ dyn_array_push(
ut_ad(size);
block = arr;
- used = block->used;
- if (used + size > DYN_ARRAY_DATA_SIZE) {
+ if (block->used + size > DYN_ARRAY_DATA_SIZE) {
/* Get the last array block */
block = dyn_array_get_last_block(arr);
- used = block->used;
- if (used + size > DYN_ARRAY_DATA_SIZE) {
+ if (block->used + size > DYN_ARRAY_DATA_SIZE) {
block = dyn_array_add_block(arr);
- used = block->used;
}
}
+ used = block->used;
+
block->used = used + size;
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
- return((block->data) + used);
+ return(block->data + used);
}
/*********************************************************************//**
@@ -210,7 +158,6 @@ dyn_array_open(
smaller than DYN_ARRAY_DATA_SIZE! */
{
dyn_block_t* block;
- ulint used;
ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
@@ -218,28 +165,23 @@ dyn_array_open(
ut_ad(size);
block = arr;
- used = block->used;
- if (used + size > DYN_ARRAY_DATA_SIZE) {
+ if (block->used + size > DYN_ARRAY_DATA_SIZE) {
/* Get the last array block */
block = dyn_array_get_last_block(arr);
- used = block->used;
- if (used + size > DYN_ARRAY_DATA_SIZE) {
+ if (block->used + size > DYN_ARRAY_DATA_SIZE) {
block = dyn_array_add_block(arr);
- used = block->used;
ut_a(size <= DYN_ARRAY_DATA_SIZE);
}
}
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
-#ifdef UNIV_DEBUG
ut_ad(arr->buf_end == 0);
+ ut_d(arr->buf_end = block->used + size);
- arr->buf_end = used + size;
-#endif
- return((block->data) + used);
+ return(block->data + block->used);
}
/*********************************************************************//**
@@ -248,8 +190,8 @@ UNIV_INLINE
void
dyn_array_close(
/*============*/
- dyn_array_t* arr, /*!< in: dynamic array */
- byte* ptr) /*!< in: buffer space from ptr up was not used */
+ dyn_array_t* arr, /*!< in/out: dynamic array */
+ const byte* ptr) /*!< in: end of used space */
{
dyn_block_t* block;
@@ -264,9 +206,7 @@ dyn_array_close(
ut_ad(block->used <= DYN_ARRAY_DATA_SIZE);
-#ifdef UNIV_DEBUG
- arr->buf_end = 0;
-#endif
+ ut_d(arr->buf_end = 0);
}
/************************************************************//**
@@ -276,12 +216,11 @@ UNIV_INLINE
void*
dyn_array_get_element(
/*==================*/
- dyn_array_t* arr, /*!< in: dyn array */
- ulint pos) /*!< in: position of element as bytes
- from array start */
+ const dyn_array_t* arr, /*!< in: dyn array */
+ ulint pos) /*!< in: position of element
+ in bytes from array start */
{
- dyn_block_t* block;
- ulint used;
+ const dyn_block_t* block;
ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
@@ -290,21 +229,23 @@ dyn_array_get_element(
block = dyn_array_get_first_block(arr);
if (arr->heap != NULL) {
- used = dyn_block_get_used(block);
+ for (;;) {
+ ulint used = dyn_block_get_used(block);
+
+ if (pos < used) {
+ break;
+ }
- while (pos >= used) {
pos -= used;
block = UT_LIST_GET_NEXT(list, block);
ut_ad(block);
-
- used = dyn_block_get_used(block);
}
}
ut_ad(block);
ut_ad(dyn_block_get_used(block) >= pos);
- return(block->data + pos);
+ return((byte*) block->data + pos);
}
/************************************************************//**
@@ -314,10 +255,10 @@ UNIV_INLINE
ulint
dyn_array_get_data_size(
/*====================*/
- dyn_array_t* arr) /*!< in: dyn array */
+ const dyn_array_t* arr) /*!< in: dyn array */
{
- dyn_block_t* block;
- ulint sum = 0;
+ const dyn_block_t* block;
+ ulint sum = 0;
ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
@@ -344,7 +285,7 @@ UNIV_INLINE
void
dyn_push_string(
/*============*/
- dyn_array_t* arr, /*!< in: dyn array */
+ dyn_array_t* arr, /*!< in/out: dyn array */
const byte* str, /*!< in: string to write */
ulint len) /*!< in: string length */
{
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index a0ec09c892f..4ffc64df238 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -307,4 +307,15 @@ ulint
innobase_get_lower_case_table_names(void);
/*=====================================*/
+/**********************************************************************
+Check if the length of the identifier exceeds the maximum allowed.
+The input to this function is an identifier in charset my_charset_filename.
+return true when length of identifier is too long. */
+UNIV_INTERN
+my_bool
+innobase_check_identifier_length(
+/*=============================*/
+ const char* id); /* in: identifier to check. it must belong
+ to charset my_charset_filename */
+
#endif
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 46f1ff9310c..88ac3c138de 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -295,9 +295,10 @@ UNIV_INTERN
void
mtr_memo_release(
/*=============*/
- mtr_t* mtr, /*!< in: mtr */
+ mtr_t* mtr, /*!< in/out: mini-transaction */
void* object, /*!< in: object */
- ulint type); /*!< in: object type: MTR_MEMO_S_LOCK, ... */
+ ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */
+ __attribute__((nonnull));
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**********************************************************//**
@@ -309,7 +310,8 @@ mtr_memo_contains(
/*==============*/
mtr_t* mtr, /*!< in: mtr */
const void* object, /*!< in: object to search */
- ulint type); /*!< in: type of object */
+ ulint type) /*!< in: type of object */
+ __attribute__((warn_unused_result, nonnull));
/**********************************************************//**
Checks if memo contains the given page.
diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic
index 75cc7a9fcc4..b5480604bdf 100644
--- a/storage/innobase/include/page0zip.ic
+++ b/storage/innobase/include/page0zip.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2005, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -188,8 +188,8 @@ page_zip_rec_needs_ext(
one record on an empty leaf page. Subtract 1 byte for
the encoded heap number. Check also the available space
on the uncompressed page. */
- return(rec_size - (REC_N_NEW_EXTRA_BYTES - 2)
- >= (page_zip_empty_size(n_fields, zip_size) - 1)
+ return(rec_size - (REC_N_NEW_EXTRA_BYTES - 2 - 1)
+ >= page_zip_empty_size(n_fields, zip_size)
|| rec_size >= page_get_free_space_of_empty(TRUE) / 2);
}
diff --git a/storage/innobase/include/ut0dbg.h b/storage/innobase/include/ut0dbg.h
index ce6dcb63049..4913b357768 100644
--- a/storage/innobase/include/ut0dbg.h
+++ b/storage/innobase/include/ut0dbg.h
@@ -55,49 +55,8 @@ ut_dbg_assertion_failed(
ulint line) /*!< in: line number of the assertion */
UNIV_COLD __attribute__((nonnull(2)));
-
-#define UT_DBG_USE_ABORT
-
-
-#ifndef UT_DBG_USE_ABORT
-/** A null pointer that will be dereferenced to trigger a memory trap */
-extern ulint* ut_dbg_null_ptr;
-#endif
-
-#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
-/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
-will stop at the next ut_a() or ut_ad(). */
-extern ibool ut_dbg_stop_threads;
-
-/*************************************************************//**
-Stop a thread after assertion failure. */
-UNIV_INTERN
-void
-ut_dbg_stop_thread(
-/*===============*/
- const char* file,
- ulint line);
-#endif
-
-#ifdef UT_DBG_USE_ABORT
/** Abort the execution. */
-#ifdef _WIN32
-# define UT_DBG_PANIC __debugbreak()
-#else
# define UT_DBG_PANIC abort()
-#endif
-/** Stop threads (null operation) */
-# define UT_DBG_STOP do {} while (0)
-#else /* UT_DBG_USE_ABORT */
-/** Abort the execution. */
-# define UT_DBG_PANIC \
- if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
-/** Stop threads in ut_a(). */
-# define UT_DBG_STOP do \
- if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
- ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
- } while (0)
-#endif /* UT_DBG_USE_ABORT */
/** Abort execution if EXPR does not evaluate to nonzero.
@param EXPR assertion expression that should hold */
@@ -107,7 +66,6 @@ ut_dbg_stop_thread(
__FILE__, (ulint) __LINE__); \
UT_DBG_PANIC; \
} \
- UT_DBG_STOP; \
} while (0)
/** Abort execution. */
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index a72be540c1b..a5ce43496af 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -1997,6 +1997,8 @@ lock_rec_lock_fast(
|| mode - (LOCK_MODE_MASK & mode) == 0
|| mode - (LOCK_MODE_MASK & mode) == LOCK_REC_NOT_GAP);
+ DBUG_EXECUTE_IF("innodb_report_deadlock", return(LOCK_REC_FAIL););
+
lock = lock_rec_get_first_on_page(block);
trx = thr_get_trx(thr);
@@ -2074,6 +2076,8 @@ lock_rec_lock_slow(
trx = thr_get_trx(thr);
+ DBUG_EXECUTE_IF("innodb_report_deadlock", return(DB_DEADLOCK););
+
lock = lock_rec_has_expl(mode, block, heap_no, trx);
if (lock) {
if (lock->type_mode & LOCK_CONV_BY_OTHER) {
@@ -4124,6 +4128,7 @@ lock_rec_unlock(
ut_ad(trx && rec);
ut_ad(block->frame == page_align(rec));
+ ut_ad(trx->conc_state == TRX_ACTIVE);
heap_no = page_rec_get_heap_no(rec);
diff --git a/storage/innobase/mtr/mtr0mtr.c b/storage/innobase/mtr/mtr0mtr.c
index d852ed6f496..a5c98761523 100644
--- a/storage/innobase/mtr/mtr0mtr.c
+++ b/storage/innobase/mtr/mtr0mtr.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -39,72 +39,81 @@ Created 11/26/1995 Heikki Tuuri
# include "log0recv.h"
/*****************************************************************//**
Releases the item in the slot given. */
-static
+static __attribute__((nonnull))
void
-mtr_memo_slot_release(
-/*==================*/
- mtr_t* mtr, /*!< in: mtr */
+mtr_memo_slot_release_func(
+/*=======================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in/out: mini-transaction */
+#endif /* UNIV_DEBUG */
mtr_memo_slot_t* slot) /*!< in: memo slot */
{
- void* object;
- ulint type;
-
- ut_ad(mtr);
- ut_ad(slot);
-
-#ifndef UNIV_DEBUG
- UT_NOT_USED(mtr);
-#endif /* UNIV_DEBUG */
-
- object = slot->object;
- type = slot->type;
+ void* object = slot->object;
+ slot->object = NULL;
- if (UNIV_LIKELY(object != NULL)) {
- if (type <= MTR_MEMO_BUF_FIX) {
- buf_page_release((buf_block_t*)object, type);
- } else if (type == MTR_MEMO_S_LOCK) {
- rw_lock_s_unlock((rw_lock_t*)object);
+ /* slot release is a local operation for the current mtr.
+ We must not be holding the flush_order mutex while
+ doing this. */
+ ut_ad(!log_flush_order_mutex_own());
+
+ switch (slot->type) {
+ case MTR_MEMO_PAGE_S_FIX:
+ case MTR_MEMO_PAGE_X_FIX:
+ case MTR_MEMO_BUF_FIX:
+ buf_page_release((buf_block_t*) object, slot->type);
+ break;
+ case MTR_MEMO_S_LOCK:
+ rw_lock_s_unlock((rw_lock_t*) object);
+ break;
+ case MTR_MEMO_X_LOCK:
+ rw_lock_x_unlock((rw_lock_t*) object);
+ break;
#ifdef UNIV_DEBUG
- } else if (type != MTR_MEMO_X_LOCK) {
- ut_ad(type == MTR_MEMO_MODIFY);
- ut_ad(mtr_memo_contains(mtr, object,
- MTR_MEMO_PAGE_X_FIX));
+ default:
+ ut_ad(slot->type == MTR_MEMO_MODIFY);
+ ut_ad(mtr_memo_contains(mtr, object, MTR_MEMO_PAGE_X_FIX));
#endif /* UNIV_DEBUG */
- } else {
- rw_lock_x_unlock((rw_lock_t*)object);
- }
}
-
- slot->object = NULL;
}
+#ifdef UNIV_DEBUG
+# define mtr_memo_slot_release(mtr, slot) mtr_memo_slot_release_func(mtr, slot)
+#else /* UNIV_DEBUG */
+# define mtr_memo_slot_release(mtr, slot) mtr_memo_slot_release_func(slot)
+#endif /* UNIV_DEBUG */
+
/**********************************************************//**
Releases the mlocks and other objects stored in an mtr memo.
They are released in the order opposite to which they were pushed
to the memo. */
-static
+static __attribute__((nonnull))
void
mtr_memo_pop_all(
/*=============*/
- mtr_t* mtr) /*!< in: mtr */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
- mtr_memo_slot_t* slot;
- dyn_array_t* memo;
- ulint offset;
+ const dyn_block_t* block;
- ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_COMMITTING); /* Currently only used in
commit */
- memo = &(mtr->memo);
-
- offset = dyn_array_get_data_size(memo);
- while (offset > 0) {
- offset -= sizeof(mtr_memo_slot_t);
- slot = dyn_array_get_element(memo, offset);
-
- mtr_memo_slot_release(mtr, slot);
+ for (block = dyn_array_get_last_block(&mtr->memo);
+ block;
+ block = dyn_array_get_prev_block(&mtr->memo, block)) {
+ const mtr_memo_slot_t* start
+ = (mtr_memo_slot_t*) dyn_block_get_data(block);
+ mtr_memo_slot_t* slot
+ = (mtr_memo_slot_t*) (dyn_block_get_data(block)
+ + dyn_block_get_used(block));
+
+ ut_ad(!(dyn_block_get_used(block) % sizeof(mtr_memo_slot_t)));
+
+ while (slot-- != start) {
+ if (slot->object != NULL) {
+ mtr_memo_slot_release(mtr, slot);
+ }
+ }
}
}
@@ -288,42 +297,36 @@ UNIV_INTERN
void
mtr_memo_release(
/*=============*/
- mtr_t* mtr, /*!< in: mtr */
+ mtr_t* mtr, /*!< in/out: mini-transaction */
void* object, /*!< in: object */
ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */
{
- mtr_memo_slot_t* slot;
- dyn_array_t* memo;
- ulint offset;
+ const dyn_block_t* block;
- ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_ACTIVE);
-
- memo = &(mtr->memo);
-
- offset = dyn_array_get_data_size(memo);
-
- log_flush_order_mutex_enter();
- while (offset > 0) {
- offset -= sizeof(mtr_memo_slot_t);
-
- slot = dyn_array_get_element(memo, offset);
-
- if (object == slot->object && type == slot->type) {
-
- /* We cannot release a page that has been written
- to in the middle of a mini-transaction. */
-
- ut_ad(!(mtr->modifications
- && slot->type == MTR_MEMO_PAGE_X_FIX));
-
- mtr_memo_slot_release(mtr, slot);
-
- break;
+ /* We cannot release a page that has been written to in the
+ middle of a mini-transaction. */
+ ut_ad(!mtr->modifications || type != MTR_MEMO_PAGE_X_FIX);
+
+ for (block = dyn_array_get_last_block(&mtr->memo);
+ block;
+ block = dyn_array_get_prev_block(&mtr->memo, block)) {
+ const mtr_memo_slot_t* start
+ = (mtr_memo_slot_t*) dyn_block_get_data(block);
+ mtr_memo_slot_t* slot
+ = (mtr_memo_slot_t*) (dyn_block_get_data(block)
+ + dyn_block_get_used(block));
+
+ ut_ad(!(dyn_block_get_used(block) % sizeof(mtr_memo_slot_t)));
+
+ while (slot-- != start) {
+ if (object == slot->object && type == slot->type) {
+ mtr_memo_slot_release(mtr, slot);
+ return;
+ }
}
}
- log_flush_order_mutex_exit();
}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
index 9f895e60803..f9338da079e 100644
--- a/storage/innobase/page/page0zip.c
+++ b/storage/innobase/page/page0zip.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2005, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -837,11 +837,12 @@ page_zip_compress_node_ptrs(
c_stream->next_in = (byte*) rec;
c_stream->avail_in = rec_offs_data_size(offsets)
- REC_NODE_PTR_SIZE;
- ut_ad(c_stream->avail_in);
- err = deflate(c_stream, Z_NO_FLUSH);
- if (UNIV_UNLIKELY(err != Z_OK)) {
- break;
+ if (c_stream->avail_in) {
+ err = deflate(c_stream, Z_NO_FLUSH);
+ if (UNIV_UNLIKELY(err != Z_OK)) {
+ break;
+ }
}
ut_ad(!c_stream->avail_in);
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 73da6215f0d..77fa6518b35 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -3840,6 +3840,7 @@ row_rename_table_for_mysql(
ut_a(old_name != NULL);
ut_a(new_name != NULL);
+ ut_ad(trx->conc_state == TRX_ACTIVE);
if (srv_created_new_raw || srv_force_recovery) {
fputs("InnoDB: A new raw disk partition was initialized or\n"
@@ -3864,7 +3865,6 @@ row_rename_table_for_mysql(
}
trx->op_info = "renaming table";
- trx_start_if_not_started(trx);
old_is_tmp = row_is_mysql_tmp_table_name(old_name);
new_is_tmp = row_is_mysql_tmp_table_name(new_name);
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index b46b2eacd9d..76c1f01d63a 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -57,6 +57,8 @@ Created 12/19/1997 Heikki Tuuri
#include "read0read.h"
#include "buf0lru.h"
#include "ha_prototypes.h"
+#include "m_string.h" /* for my_sys.h */
+#include "my_sys.h" /* DEBUG_SYNC_C */
/* Maximum number of rows to prefetch; MySQL interface has another parameter */
#define SEL_MAX_N_PREFETCH 16
@@ -3918,7 +3920,9 @@ wait_table_again:
}
rec_loop:
+ DEBUG_SYNC_C("row_search_rec_loop");
if (trx_is_interrupted(trx)) {
+ btr_pcur_store_position(pcur, &mtr);
err = DB_INTERRUPTED;
goto normal_return;
}
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index c0b2f6cb700..86caf9d4243 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -279,7 +279,7 @@ UNIV_INTERN ulint srv_data_read = 0;
/* Internal setting for "innodb_stats_method". Decides how InnoDB treats
NULL value when collecting statistics. By default, it is set to
SRV_STATS_NULLS_EQUAL(0), ie. all NULL value are treated equal */
-ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL;
+UNIV_INTERN ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL;
/* here we count the amount of data written in total (in bytes) */
UNIV_INTERN ulint srv_data_written = 0;
@@ -2109,19 +2109,31 @@ srv_export_innodb_status(void)
export_vars.innodb_truncated_status_writes = srv_truncated_status_writes;
#ifdef UNIV_DEBUG
- if (trx_sys->max_trx_id < purge_sys->done_trx_no) {
- export_vars.innodb_purge_trx_id_age = 0;
- } else {
- export_vars.innodb_purge_trx_id_age =
- trx_sys->max_trx_id - purge_sys->done_trx_no;
- }
+ {
+ trx_id_t done_trx_no;
+ trx_id_t up_limit_id;
+
+ rw_lock_s_lock(&purge_sys->latch);
+ done_trx_no = purge_sys->done_trx_no;
+ up_limit_id = purge_sys->view
+ ? purge_sys->view->up_limit_id
+ : 0;
+ rw_lock_s_unlock(&purge_sys->latch);
+
+ if (trx_sys->max_trx_id < done_trx_no) {
+ export_vars.innodb_purge_trx_id_age = 0;
+ } else {
+ export_vars.innodb_purge_trx_id_age =
+ trx_sys->max_trx_id - done_trx_no;
+ }
- if (!purge_sys->view
- || trx_sys->max_trx_id < purge_sys->view->up_limit_id) {
- export_vars.innodb_purge_view_trx_id_age = 0;
- } else {
- export_vars.innodb_purge_view_trx_id_age =
- trx_sys->max_trx_id - purge_sys->view->up_limit_id;
+ if (!up_limit_id
+ || trx_sys->max_trx_id < up_limit_id) {
+ export_vars.innodb_purge_view_trx_id_age = 0;
+ } else {
+ export_vars.innodb_purge_view_trx_id_age =
+ trx_sys->max_trx_id - up_limit_id;
+ }
}
#endif /* UNIV_DEBUG */
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
index c6cbfc94dca..b2778184335 100644
--- a/storage/innobase/sync/sync0arr.c
+++ b/storage/innobase/sync/sync0arr.c
@@ -604,10 +604,6 @@ sync_array_deadlock_step(
new = sync_array_find_thread(arr, thread);
if (UNIV_UNLIKELY(new == start)) {
- /* Stop running of other threads */
-
- ut_dbg_stop_threads = TRUE;
-
/* Deadlock */
fputs("########################################\n"
"DEADLOCK of threads detected!\n", stderr);
@@ -945,6 +941,8 @@ sync_array_print_long_waits(
# define SYNC_ARRAY_TIMEOUT 240
#endif
+ sync_array_enter(sync_primary_wait_array);
+
for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
double diff;
@@ -979,6 +977,8 @@ sync_array_print_long_waits(
}
}
+ sync_array_exit(sync_primary_wait_array);
+
if (noticed) {
fprintf(stderr,
"InnoDB: ###### Starts InnoDB Monitor"
diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
index 0c5e367ac30..bc51dc43032 100644
--- a/storage/innobase/trx/trx0sys.c
+++ b/storage/innobase/trx/trx0sys.c
@@ -137,7 +137,7 @@ UNIV_INTERN mysql_pfs_key_t file_format_max_mutex_key;
#ifndef UNIV_HOTBACKUP
#ifdef UNIV_DEBUG
/* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */
-uint trx_rseg_n_slots_debug = 0;
+UNIV_INTERN uint trx_rseg_n_slots_debug = 0;
#endif
/** This is used to track the maximum file format id known to InnoDB. It's
diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c
index 53ed4a53044..a440b72d32a 100644
--- a/storage/innobase/ut/ut0dbg.c
+++ b/storage/innobase/ut/ut0dbg.c
@@ -35,16 +35,6 @@ Created 1/30/1994 Heikki Tuuri
UNIV_INTERN ulint ut_dbg_zero = 0;
#endif
-#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
-/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
-will stop at the next ut_a() or ut_ad(). */
-UNIV_INTERN ibool ut_dbg_stop_threads = FALSE;
-#endif
-#ifndef UT_DBG_USE_ABORT
-/** A null pointer that will be dereferenced to trigger a memory trap */
-UNIV_INTERN ulint* ut_dbg_null_ptr = NULL;
-#endif
-
/*************************************************************//**
Report a failed assertion. */
UNIV_INTERN
@@ -80,30 +70,8 @@ ut_dbg_assertion_failed(
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
"InnoDB: " REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
-#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
- ut_dbg_stop_threads = TRUE;
-#endif
}
-#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
-/*************************************************************//**
-Stop a thread after assertion failure. */
-UNIV_INTERN
-void
-ut_dbg_stop_thread(
-/*===============*/
- const char* file,
- ulint line)
-{
-#ifndef UNIV_HOTBACKUP
- fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n",
- os_thread_pf(os_thread_get_curr_id()),
- innobase_basename(file), line);
- os_thread_sleep(1000000000);
-#endif /* !UNIV_HOTBACKUP */
-}
-#endif
-
#ifdef UNIV_COMPILE_TEST_FUNCS
#include <sys/types.h>
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index 2fe45aad2a7..699af1fcaa1 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -728,6 +728,8 @@ ut_strerr(
return("End of index");
case DB_TABLE_IN_FK_CHECK:
return("Table is being used in foreign key check");
+ case DB_IDENTIFIER_TOO_LONG:
+ return("Identifier name is too long");
/* do not add default: in order to produce a warning if new code
is added to the enum but not added here */
}
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 6561bec5f22..f215b04b68f 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -1304,8 +1304,9 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt)
old_proc_info= thd_proc_info(thd, "Checking status");
thd_progress_init(thd, 3);
- (void) maria_chk_status(&param, file); // Not fatal
- error= maria_chk_size(&param, file);
+ error= maria_chk_status(&param, file); // Not fatal
+ if (maria_chk_size(&param, file))
+ error= 1;
if (!error)
error|= maria_chk_del(&param, file, param.testflag);
thd_proc_info(thd, "Checking keys");
@@ -1669,6 +1670,11 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
}
}
thd_proc_info(thd, "Saving state");
+ if (optimize_done && !error && !(param->testflag & T_NO_CREATE_RENAME_LSN))
+ {
+ /* Set trid (needed if the table was moved from another system) */
+ share->state.create_trid= trnman_get_min_safe_trid();
+ }
mysql_mutex_lock(&share->intern_lock);
if (!error)
{
@@ -1684,6 +1690,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
*/
if (file->state != &share->state.state)
*file->state= share->state.state;
+
if (share->base.auto_key)
_ma_update_auto_increment_key(param, file, 1);
if (optimize_done)
@@ -1691,6 +1698,9 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
UPDATE_TIME | UPDATE_OPEN_COUNT |
(local_testflag &
T_STATISTICS ? UPDATE_STAT : 0));
+ /* File is repaired; Mark the file as moved to this system */
+ (void) _ma_set_uuid(share, 0);
+
info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE |
HA_STATUS_CONST);
if (rows != file->state->records && !(param->testflag & T_VERY_SILENT))
@@ -2411,7 +2421,9 @@ int ha_maria::remember_rnd_pos()
int ha_maria::restart_rnd_next(uchar *buf)
{
- (*file->s->scan_restore_pos)(file, remember_pos);
+ int error;
+ if ((error= (*file->s->scan_restore_pos)(file, remember_pos)))
+ return error;
return rnd_next(buf);
}
@@ -2644,23 +2656,6 @@ int ha_maria::external_lock(THD *thd, int lock_type)
/* Transactional table */
if (lock_type != F_UNLCK)
{
- if (!file->s->lock_key_trees) // If we don't use versioning
- {
- /*
- We come here in the following cases:
- - The table is a temporary table
- - It's a table which is crash safe but not yet versioned, for
- example a table with fulltext or rtree keys
-
- Set the current state to point to save_state so that the
- block_format code don't count the same record twice.
- Copy also the current state. This may have been wrong if the
- same file was used several times in the last statement
- */
- file->state= file->state_start;
- *file->state= file->s->state.state;
- }
-
if (file->trn)
{
/* This can only happen with tables created with clone() */
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 16657ba80ae..03fd0200d18 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -4007,6 +4007,8 @@ static int delete_dir_entry(uchar *buff, uint block_size, uint record_number,
uint length, empty_space;
uchar *dir;
DBUG_ENTER("delete_dir_entry");
+ DBUG_PRINT("enter", ("record_number: %u number_of_records: %u",
+ record_number, number_of_records));
#ifdef SANITY_CHECKS
if (record_number >= number_of_records ||
@@ -4023,7 +4025,8 @@ static int delete_dir_entry(uchar *buff, uint block_size, uint record_number,
check_directory(buff, block_size, 0, (uint) -1);
empty_space= uint2korr(buff + EMPTY_SPACE_OFFSET);
dir= dir_entry_pos(buff, block_size, record_number);
- length= uint2korr(dir + 2);
+ length= uint2korr(dir + 2); /* Length of entry we just deleted */
+ DBUG_ASSERT(uint2korr(dir) != 0 && length < block_size);
if (record_number == number_of_records - 1)
{
@@ -5240,11 +5243,6 @@ void _ma_scan_end_block_record(MARIA_HA *info)
For the moment we can only remember one position, but this is
good enough for MySQL usage
- @Warning
- When this function is called, we assume that the thread is not deleting
- or updating the current row before ma_scan_restore_block_record()
- is called!
-
@return
@retval 0 ok
@retval HA_ERR_WRONG_IN_RECORD Could not allocate memory to hold position
@@ -5264,15 +5262,18 @@ int _ma_scan_remember_block_record(MARIA_HA *info,
info->scan_save->bitmap_buff= ((uchar*) info->scan_save +
ALIGN_SIZE(sizeof(*info->scan_save)));
}
- /* Point to the last read row */
- *lastpos= info->cur_row.nextpos - 1;
- info->scan.dir+= DIR_ENTRY_SIZE;
+ /* For checking if pages have changed since we last read it */
+ info->scan.row_changes= info->row_changes;
/* Remember used bitmap and used head page */
bitmap_buff= info->scan_save->bitmap_buff;
memcpy(info->scan_save, &info->scan, sizeof(*info->scan_save));
info->scan_save->bitmap_buff= bitmap_buff;
memcpy(bitmap_buff, info->scan.bitmap_buff, info->s->block_size * 2);
+
+ /* Point to the last read row */
+ *lastpos= info->cur_row.nextpos - 1;
+ info->scan_save->dir+= DIR_ENTRY_SIZE;
DBUG_RETURN(0);
}
@@ -5280,15 +5281,22 @@ int _ma_scan_remember_block_record(MARIA_HA *info,
/**
@brief restore scan block it's original values
+ @return
+ 0 ok
+ # error
+
@note
In theory we could swap bitmap buffers instead of copy them.
For the moment we don't do that because there are variables pointing
inside the buffers and it's a bit of hassle to either make them relative
or repoint them.
+
+ If the data file has changed, we will re-read the new block record
+ to ensure that when we continue scanning we can ignore any deleted rows.
*/
-void _ma_scan_restore_block_record(MARIA_HA *info,
- MARIA_RECORD_POS lastpos)
+int _ma_scan_restore_block_record(MARIA_HA *info,
+ MARIA_RECORD_POS lastpos)
{
uchar *bitmap_buff;
DBUG_ENTER("_ma_scan_restore_block_record");
@@ -5299,7 +5307,26 @@ void _ma_scan_restore_block_record(MARIA_HA *info,
info->scan.bitmap_buff= bitmap_buff;
memcpy(bitmap_buff, info->scan_save->bitmap_buff, info->s->block_size * 2);
- DBUG_VOID_RETURN;
+ if (info->scan.row_changes != info->row_changes)
+ {
+ /*
+ Table has been changed. We have to re-read the current page block as
+ data may have changed on it that we have to see.
+ */
+ if (!(pagecache_read(info->s->pagecache,
+ &info->dfile,
+ ma_recordpos_to_page(info->scan.row_base_page),
+ 0, info->scan.page_buff,
+ info->s->page_type,
+ PAGECACHE_LOCK_LEFT_UNLOCKED, 0)))
+ DBUG_RETURN(my_errno);
+ info->scan.number_of_rows=
+ (uint) (uchar) info->scan.page_buff[DIR_COUNT_OFFSET];
+ info->scan.dir_end= (info->scan.page_buff + info->s->block_size -
+ PAGE_SUFFIX_SIZE -
+ info->scan.number_of_rows * DIR_ENTRY_SIZE);
+ }
+ DBUG_RETURN(0);
}
@@ -5326,7 +5353,7 @@ void _ma_scan_restore_block_record(MARIA_HA *info,
RETURN
0 ok
- # Error code
+ # Error code (Normally HA_ERR_END_OF_FILE)
*/
int _ma_scan_block_record(MARIA_HA *info, uchar *record,
@@ -5345,6 +5372,12 @@ restart_record_read:
uchar *data, *end_of_data;
int error;
+ /* Ensure that scan.dir and record_pos are in sync */
+ DBUG_ASSERT(info->scan.dir == dir_entry_pos(info->scan.page_buff,
+ share->block_size,
+ record_pos));
+
+ /* Search for a valid directory entry (not 0) */
while (!(offset= uint2korr(info->scan.dir)))
{
info->scan.dir-= DIR_ENTRY_SIZE;
@@ -5357,13 +5390,19 @@ restart_record_read:
}
#endif
}
+ /*
+ This should always be true as the directory should always start with
+ a valid entry.
+ */
+ DBUG_ASSERT(info->scan.dir >= info->scan.dir_end);
+
/* found row */
info->cur_row.lastpos= info->scan.row_base_page + record_pos;
info->cur_row.nextpos= record_pos + 1;
data= info->scan.page_buff + offset;
length= uint2korr(info->scan.dir + 2);
end_of_data= data + length;
- info->scan.dir-= DIR_ENTRY_SIZE; /* Point to previous row */
+ info->scan.dir-= DIR_ENTRY_SIZE; /* Point to next row to process */
#ifdef SANITY_CHECKS
if (end_of_data > info->scan.dir_end ||
offset < PAGE_HEADER_SIZE || length < share->base.min_block_length)
@@ -6937,6 +6976,7 @@ my_bool _ma_apply_undo_row_insert(MARIA_HA *info, LSN undo_lsn,
res= 0;
end:
+ /* The following is true only if _ma_bitmap_flushable() was called earlier */
if (info->non_flushable_state)
_ma_bitmap_flushable(info, -1);
_ma_unpin_all_pages_and_finalize_row(info, lsn);
@@ -6946,6 +6986,11 @@ err:
DBUG_ASSERT(!maria_assert_if_crashed_table);
res= 1;
_ma_mark_file_crashed(share);
+ /*
+ Don't write a new LSN on the used pages. Not important as the file is
+ marked as crashed and need to be repaired before it can be used.
+ */
+ lsn= LSN_IMPOSSIBLE;
goto end;
}
diff --git a/storage/maria/ma_blockrec.h b/storage/maria/ma_blockrec.h
index 45f5613bb60..40ca2591236 100644
--- a/storage/maria/ma_blockrec.h
+++ b/storage/maria/ma_blockrec.h
@@ -167,8 +167,8 @@ my_bool _ma_scan_init_block_record(MARIA_HA *info);
void _ma_scan_end_block_record(MARIA_HA *info);
int _ma_scan_remember_block_record(MARIA_HA *info,
MARIA_RECORD_POS *lastpos);
-void _ma_scan_restore_block_record(MARIA_HA *info,
- MARIA_RECORD_POS lastpos);
+int _ma_scan_restore_block_record(MARIA_HA *info,
+ MARIA_RECORD_POS lastpos);
MARIA_RECORD_POS _ma_write_init_block_record(MARIA_HA *info,
const uchar *record);
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 6bcb9c21a71..fdb2bae3d8c 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -140,13 +140,22 @@ void maria_chk_init_for_check(HA_CHECK *param, MARIA_HA *info)
Set up transaction handler so that we can see all rows. When rows is read
we will check the found id against param->max_tried
*/
- if (param->max_trid == 0)
+ if (!info->s->base.born_transactional)
+ {
+ /*
+ There are no trids. Howver we want to set max_trid to make test of
+ create_trid simpler.
+ */
+ param->max_trid= ~(TrID) 0;
+ }
+ else if (param->max_trid == 0)
{
if (!ma_control_file_inited())
param->max_trid= 0; /* Give warning for first trid found */
else
param->max_trid= max_trid_in_system();
}
+
maria_ignore_trids(info);
}
@@ -179,6 +188,13 @@ int maria_chk_status(HA_CHECK *param, MARIA_HA *info)
if (param->testflag & T_UPDATE_STATE)
param->warning_printed=save;
}
+ if (share->state.create_trid > param->max_trid)
+ {
+ _ma_check_print_warning(param,
+ "Table create_trd (%llu) > current max_transaction id (%llu). Table needs to be repaired or zerofilled to be usable",
+ share->state.create_trid, param->max_trid);
+ return 1;
+ }
return 0;
}
@@ -2424,11 +2440,10 @@ static void restore_table_state_after_repair(MARIA_HA *info,
{
maria_versioning(info, info->s->have_versioning);
info->s->lock_key_trees= org_share->lock_key_trees;
+ DBUG_ASSERT(!info->s->have_versioning || info->s->lock_key_trees);
}
-
-
/**
@brief Drop all indexes
@@ -3553,7 +3568,10 @@ int maria_zerofill(HA_CHECK *param, MARIA_HA *info, const char *name)
/* Ensure state is later flushed to disk, if within maria_chk */
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- /* Reset create_trid to make file comparable */
+ /*
+ Reset create_trid to make file comparable and to ensure that new
+ trid's in the file starts from 0.
+ */
share->state.create_trid= 0;
}
if (reenable_logging)
diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c
index 5b8d0e01677..22f7341098d 100644
--- a/storage/maria/ma_delete.c
+++ b/storage/maria/ma_delete.c
@@ -112,6 +112,7 @@ int maria_delete(MARIA_HA *info,const uchar *record)
info->state->checksum-= info->cur_row.checksum;
info->state->records--;
info->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED;
+ info->row_changes++;
share->state.changed|= (STATE_NOT_OPTIMIZED_ROWS | STATE_NOT_MOVABLE |
STATE_NOT_ZEROFILLED);
info->state->changed=1;
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 5233e57594c..f0ade217341 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -7472,9 +7472,8 @@ static void translog_force_current_buffer_to_finish()
struct st_translog_buffer *old_buffer= log_descriptor.bc.buffer;
uchar *data= log_descriptor.bc.ptr - log_descriptor.bc.current_page_fill;
uint16 left= TRANSLOG_PAGE_SIZE - log_descriptor.bc.current_page_fill;
- uint16 current_page_fill, write_counter, previous_offset;
+ uint16 UNINIT_VAR(current_page_fill), write_counter, previous_offset;
DBUG_ENTER("translog_force_current_buffer_to_finish");
- LINT_INIT(current_page_fill);
DBUG_PRINT("enter", ("Buffer #%u 0x%lx "
"Buffer addr: (%lu,0x%lx) "
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 88422e3dc5f..d2ae10ccb18 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -437,15 +437,23 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
share->open_count_not_zero_on_open= 1;
/*
+ A transactional table is not usable on this system if:
+ - share->state.create_trid > trnman_get_max_trid()
+ - Critical as trid as stored releativel to create_trid.
+ - uuid is different
+
+ STATE_NOT_MOVABLE is reset when a table is zerofilled
+ (has no LSN's and no trids)
+
We can ignore testing uuid if STATE_NOT_MOVABLE is set, as in this
- case the uuid will be set in _ma_mark_file_changed()
+ case the uuid will be set in _ma_mark_file_changed().
*/
- if ((share->state.changed & STATE_NOT_MOVABLE) &&
- share->base.born_transactional &&
- ((!(open_flags & HA_OPEN_IGNORE_MOVED_STATE) &&
- memcmp(share->base.uuid, maria_uuid, MY_UUID_SIZE)) ||
- (share->state.create_trid > trnman_get_max_trid() &&
- !maria_in_recovery)))
+ if (share->base.born_transactional &&
+ ((share->state.create_trid > trnman_get_max_trid() &&
+ !maria_in_recovery) ||
+ ((share->state.changed & STATE_NOT_MOVABLE) &&
+ ((!(open_flags & HA_OPEN_IGNORE_MOVED_STATE) &&
+ memcmp(share->base.uuid, maria_uuid, MY_UUID_SIZE))))))
{
DBUG_PRINT("warning", ("table is moved from another system. uuid_diff: %d create_trid: %lu max_trid: %lu",
memcmp(share->base.uuid, maria_uuid,
@@ -756,7 +764,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
HA_ERR_CRASHED_ON_REPAIR : HA_ERR_CRASHED_ON_USAGE);
goto err;
}
- else
+ else if (!(open_flags & HA_OPEN_FOR_REPAIR))
{
/* create_rename_lsn != LSN_NEEDS_NEW_STATE_LSNS */
share->state.changed|= STATE_NOT_MOVABLE;
@@ -894,8 +902,10 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
&share->keyinfo[i].root_lock);
mysql_rwlock_init(key_SHARE_mmap_lock, &share->mmap_lock);
- share->row_is_visible= _ma_row_visible_always;
- share->lock.get_status= _ma_reset_update_flag;
+ share->row_is_visible= _ma_row_visible_always;
+ share->lock.get_status= _ma_reset_update_flag;
+ share->lock.start_trans= _ma_start_trans;
+
if (!thr_lock_inited)
{
/* Probably a single threaded program; Don't use concurrent inserts */
diff --git a/storage/maria/ma_pagecrc.c b/storage/maria/ma_pagecrc.c
index 58e3b4b203d..a79f34016c1 100644
--- a/storage/maria/ma_pagecrc.c
+++ b/storage/maria/ma_pagecrc.c
@@ -358,8 +358,7 @@ my_bool maria_flush_log_for_page(uchar *page,
MARIA_SHARE *share= (MARIA_SHARE*) data_ptr;
DBUG_ENTER("maria_flush_log_for_page");
/* share is 0 here only in unittest */
- DBUG_ASSERT(!share || (share->page_type == PAGECACHE_LSN_PAGE &&
- share->now_transactional));
+ DBUG_ASSERT(!share || share->page_type == PAGECACHE_LSN_PAGE);
lsn= lsn_korr(page);
if (translog_flush(lsn))
DBUG_RETURN(1);
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index aeeda26b791..bd2bde1c89a 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -3304,7 +3304,7 @@ static LSN parse_checkpoint_record(LSN lsn)
first_log_write_lsn= lsn_korr(ptr);
ptr+= LSN_STORE_SIZE;
name_len= strlen((char *)ptr) + 1;
- strmake(name, (char *)ptr, sizeof(name)-1);
+ strmake_buf(name, (char *)ptr);
ptr+= name_len;
if (new_table(sid, name, first_log_write_lsn))
return LSN_ERROR;
diff --git a/storage/maria/ma_scan.c b/storage/maria/ma_scan.c
index cbac463a2c8..ad526211615 100644
--- a/storage/maria/ma_scan.c
+++ b/storage/maria/ma_scan.c
@@ -68,7 +68,8 @@ int _ma_def_scan_remember_pos(MARIA_HA *info, MARIA_RECORD_POS *lastpos)
}
-void _ma_def_scan_restore_pos(MARIA_HA *info, MARIA_RECORD_POS lastpos)
+int _ma_def_scan_restore_pos(MARIA_HA *info, MARIA_RECORD_POS lastpos)
{
info->cur_row.nextpos= lastpos;
+ return 0;
}
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index ccb4bf77717..d38bc7af26c 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -424,9 +424,9 @@ int _ma_prefix_search(const MARIA_KEY *key, const MARIA_PAGE *ma_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 page_flag, 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 page_flag, UNINIT_VAR(prefix_len),suffix_len;
+ int key_len_skip, UNINIT_VAR(seg_len_pack), key_len_left;
uchar *end, *vseg, *UNINIT_VAR(saved_vseg), *UNINIT_VAR(saved_from);
uchar *page;
uchar tt_buff[MARIA_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
@@ -439,10 +439,6 @@ int _ma_prefix_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page,
const uchar *sort_order= keyinfo->seg->charset->sort_order;
DBUG_ENTER("_ma_prefix_search");
- LINT_INIT(seg_len_pack);
- LINT_INIT(prefix_len);
- LINT_INIT(length);
-
t_buff[0]=0; /* Avoid bugs */
page_flag= ma_page->flag;
nod_flag= ma_page->node;
diff --git a/storage/maria/ma_state.c b/storage/maria/ma_state.c
index 1f4a7504c56..f130da21d07 100644
--- a/storage/maria/ma_state.c
+++ b/storage/maria/ma_state.c
@@ -59,6 +59,8 @@ my_bool _ma_setup_live_state(MARIA_HA *info)
MARIA_STATE_HISTORY *history;
DBUG_ENTER("_ma_setup_live_state");
+ DBUG_ASSERT(share->lock_key_trees);
+
if (maria_create_trn_hook(info))
DBUG_RETURN(1);
@@ -377,6 +379,17 @@ void _ma_reset_update_flag(void *param,
info->state->changed= 0;
}
+my_bool _ma_start_trans(void* param)
+{
+ MARIA_HA *info=(MARIA_HA*) param;
+ if (!info->s->lock_key_trees)
+ {
+ info->state= info->state_start;
+ *info->state= info->s->state.state;
+ }
+ return 0;
+}
+
/**
@brief Check if should allow concurrent inserts
@@ -622,6 +635,22 @@ my_bool _ma_block_start_trans(void* param)
*/
return _ma_setup_live_state(info);
}
+ else
+ {
+ /*
+ We come here in the following cases:
+ - The table is a temporary table
+ - It's a table which is crash safe but not yet versioned, for
+ example a table with fulltext or rtree keys
+
+ Set the current state to point to save_state so that the
+ block_format code don't count the same record twice.
+ Copy also the current state. This may have been wrong if the
+ same file was used several times in the last statement
+ */
+ info->state= info->state_start;
+ *info->state= info->s->state.state;
+ }
/*
Info->trn is set if this table is already handled and we are
@@ -668,9 +697,11 @@ my_bool _ma_block_start_trans_no_versioning(void* param)
{
MARIA_HA *info=(MARIA_HA*) param;
DBUG_ENTER("_ma_block_get_status_no_version");
- DBUG_ASSERT(info->s->base.born_transactional);
+ DBUG_ASSERT(info->s->base.born_transactional && !info->s->lock_key_trees);
info->state->changed= 0; /* from _ma_reset_update_flag() */
+ info->state= info->state_start;
+ *info->state= info->s->state.state;
if (!info->trn)
{
/*
@@ -689,18 +720,22 @@ my_bool _ma_block_start_trans_no_versioning(void* param)
void maria_versioning(MARIA_HA *info, my_bool versioning)
{
+ MARIA_SHARE *share= info->s;
/* For now, this is a hack */
- if (info->s->have_versioning)
+ if (share->have_versioning)
{
enum thr_lock_type save_lock_type;
- /* Assume is a non threaded application (for now) */
- info->s->lock_key_trees= 0;
+ share->lock_key_trees= versioning;
/* Set up info->lock.type temporary for _ma_block_get_status() */
save_lock_type= info->lock.type;
info->lock.type= versioning ? TL_WRITE_CONCURRENT_INSERT : TL_WRITE;
_ma_block_get_status((void*) info, versioning);
info->lock.type= save_lock_type;
- info->state= info->state_start= &info->s->state.common;
+ if (versioning)
+ info->state= &share->state.common;
+ else
+ info->state= &share->state.state; /* Change global values by default */
+ info->state_start= info->state; /* Initial values */
}
}
diff --git a/storage/maria/ma_state.h b/storage/maria/ma_state.h
index 03ce5c2ea8c..2903986e32a 100644
--- a/storage/maria/ma_state.h
+++ b/storage/maria/ma_state.h
@@ -66,6 +66,7 @@ void _ma_update_status_with_lock(MARIA_HA *info);
void _ma_restore_status(void *param);
void _ma_copy_status(void* to, void *from);
void _ma_reset_update_flag(void *param, my_bool concurrent_insert);
+my_bool _ma_start_trans(void* param);
my_bool _ma_check_status(void *param);
void _ma_block_get_status(void* param, my_bool concurrent_insert);
void _ma_block_update_status(void *param);
diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c
index 945654a0bbe..5a655d4412a 100644
--- a/storage/maria/ma_test1.c
+++ b/storage/maria/ma_test1.c
@@ -55,7 +55,6 @@ static void create_key(uchar *key,uint rownr);
static void create_record(uchar *record,uint rownr);
static void update_record(uchar *record);
-
/*
These are here only for testing of recovery with undo. We are not
including maria_def.h here as this test is also to be an example of
@@ -506,6 +505,7 @@ end:
break;
}
printf("Dying on request without maria_commit()/maria_close()\n");
+ sf_leaking_memory= 1;
exit(0);
}
@@ -514,6 +514,7 @@ end:
if (maria_close(file))
goto err;
maria_end();
+ my_uuid_end();
my_end(MY_CHECK_ERROR);
return (0);
diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c
index ea1978b4ee5..a3b7a2a9e98 100644
--- a/storage/maria/ma_test2.c
+++ b/storage/maria/ma_test2.c
@@ -971,6 +971,7 @@ end:
break;
}
printf("Dying on request without maria_commit()/maria_close()\n");
+ sf_leaking_memory= 1; /* no memory leak reports here */
exit(0);
}
if (maria_commit(file))
@@ -1017,6 +1018,7 @@ reads: %10lu\n",
}
maria_end();
my_free(blob_buffer);
+ my_uuid_end();
my_end(silent ? MY_CHECK_ERROR : MY_CHECK_ERROR | MY_GIVE_INFO);
return(0);
err:
@@ -1029,6 +1031,8 @@ err2:
maria_close(file);
}
maria_end();
+ my_uuid_end();
+ my_end(0);
return(1);
} /* main */
diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c
index 0a726c1b7f9..e0e804ca655 100644
--- a/storage/maria/ma_update.c
+++ b/storage/maria/ma_update.c
@@ -173,6 +173,7 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec)
We can't yet have HA_STATE_AKTIV here, as block_record dosn't support it
*/
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | key_changed);
+ info->row_changes++;
share->state.changed|= STATE_NOT_MOVABLE | STATE_NOT_ZEROFILLED;
info->state->changed= 1;
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 752741d0a5e..09d42a9be72 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -298,6 +298,7 @@ int maria_write(MARIA_HA *info, uchar *record)
info->state->records++;
info->update= (HA_STATE_CHANGED | HA_STATE_AKTIV | HA_STATE_WRITTEN |
HA_STATE_ROW_CHANGED);
+ info->row_changes++;
share->state.changed|= STATE_NOT_MOVABLE | STATE_NOT_ZEROFILLED;
info->state->changed= 1;
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index 8a7ba30eb08..065063fcb07 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -88,9 +88,22 @@ static int sort_record_index(MARIA_SORT_PARAM *sort_param, MARIA_PAGE *page,
uint sortkey, File new_file,
my_bool update_index);
static my_bool write_log_record(HA_CHECK *param);
+static void my_exit(int exit_code) __attribute__ ((noreturn));
HA_CHECK check_param;
+/* Free memory and exit */
+
+static void my_exit(int exit_code)
+{
+ free_tmpdir(&maria_chk_tmpdir);
+ free_defaults(default_argv);
+ my_end(check_param.testflag & T_INFO ?
+ MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
+ exit(exit_code);
+}
+
+
/* Main program */
int main(int argc, char **argv)
@@ -178,12 +191,8 @@ end:
printf("\nTotal of all %d Aria-files:\nData records: %9s Deleted blocks: %9s\n",check_param.total_files,llstr(check_param.total_records,buff),
llstr(check_param.total_deleted,buff2));
}
- free_defaults(default_argv);
- free_tmpdir(&maria_chk_tmpdir);
maria_end();
- my_end(check_param.testflag & T_INFO ?
- MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
- exit(error);
+ my_exit(error);
#ifndef _lint
return 0; /* No compiler warning */
#endif
@@ -257,10 +266,10 @@ static struct my_option my_long_options[] =
"Restart with -r if there are any errors in the table. States will be updated as with --update-state.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"HELP", 'H',
- "Display this help and exit.",
+ "Print all argument options sorted alphabetically and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?',
- "Display this help and exit.",
+ "Print all options by groups and exit. See also --HELP",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"information", 'i',
"Print statistics information about table that is checked.",
@@ -410,7 +419,7 @@ static struct my_option my_long_options[] =
(char**) &maria_stats_method_str, (char**) &maria_stats_method_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "zerofill", 'z',
- "Fill empty space in data and index files with zeroes,",
+ "Fill empty space in data and index files with zeroes. This makes the data file movable between different servers.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "zerofill-keep-lsn", OPT_ZEROFILL_KEEP_LSN,
"Like --zerofill but does not zero out LSN of data/index pages;"
@@ -422,7 +431,7 @@ static struct my_option my_long_options[] =
static void print_version(void)
{
- printf("%s Ver 1.1 for %s at %s\n", my_progname, SYSTEM_TYPE,
+ printf("%s Ver 1.2 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
}
@@ -441,8 +450,8 @@ static void usage(void)
-#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n");
#endif
printf("\
- -H, --HELP Display this help and exit.\n\
- -?, --help Display this help and exit.\n\
+ -H, --HELP Print all argument options sorted alphabetically.\n\
+ -?, --help Print all options by groups\n\
--datadir=path Path for control file (and logs if --logdir not used)\n\
--logdir=path Path for log files\n\
--ignore-control-file Don't open the control file. Only use this if you\n\
@@ -566,7 +575,9 @@ Recover (repair)/ options (When using '--recover' or '--safe-recover'):\n\
(It may be VERY slow to do a sort the first time!).\n\
-b, --block-search=#\n\
Find a record, a block at given offset belongs to.\n\
- -z, --zerofill Fill empty space in data and index files with zeroes\n\
+ -z, --zerofill Fill empty space in data and index files with zeroes.\n\
+ This makes the data file movable between different \n\
+ servers.\n\
--zerofill-keep-lsn Like --zerofill but does not zero out LSN of\n\
data/index pages.");
@@ -790,7 +801,7 @@ get_one_option(int optid,
fprintf(stderr,
"The value of the sort key is bigger than max key: %d.\n",
MARIA_MAX_KEY);
- exit(1);
+ my_exit(1);
}
}
break;
@@ -818,7 +829,7 @@ get_one_option(int optid,
break;
case 'V':
print_version();
- exit(0);
+ my_exit(0);
case OPT_CORRECT_CHECKSUM:
if (argument == disabled_my_option)
check_param.testflag&= ~T_CALC_CHECKSUM;
@@ -833,7 +844,7 @@ get_one_option(int optid,
if ((method=find_type(argument, &maria_stats_method_typelib, 2)) <= 0)
{
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
- exit(1);
+ my_exit(1);
}
switch (method-1) {
case 0:
@@ -869,10 +880,11 @@ get_one_option(int optid,
break;
case 'H':
my_print_help(my_long_options);
- exit(0);
+ my_print_variables(my_long_options);
+ my_exit(0);
case '?':
usage();
- exit(0);
+ my_exit(0);
}
return 0;
}
@@ -889,7 +901,7 @@ static void get_options(register int *argc,register char ***argv)
check_param.testflag|=T_WRITE_LOOP;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
- exit(ho_error);
+ my_exit(ho_error);
/* If using repair, then update checksum if one uses --update-state */
if ((check_param.testflag & T_UPDATE_STATE) &&
@@ -899,7 +911,7 @@ static void get_options(register int *argc,register char ***argv)
if (*argc == 0)
{
usage();
- exit(-1);
+ my_exit(-1);
}
if ((check_param.testflag & T_UNPACK) &&
@@ -907,7 +919,7 @@ static void get_options(register int *argc,register char ***argv)
{
fprintf(stderr, "%s: --unpack can't be used with --quick or --sort-records\n",
my_progname_short);
- exit(1);
+ my_exit(1);
}
if ((check_param.testflag & T_READONLY) &&
(check_param.testflag &
@@ -916,7 +928,7 @@ static void get_options(register int *argc,register char ***argv)
{
fprintf(stderr, "%s: Can't use --readonly when repairing or sorting\n",
my_progname_short);
- exit(1);
+ my_exit(1);
}
if (!opt_debug)
@@ -924,20 +936,26 @@ static void get_options(register int *argc,register char ***argv)
DEBUGGER_OFF; /* Speed up things a bit */
}
if (init_tmpdir(&maria_chk_tmpdir, opt_tmpdir))
- exit(1);
+ my_exit(1);
check_param.tmpdir=&maria_chk_tmpdir;
if (set_collation_name)
if (!(set_collation= get_charset_by_name(set_collation_name,
MYF(MY_WME))))
- exit(1);
+ my_exit(1);
if (maria_data_root != default_log_dir && opt_log_dir == default_log_dir)
{
/* --datadir was used and --log-dir was not. Set log-dir to datadir */
opt_log_dir= maria_data_root;
}
+
+ /* If we are using zerofill, then we don't need to read the control file */
+ if ((check_param.testflag & (T_ZEROFILL_KEEP_LSN | T_ZEROFILL)) &&
+ !(check_param.testflag & ~(T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX | T_STATISTICS | T_CHECK | T_FAST | T_CHECK_ONLY_CHANGED)))
+ opt_ignore_control_file= 1;
+
return;
} /* get options */
@@ -1220,8 +1238,11 @@ static int maria_chk(HA_CHECK *param, char *filename)
((param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX |
T_ZEROFILL | T_ZEROFILL_KEEP_LSN)) !=
(T_ZEROFILL | T_ZEROFILL_KEEP_LSN)))
+ {
share->state.create_rename_lsn= share->state.is_of_horizon=
share->state.skip_redo_lsn= LSN_NEEDS_NEW_STATE_LSNS;
+ share->state.create_trid= 0;
+ }
}
if (!error && (param->testflag & T_REP_ANY))
{
@@ -1508,6 +1529,8 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
LSN_IN_PARTS(share->state.create_rename_lsn),
LSN_IN_PARTS(share->state.is_of_horizon),
LSN_IN_PARTS(share->state.skip_redo_lsn));
+ printf("create_trid: %s\n",
+ llstr(share->state.create_trid, llbuff));
}
compile_time_assert((MY_UUID_STRING_LENGTH + 1) <= sizeof(buff));
buff[MY_UUID_STRING_LENGTH]= 0;
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index a1275e7ccd2..8c19d0f18f3 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -389,7 +389,7 @@ typedef struct st_maria_share
/* End scan */
void (*scan_end)(MARIA_HA *);
int (*scan_remember_pos)(MARIA_HA *, MARIA_RECORD_POS*);
- void (*scan_restore_pos)(MARIA_HA *, MARIA_RECORD_POS);
+ int (*scan_restore_pos)(MARIA_HA *, MARIA_RECORD_POS);
/* Pre-write of row (some handlers may do the actual write here) */
MARIA_RECORD_POS (*write_record_init)(MARIA_HA *, const uchar *);
/* Write record (or accept write_record_init) */
@@ -564,6 +564,7 @@ typedef struct st_maria_block_scan
ulonglong bits;
uint number_of_rows, bit_pos;
MARIA_RECORD_POS row_base_page;
+ ulonglong row_changes;
} MARIA_BLOCK_SCAN;
//typedef ICP_RESULT (*index_cond_func_t)(void *param);
@@ -606,6 +607,7 @@ struct st_maria_handler
int (*read_record)(MARIA_HA *, uchar*, MARIA_RECORD_POS);
invalidator_by_filename invalidator; /* query cache invalidator */
ulonglong last_auto_increment; /* auto value at start of statement */
+ ulonglong row_changes; /* Incremented for each change */
ulong this_unique; /* uniq filenumber or thread */
ulong last_unique; /* last unique number */
ulong this_loop; /* counter for this open */
@@ -1297,7 +1299,7 @@ my_bool _ma_check_status(void *param);
void _ma_restore_status(void *param);
void _ma_reset_status(MARIA_HA *maria);
int _ma_def_scan_remember_pos(MARIA_HA *info, MARIA_RECORD_POS *lastpos);
-void _ma_def_scan_restore_pos(MARIA_HA *info, MARIA_RECORD_POS lastpos);
+int _ma_def_scan_restore_pos(MARIA_HA *info, MARIA_RECORD_POS lastpos);
#include "ma_commit.h"
diff --git a/storage/maria/unittest/ma_test_recovery.expected b/storage/maria/unittest/ma_test_recovery.expected
index 6a6051735c5..6aaff86e6cf 100644
--- a/storage/maria/unittest/ma_test_recovery.expected
+++ b/storage/maria/unittest/ma_test_recovery.expected
@@ -69,8 +69,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -78,8 +78,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -87,8 +87,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -98,8 +98,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -107,8 +107,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -116,8 +116,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -166,8 +166,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -175,8 +175,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -184,8 +184,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -195,8 +195,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -204,8 +204,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -213,8 +213,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -263,8 +263,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -272,8 +272,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -281,8 +281,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -292,8 +292,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -301,8 +301,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -310,8 +310,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -360,8 +360,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -369,8 +369,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -378,8 +378,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -389,8 +389,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -398,8 +398,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -407,8 +407,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -457,8 +457,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -466,8 +466,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -475,8 +475,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -486,8 +486,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -495,8 +495,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -504,8 +504,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -554,8 +554,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -563,8 +563,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -572,8 +572,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -583,8 +583,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -592,8 +592,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -601,8 +601,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -651,8 +651,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -660,8 +660,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -669,8 +669,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -680,8 +680,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -689,8 +689,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -698,8 +698,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -748,8 +748,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -757,8 +757,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -766,8 +766,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -777,8 +777,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -786,8 +786,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -795,8 +795,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -845,8 +845,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -854,8 +854,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -863,8 +863,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -874,8 +874,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -883,8 +883,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -892,8 +892,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -942,8 +942,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -951,8 +951,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -960,8 +960,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -971,8 +971,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -980,8 +980,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -989,8 +989,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1039,8 +1039,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1048,8 +1048,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1057,8 +1057,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1068,8 +1068,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1077,8 +1077,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1086,8 +1086,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1136,8 +1136,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1145,8 +1145,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1154,8 +1154,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1165,8 +1165,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1174,8 +1174,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1183,8 +1183,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1233,8 +1233,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1242,8 +1242,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1251,8 +1251,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1262,8 +1262,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1271,8 +1271,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1280,8 +1280,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1330,8 +1330,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1339,8 +1339,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1348,8 +1348,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1359,8 +1359,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1368,8 +1368,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1377,8 +1377,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1427,8 +1427,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1436,8 +1436,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1445,8 +1445,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1456,8 +1456,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1465,8 +1465,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1474,8 +1474,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1524,8 +1524,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1533,8 +1533,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1542,8 +1542,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1553,8 +1553,8 @@ Dying on request without maria_commit()/maria_close()
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1562,8 +1562,8 @@ testing idempotency
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
@@ -1571,8 +1571,8 @@ testing applying of CLRs to recreate table
applying log
Differences in aria_chk -dvv, recovery not yet perfect !
========DIFF START=======
-6c6
-< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled
+7c7
+< Status: checked,analyzed,optimized keys,sorted index pages,zerofilled,movable
---
> Status: changed
========DIFF END=======
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 60ea7757827..011df5e8eb9 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -85,9 +85,10 @@ int mi_write(MI_INFO *info, uchar *record)
/* Calculate and check all unique constraints */
for (i=0 ; i < share->state.header.uniques ; i++)
{
- if (mi_check_unique(info,share->uniqueinfo+i,record,
- mi_unique_hash(share->uniqueinfo+i,record),
- HA_OFFSET_ERROR))
+ MI_UNIQUEDEF *def= share->uniqueinfo + i;
+ if (mi_is_key_active(share->state.key_map, def->key) &&
+ mi_check_unique(info, def, record, mi_unique_hash(def, record),
+ HA_OFFSET_ERROR))
goto err2;
}
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 1985a53acf8..74be8b99d87 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -2144,7 +2144,8 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
*/
if (!(packed_tree=(uint*) my_alloca(sizeof(uint)*length*2)))
{
- my_error(EE_OUTOFMEMORY,MYF(ME_BELL),sizeof(uint)*length*2);
+ my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_FATALERROR),
+ sizeof(uint)*length*2);
return 0;
}
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 5d9b5b5808b..481ca41ba9d 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1460,7 +1460,7 @@ static void split_file_name(const char *file_name,
char buff[FN_REFLEN];
db->length= 0;
- strmake(buff, file_name, sizeof(buff)-1);
+ strmake_buf(buff, file_name);
dir_length= dirname_length(buff);
if (dir_length > 1)
{
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 38f6df3003d..2c9951e3f46 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -512,7 +512,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
uint buflen;
const char *name;
int i;
- uint size;
+ size_t size;
DBUG_ENTER("pfs_show_status");
@@ -526,7 +526,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
if (stat != HA_ENGINE_STATUS)
DBUG_RETURN(false);
- uint total_memory= 0;
+ size_t total_memory= 0;
for (i=0; /* empty */; i++)
{
@@ -763,7 +763,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
break;
}
- buflen= int10_to_str(size, buf, 10) - buf;
+ buflen= longlong10_to_str(size, buf, 10) - buf;
if (print(thd,
PERFORMANCE_SCHEMA_str.str, PERFORMANCE_SCHEMA_str.length,
name, strlen(name),
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index fa57f335325..335f57c69c6 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -26,7 +26,7 @@
#include <string.h>
bool pfs_initialized= false;
-ulonglong pfs_allocated_memory= 0;
+size_t pfs_allocated_memory= 0;
/**
Memory allocation for the performance schema.
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index c0c0490a380..5a3cc342b7d 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -22,7 +22,7 @@
*/
extern bool pfs_initialized;
-extern ulonglong pfs_allocated_memory;
+extern size_t pfs_allocated_memory;
void *pfs_malloc(size_t size, myf flags);
#define PFS_MALLOC_ARRAY(n, T, f) \
diff --git a/storage/sphinx/CMakeLists.txt b/storage/sphinx/CMakeLists.txt
index d9320d10cf7..3e26637218f 100644
--- a/storage/sphinx/CMakeLists.txt
+++ b/storage/sphinx/CMakeLists.txt
@@ -3,3 +3,12 @@ IF(MSVC)
LINK_LIBRARIES(ws2_32)
ENDIF(MSVC)
MYSQL_ADD_PLUGIN(sphinx ha_sphinx.cc STORAGE_ENGINE)
+
+IF(NOT WITHOUT_SPHINX_STORAGE_ENGINE)
+ ADD_LIBRARY(snippets_udf MODULE snippets_udf.cc)
+ TARGET_LINK_LIBRARIES(snippets_udf mysys) # my_error
+ ADD_DEPENDENCIES(snippets_udf GenError) # uses generated error constants
+ SET_TARGET_PROPERTIES(snippets_udf PROPERTIES OUTPUT_NAME sphinx PREFIX "")
+ INSTALL(TARGETS snippets_udf COMPONENT Server DESTINATION ${INSTALL_PLUGINDIR})
+ENDIF()
+
diff --git a/storage/sphinx/snippets_udf.cc b/storage/sphinx/snippets_udf.cc
index 85fb66ab793..5318592ab5f 100644
--- a/storage/sphinx/snippets_udf.cc
+++ b/storage/sphinx/snippets_udf.cc
@@ -1,5 +1,5 @@
//
-// $Id: snippets_udf.cc 3087 2012-01-30 23:07:35Z shodan $
+// $Id: snippets_udf.cc 3508 2012-11-05 11:48:48Z kevg $
//
//
@@ -17,12 +17,19 @@
#include <string.h>
#include <assert.h>
+#ifndef __WIN__
#include <sys/un.h>
#include <netdb.h>
+#else
+#include <winsock2.h>
+#endif
#include <mysql_version.h>
-#if MYSQL_VERSION_ID>50100
+#if MYSQL_VERSION_ID>=50515
+#include "sql_class.h"
+#include "sql_array.h"
+#elif MYSQL_VERSION_ID>50100
#include "mysql_priv.h"
#include <mysql/plugin.h>
#else
@@ -84,9 +91,9 @@ void sphUnalignedWrite ( void * pPtr, const T & tVal )
#define SafeDeleteArray(_arg) { if ( _arg ) delete [] ( _arg ); (_arg) = NULL; }
#define Min(a,b) ((a)<(b)?(a):(b))
-
+#ifndef __WIN__
typedef unsigned int DWORD;
-
+#endif
inline DWORD sphF2DW ( float f ) { union { float f; uint32 d; } u; u.f = f; return u.d; }
static char * sphDup ( const char * sSrc, int iLen=-1 )
@@ -158,7 +165,7 @@ enum
SEARCHD_COMMAND_EXCERPT = 1,
- VER_COMMAND_EXCERPT = 0x103,
+ VER_COMMAND_EXCERPT = 0x104,
};
/// known answers
@@ -380,23 +387,44 @@ int CSphUrl::Connect()
else
{
int tmp_errno;
+ bool bError = false;
+
+#if MYSQL_VERSION_ID>=50515
+ struct addrinfo *hp = NULL;
+ tmp_errno = getaddrinfo ( m_sHost, NULL, NULL, &hp );
+ if ( !tmp_errno || !hp || !hp->ai_addr )
+ {
+ bError = true;
+ if ( hp )
+ freeaddrinfo ( hp );
+ }
+#else
struct hostent tmp_hostent, *hp;
char buff2 [ GETHOSTBYNAME_BUFF_SIZE ];
-
hp = my_gethostbyname_r ( m_sHost, &tmp_hostent, buff2, sizeof(buff2), &tmp_errno );
if ( !hp )
{
my_gethostbyname_r_free();
+ bError = true;
+ }
+#endif
+ if ( bError )
+ {
char sError[256];
- snprintf ( sError, sizeof(sError), "failed to resolve searchd host (name=%s)", m_sHost );
+ my_snprintf ( sError, sizeof(sError), "failed to resolve searchd host (name=%s)", m_sHost );
my_error ( ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), sError );
return -1;
}
+#if MYSQL_VERSION_ID>=50515
+ memcpy ( &sin.sin_addr, hp->ai_addr, Min ( sizeof(sin.sin_addr), (size_t)hp->ai_addrlen ) );
+ freeaddrinfo ( hp );
+#else
memcpy ( &sin.sin_addr, hp->h_addr, Min ( sizeof(sin.sin_addr), (size_t)hp->h_length ) );
my_gethostbyname_r_free();
+#endif
}
} else
{
@@ -534,12 +562,16 @@ CSphResponse::Read ( int iSocket, int iClientVersion )
}
/// udf
-
+#ifdef _MSC_VER
+#define DLLEXPORT __declspec(dllexport)
+#else
+#define DLLEXPORT
+#endif
extern "C"
{
- my_bool sphinx_snippets_init ( UDF_INIT * pUDF, UDF_ARGS * pArgs, char * sMessage );
- void sphinx_snippets_deinit ( UDF_INIT * pUDF );
- char * sphinx_snippets ( UDF_INIT * pUDF, UDF_ARGS * pArgs, char * sResult, unsigned long * pLength, char * pIsNull, char * sError );
+ DLLEXPORT my_bool sphinx_snippets_init ( UDF_INIT * pUDF, UDF_ARGS * pArgs, char * sMessage );
+ DLLEXPORT void sphinx_snippets_deinit ( UDF_INIT * pUDF );
+ DLLEXPORT char * sphinx_snippets ( UDF_INIT * pUDF, UDF_ARGS * pArgs, char * sResult, unsigned long * pLength, char * pIsNull, char * sError );
};
#define MAX_MESSAGE_LENGTH 255
@@ -608,7 +640,7 @@ struct CSphSnippets
}
#define STRING CHECK_TYPE(STRING_RESULT)
-#define INT CHECK_TYPE(INT_RESULT); int iValue = *(long long *)pArgs->args[i]
+#define INT CHECK_TYPE(INT_RESULT); int iValue =(int) *(long long *)pArgs->args[i]
my_bool sphinx_snippets_init ( UDF_INIT * pUDF, UDF_ARGS * pArgs, char * sMessage )
{
@@ -662,6 +694,7 @@ my_bool sphinx_snippets_init ( UDF_INIT * pUDF, UDF_ARGS * pArgs, char * sMessag
KEYWORD("load_files") { INT; if ( iValue ) pOpts->m_iFlags |= 128; }
KEYWORD("allow_empty") { INT; if ( iValue ) pOpts->m_iFlags |= 256; }
KEYWORD("emit_zones") { INT; if ( iValue ) pOpts->m_iFlags |= 512; }
+ KEYWORD("load_files_scattered") { INT; if ( iValue ) pOpts->m_iFlags |= 1024; }
else
{
snprintf ( sMessage, MAX_MESSAGE_LENGTH, "unrecognized argument: %.*s",
@@ -787,5 +820,5 @@ void sphinx_snippets_deinit ( UDF_INIT * pUDF )
}
//
-// $Id: snippets_udf.cc 3087 2012-01-30 23:07:35Z shodan $
+// $Id: snippets_udf.cc 3508 2012-11-05 11:48:48Z kevg $
//
diff --git a/storage/xtradb/btr/btr0btr.c b/storage/xtradb/btr/btr0btr.c
index a3e57d632a0..79a8eb9dcc6 100644
--- a/storage/xtradb/btr/btr0btr.c
+++ b/storage/xtradb/btr/btr0btr.c
@@ -688,7 +688,7 @@ btr_root_fseg_validate(
{
ulint offset = mach_read_from_2(seg_header + FSEG_HDR_OFFSET);
- if (UNIV_UNLIKELY(srv_pass_corrupt_table)) {
+ if (UNIV_UNLIKELY(srv_pass_corrupt_table != 0)) {
return (mach_read_from_4(seg_header + FSEG_HDR_SPACE) == space)
&& (offset >= FIL_PAGE_DATA)
&& (offset <= UNIV_PAGE_SIZE - FIL_PAGE_DATA_END);
@@ -723,17 +723,14 @@ btr_root_block_get(
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
index, mtr);
- if (srv_pass_corrupt_table && !block) {
- return(0);
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(0););
btr_assert_not_corrupted(block, index);
#ifdef UNIV_BTR_DEBUG
if (!dict_index_is_ibuf(index)) {
const page_t* root = buf_block_get_frame(block);
- if (UNIV_UNLIKELY(srv_pass_corrupt_table)) {
+ if (UNIV_UNLIKELY(srv_pass_corrupt_table != 0)) {
if (!btr_root_fseg_validate(FIL_PAGE_DATA
+ PAGE_BTR_SEG_LEAF
+ root, space))
@@ -1063,11 +1060,11 @@ btr_get_size(
root = btr_root_get(index, mtr);
- if (srv_pass_corrupt_table && !root) {
+ SRV_CORRUPT_TABLE_CHECK(root,
+ {
mtr_commit(mtr);
return(0);
- }
- ut_a(root);
+ });
if (flag == BTR_N_LEAF_PAGES) {
seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
@@ -1525,11 +1522,11 @@ leaf_loop:
root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
NULL, &mtr);
- if (srv_pass_corrupt_table && !root) {
+ SRV_CORRUPT_TABLE_CHECK(root,
+ {
mtr_commit(&mtr);
return;
- }
- ut_a(root);
+ });
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
@@ -1555,11 +1552,12 @@ top_loop:
root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
NULL, &mtr);
- if (srv_pass_corrupt_table && !root) {
+ SRV_CORRUPT_TABLE_CHECK(root,
+ {
mtr_commit(&mtr);
return;
- }
- ut_a(root);
+ });
+
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
+ root, space));
@@ -1593,10 +1591,7 @@ btr_free_root(
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
NULL, mtr);
- if (srv_pass_corrupt_table && !block) {
- return;
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return;);
btr_search_drop_page_hash_index(block);
@@ -4565,10 +4560,11 @@ btr_validate_index(
root = btr_root_get(index, &mtr);
- if (UNIV_UNLIKELY(srv_pass_corrupt_table && !root)) {
+ SRV_CORRUPT_TABLE_CHECK(root,
+ {
mtr_commit(&mtr);
return(FALSE);
- }
+ });
n = btr_page_get_level(root, &mtr);
diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c
index d089fb5ad22..488212f087c 100644
--- a/storage/xtradb/btr/btr0cur.c
+++ b/storage/xtradb/btr/btr0cur.c
@@ -258,10 +258,8 @@ btr_cur_latch_leaves(
get_block = btr_block_get(
space, zip_size, page_no, mode, cursor->index, mtr);
- if (srv_pass_corrupt_table && !get_block) {
- return;
- }
- ut_a(get_block);
+ SRV_CORRUPT_TABLE_CHECK(get_block, return;);
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
#endif /* UNIV_BTR_DEBUG */
@@ -283,10 +281,8 @@ btr_cur_latch_leaves(
space, zip_size, left_page_no,
sibling_mode, cursor->index, mtr);
- if (srv_pass_corrupt_table && !get_block) {
- return;
- }
- ut_a(get_block);
+ SRV_CORRUPT_TABLE_CHECK(get_block, return;);
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame)
== page_is_comp(page));
@@ -309,10 +305,8 @@ btr_cur_latch_leaves(
space, zip_size, page_no,
mode, cursor->index, mtr);
- if (srv_pass_corrupt_table && !get_block) {
- return;
- }
- ut_a(get_block);
+ SRV_CORRUPT_TABLE_CHECK(get_block, return;);
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
#endif /* UNIV_BTR_DEBUG */
@@ -325,10 +319,8 @@ btr_cur_latch_leaves(
space, zip_size, right_page_no,
sibling_mode, cursor->index, mtr);
- if (srv_pass_corrupt_table && !get_block) {
- return;
- }
- ut_a(get_block);
+ SRV_CORRUPT_TABLE_CHECK(get_block, return;);
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame)
== page_is_comp(page));
@@ -357,10 +349,8 @@ btr_cur_latch_leaves(
left_page_no, mode, cursor->index, mtr);
cursor->left_block = get_block;
- if (srv_pass_corrupt_table && !get_block) {
- return;
- }
- ut_a(get_block);
+ SRV_CORRUPT_TABLE_CHECK(get_block, return;);
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame)
== page_is_comp(page));
@@ -373,10 +363,8 @@ btr_cur_latch_leaves(
get_block = btr_block_get(
space, zip_size, page_no, mode, cursor->index, mtr);
- if (srv_pass_corrupt_table && !get_block) {
- return;
- }
- ut_a(get_block);
+ SRV_CORRUPT_TABLE_CHECK(get_block, return;);
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
#endif /* UNIV_BTR_DEBUG */
@@ -652,18 +640,19 @@ retry_page_get:
file, line, mtr);
if (block == NULL) {
- if (srv_pass_corrupt_table
- && buf_mode != BUF_GET_IF_IN_POOL
- && buf_mode != BUF_GET_IF_IN_POOL_OR_WATCH) {
- page_cursor->block = 0;
- page_cursor->rec = 0;
- if (estimate) {
- cursor->path_arr->nth_rec = ULINT_UNDEFINED;
- }
- goto func_exit;
- }
- ut_a(buf_mode == BUF_GET_IF_IN_POOL
- || buf_mode == BUF_GET_IF_IN_POOL_OR_WATCH);
+ SRV_CORRUPT_TABLE_CHECK(buf_mode == BUF_GET_IF_IN_POOL ||
+ buf_mode == BUF_GET_IF_IN_POOL_OR_WATCH,
+ {
+ page_cursor->block = 0;
+ page_cursor->rec = 0;
+ if (estimate) {
+
+ cursor->path_arr->nth_rec =
+ ULINT_UNDEFINED;
+ }
+
+ goto func_exit;
+ });
/* This must be a search to perform an insert/delete
mark/ delete; try using the insert/delete buffer */
@@ -739,15 +728,18 @@ retry_page_get:
block->check_index_page_at_flush = TRUE;
page = buf_block_get_frame(block);
- if (srv_pass_corrupt_table && !page) {
+ SRV_CORRUPT_TABLE_CHECK(page,
+ {
page_cursor->block = 0;
page_cursor->rec = 0;
+
if (estimate) {
+
cursor->path_arr->nth_rec = ULINT_UNDEFINED;
}
+
goto func_exit;
- }
- ut_a(page);
+ });
if (rw_latch != RW_NO_LATCH) {
#ifdef UNIV_ZIP_DEBUG
@@ -943,15 +935,19 @@ btr_cur_open_at_index_side_func(
file, line, mtr);
page = buf_block_get_frame(block);
- if (srv_pass_corrupt_table && !page) {
+ SRV_CORRUPT_TABLE_CHECK(page,
+ {
page_cursor->block = 0;
page_cursor->rec = 0;
+
if (estimate) {
- cursor->path_arr->nth_rec = ULINT_UNDEFINED;
+
+ cursor->path_arr->nth_rec =
+ ULINT_UNDEFINED;
}
- break;
- }
- ut_a(page);
+ /* Can't use break with the macro */
+ goto exit_loop;
+ });
ut_ad(index->id == btr_page_get_index_id(page));
@@ -1021,6 +1017,7 @@ btr_cur_open_at_index_side_func(
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
}
+exit_loop:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -1074,12 +1071,13 @@ btr_cur_open_at_rnd_pos_func(
file, line, mtr);
page = buf_block_get_frame(block);
- if (srv_pass_corrupt_table && !page) {
+ SRV_CORRUPT_TABLE_CHECK(page,
+ {
page_cursor->block = 0;
page_cursor->rec = 0;
- break;
- }
- ut_a(page);
+
+ goto exit_loop;
+ });
ut_ad(index->id == btr_page_get_index_id(page));
@@ -1112,6 +1110,7 @@ btr_cur_open_at_rnd_pos_func(
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
}
+exit_loop:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -1300,10 +1299,7 @@ btr_cur_optimistic_insert(
block = btr_cur_get_block(cursor);
- if (srv_pass_corrupt_table && !block) {
- return(DB_CORRUPTION);
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(DB_CORRUPTION););
page = buf_block_get_frame(block);
index = cursor->index;
@@ -3149,10 +3145,7 @@ btr_cur_optimistic_delete(
block = btr_cur_get_block(cursor);
- if (srv_pass_corrupt_table && !block) {
- return(DB_CORRUPTION);
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(DB_CORRUPTION););
ut_ad(page_is_leaf(buf_block_get_frame(block)));
@@ -3868,10 +3861,7 @@ btr_estimate_number_of_different_key_vals(
page = btr_cur_get_page(&cursor);
- if (srv_pass_corrupt_table && !page) {
- break;
- }
- ut_a(page);
+ SRV_CORRUPT_TABLE_CHECK(page, goto exit_loop;);
rec = page_rec_get_next(page_get_infimum_rec(page));
@@ -3957,6 +3947,7 @@ btr_estimate_number_of_different_key_vals(
mtr_commit(&mtr);
}
+exit_loop:
/* If we saw k borders between different key values on
n_sample_pages leaf pages, we can estimate how many
there will be in index->stat_n_leaf_pages */
diff --git a/storage/xtradb/btr/btr0pcur.c b/storage/xtradb/btr/btr0pcur.c
index a1b7affdeb7..7c4ec2dd1ac 100644
--- a/storage/xtradb/btr/btr0pcur.c
+++ b/storage/xtradb/btr/btr0pcur.c
@@ -116,10 +116,7 @@ btr_pcur_store_position(
block = btr_pcur_get_block(cursor);
- if (srv_pass_corrupt_table && !block) {
- return;
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return;);
index = btr_cur_get_index(btr_pcur_get_btr_cur(cursor));
@@ -439,14 +436,16 @@ btr_pcur_move_to_next_page(
btr_pcur_get_btr_cur(cursor)->index, mtr);
next_page = buf_block_get_frame(next_block);
- if (srv_pass_corrupt_table && !next_page) {
+ SRV_CORRUPT_TABLE_CHECK(next_page,
+ {
btr_leaf_page_release(btr_pcur_get_block(cursor),
cursor->latch_mode, mtr);
btr_pcur_get_page_cur(cursor)->block = 0;
btr_pcur_get_page_cur(cursor)->rec = 0;
+
return;
- }
- ut_a(next_page);
+ });
+
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(next_page) == page_is_comp(page));
ut_a(btr_page_get_prev(next_page, mtr)
diff --git a/storage/xtradb/btr/btr0sea.c b/storage/xtradb/btr/btr0sea.c
index 7e9449a6474..d53452bb959 100644
--- a/storage/xtradb/btr/btr0sea.c
+++ b/storage/xtradb/btr/btr0sea.c
@@ -649,10 +649,7 @@ btr_search_info_update_slow(
block = btr_cur_get_block(cursor);
- if (srv_pass_corrupt_table && !block) {
- return;
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return;);
/* NOTE that the following two function calls do NOT protect
info or block->n_fields etc. with any semaphore, to save CPU time!
diff --git a/storage/xtradb/buf/buf0buf.c b/storage/xtradb/buf/buf0buf.c
index 5bcfb0f51b9..ae4b2fba98d 100644
--- a/storage/xtradb/buf/buf0buf.c
+++ b/storage/xtradb/buf/buf0buf.c
@@ -2002,27 +2002,6 @@ lookup:
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
}
- if (UNIV_UNLIKELY(bpage->space_was_being_deleted)) {
- /* This page is obsoleted, should discard and retry */
- rw_lock_s_unlock(&buf_pool->page_hash_latch);
-
- mutex_enter(&buf_pool->LRU_list_mutex);
- block_mutex = buf_page_get_mutex_enter(bpage);
-
- if (UNIV_UNLIKELY(!block_mutex)) {
- mutex_exit(&buf_pool->LRU_list_mutex);
- goto lookup;
- }
-
- buf_LRU_free_block(bpage, TRUE, TRUE);
-
- mutex_exit(&buf_pool->LRU_list_mutex);
- mutex_exit(block_mutex);
- block_mutex = NULL;
-
- goto lookup;
- }
-
if (UNIV_UNLIKELY(!bpage->zip.data)) {
/* There is no compressed page. */
err_exit:
@@ -2031,11 +2010,11 @@ err_exit:
return(NULL);
}
- if (srv_pass_corrupt_table <= 1) {
- if (bpage->is_corrupt) {
- rw_lock_s_unlock(&buf_pool->page_hash_latch);
- return(NULL);
- }
+ if (UNIV_UNLIKELY(bpage->is_corrupt && srv_pass_corrupt_table <= 1)) {
+
+ rw_lock_s_unlock(&buf_pool->page_hash_latch);
+
+ return(NULL);
}
block_mutex = buf_page_get_mutex_enter(bpage);
@@ -2533,26 +2512,6 @@ loop:
block = (buf_block_t*) buf_page_hash_get_low(
buf_pool, space, offset, fold);
if (block) {
- if (UNIV_UNLIKELY(block->page.space_was_being_deleted)) {
- /* This page is obsoleted, should discard and retry */
- rw_lock_s_unlock(&buf_pool->page_hash_latch);
-
- mutex_enter(&buf_pool->LRU_list_mutex);
- block_mutex = buf_page_get_mutex_enter((buf_page_t*)block);
-
- if (UNIV_UNLIKELY(!block_mutex)) {
- mutex_exit(&buf_pool->LRU_list_mutex);
- goto loop;
- }
-
- buf_LRU_free_block((buf_page_t*)block, TRUE, TRUE);
-
- mutex_exit(&buf_pool->LRU_list_mutex);
- mutex_exit(block_mutex);
- block_mutex = NULL;
-
- goto loop;
- }
block_mutex = buf_page_get_mutex_enter((buf_page_t*)block);
ut_a(block_mutex);
@@ -2640,11 +2599,12 @@ got_block:
return(NULL);
}
- if (srv_pass_corrupt_table <= 1) {
- if (block->page.is_corrupt) {
- mutex_exit(block_mutex);
- return(NULL);
- }
+ if (UNIV_UNLIKELY(block->page.is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
+
+ mutex_exit(block_mutex);
+
+ return(NULL);
}
switch (buf_block_get_state(block)) {
@@ -3487,28 +3447,12 @@ buf_page_init_for_read(
fold = buf_page_address_fold(space, offset);
-retry:
//buf_pool_mutex_enter(buf_pool);
mutex_enter(&buf_pool->LRU_list_mutex);
rw_lock_x_lock(&buf_pool->page_hash_latch);
watch_page = buf_page_hash_get_low(buf_pool, space, offset, fold);
- if (UNIV_UNLIKELY(watch_page && watch_page->space_was_being_deleted)) {
- mutex_t* block_mutex = buf_page_get_mutex_enter(watch_page);
-
- /* This page is obsoleted, should discard and retry */
- rw_lock_x_unlock(&buf_pool->page_hash_latch);
- ut_a(block_mutex);
-
- buf_LRU_free_block(watch_page, TRUE, TRUE);
-
- mutex_exit(&buf_pool->LRU_list_mutex);
- mutex_exit(block_mutex);
-
- goto retry;
- }
-
if (watch_page && !buf_pool_watch_is_sentinel(buf_pool, watch_page)) {
/* The page is already in the buffer pool. */
watch_page = NULL;
@@ -3637,7 +3581,6 @@ err_exit:
bpage->state = BUF_BLOCK_ZIP_PAGE;
bpage->space = space;
bpage->offset = offset;
- bpage->space_was_being_deleted = FALSE;
#ifdef UNIV_DEBUG
bpage->in_page_hash = FALSE;
@@ -3722,7 +3665,6 @@ buf_page_create(
fold = buf_page_address_fold(space, offset);
-retry:
//buf_pool_mutex_enter(buf_pool);
mutex_enter(&buf_pool->LRU_list_mutex);
rw_lock_x_lock(&buf_pool->page_hash_latch);
@@ -3730,21 +3672,6 @@ retry:
block = (buf_block_t*) buf_page_hash_get_low(
buf_pool, space, offset, fold);
- if (UNIV_UNLIKELY(block && block->page.space_was_being_deleted)) {
- mutex_t* block_mutex = buf_page_get_mutex_enter((buf_page_t*)block);
-
- /* This page is obsoleted, should discard and retry */
- rw_lock_x_unlock(&buf_pool->page_hash_latch);
- ut_a(block_mutex);
-
- buf_LRU_free_block((buf_page_t*)block, TRUE, TRUE);
-
- mutex_exit(&buf_pool->LRU_list_mutex);
- mutex_exit(block_mutex);
-
- goto retry;
- }
-
if (block
&& buf_page_in_file(&block->page)
&& !buf_pool_watch_is_sentinel(buf_pool, &block->page)) {
@@ -4001,7 +3928,8 @@ buf_page_io_complete(
(ulong) bpage->offset);
}
- if (!srv_pass_corrupt_table || !bpage->is_corrupt) {
+ if (UNIV_LIKELY(!bpage->is_corrupt ||
+ !srv_pass_corrupt_table)) {
/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
@@ -4086,13 +4014,26 @@ corrupt:
}
if (uncompressed && !recv_no_ibuf_operations) {
+
+ buf_block_t* block;
+ ibool update_ibuf_bitmap;
+
+ if (UNIV_UNLIKELY(bpage->is_corrupt &&
+ srv_pass_corrupt_table)) {
+
+ block = NULL;
+ update_ibuf_bitmap = FALSE;
+
+ } else {
+
+ block = (buf_block_t *) bpage;
+ update_ibuf_bitmap = TRUE;
+ }
+
ibuf_merge_or_delete_for_page(
- /* Delete possible entries, if bpage is_corrupt */
- (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :
- (buf_block_t*) bpage, bpage->space,
+ block, bpage->space,
bpage->offset, buf_page_get_zip_size(bpage),
- (srv_pass_corrupt_table && bpage->is_corrupt) ? FALSE :
- TRUE);
+ update_ibuf_bitmap);
}
}
diff --git a/storage/xtradb/buf/buf0flu.c b/storage/xtradb/buf/buf0flu.c
index 663e2d8f537..9452b53df38 100644
--- a/storage/xtradb/buf/buf0flu.c
+++ b/storage/xtradb/buf/buf0flu.c
@@ -459,7 +459,7 @@ buf_flush_ready_for_replace(
if (UNIV_LIKELY(bpage->in_LRU_list && buf_page_in_file(bpage))) {
- return((bpage->oldest_modification == 0 || bpage->space_was_being_deleted)
+ return(bpage->oldest_modification == 0
&& buf_page_get_io_fix(bpage) == BUF_IO_NONE
&& bpage->buf_fix_count == 0);
}
@@ -501,13 +501,6 @@ buf_flush_ready_for_flush(
&& buf_page_get_io_fix(bpage) == BUF_IO_NONE) {
ut_ad(bpage->in_flush_list);
- if (bpage->space_was_being_deleted) {
- /* should be removed from flush_list here */
- /* because buf_flush_try_neighbors() cannot flush without fil_space_get_size(space) */
- buf_flush_remove(bpage);
- return(FALSE);
- }
-
if (flush_type != BUF_FLUSH_LRU) {
return(TRUE);
diff --git a/storage/xtradb/buf/buf0lru.c b/storage/xtradb/buf/buf0lru.c
index cd99d3e4e13..8a35c87c92f 100644
--- a/storage/xtradb/buf/buf0lru.c
+++ b/storage/xtradb/buf/buf0lru.c
@@ -884,42 +884,6 @@ buf_LRU_flush_or_remove_pages(
}
}
-/******************************************************************//**
-*/
-UNIV_INTERN
-void
-buf_LRU_mark_space_was_deleted(
-/*===========================*/
- ulint id) /*!< in: space id */
-{
- ulint i;
-
- for (i = 0; i < srv_buf_pool_instances; i++) {
- buf_pool_t* buf_pool;
- buf_page_t* bpage;
-
- buf_pool = buf_pool_from_array(i);
-
- mutex_enter(&buf_pool->LRU_list_mutex);
-
- bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
-
- while (bpage != NULL) {
- if (buf_page_get_space(bpage) == id) {
- bpage->space_was_being_deleted = TRUE;
- }
- bpage = UT_LIST_GET_NEXT(LRU, bpage);
- }
-
- mutex_exit(&buf_pool->LRU_list_mutex);
-
- /* The AHI entries for the tablespace being deleted should be
- removed by now. */
- ut_ad(buf_LRU_drop_page_hash_for_tablespace(buf_pool, id)
- == 0);
- }
-}
-
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/********************************************************************//**
Insert a compressed block into buf_pool->zip_clean in the LRU order. */
@@ -1891,10 +1855,6 @@ buf_LRU_free_block(
return(FALSE);
}
- if (bpage->space_was_being_deleted && bpage->oldest_modification != 0) {
- buf_flush_remove(bpage);
- }
-
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(bpage->space, bpage->offset) == 0);
#endif /* UNIV_IBUF_COUNT_DEBUG */
diff --git a/storage/xtradb/buf/buf0rea.c b/storage/xtradb/buf/buf0rea.c
index cf0a029df92..5edbeadb64e 100644
--- a/storage/xtradb/buf/buf0rea.c
+++ b/storage/xtradb/buf/buf0rea.c
@@ -245,13 +245,7 @@ not_to_recover:
return(0);
}
- if (srv_pass_corrupt_table) {
- if (*err != DB_SUCCESS) {
- bpage->is_corrupt = TRUE;
- }
- } else {
- ut_a(*err == DB_SUCCESS);
- }
+ SRV_CORRUPT_TABLE_CHECK(*err == DB_SUCCESS, bpage->is_corrupt = TRUE;);
if (sync) {
/* The i/o is already completed when we arrive from
diff --git a/storage/xtradb/dict/dict0dict.c b/storage/xtradb/dict/dict0dict.c
index 29063f028f1..817da6e6074 100644
--- a/storage/xtradb/dict/dict0dict.c
+++ b/storage/xtradb/dict/dict0dict.c
@@ -4419,7 +4419,7 @@ dict_reload_statistics(
while (index) {
mtr_t mtr;
- if (table->is_corrupt) {
+ if (UNIV_UNLIKELY(table->is_corrupt)) {
ut_a(srv_pass_corrupt_table);
mem_heap_free(heap);
return(FALSE);
@@ -4577,7 +4577,7 @@ dict_store_statistics(
heap = mem_heap_create(1000);
while (index) {
- if (table->is_corrupt) {
+ if (UNIV_UNLIKELY(table->is_corrupt)) {
ut_a(srv_pass_corrupt_table);
mem_heap_free(heap);
return;
@@ -4771,7 +4771,7 @@ dict_update_statistics(
mtr_t mtr;
ulint size;
- if (table->is_corrupt) {
+ if (UNIV_UNLIKELY(table->is_corrupt)) {
ut_a(srv_pass_corrupt_table);
dict_table_stats_unlock(table, RW_X_LATCH);
return;
diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c
index 397c4de4b6e..ff4e5b1b033 100644
--- a/storage/xtradb/fil/fil0fil.c
+++ b/storage/xtradb/fil/fil0fil.c
@@ -2426,15 +2426,11 @@ try_again:
To deal with potential read requests by checking the
::stop_new_ops flag in fil_io() */
- if (srv_lazy_drop_table) {
- buf_LRU_mark_space_was_deleted(id);
- } else {
buf_LRU_flush_or_remove_pages(
id, evict_all
? BUF_REMOVE_ALL_NO_WRITE
: BUF_REMOVE_FLUSH_NO_WRITE);
- }
#endif
/* printf("Deleting tablespace %s id %lu\n", space->name, id); */
@@ -5326,22 +5322,6 @@ _fil_io(
srv_data_written+= len;
}
- /* if the table space was already deleted, space might not exist already. */
- if (message
- && space_id < SRV_LOG_SPACE_FIRST_ID
- && ((buf_page_t*)message)->space_was_being_deleted) {
-
- if (mode == OS_AIO_NORMAL) {
- buf_page_io_complete(message);
- return(DB_SUCCESS); /*fake*/
- }
- if (type == OS_FILE_READ) {
- return(DB_TABLESPACE_DELETED);
- } else {
- return(DB_SUCCESS); /*fake*/
- }
- }
-
/* Reserve the fil_system mutex and make sure that we can open at
least one file while holding it, if the file is not already open */
@@ -5445,35 +5425,38 @@ _fil_io(
ut_a(byte_offset % OS_MIN_LOG_BLOCK_SIZE == 0);
ut_a((len % OS_MIN_LOG_BLOCK_SIZE) == 0);
- if (srv_pass_corrupt_table == 1 && space->is_corrupt) {
+#ifndef UNIV_HOTBACKUP
+ if (UNIV_UNLIKELY(space->is_corrupt && srv_pass_corrupt_table)) {
+
/* should ignore i/o for the crashed space */
- mutex_enter(&fil_system->mutex);
- fil_node_complete_io(node, fil_system, type);
- mutex_exit(&fil_system->mutex);
- if (mode == OS_AIO_NORMAL) {
- ut_a(space->purpose == FIL_TABLESPACE);
- buf_page_io_complete(message);
+ if (srv_pass_corrupt_table == 1 ||
+ type == OS_FILE_WRITE) {
+
+ mutex_enter(&fil_system->mutex);
+ fil_node_complete_io(node, fil_system, type);
+ mutex_exit(&fil_system->mutex);
+ if (mode == OS_AIO_NORMAL) {
+ ut_a(space->purpose == FIL_TABLESPACE);
+ buf_page_io_complete(message);
+ }
}
- if (type == OS_FILE_READ) {
+
+ if (srv_pass_corrupt_table == 1 && type == OS_FILE_READ) {
+
return(DB_TABLESPACE_DELETED);
- } else {
+
+ } else if (type == OS_FILE_WRITE) {
+
return(DB_SUCCESS);
}
- } else {
- if (srv_pass_corrupt_table > 1 && space->is_corrupt) {
- /* should ignore write i/o for the crashed space */
- if (type == OS_FILE_WRITE) {
- mutex_enter(&fil_system->mutex);
- fil_node_complete_io(node, fil_system, type);
- mutex_exit(&fil_system->mutex);
- if (mode == OS_AIO_NORMAL) {
- ut_a(space->purpose == FIL_TABLESPACE);
- buf_page_io_complete(message);
- }
- return(DB_SUCCESS);
- }
- }
-#ifdef UNIV_HOTBACKUP
+ } /**/
+
+ /* Queue the aio request */
+ ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
+ offset_low, offset_high, len, node, message, space_id,
+ trx);
+
+#else
/* In ibbackup do normal i/o, not aio */
if (type == OS_FILE_READ) {
ret = os_file_read(node->handle, buf, offset_low, offset_high,
@@ -5482,26 +5465,7 @@ _fil_io(
ret = os_file_write(node->name, node->handle, buf,
offset_low, offset_high, len);
}
-#else
- /* Queue the aio request */
- ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
- offset_low, offset_high, len, node, message, space_id, trx);
#endif
- } /**/
-
- /* if the table space was already deleted, space might not exist already. */
- if (message
- && space_id < SRV_LOG_SPACE_FIRST_ID
- && ((buf_page_t*)message)->space_was_being_deleted) {
-
- if (mode == OS_AIO_SYNC) {
- if (type == OS_FILE_READ) {
- return(DB_TABLESPACE_DELETED);
- } else {
- return(DB_SUCCESS); /*fake*/
- }
- }
- }
ut_a(ret);
@@ -5625,21 +5589,6 @@ fil_aio_wait(
&message, &type, &space_id);
}
- /* if the table space was already deleted, fil_node might not exist already. */
- if (message
- && space_id < SRV_LOG_SPACE_FIRST_ID
- && ((buf_page_t*)message)->space_was_being_deleted) {
-
- /* intended not to be uncompress read page */
- ut_a(buf_page_get_io_fix_unlocked(message) == BUF_IO_WRITE
- || !buf_page_get_zip_size(message)
- || buf_page_get_state(message) != BUF_BLOCK_FILE_PAGE);
-
- srv_set_io_thread_op_info(segment, "complete io for buf page");
- buf_page_io_complete(message);
- return;
- }
-
ut_a(ret);
if (UNIV_UNLIKELY(fil_node == NULL)) {
ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS);
diff --git a/storage/xtradb/fsp/fsp0fsp.c b/storage/xtradb/fsp/fsp0fsp.c
index 5cbc74b0862..d5717638f29 100644
--- a/storage/xtradb/fsp/fsp0fsp.c
+++ b/storage/xtradb/fsp/fsp0fsp.c
@@ -317,10 +317,7 @@ fsp_get_space_header(
block = buf_page_get(id, zip_size, 0, RW_X_LATCH, mtr);
- if (srv_pass_corrupt_table && !block) {
- return(0);
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(0););
header = FSP_HEADER_OFFSET + buf_block_get_frame(block);
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
@@ -728,10 +725,7 @@ xdes_get_descriptor(
block = buf_page_get(space, zip_size, 0, RW_X_LATCH, mtr);
- if (srv_pass_corrupt_table && !block) {
- return(0);
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(0););
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
@@ -1879,10 +1873,7 @@ fsp_seg_inode_page_find_free(
{
fseg_inode_t* inode;
- if (srv_pass_corrupt_table && !page) {
- return(ULINT_UNDEFINED);
- }
- ut_a(page);
+ SRV_CORRUPT_TABLE_CHECK(page, return(ULINT_UNDEFINED););
for (; i < FSP_SEG_INODES_PER_PAGE(zip_size); i++) {
@@ -1996,10 +1987,7 @@ fsp_alloc_seg_inode(
page = buf_block_get_frame(block);
- if (srv_pass_corrupt_table && !page) {
- return(0);
- }
- ut_a(page);
+ SRV_CORRUPT_TABLE_CHECK(page, return(0););
n = fsp_seg_inode_page_find_free(page, 0, zip_size, mtr);
@@ -2094,10 +2082,7 @@ fseg_inode_try_get(
inode = fut_get_ptr(space, zip_size, inode_addr, RW_X_LATCH, mtr);
- if (srv_pass_corrupt_table && !inode) {
- return(0);
- }
- ut_a(inode);
+ SRV_CORRUPT_TABLE_CHECK(inode, return(0););
if (UNIV_UNLIKELY(!mach_read_from_8(inode + FSEG_ID))) {
@@ -2125,7 +2110,7 @@ fseg_inode_get(
{
fseg_inode_t* inode
= fseg_inode_try_get(header, space, zip_size, mtr);
- ut_a(srv_pass_corrupt_table || inode);
+ SRV_CORRUPT_TABLE_CHECK(inode, ; /* do nothing */);
return(inode);
}
@@ -3317,12 +3302,12 @@ fseg_free_page_low(
descr = xdes_get_descriptor(space, zip_size, page, mtr);
- if (srv_pass_corrupt_table && !descr) {
+ SRV_CORRUPT_TABLE_CHECK(descr,
+ {
/* The page may be corrupt. pass it. */
return;
- }
+ });
- ut_a(descr);
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)) {
fputs("InnoDB: Dump of the tablespace extent descriptor: ",
stderr);
@@ -3571,15 +3556,15 @@ fseg_free_step(
descr = xdes_get_descriptor(space, zip_size, header_page, mtr);
- if (srv_pass_corrupt_table && !descr) {
+ SRV_CORRUPT_TABLE_CHECK(descr,
+ {
/* The page may be corrupt. pass it. */
return(TRUE);
- }
+ });
/* Check that the header resides on a page which has not been
freed yet */
- ut_a(descr);
ut_a(xdes_get_bit(descr, XDES_FREE_BIT,
header_page % FSP_EXTENT_SIZE, mtr) == FALSE);
inode = fseg_inode_try_get(header, space, zip_size, mtr);
@@ -3660,11 +3645,11 @@ fseg_free_step_not_header(
inode = fseg_inode_get(header, space, zip_size, mtr);
- if (srv_pass_corrupt_table && !inode) {
+ SRV_CORRUPT_TABLE_CHECK(inode,
+ {
/* ignore the corruption */
return(TRUE);
- }
- ut_a(inode);
+ });
descr = fseg_get_first_extent(inode, space, zip_size, mtr);
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index a25a3b8679f..f7507a04412 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -204,6 +204,8 @@ static ulong innobase_sys_stats_root_page = 0;
#endif
static my_bool innobase_buffer_pool_shm_checksum = TRUE;
static uint innobase_buffer_pool_shm_key = 0;
+static ulint srv_lazy_drop_table = 0;
+
static char* internal_innobase_data_file_path = NULL;
@@ -1896,7 +1898,7 @@ trx_is_started(
/*===========*/
trx_t* trx) /* in: transaction */
{
- return(trx->conc_state != TRX_NOT_STARTED);
+ return(trx->state != TRX_NOT_STARTED);
}
/*********************************************************************//**
@@ -3016,6 +3018,12 @@ innobase_change_buffering_inited_ok:
"InnoDB: innodb_buffer_pool_shm_key was ignored.\n");
}
+ if (srv_lazy_drop_table) {
+ fprintf(stderr,
+ "InnoDB: Warning: "
+ "innodb_lazy_drop_table is deprecated and ignored.\n");
+ }
+
srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
srv_n_file_io_threads = (ulint) innobase_file_io_threads;
@@ -4725,7 +4733,8 @@ ha_innobase::open(
DBUG_RETURN(1);
}
- if (srv_pass_corrupt_table <= 1 && share->ib_table && share->ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
free_share(share);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
@@ -4750,7 +4759,8 @@ retry:
/* Get pointer to a table object in InnoDB dictionary cache */
ib_table = dict_table_get(norm_name, TRUE);
- if (srv_pass_corrupt_table <= 1 && ib_table && ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(ib_table && ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
free_share(share);
my_free(upd_buf);
upd_buf = NULL;
@@ -7037,7 +7047,8 @@ ha_innobase::index_read(
ha_statistic_increment(&SSV::ha_read_key_count);
- if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(share->ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -7108,7 +7119,8 @@ ha_innobase::index_read(
ret = DB_UNSUPPORTED;
}
- if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(share->ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -7226,7 +7238,8 @@ ha_innobase::change_active_index(
{
DBUG_ENTER("change_active_index");
- if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(share->ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -7344,7 +7357,8 @@ ha_innobase::general_fetch(
DBUG_ENTER("general_fetch");
- if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(share->ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -7357,7 +7371,8 @@ ha_innobase::general_fetch(
innodb_srv_conc_exit_innodb(prebuilt->trx);
- if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) {
+ if (UNIV_UNLIKELY(share->ib_table->is_corrupt &&
+ srv_pass_corrupt_table <= 1)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -9390,7 +9405,7 @@ ha_innobase::info_low(
prebuilt->trx->op_info = "confirming rows of SYS_STATS to store statistics";
- ut_a(prebuilt->trx->conc_state == TRX_NOT_STARTED);
+ ut_a(!trx_is_started(prebuilt->trx));
for (index = dict_table_get_first_index(ib_table);
index != NULL;
@@ -9403,7 +9418,7 @@ ha_innobase::info_low(
innobase_commit_low(prebuilt->trx);
}
- ut_a(prebuilt->trx->conc_state == TRX_NOT_STARTED);
+ ut_a(!trx_is_started(prebuilt->trx));
}
prebuilt->trx->op_info = "updating table statistics";
@@ -13428,8 +13443,7 @@ static MYSQL_SYSVAR_ENUM(corrupt_table_action, srv_pass_corrupt_table,
static MYSQL_SYSVAR_ULINT(lazy_drop_table, srv_lazy_drop_table,
PLUGIN_VAR_RQCMDARG,
- "At deleting tablespace, only miminum needed processes at the time are done. "
- "e.g. for http://bugs.mysql.com/51325",
+ "[Deprecated option] no effect",
NULL, NULL, 0, 0, 1, 0);
static MYSQL_SYSVAR_BOOL(locking_fake_changes, srv_fake_changes_locks,
diff --git a/storage/xtradb/include/btr0btr.ic b/storage/xtradb/include/btr0btr.ic
index 53c8159c448..798107628d7 100644
--- a/storage/xtradb/include/btr0btr.ic
+++ b/storage/xtradb/include/btr0btr.ic
@@ -59,7 +59,7 @@ btr_block_get_func(
block = buf_page_get_gen(space, zip_size, page_no, mode,
NULL, BUF_GET, file, line, mtr);
- ut_a(srv_pass_corrupt_table || block);
+ SRV_CORRUPT_TABLE_CHECK(block, ; /* do nothing */);
if (block && mode != RW_NO_LATCH) {
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h
index e0d7a974fc3..f00a06c8805 100644
--- a/storage/xtradb/include/buf0buf.h
+++ b/storage/xtradb/include/buf0buf.h
@@ -1589,7 +1589,6 @@ struct buf_page_struct{
0 if the block was never accessed
in the buffer pool. Protected by
block mutex */
- ibool space_was_being_deleted;
ibool is_corrupt;
# if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
ibool file_page_was_freed;
diff --git a/storage/xtradb/include/buf0buf.ic b/storage/xtradb/include/buf0buf.ic
index 8d5c3edeef8..18c46b6412e 100644
--- a/storage/xtradb/include/buf0buf.ic
+++ b/storage/xtradb/include/buf0buf.ic
@@ -430,7 +430,6 @@ buf_block_set_file_page(
buf_block_set_state(block, BUF_BLOCK_FILE_PAGE);
block->page.space = space;
block->page.offset = page_no;
- block->page.space_was_being_deleted = FALSE;
}
/*********************************************************************//**
@@ -712,13 +711,7 @@ buf_block_get_frame(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
{
- ut_a(srv_pass_corrupt_table || block);
-
- if (srv_pass_corrupt_table && !block) {
- return(0);
- }
-
- ut_ad(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(0););
switch (buf_block_get_state(block)) {
case BUF_BLOCK_ZIP_FREE:
diff --git a/storage/xtradb/include/buf0flu.ic b/storage/xtradb/include/buf0flu.ic
index 30e2cc8efe8..8228c025d23 100644
--- a/storage/xtradb/include/buf0flu.ic
+++ b/storage/xtradb/include/buf0flu.ic
@@ -70,7 +70,7 @@ buf_flush_note_modification(
ut_ad(!buf_pool_mutex_own(buf_pool));
ut_ad(!buf_flush_list_mutex_own(buf_pool));
- ut_ad(log_flush_order_mutex_own());
+ ut_ad(!mtr->made_dirty || log_flush_order_mutex_own());
ut_ad(mtr->start_lsn != 0);
ut_ad(mtr->modifications);
diff --git a/storage/xtradb/include/buf0lru.h b/storage/xtradb/include/buf0lru.h
index 2ea4f9b1ecf..8bb3aed4059 100644
--- a/storage/xtradb/include/buf0lru.h
+++ b/storage/xtradb/include/buf0lru.h
@@ -73,13 +73,6 @@ buf_LRU_flush_or_remove_pages(
enum buf_remove_t buf_remove);/*!< in: remove or flush
strategy */
-/******************************************************************//**
-*/
-UNIV_INTERN
-void
-buf_LRU_mark_space_was_deleted(
-/*===========================*/
- ulint id); /*!< in: space id */
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/********************************************************************//**
Insert a compressed block into buf_pool->zip_clean in the LRU order. */
diff --git a/storage/xtradb/include/fut0fut.ic b/storage/xtradb/include/fut0fut.ic
index 529f2a516d3..63e5736d99e 100644
--- a/storage/xtradb/include/fut0fut.ic
+++ b/storage/xtradb/include/fut0fut.ic
@@ -50,10 +50,7 @@ fut_get_ptr(
block = buf_page_get(space, zip_size, addr.page, rw_latch, mtr);
- if (srv_pass_corrupt_table && !block) {
- return(0);
- }
- ut_a(block);
+ SRV_CORRUPT_TABLE_CHECK(block, return(0););
ptr = buf_block_get_frame(block) + addr.boffset;
diff --git a/storage/xtradb/include/log0log.h b/storage/xtradb/include/log0log.h
index 4f017e01dfd..59dfb457d56 100644
--- a/storage/xtradb/include/log0log.h
+++ b/storage/xtradb/include/log0log.h
@@ -122,14 +122,22 @@ UNIV_INLINE
void
log_free_check(void);
/*================*/
+/**************************************************************************//**
+Locks the log mutex and opens the log for log_write_low. The log must be closed
+with log_close and released with log_release.
+@return start lsn of the log record */
+UNIV_INLINE
+ib_uint64_t
+log_reserve_and_open(
+/*=================*/
+ ulint len); /*!< in: length of data to be catenated */
/************************************************************//**
-Opens the log for log_write_low. The log must be closed with log_close and
-released with log_release.
+Opens the log for log_write_low. The log must be closed with log_close.
@return start lsn of the log record */
UNIV_INTERN
ib_uint64_t
-log_reserve_and_open(
-/*=================*/
+log_open(
+/*=====*/
ulint len); /*!< in: length of data to be catenated */
/************************************************************//**
Writes to the log the string given. It is assumed that the caller holds the
diff --git a/storage/xtradb/include/log0log.ic b/storage/xtradb/include/log0log.ic
index b54697637b0..5b864f3d7d4 100644
--- a/storage/xtradb/include/log0log.ic
+++ b/storage/xtradb/include/log0log.ic
@@ -332,10 +332,10 @@ log_reserve_and_write_fast(
if (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE) {
- /* The string does not fit within the current log block
- or the log block would become full */
-
- mutex_exit(&log_sys->mutex);
+ /* The string does not fit within the current log block or the
+ log block would become full. Do not release the log mutex,
+ because it has to be reacquired immediately for the "slow" write
+ procedure via log_write_low(). */
return(0);
}
@@ -382,6 +382,21 @@ log_reserve_and_write_fast(
return(log_sys->lsn);
}
+/**************************************************************************//**
+Locks the log mutex and opens the log for log_write_low. The log must be closed
+with log_close and released with log_release.
+@return start lsn of the log record */
+UNIV_INLINE
+ib_uint64_t
+log_reserve_and_open(
+/*=================*/
+ ulint len) /*!< in: length of data to be catenated */
+{
+ mutex_enter(&(log_sys->mutex));
+
+ return log_open(len);
+}
+
/***********************************************************************//**
Releases the log mutex. */
UNIV_INLINE
diff --git a/storage/xtradb/include/mtr0mtr.h b/storage/xtradb/include/mtr0mtr.h
index 46f1ff9310c..c51632e0ed5 100644
--- a/storage/xtradb/include/mtr0mtr.h
+++ b/storage/xtradb/include/mtr0mtr.h
@@ -375,6 +375,8 @@ struct mtr_struct{
ibool modifications;
/* TRUE if the mtr made modifications to
buffer pool pages */
+ ibool made_dirty;/*!< TRUE if mtr has made at least
+ one buffer pool page dirty */
ulint n_log_recs;
/* count of how many page initial log records
have been written to the mtr log */
diff --git a/storage/xtradb/include/mtr0mtr.ic b/storage/xtradb/include/mtr0mtr.ic
index a03a0271535..7b5d268b70f 100644
--- a/storage/xtradb/include/mtr0mtr.ic
+++ b/storage/xtradb/include/mtr0mtr.ic
@@ -29,6 +29,17 @@ Created 11/26/1995 Heikki Tuuri
#endif /* !UNIV_HOTBACKUP */
#include "mach0data.h"
+/***************************************************//**
+Checks if a mini-transaction is dirtying a clean page.
+@return TRUE if the mtr is dirtying a clean page. */
+UNIV_INTERN
+ibool
+mtr_block_dirtied(
+/*==============*/
+ const buf_block_t* block) /*!< in: block being x-fixed */
+ __attribute__((nonnull,warn_unused_result));
+
+
/***************************************************************//**
Starts a mini-transaction. */
UNIV_INLINE
@@ -47,6 +58,7 @@ mtr_start(
mtr->inside_ibuf = FALSE;
mtr->n_log_recs = 0;
mtr->n_freed_pages = 0;
+ mtr->made_dirty = FALSE;
ut_d(mtr->state = MTR_ACTIVE);
ut_d(mtr->magic_n = MTR_MAGIC_N);
@@ -65,6 +77,15 @@ mtr_memo_push(
dyn_array_t* memo;
mtr_memo_slot_t* slot;
+ /* If this mtr has x-fixed a clean page then we set
+ the made_dirty flag. This tells us if we need to
+ grab log_flush_order_mutex at mtr_commit so that we
+ can insert the dirtied page to the flush list. */
+ if (type == MTR_MEMO_PAGE_X_FIX && !mtr->made_dirty) {
+ mtr->made_dirty =
+ mtr_block_dirtied((const buf_block_t *)object);
+ }
+
ut_ad(object);
ut_ad(type >= MTR_MEMO_PAGE_S_FIX);
ut_ad(type <= MTR_MEMO_X_LOCK);
diff --git a/storage/xtradb/include/read0read.h b/storage/xtradb/include/read0read.h
index 0c9468d985e..dd378ecc997 100644
--- a/storage/xtradb/include/read0read.h
+++ b/storage/xtradb/include/read0read.h
@@ -32,6 +32,7 @@ Created 2/16/1997 Heikki Tuuri
#include "ut0byte.h"
#include "ut0lst.h"
#include "trx0trx.h"
+#include "trx0sys.h"
#include "read0types.h"
/*********************************************************************//**
@@ -44,8 +45,11 @@ read_view_open_now(
/*===============*/
trx_id_t cr_trx_id, /*!< in: trx_id of creating
transaction, or 0 used in purge */
- mem_heap_t* heap); /*!< in: memory heap from which
- allocated */
+ read_view_t* view, /*!< in: current read view or NULL if it
+ doesn't exist yet */
+ ibool exclude_self); /*!< in: TRUE, if cr_trx_id should be
+ excluded from the resulting view */
+
/*********************************************************************//**
Makes a copy of the oldest existing read view, or opens a new. The view
must be closed with ..._close.
@@ -56,8 +60,8 @@ read_view_oldest_copy_or_open_new(
/*==============================*/
trx_id_t cr_trx_id, /*!< in: trx_id of creating
transaction, or 0 used in purge */
- mem_heap_t* heap); /*!< in: memory heap from which
- allocated */
+ read_view_t* view); /*!< in: pre-allocated view array or
+ NULL if a new one needs to be created */
/*********************************************************************//**
Closes a read view. */
UNIV_INTERN
@@ -66,6 +70,13 @@ read_view_close(
/*============*/
read_view_t* view); /*!< in: read view */
/*********************************************************************//**
+Frees memory allocated by a read view. */
+UNIV_INTERN
+void
+read_view_free(
+/*===========*/
+ read_view_t* view); /*< in: read view */
+/*********************************************************************//**
Closes a consistent read view for MySQL. This function is called at an SQL
statement end if the trx isolation level is <= TRX_ISO_READ_COMMITTED. */
UNIV_INTERN
@@ -143,16 +154,20 @@ struct read_view_struct{
are strictly smaller (<) than this value.
In other words,
this is the "low water mark". */
- ulint n_trx_ids;
+ ulint n_descr;
/*!< Number of cells in the trx_ids array */
- trx_id_t* trx_ids;/*!< Additional trx ids which the read should
- not see: typically, these are the active
+ ulint max_descr;
+ /*!< Maximum number of cells in the trx_ids
+ array */
+ trx_id_t* descriptors;
+ /*!< Array of trx descriptors which the read
+ should not see: typically, these are the active
transactions at the time when the read is
serialized, except the reading transaction
itself; the trx ids in this array are in a
descending order. These trx_ids should be
- between the "low" and "high" water marks,
- that is, up_limit_id and low_limit_id. */
+ between the "low" and "high" water marks, that
+ is, up_limit_id and low_limit_id. */
trx_id_t creator_trx_id;
/*!< trx id of creating transaction, or
0 used in purge */
diff --git a/storage/xtradb/include/read0read.ic b/storage/xtradb/include/read0read.ic
index 5bb5249b591..ebcdb767406 100644
--- a/storage/xtradb/include/read0read.ic
+++ b/storage/xtradb/include/read0read.ic
@@ -25,6 +25,11 @@ Created 2/16/1997 Heikki Tuuri
/*********************************************************************//**
Gets the nth trx id in a read view.
+
+Upstream code stores array of trx_ids in the descending order. Percona Server
+keeps it in the ascending order for performance reasons. Let us keep the
+semantics.
+
@return trx id */
UNIV_INLINE
trx_id_t
@@ -33,13 +38,17 @@ read_view_get_nth_trx_id(
const read_view_t* view, /*!< in: read view */
ulint n) /*!< in: position */
{
- ut_ad(n < view->n_trx_ids);
+ ut_ad(n < view->n_descr);
- return(*(view->trx_ids + n));
+ return(view->descriptors[view->n_descr - 1 - n]);
}
/*********************************************************************//**
-Sets the nth trx id in a read view. */
+Sets the nth trx id in a read view.
+
+Upstream code stores array of trx_ids in the descending order. Percona Server
+keeps it in the ascending order for performance reasons. Let us keep the
+semantics. */
UNIV_INLINE
void
read_view_set_nth_trx_id(
@@ -48,9 +57,9 @@ read_view_set_nth_trx_id(
ulint n, /*!< in: position */
trx_id_t trx_id) /*!< in: trx id to set */
{
- ut_ad(n < view->n_trx_ids);
+ ut_ad(n < view->n_descr);
- *(view->trx_ids + n) = trx_id;
+ view->descriptors[view->n_descr - 1 - n] = trx_id;
}
/*********************************************************************//**
@@ -63,9 +72,6 @@ read_view_sees_trx_id(
const read_view_t* view, /*!< in: read view */
trx_id_t trx_id) /*!< in: trx id */
{
- ulint n_ids;
- ulint i;
-
if (trx_id < view->up_limit_id) {
return(TRUE);
@@ -76,21 +82,8 @@ read_view_sees_trx_id(
return(FALSE);
}
- /* We go through the trx ids in the array smallest first: this order
- may save CPU time, because if there was a very long running
- transaction in the trx id array, its trx id is looked at first, and
- the first two comparisons may well decide the visibility of trx_id. */
-
- n_ids = view->n_trx_ids;
-
- for (i = 0; i < n_ids; i++) {
- trx_id_t view_trx_id
- = read_view_get_nth_trx_id(view, n_ids - i - 1);
-
- if (trx_id <= view_trx_id) {
- return(trx_id != view_trx_id);
- }
- }
+ /* Do a binary search over this view's descriptors array */
- return(TRUE);
+ return(trx_find_descriptor(view->descriptors, view->n_descr,
+ trx_id) == NULL);
}
diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h
index 586c1e73879..53dbf21e455 100644
--- a/storage/xtradb/include/srv0srv.h
+++ b/storage/xtradb/include/srv0srv.h
@@ -274,9 +274,22 @@ extern ulong srv_adaptive_flushing_method;
extern ulong srv_expand_import;
extern ulong srv_pass_corrupt_table;
-extern ulint srv_dict_size_limit;
+/* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE,
+execute 'code' if srv_pass_corrupt_table is non-zero, or trigger a fatal error
+otherwise. The break statement in 'code' will obviously not work as expected. */
+
+#define SRV_CORRUPT_TABLE_CHECK(cond,code) \
+ do { \
+ if (UNIV_UNLIKELY(!(cond))) { \
+ if (srv_pass_corrupt_table) { \
+ code \
+ } else { \
+ ut_error; \
+ } \
+ } \
+ } while(0)
-extern ulint srv_lazy_drop_table;
+extern ulint srv_dict_size_limit;
/*-------------------------------------------*/
extern ulint srv_n_rows_inserted;
diff --git a/storage/xtradb/include/trx0purge.h b/storage/xtradb/include/trx0purge.h
index 1e8acd65e01..1ddc9068b8e 100644
--- a/storage/xtradb/include/trx0purge.h
+++ b/storage/xtradb/include/trx0purge.h
@@ -143,6 +143,7 @@ struct trx_purge_struct{
obtaining an s-latch here. */
read_view_t* view; /*!< The purge will not remove undo logs
which are >= this view (purge view) */
+ read_view_t* prebuilt_view; /*!< Pre-built view array */
ulonglong n_pages_handled;/*!< Approximate number of undo log
pages processed in purge */
ulonglong handle_limit; /*!< Target of how many pages to get
diff --git a/storage/xtradb/include/trx0sys.h b/storage/xtradb/include/trx0sys.h
index cba21ae97a9..75a3b0fb4fd 100644
--- a/storage/xtradb/include/trx0sys.h
+++ b/storage/xtradb/include/trx0sys.h
@@ -249,6 +249,17 @@ trx_id_t
trx_sys_get_new_trx_id(void);
/*========================*/
+/*************************************************************//**
+Find a slot for a given trx ID in a descriptors array.
+@return: slot pointer */
+UNIV_INLINE
+trx_id_t*
+trx_find_descriptor(
+/*================*/
+ const trx_id_t* descriptors, /*!< in: descriptors array */
+ ulint n_descr, /*!< in: array size */
+ trx_id_t trx_id); /*!< in: trx pointer */
+
#ifdef UNIV_DEBUG
/* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */
extern uint trx_rseg_n_slots_debug;
@@ -633,6 +644,8 @@ identifier is added to this 64-bit constant. */
| TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW)
/* @} */
+#define TRX_DESCR_ARRAY_INITIAL_SIZE 1000
+
#ifndef UNIV_HOTBACKUP
/** Doublewrite control struct */
struct trx_doublewrite_struct{
@@ -660,16 +673,41 @@ struct trx_sys_struct{
trx_id_t max_trx_id; /*!< The smallest number not yet
assigned as a transaction id or
transaction number */
+ char pad1[64]; /*!< Ensure max_trx_id does not share
+ cache line with other fields. */
+ trx_id_t* descriptors; /*!< Array of trx descriptors */
+ ulint descr_n_max; /*!< The current size of the descriptors
+ array. */
+ char pad2[64]; /*!< Ensure static descriptor fields
+ do not share cache lines with
+ descr_n_used */
+ ulint descr_n_used; /*!< Number of used elements in the
+ descriptors array. */
+ char pad3[64]; /*!< Ensure descriptors do not share
+ cache line with other fields */
UT_LIST_BASE_NODE_T(trx_t) trx_list;
/*!< List of active and committed in
memory transactions, sorted on trx id,
biggest first */
+ char pad4[64]; /*!< Ensure list base nodes do not
+ share cache line with other fields */
UT_LIST_BASE_NODE_T(trx_t) mysql_trx_list;
/*!< List of transactions created
for MySQL */
+ char pad5[64]; /*!< Ensure list base nodes do not
+ share cache line with other fields */
+ UT_LIST_BASE_NODE_T(trx_t) trx_serial_list;
+ /*!< trx->no ordered List of
+ transactions in either TRX_PREPARED or
+ TRX_ACTIVE which have already been
+ assigned a serialization number */
+ char pad6[64]; /*!< Ensure trx_serial_list does not
+ share cache line with other fields */
UT_LIST_BASE_NODE_T(trx_rseg_t) rseg_list;
/*!< List of rollback segment
objects */
+ char pad7[64]; /*!< Ensure list base nodes do not
+ share cache line with other fields */
trx_rseg_t* latest_rseg; /*!< Latest rollback segment in the
round-robin assignment of rollback
segments to transactions */
diff --git a/storage/xtradb/include/trx0sys.ic b/storage/xtradb/include/trx0sys.ic
index af05ab2f5ed..3af98cdf98b 100644
--- a/storage/xtradb/include/trx0sys.ic
+++ b/storage/xtradb/include/trx0sys.ic
@@ -367,28 +367,11 @@ trx_is_active(
/*==========*/
trx_id_t trx_id) /*!< in: trx id of the transaction */
{
- trx_t* trx;
-
ut_ad(mutex_own(&(kernel_mutex)));
- if (trx_id < trx_list_get_min_trx_id()) {
-
- return(FALSE);
- }
-
- if (UNIV_UNLIKELY(trx_id >= trx_sys->max_trx_id)) {
-
- /* There must be corruption: we return TRUE because this
- function is only called by lock_clust_rec_some_has_impl()
- and row_vers_impl_x_locked_off_kernel() and they have
- diagnostic prints in this case */
-
- return(TRUE);
- }
-
- trx = trx_get_on_id(trx_id);
- if (trx && (trx->conc_state == TRX_ACTIVE
- || trx->conc_state == TRX_PREPARED)) {
+ if (trx_find_descriptor(trx_sys->descriptors,
+ trx_sys->descr_n_used,
+ trx_id)) {
return(TRUE);
}
@@ -425,4 +408,27 @@ trx_sys_get_new_trx_id(void)
return(id);
}
+
+/*************************************************************//**
+Find a slot for a given trx ID in a descriptors array.
+@return: slot pointer */
+UNIV_INLINE
+trx_id_t*
+trx_find_descriptor(
+/*================*/
+ const trx_id_t* descriptors, /*!< in: descriptors array */
+ ulint n_descr, /*!< in: array size */
+ trx_id_t trx_id) /*!< in: trx pointer */
+{
+ ut_ad(descriptors != trx_sys->descriptors ||
+ mutex_own(&kernel_mutex));
+
+ if (UNIV_UNLIKELY(n_descr == 0)) {
+
+ return(NULL);
+ }
+
+ return((trx_id_t *) bsearch(&trx_id, descriptors, n_descr,
+ sizeof(trx_id_t), trx_descr_cmp));
+}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/xtradb/include/trx0trx.h b/storage/xtradb/include/trx0trx.h
index a03f7aceafa..40f441295b0 100644
--- a/storage/xtradb/include/trx0trx.h
+++ b/storage/xtradb/include/trx0trx.h
@@ -447,6 +447,23 @@ trx_get_que_state_str(
/*==================*/
const trx_t* trx); /*!< in: transaction */
+/*************************************************************//**
+Callback function for trx_find_descriptor() to compare trx IDs. */
+UNIV_INTERN
+int
+trx_descr_cmp(
+/*==========*/
+ const void *a, /*!< in: pointer to first comparison argument */
+ const void *b); /*!< in: pointer to second comparison argument */
+
+/*************************************************************//**
+Release a slot for a given trx in the global descriptors array. */
+UNIV_INTERN
+void
+trx_release_descriptor(
+/*===================*/
+ trx_t* trx); /*!< in: trx pointer */
+
/* Signal to a transaction */
struct trx_sig_struct{
unsigned type:3; /*!< signal type */
@@ -477,10 +494,18 @@ struct trx_struct{
const char* op_info; /*!< English text describing the
current operation, or an empty
string */
- ulint conc_state; /*!< state of the trx from the point
- of view of concurrency control:
- TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
- ... */
+ ulint state; /*!< state of the trx from the point of
+ view of concurrency control: TRX_ACTIVE,
+ TRX_COMMITTED_IN_MEMORY, ... This was
+ called 'conc_state' in the upstream and
+ has been renamed in Percona Server,
+ because changing it's value to/from
+ either TRX_ACTIVE or TRX_PREPARED
+ requires calling
+ trx_reserve_descriptor() /
+ trx_release_descriptor(). Different name
+ ensures we notice any new code changing
+ the state. */
/*------------------------------*/
/* MySQL has a transaction coordinator to coordinate two phase
commit between multiple storage engines and the binary log. When
@@ -494,6 +519,9 @@ struct trx_struct{
this is set to 1 then registered should
also be set to 1. This is used in the
XA code */
+ unsigned is_in_trx_serial_list:1;
+ /* Set when transaction is in the
+ trx_serial_list */
/*------------------------------*/
ulint isolation_level;/* TRX_ISO_REPEATABLE_READ, ... */
ulint check_foreigns; /* normally TRUE, but if the user
@@ -627,6 +655,9 @@ struct trx_struct{
UT_LIST_NODE_T(trx_t)
mysql_trx_list; /*!< list of transactions created for
MySQL */
+ UT_LIST_NODE_T(trx_t)
+ trx_serial_list;/*!< list node for
+ trx_sys->trx_serial_list */
/*------------------------------*/
ulint error_state; /*!< 0 if no error, otherwise error
number; NOTE That ONLY the thread
@@ -685,9 +716,6 @@ struct trx_struct{
UT_LIST_BASE_NODE_T(lock_t)
trx_locks; /*!< locks reserved by the transaction */
/*------------------------------*/
- mem_heap_t* global_read_view_heap;
- /* memory heap for the global read
- view */
read_view_t* global_read_view;
/* consistent read view associated
to a transaction or NULL */
@@ -697,6 +725,7 @@ struct trx_struct{
associated to a transaction (i.e.
same as global_read_view) or read view
associated to a cursor */
+ read_view_t* prebuilt_view; /* pre-built view array */
/*------------------------------*/
UT_LIST_BASE_NODE_T(trx_named_savept_t)
trx_savepoints; /*!< savepoints set with SAVEPOINT ...,
diff --git a/storage/xtradb/include/trx0trx.ic b/storage/xtradb/include/trx0trx.ic
index 4a1d3bcde0b..1a1fc91eac5 100644
--- a/storage/xtradb/include/trx0trx.ic
+++ b/storage/xtradb/include/trx0trx.ic
@@ -31,9 +31,9 @@ trx_start_if_not_started(
/*=====================*/
trx_t* trx) /*!< in: transaction */
{
- ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY);
+ ut_ad(trx->state != TRX_COMMITTED_IN_MEMORY);
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
trx_start(trx, ULINT_UNDEFINED);
}
@@ -48,9 +48,9 @@ trx_start_if_not_started_low(
/*=========================*/
trx_t* trx) /*!< in: transaction */
{
- ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY);
+ ut_ad(trx->state != TRX_COMMITTED_IN_MEMORY);
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
trx_start_low(trx, ULINT_UNDEFINED);
}
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index 60c5cc79852..0fefdbaeb9a 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -64,7 +64,7 @@ component, i.e. we show M.N.P as M.N */
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
#ifndef PERCONA_INNODB_VERSION
-#define PERCONA_INNODB_VERSION 30.1
+#define PERCONA_INNODB_VERSION 30.2
#endif
#define INNODB_VERSION_STR MYSQL_SERVER_VERSION "-" IB_TO_STR(PERCONA_INNODB_VERSION)
diff --git a/storage/xtradb/lock/lock0lock.c b/storage/xtradb/lock/lock0lock.c
index 47d082ed49f..f4c991d4fe9 100644
--- a/storage/xtradb/lock/lock0lock.c
+++ b/storage/xtradb/lock/lock0lock.c
@@ -4652,7 +4652,7 @@ lock_print_info_all_transactions(
trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
while (trx) {
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
fputs("---", file);
trx_print(file, trx, 600);
}
@@ -4820,9 +4820,9 @@ lock_table_queue_validate(
lock = UT_LIST_GET_FIRST(table->locks);
while (lock) {
- ut_a(((lock->trx)->conc_state == TRX_ACTIVE)
- || ((lock->trx)->conc_state == TRX_PREPARED)
- || ((lock->trx)->conc_state == TRX_COMMITTED_IN_MEMORY));
+ ut_a(((lock->trx)->state == TRX_ACTIVE)
+ || ((lock->trx)->state == TRX_PREPARED)
+ || ((lock->trx)->state == TRX_COMMITTED_IN_MEMORY));
if (!lock_get_wait(lock)) {
@@ -4870,7 +4870,7 @@ lock_rec_queue_validate(
lock = lock_rec_get_first(block, heap_no);
while (lock) {
- switch(lock->trx->conc_state) {
+ switch(lock->trx->state) {
case TRX_ACTIVE:
case TRX_PREPARED:
case TRX_COMMITTED_IN_MEMORY:
@@ -4957,9 +4957,9 @@ lock_rec_queue_validate(
lock = lock_rec_get_first(block, heap_no);
while (lock) {
- ut_a(lock->trx->conc_state == TRX_ACTIVE
- || lock->trx->conc_state == TRX_PREPARED
- || lock->trx->conc_state == TRX_COMMITTED_IN_MEMORY);
+ ut_a(lock->trx->state == TRX_ACTIVE
+ || lock->trx->state == TRX_PREPARED
+ || lock->trx->state == TRX_COMMITTED_IN_MEMORY);
ut_a(trx_in_trx_list(lock->trx));
if (index) {
@@ -5036,9 +5036,9 @@ loop:
}
ut_a(trx_in_trx_list(lock->trx));
- ut_a(lock->trx->conc_state == TRX_ACTIVE
- || lock->trx->conc_state == TRX_PREPARED
- || lock->trx->conc_state == TRX_COMMITTED_IN_MEMORY);
+ ut_a(lock->trx->state == TRX_ACTIVE
+ || lock->trx->state == TRX_PREPARED
+ || lock->trx->state == TRX_COMMITTED_IN_MEMORY);
# ifdef UNIV_SYNC_DEBUG
/* Only validate the record queues when this thread is not
diff --git a/storage/xtradb/log/log0log.c b/storage/xtradb/log/log0log.c
index e7c7a165b9c..a5243d22e8d 100644
--- a/storage/xtradb/log/log0log.c
+++ b/storage/xtradb/log/log0log.c
@@ -265,13 +265,12 @@ log_check_tracking_margin(
}
/************************************************************//**
-Opens the log for log_write_low. The log must be closed with log_close and
-released with log_release.
+Opens the log for log_write_low. The log must be closed with log_close.
@return start lsn of the log record */
UNIV_INTERN
ib_uint64_t
-log_reserve_and_open(
-/*=================*/
+log_open(
+/*=====*/
ulint len) /*!< in: length of data to be catenated */
{
log_t* log = log_sys;
@@ -284,7 +283,6 @@ log_reserve_and_open(
ut_a(len < log->buf_size / 2);
loop:
- mutex_enter(&(log->mutex));
ut_ad(!recv_no_log_write);
/* Calculate an upper limit for the space the string may take in the
@@ -305,6 +303,8 @@ loop:
ut_ad(++count < 50);
+ mutex_enter(&(log->mutex));
+
goto loop;
}
@@ -318,6 +318,8 @@ loop:
os_thread_sleep(10000);
+ mutex_enter(&(log->mutex));
+
goto loop;
}
@@ -338,6 +340,8 @@ loop:
ut_ad(++count < 50);
+ mutex_enter(&(log->mutex));
+
goto loop;
}
}
@@ -494,9 +498,12 @@ log_close(void)
if (tracked_lsn_age >= log->log_group_capacity) {
- fprintf(stderr, " InnoDB: Error: the age of the "
+ fprintf(stderr, "InnoDB: Error: the age of the "
"oldest untracked record exceeds the log "
"group capacity!\n");
+ fprintf(stderr, "InnoDB: Error: stopping the log "
+ "tracking thread at LSN %llu\n", tracked_lsn);
+ srv_track_changed_pages = FALSE;
}
}
diff --git a/storage/xtradb/mtr/mtr0mtr.c b/storage/xtradb/mtr/mtr0mtr.c
index 092bd702115..9eb7b18f301 100644
--- a/storage/xtradb/mtr/mtr0mtr.c
+++ b/storage/xtradb/mtr/mtr0mtr.c
@@ -38,6 +38,25 @@ Created 11/26/1995 Heikki Tuuri
#ifndef UNIV_HOTBACKUP
# include "log0recv.h"
+
+/***************************************************//**
+Checks if a mini-transaction is dirtying a clean page.
+@return TRUE if the mtr is dirtying a clean page. */
+UNIV_INTERN
+ibool
+mtr_block_dirtied(
+/*==============*/
+ const buf_block_t* block) /*!< in: block being x-fixed */
+{
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
+ ut_ad(block->page.buf_fix_count > 0);
+
+ /* It is OK to read oldest_modification because no
+ other thread can be performing a write of it and it
+ is only during write that the value is reset to 0. */
+ return(block->page.oldest_modification == 0);
+}
+
/*****************************************************************//**
Releases the item in the slot given. */
static
@@ -126,7 +145,7 @@ mtr_memo_slot_note_modification(
buf_block_t* block = (buf_block_t*) slot->object;
#ifdef UNIV_DEBUG
- ut_ad(log_flush_order_mutex_own());
+ ut_ad(!mtr->made_dirty || log_flush_order_mutex_own());
#endif /* UNIV_DEBUG */
buf_flush_note_modification(block, mtr);
}
@@ -202,12 +221,14 @@ mtr_log_reserve_and_write(
Add pages to flush list and exit */
goto func_exit;
}
+ } else {
+ mutex_enter(&log_sys->mutex);
}
data_size = dyn_array_get_data_size(mlog);
/* Open the database log for log_write_low */
- mtr->start_lsn = log_reserve_and_open(data_size);
+ mtr->start_lsn = log_open(data_size);
if (mtr->log_mode == MTR_LOG_ALL) {
@@ -226,7 +247,15 @@ mtr_log_reserve_and_write(
mtr->end_lsn = log_close();
func_exit:
- log_flush_order_mutex_enter();
+
+ /* No need to acquire log_flush_order_mutex if this mtr has
+ not dirtied a clean page. log_flush_order_mutex is used to
+ ensure ordered insertions in the flush_list. We need to
+ insert in the flush_list iff the page in question was clean
+ before modifications. */
+ if (mtr->made_dirty) {
+ log_flush_order_mutex_enter();
+ }
/* It is now safe to release the log mutex because the
flush_order mutex will ensure that we are the first one
@@ -237,7 +266,9 @@ func_exit:
mtr_memo_note_modifications(mtr);
}
- log_flush_order_mutex_exit();
+ if (mtr->made_dirty) {
+ log_flush_order_mutex_exit();
+ }
}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/xtradb/read/read0read.c b/storage/xtradb/read/read0read.c
index f049dd21e8d..c04dae51ff5 100644
--- a/storage/xtradb/read/read0read.c
+++ b/storage/xtradb/read/read0read.c
@@ -145,14 +145,27 @@ read_view_t*
read_view_create_low(
/*=================*/
ulint n, /*!< in: number of cells in the trx_ids array */
- mem_heap_t* heap) /*!< in: memory heap from which allocated */
+ read_view_t* view) /*!< in: pre-allocated view array or NULL if a
+ new one needs to be created */
{
- read_view_t* view;
+ if (view == NULL) {
+ view = ut_malloc(sizeof(read_view_t));
+ view->max_descr = 0;
+ view->descriptors = NULL;
+ }
+
+ if (UNIV_UNLIKELY(view->max_descr < n)) {
- view = mem_heap_alloc(heap, sizeof(read_view_t));
+ /* avoid frequent re-allocations by extending the array to the
+ desired size + 10% */
+
+ view->max_descr = n + n / 10;
+ view->descriptors = ut_realloc(view->descriptors,
+ view->max_descr *
+ sizeof(trx_id_t));
+ }
- view->n_trx_ids = n;
- view->trx_ids = mem_heap_alloc(heap, n * sizeof *view->trx_ids);
+ view->n_descr = n;
return(view);
}
@@ -169,8 +182,8 @@ read_view_oldest_copy_or_open_new(
/*==============================*/
trx_id_t cr_trx_id, /*!< in: trx_id of creating
transaction, or 0 used in purge */
- mem_heap_t* heap) /*!< in: memory heap from which
- allocated */
+ read_view_t* view) /*!< in: pre-allocated view array or
+ NULL if a new one needs to be created */
{
read_view_t* old_view;
read_view_t* view_copy;
@@ -185,10 +198,10 @@ read_view_oldest_copy_or_open_new(
if (old_view == NULL) {
- return(read_view_open_now(cr_trx_id, heap));
+ return(read_view_open_now(cr_trx_id, view, TRUE));
}
- n = old_view->n_trx_ids;
+ n = old_view->n_descr;
if (old_view->creator_trx_id) {
n++;
@@ -196,7 +209,7 @@ read_view_oldest_copy_or_open_new(
needs_insert = FALSE;
}
- view_copy = read_view_create_low(n, heap);
+ view_copy = read_view_create_low(n, view);
/* Insert the id of the creator in the right place of the descending
array of ids, if needs_insert is TRUE: */
@@ -204,7 +217,7 @@ read_view_oldest_copy_or_open_new(
i = 0;
while (i < n) {
if (needs_insert
- && (i >= old_view->n_trx_ids
+ && (i >= old_view->n_descr
|| old_view->creator_trx_id
> read_view_get_nth_trx_id(old_view, i))) {
@@ -251,16 +264,17 @@ read_view_open_now(
/*===============*/
trx_id_t cr_trx_id, /*!< in: trx_id of creating
transaction, or 0 used in purge */
- mem_heap_t* heap) /*!< in: memory heap from which
- allocated */
+ read_view_t* view, /*!< in: current read view or NULL if it
+ doesn't exist yet */
+ ibool exclude_self) /*!< in: TRUE, if cr_trx_id should be
+ excluded from the resulting view */
{
- read_view_t* view;
- trx_t* trx;
- ulint n;
+ trx_id_t* descr;
+ ulint i;
ut_ad(mutex_own(&kernel_mutex));
- view = read_view_create_low(UT_LIST_GET_LEN(trx_sys->trx_list), heap);
+ view = read_view_create_low(trx_sys->descr_n_used, view);
view->creator_trx_id = cr_trx_id;
view->type = VIEW_NORMAL;
@@ -271,40 +285,58 @@ read_view_open_now(
view->low_limit_no = trx_sys->max_trx_id;
view->low_limit_id = view->low_limit_no;
- n = 0;
- trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
+ /* No active transaction should be visible */
- /* No active transaction should be visible, except cr_trx */
+ descr = trx_find_descriptor(trx_sys->descriptors,
+ trx_sys->descr_n_used,
+ cr_trx_id);
- while (trx) {
- if (trx->id != cr_trx_id
- && (trx->conc_state == TRX_ACTIVE
- || trx->conc_state == TRX_PREPARED)) {
+ if (UNIV_LIKELY(exclude_self && descr != NULL)) {
- read_view_set_nth_trx_id(view, n, trx->id);
+ ut_ad(trx_sys->descr_n_used > 0);
+ ut_ad(view->n_descr > 0);
- n++;
+ view->n_descr--;
- /* NOTE that a transaction whose trx number is <
- trx_sys->max_trx_id can still be active, if it is
- in the middle of its commit! Note that when a
- transaction starts, we initialize trx->no to
- IB_ULONGLONG_MAX. */
+ i = descr - trx_sys->descriptors;
+ } else {
+ i = trx_sys->descr_n_used;
+ }
- if (view->low_limit_no > trx->no) {
+ if (UNIV_LIKELY(i > 0)) {
- view->low_limit_no = trx->no;
- }
- }
+ /* Copy the [0; i-1] range */
+ memcpy(view->descriptors, trx_sys->descriptors,
+ i * sizeof(trx_id_t));
+ }
- trx = UT_LIST_GET_NEXT(trx_list, trx);
+ if (UNIV_UNLIKELY(i + 1 < trx_sys->descr_n_used)) {
+
+ /* Copy the [i+1; descr_n_used-1] range */
+ memcpy(view->descriptors + i,
+ trx_sys->descriptors + i + 1,
+ (trx_sys->descr_n_used - i - 1) *
+ sizeof(trx_id_t));
}
- view->n_trx_ids = n;
+ /* NOTE that a transaction whose trx number is < trx_sys->max_trx_id can
+ still be active, if it is in the middle of its commit! Note that when a
+ transaction starts, we initialize trx->no to IB_ULONGLONG_MAX. */
- if (n > 0) {
+ if (UT_LIST_GET_LEN(trx_sys->trx_serial_list) > 0) {
+
+ trx_id_t trx_no;
+
+ trx_no = UT_LIST_GET_FIRST(trx_sys->trx_serial_list)->no;
+
+ if (trx_no < view->low_limit_no) {
+ view->low_limit_no = trx_no;
+ }
+ }
+
+ if (UNIV_LIKELY(view->n_descr > 0)) {
/* The last active transaction has the smallest id: */
- view->up_limit_id = read_view_get_nth_trx_id(view, n - 1);
+ view->up_limit_id = view->descriptors[0];
} else {
view->up_limit_id = view->low_limit_id;
}
@@ -329,6 +361,23 @@ read_view_close(
}
/*********************************************************************//**
+Frees resource allocated by a read view. */
+UNIV_INTERN
+void
+read_view_free(
+/*===========*/
+ read_view_t* view) /*< in: read view */
+{
+ ut_ad(mutex_own(&kernel_mutex));
+
+ if (view->descriptors != NULL) {
+ ut_free(view->descriptors);
+ }
+
+ ut_free(view);
+}
+
+/*********************************************************************//**
Closes a consistent read view for MySQL. This function is called at an SQL
statement end if the trx isolation level is <= TRX_ISO_READ_COMMITTED. */
UNIV_INTERN
@@ -343,8 +392,6 @@ read_view_close_for_mysql(
read_view_close(trx->global_read_view);
- mem_heap_empty(trx->global_read_view_heap);
-
trx->read_view = NULL;
trx->global_read_view = NULL;
@@ -382,7 +429,7 @@ read_view_print(
fprintf(file, "Read view individually stored trx ids:\n");
- n_ids = view->n_trx_ids;
+ n_ids = view->n_descr;
for (i = 0; i < n_ids; i++) {
fprintf(file, "Read view trx id " TRX_ID_FMT "\n",
@@ -404,8 +451,6 @@ read_cursor_view_create_for_mysql(
cursor_view_t* curview;
read_view_t* view;
mem_heap_t* heap;
- trx_t* trx;
- ulint n;
ut_a(cr_trx);
@@ -424,61 +469,14 @@ read_cursor_view_create_for_mysql(
mutex_enter(&kernel_mutex);
- curview->read_view = read_view_create_low(
- UT_LIST_GET_LEN(trx_sys->trx_list), curview->heap);
+ curview->read_view = read_view_open_now(cr_trx->id, NULL, FALSE);
+
+ mutex_exit(&kernel_mutex);
view = curview->read_view;
- view->creator_trx_id = cr_trx->id;
view->type = VIEW_HIGH_GRANULARITY;
view->undo_no = cr_trx->undo_no;
- /* No future transactions should be visible in the view */
-
- view->low_limit_no = trx_sys->max_trx_id;
- view->low_limit_id = view->low_limit_no;
-
- n = 0;
- trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
-
- /* No active transaction should be visible */
-
- while (trx) {
-
- if (trx->conc_state == TRX_ACTIVE
- || trx->conc_state == TRX_PREPARED) {
-
- read_view_set_nth_trx_id(view, n, trx->id);
-
- n++;
-
- /* NOTE that a transaction whose trx number is <
- trx_sys->max_trx_id can still be active, if it is
- in the middle of its commit! Note that when a
- transaction starts, we initialize trx->no to
- IB_ULONGLONG_MAX. */
-
- if (view->low_limit_no > trx->no) {
-
- view->low_limit_no = trx->no;
- }
- }
-
- trx = UT_LIST_GET_NEXT(trx_list, trx);
- }
-
- view->n_trx_ids = n;
-
- if (n > 0) {
- /* The last active transaction has the smallest id: */
- view->up_limit_id = read_view_get_nth_trx_id(view, n - 1);
- } else {
- view->up_limit_id = view->low_limit_id;
- }
-
- UT_LIST_ADD_FIRST(view_list, trx_sys->view_list, view);
-
- mutex_exit(&kernel_mutex);
-
return(curview);
}
@@ -503,6 +501,8 @@ read_cursor_view_close_for_mysql(
mutex_enter(&kernel_mutex);
read_view_close(curview->read_view);
+ read_view_free(curview->read_view);
+
trx->read_view = trx->global_read_view;
mutex_exit(&kernel_mutex);
diff --git a/storage/xtradb/row/row0ins.c b/storage/xtradb/row/row0ins.c
index fda0c55b5c7..0002f4410d6 100644
--- a/storage/xtradb/row/row0ins.c
+++ b/storage/xtradb/row/row0ins.c
@@ -1346,11 +1346,11 @@ run_again:
const rec_t* rec = btr_pcur_get_rec(&pcur);
const buf_block_t* block = btr_pcur_get_block(&pcur);
- if (srv_pass_corrupt_table && !block) {
+ SRV_CORRUPT_TABLE_CHECK(block,
+ {
err = DB_CORRUPTION;
- break;
- }
- ut_a(block);
+ goto exit_loop;
+ });
if (page_rec_is_infimum(rec)) {
@@ -1474,6 +1474,7 @@ run_again:
}
} while (btr_pcur_move_to_next(&pcur, &mtr));
+exit_loop:
if (check_ref) {
row_ins_foreign_report_add_err(
trx, foreign, btr_pcur_get_rec(&pcur), entry);
diff --git a/storage/xtradb/row/row0merge.c b/storage/xtradb/row/row0merge.c
index 0b6a6302854..40e7d99b839 100644
--- a/storage/xtradb/row/row0merge.c
+++ b/storage/xtradb/row/row0merge.c
@@ -1298,11 +1298,11 @@ row_merge_read_clustered_index(
if (UNIV_LIKELY(has_next)) {
rec = btr_pcur_get_rec(&pcur);
- if (srv_pass_corrupt_table && !rec) {
+ SRV_CORRUPT_TABLE_CHECK(rec,
+ {
err = DB_CORRUPTION;
goto err_exit;
- }
- ut_a(rec);
+ });
offsets = rec_get_offsets(rec, clust_index, NULL,
ULINT_UNDEFINED, &row_heap);
diff --git a/storage/xtradb/row/row0sel.c b/storage/xtradb/row/row0sel.c
index 858d50fd5a6..dec192585ce 100644
--- a/storage/xtradb/row/row0sel.c
+++ b/storage/xtradb/row/row0sel.c
@@ -3952,9 +3952,9 @@ release_search_latch_if_needed:
trx->has_search_latch = FALSE;
}
- ut_ad(prebuilt->sql_stat_start || trx->conc_state == TRX_ACTIVE);
- ut_ad(trx->conc_state == TRX_NOT_STARTED
- || trx->conc_state == TRX_ACTIVE);
+ ut_ad(prebuilt->sql_stat_start || trx->state == TRX_ACTIVE);
+ ut_ad(trx->state == TRX_NOT_STARTED
+ || trx->state == TRX_ACTIVE);
ut_ad(prebuilt->sql_stat_start
|| prebuilt->select_lock_type != LOCK_NONE
|| trx->read_view);
@@ -4137,11 +4137,11 @@ rec_loop:
rec = btr_pcur_get_rec(pcur);
- if (srv_pass_corrupt_table && !rec) {
+ SRV_CORRUPT_TABLE_CHECK(rec,
+ {
err = DB_CORRUPTION;
goto lock_wait_or_error;
- }
- ut_a(rec);
+ });
ut_ad(!!page_rec_is_comp(rec) == comp);
#ifdef UNIV_SEARCH_DEBUG
@@ -4278,8 +4278,9 @@ wrong_offs:
offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
- if (UNIV_UNLIKELY(srv_force_recovery > 0)
- || (srv_pass_corrupt_table == 2 && index->table->is_corrupt)) {
+ if (UNIV_UNLIKELY(srv_force_recovery > 0
+ || (index->table->is_corrupt &&
+ srv_pass_corrupt_table == 2))) {
if (!rec_validate(rec, offsets)
|| !btr_index_rec_validate(rec, index, FALSE)) {
fprintf(stderr,
@@ -5092,8 +5093,10 @@ row_search_check_if_query_cache_permitted(
if (trx->isolation_level >= TRX_ISO_REPEATABLE_READ
&& !trx->read_view) {
- trx->read_view = read_view_open_now(
- trx->id, trx->global_read_view_heap);
+ trx->read_view =
+ read_view_open_now(trx->id,
+ NULL, TRUE);
+
trx->global_read_view = trx->read_view;
}
}
diff --git a/storage/xtradb/row/row0vers.c b/storage/xtradb/row/row0vers.c
index 6d83dbaf8ee..3fd13b829a2 100644
--- a/storage/xtradb/row/row0vers.c
+++ b/storage/xtradb/row/row0vers.c
@@ -667,9 +667,9 @@ row_vers_build_for_semi_consistent_read(
mutex_enter(&kernel_mutex);
version_trx = trx_get_on_id(version_trx_id);
- if (version_trx
- && (version_trx->conc_state == TRX_COMMITTED_IN_MEMORY
- || version_trx->conc_state == TRX_NOT_STARTED)) {
+ if (version_trx &&
+ (version_trx->state == TRX_COMMITTED_IN_MEMORY
+ || version_trx->state == TRX_NOT_STARTED)) {
version_trx = NULL;
}
diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c
index 6edfbaa7755..3119c870d2c 100644
--- a/storage/xtradb/srv/srv0srv.c
+++ b/storage/xtradb/srv/srv0srv.c
@@ -434,8 +434,6 @@ UNIV_INTERN ulong srv_expand_import = 0; /* 0:disable 1:enable */
UNIV_INTERN ulong srv_pass_corrupt_table = 0; /* 0:disable 1:enable */
UNIV_INTERN ulint srv_dict_size_limit = 0;
-
-UNIV_INTERN ulint srv_lazy_drop_table = 0;
/*-------------------------------------------*/
UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
@@ -2932,7 +2930,7 @@ rescan_idle:
mutex_enter(&kernel_mutex);
trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
while (trx) {
- if (trx->conc_state == TRX_ACTIVE
+ if (trx->state == TRX_ACTIVE
&& trx->mysql_thd
&& innobase_thd_is_idle(trx->mysql_thd)) {
ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd);
diff --git a/storage/xtradb/trx/trx0purge.c b/storage/xtradb/trx/trx0purge.c
index b048dc66efe..1e119c6828b 100644
--- a/storage/xtradb/trx/trx0purge.c
+++ b/storage/xtradb/trx/trx0purge.c
@@ -263,8 +263,9 @@ trx_purge_sys_create(
purge_sys->query = trx_purge_graph_build();
- purge_sys->view = read_view_oldest_copy_or_open_new(0,
- purge_sys->heap);
+ purge_sys->prebuilt_view =
+ read_view_oldest_copy_or_open_new(0, NULL);
+ purge_sys->view = purge_sys->prebuilt_view;
}
/************************************************************************
@@ -279,7 +280,12 @@ trx_purge_sys_close(void)
que_graph_free(purge_sys->query);
ut_a(purge_sys->sess->trx->is_purge);
- purge_sys->sess->trx->conc_state = TRX_NOT_STARTED;
+ purge_sys->sess->trx->state = TRX_NOT_STARTED;
+
+ mutex_enter(&kernel_mutex);
+ trx_release_descriptor(purge_sys->sess->trx);
+ mutex_exit(&kernel_mutex);
+
sess_close(purge_sys->sess);
purge_sys->sess = NULL;
@@ -289,6 +295,8 @@ trx_purge_sys_close(void)
mutex_enter(&kernel_mutex);
read_view_close(purge_sys->view);
+ read_view_free(purge_sys->prebuilt_view);
+ purge_sys->prebuilt_view = NULL;
purge_sys->view = NULL;
mutex_exit(&kernel_mutex);
@@ -1177,7 +1185,7 @@ trx_purge(
}
purge_sys->view = read_view_oldest_copy_or_open_new(
- 0, purge_sys->heap);
+ 0, purge_sys->prebuilt_view);
mutex_exit(&kernel_mutex);
diff --git a/storage/xtradb/trx/trx0roll.c b/storage/xtradb/trx/trx0roll.c
index b55471959ce..ae42623a1d9 100644
--- a/storage/xtradb/trx/trx0roll.c
+++ b/storage/xtradb/trx/trx0roll.c
@@ -132,7 +132,7 @@ trx_rollback_for_mysql(
{
int err;
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
return(DB_SUCCESS);
}
@@ -161,7 +161,7 @@ trx_rollback_last_sql_stat_for_mysql(
{
int err;
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
return(DB_SUCCESS);
}
@@ -263,7 +263,7 @@ trx_rollback_to_savepoint_for_mysql(
return(DB_NO_SAVEPOINT);
}
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: transaction has a savepoint ", stderr);
ut_print_name(stderr, trx, FALSE, savep->name);
@@ -560,7 +560,7 @@ loop:
continue;
}
- switch (trx->conc_state) {
+ switch (trx->state) {
case TRX_NOT_STARTED:
case TRX_PREPARED:
continue;
diff --git a/storage/xtradb/trx/trx0sys.c b/storage/xtradb/trx/trx0sys.c
index c40bf02a7a2..2c44cee60fe 100644
--- a/storage/xtradb/trx/trx0sys.c
+++ b/storage/xtradb/trx/trx0sys.c
@@ -1319,6 +1319,12 @@ trx_sys_init_at_db_start(void)
trx_sys = mem_zalloc(sizeof(*trx_sys));
+ /* Allocate the trx descriptors array */
+ trx_sys->descriptors = ut_malloc(sizeof(trx_id_t) *
+ TRX_DESCR_ARRAY_INITIAL_SIZE);
+ trx_sys->descr_n_max = TRX_DESCR_ARRAY_INITIAL_SIZE;
+ trx_sys->descr_n_used = 0;
+
sys_header = trx_sysf_get(&mtr);
trx_rseg_list_and_array_init(sys_header, ib_bh, &mtr);
@@ -1346,7 +1352,7 @@ trx_sys_init_at_db_start(void)
for (;;) {
- if (trx->conc_state != TRX_PREPARED) {
+ if (trx->state != TRX_PREPARED) {
rows_to_undo += trx->undo_no;
}
@@ -2028,6 +2034,9 @@ trx_sys_close(void)
ut_a(UT_LIST_GET_LEN(trx_sys->view_list) == 0);
ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0);
+ ut_ad(trx_sys->descr_n_used == 0);
+ ut_free(trx_sys->descriptors);
+
mem_free(trx_sys);
trx_sys = NULL;
diff --git a/storage/xtradb/trx/trx0trx.c b/storage/xtradb/trx/trx0trx.c
index a17f8abdad0..a2a41ef006f 100644
--- a/storage/xtradb/trx/trx0trx.c
+++ b/storage/xtradb/trx/trx0trx.c
@@ -85,6 +85,126 @@ trx_set_detailed_error_from_file(
sizeof(trx->detailed_error));
}
+/*************************************************************//**
+Callback function for trx_find_descriptor() to compare trx IDs. */
+UNIV_INTERN
+int
+trx_descr_cmp(
+/*==========*/
+ const void *a, /*!< in: pointer to first comparison argument */
+ const void *b) /*!< in: pointer to second comparison argument */
+{
+ const trx_id_t* da = (const trx_id_t*) a;
+ const trx_id_t* db = (const trx_id_t*) b;
+
+ if (*da < *db) {
+ return -1;
+ } else if (*da > *db) {
+ return 1;
+ }
+
+ return 0;
+}
+
+/*************************************************************//**
+Reserve a slot for a given trx in the global descriptors array. */
+UNIV_INLINE
+void
+trx_reserve_descriptor(
+/*===================*/
+ const trx_t* trx) /*!< in: trx pointer */
+{
+ ulint n_used;
+ ulint n_max;
+ trx_id_t* descr;
+
+ ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(!trx_find_descriptor(trx_sys->descriptors,
+ trx_sys->descr_n_used,
+ trx->id));
+
+ n_used = trx_sys->descr_n_used + 1;
+ n_max = trx_sys->descr_n_max;
+
+ if (UNIV_UNLIKELY(n_used > n_max)) {
+
+ n_max = n_max * 2;
+
+ trx_sys->descriptors =
+ ut_realloc(trx_sys->descriptors,
+ n_max * sizeof(trx_id_t));
+
+ trx_sys->descr_n_max = n_max;
+ }
+
+ descr = trx_sys->descriptors + n_used - 1;
+
+ if (UNIV_UNLIKELY(n_used > 1 && trx->id < descr[-1])) {
+
+ /* Find the slot where it should be inserted. We could use a
+ binary search, but in reality linear search should be faster,
+ because the slot we are looking for is near the array end. */
+
+ trx_id_t* tdescr;
+
+ for (tdescr = descr - 1;
+ tdescr >= trx_sys->descriptors && *tdescr > trx->id;
+ tdescr--) {
+ }
+
+ tdescr++;
+
+ ut_memmove(tdescr + 1, tdescr, (descr - tdescr) *
+ sizeof(trx_id_t));
+
+ descr = tdescr;
+ }
+
+ *descr = trx->id;
+
+ trx_sys->descr_n_used = n_used;
+}
+
+/*************************************************************//**
+Release a slot for a given trx in the global descriptors array. */
+UNIV_INTERN
+void
+trx_release_descriptor(
+/*===================*/
+ trx_t* trx) /*!< in: trx pointer */
+{
+ ulint size;
+ trx_id_t* descr;
+
+ ut_ad(mutex_own(&kernel_mutex));
+
+ if (UNIV_LIKELY(trx->is_in_trx_serial_list)) {
+
+ UT_LIST_REMOVE(trx_serial_list, trx_sys->trx_serial_list,
+ trx);
+ trx->is_in_trx_serial_list = 0;
+ }
+
+ descr = trx_find_descriptor(trx_sys->descriptors,
+ trx_sys->descr_n_used,
+ trx->id);
+
+ if (UNIV_UNLIKELY(descr == NULL)) {
+
+ return;
+ }
+
+ size = (trx_sys->descriptors + trx_sys->descr_n_used - 1 - descr) *
+ sizeof(trx_id_t);
+
+ if (UNIV_LIKELY(size > 0)) {
+
+ ut_memmove(descr, descr + 1, size);
+ }
+
+ trx_sys->descr_n_used--;
+}
+
/****************************************************************//**
Creates and initializes a transaction object.
@return own: the transaction */
@@ -107,7 +227,7 @@ trx_create(
trx->is_purge = 0;
trx->is_recovered = 0;
- trx->conc_state = TRX_NOT_STARTED;
+ trx->state = TRX_NOT_STARTED;
trx->is_registered = 0;
trx->active_commit_ordered = 0;
@@ -118,6 +238,7 @@ trx_create(
trx->id = 0;
trx->no = IB_ULONGLONG_MAX;
+ trx->is_in_trx_serial_list = 0;
trx->support_xa = TRUE;
@@ -189,9 +310,9 @@ trx_create(
trx->declared_to_be_inside_innodb = FALSE;
trx->n_tickets_to_enter_innodb = 0;
- trx->global_read_view_heap = mem_heap_create(256);
trx->global_read_view = NULL;
trx->read_view = NULL;
+ trx->prebuilt_view = NULL;
trx->io_reads = 0;
trx->io_read = 0;
@@ -327,7 +448,7 @@ trx_free(
trx->magic_n = 11112222;
- ut_a(trx->conc_state == TRX_NOT_STARTED);
+ ut_a(trx->state == TRX_NOT_STARTED);
mutex_free(&(trx->undo_mutex));
@@ -354,18 +475,18 @@ trx_free(
ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0);
- if (trx->global_read_view_heap) {
- mem_heap_free(trx->global_read_view_heap);
+ if (trx->prebuilt_view != NULL) {
+ read_view_free(trx->prebuilt_view);
}
- trx->global_read_view = NULL;
-
ut_a(trx->read_view == NULL);
ut_a(ib_vector_is_empty(trx->autoinc_locks));
/* We allocated a dedicated heap for the vector. */
ib_vector_free(trx->autoinc_locks);
+ trx_release_descriptor(trx);
+
mem_free(trx);
}
@@ -378,7 +499,7 @@ trx_free_prepared(
trx_t* trx) /*!< in, own: trx object */
{
ut_ad(mutex_own(&kernel_mutex));
- ut_a(trx->conc_state == TRX_PREPARED);
+ ut_a(trx->state == TRX_PREPARED);
ut_a(trx->magic_n == TRX_MAGIC_N);
/* Prepared transactions are sort of active; they allow
@@ -411,15 +532,19 @@ trx_free_prepared(
mem_heap_free(trx->lock_heap);
}
- if (trx->global_read_view_heap) {
- mem_heap_free(trx->global_read_view_heap);
- }
-
ut_a(ib_vector_is_empty(trx->autoinc_locks));
ib_vector_free(trx->autoinc_locks);
+ trx_release_descriptor(trx);
+
+ if (trx->prebuilt_view != NULL) {
+ read_view_free(trx->prebuilt_view);
+ }
+
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
+ ut_ad(trx_sys->descr_n_used <= UT_LIST_GET_LEN(trx_sys->trx_list));
+
mem_free(trx);
}
@@ -528,6 +653,7 @@ trx_lists_init_at_db_start(void)
ut_ad(mutex_own(&kernel_mutex));
UT_LIST_INIT(trx_sys->trx_list);
+ UT_LIST_INIT(trx_sys->trx_serial_list);
/* Look from the rollback segments if there exist undo logs for
transactions */
@@ -564,7 +690,7 @@ trx_lists_init_at_db_start(void)
if (srv_force_recovery == 0) {
- trx->conc_state = TRX_PREPARED;
+ trx->state = TRX_PREPARED;
trx_n_prepared++;
} else {
fprintf(stderr,
@@ -574,11 +700,12 @@ trx_lists_init_at_db_start(void)
" rollback it"
" anyway.\n");
- trx->conc_state = TRX_ACTIVE;
+ trx->state = TRX_ACTIVE;
}
+
+ trx_reserve_descriptor(trx);
} else {
- trx->conc_state
- = TRX_COMMITTED_IN_MEMORY;
+ trx->state = TRX_COMMITTED_IN_MEMORY;
}
/* We give a dummy value for the trx no;
@@ -590,12 +717,15 @@ trx_lists_init_at_db_start(void)
trx->no = trx->id;
} else {
- trx->conc_state = TRX_ACTIVE;
+ trx->state = TRX_ACTIVE;
/* A running transaction always has the number
field inited to IB_ULONGLONG_MAX */
trx->no = IB_ULONGLONG_MAX;
+
+ trx_reserve_descriptor(trx);
+
}
if (undo->dict_operation) {
@@ -640,7 +770,7 @@ trx_lists_init_at_db_start(void)
if (srv_force_recovery == 0) {
- trx->conc_state
+ trx->state
= TRX_PREPARED;
trx_n_prepared++;
} else {
@@ -651,11 +781,12 @@ trx_lists_init_at_db_start(void)
" rollback it"
" anyway.\n");
- trx->conc_state
- = TRX_ACTIVE;
+ trx->state = TRX_ACTIVE;
+ trx_reserve_descriptor(
+ trx);
}
} else {
- trx->conc_state
+ trx->state
= TRX_COMMITTED_IN_MEMORY;
}
@@ -664,13 +795,14 @@ trx_lists_init_at_db_start(void)
trx->no = trx->id;
} else {
- trx->conc_state = TRX_ACTIVE;
-
+ trx->state = TRX_ACTIVE;
/* A running transaction always has
the number field inited to
IB_ULONGLONG_MAX */
trx->no = IB_ULONGLONG_MAX;
+
+ trx_reserve_descriptor(trx);
}
trx->rseg = rseg;
@@ -741,13 +873,15 @@ trx_start_low(
if (trx->is_purge) {
trx->id = 0;
- trx->conc_state = TRX_ACTIVE;
+ /* Don't reserve a descriptor, since this trx is not added to
+ trx_list. */
+ trx->state = TRX_ACTIVE;
trx->start_time = time(NULL);
return(TRUE);
}
- ut_ad(trx->conc_state != TRX_ACTIVE);
+ ut_ad(trx->state != TRX_ACTIVE);
ut_a(rseg_id == ULINT_UNDEFINED);
@@ -762,7 +896,10 @@ trx_start_low(
trx->rseg = rseg;
- trx->conc_state = TRX_ACTIVE;
+ trx->state = TRX_ACTIVE;
+
+ trx_reserve_descriptor(trx);
+
trx->start_time = time(NULL);
UT_LIST_ADD_FIRST(trx_list, trx_sys->trx_list, trx);
@@ -819,6 +956,14 @@ trx_serialisation_number_get(
trx->no = trx_sys_get_new_trx_id();
+ if (UNIV_LIKELY(trx->is_in_trx_serial_list == 0)) {
+
+ UT_LIST_ADD_LAST(trx_serial_list, trx_sys->trx_serial_list,
+ trx);
+
+ trx->is_in_trx_serial_list = 1;
+ }
+
/* If the rollack segment is not empty then the
new trx_t::no can't be less than any trx_t::no
already in the rollback segment. User threads only
@@ -1000,10 +1145,10 @@ trx_commit_off_kernel(
lsn = 0;
}
- ut_ad(trx->conc_state == TRX_ACTIVE || trx->conc_state == TRX_PREPARED);
+ ut_ad(trx->state == TRX_ACTIVE || trx->state == TRX_PREPARED);
ut_ad(mutex_own(&kernel_mutex));
- if (UNIV_UNLIKELY(trx->conc_state == TRX_PREPARED)) {
+ if (UNIV_UNLIKELY(trx->state == TRX_PREPARED)) {
ut_a(trx_n_prepared > 0);
trx_n_prepared--;
}
@@ -1023,7 +1168,9 @@ trx_commit_off_kernel(
committed. */
/*--------------------------------------*/
- trx->conc_state = TRX_COMMITTED_IN_MEMORY;
+ trx->state = TRX_COMMITTED_IN_MEMORY;
+ /* The following also removes trx from trx_serial_list */
+ trx_release_descriptor(trx);
/*--------------------------------------*/
/* If we release kernel_mutex below and we are still doing
@@ -1044,7 +1191,6 @@ trx_commit_off_kernel(
if (trx->global_read_view) {
read_view_close(trx->global_read_view);
- mem_heap_empty(trx->global_read_view_heap);
trx->global_read_view = NULL;
}
@@ -1131,7 +1277,7 @@ trx_commit_off_kernel(
/* Free all savepoints */
trx_roll_free_all_savepoints(trx);
- trx->conc_state = TRX_NOT_STARTED;
+ trx->state = TRX_NOT_STARTED;
trx->rseg = NULL;
trx->undo_no = 0;
trx->last_sql_stat_start.least_undo_no = 0;
@@ -1141,6 +1287,8 @@ trx_commit_off_kernel(
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
+ ut_ad(trx_sys->descr_n_used <= UT_LIST_GET_LEN(trx_sys->trx_list));
+
trx->error_state = DB_SUCCESS;
}
@@ -1159,12 +1307,15 @@ trx_cleanup_at_db_startup(
trx_undo_insert_cleanup(trx);
}
- trx->conc_state = TRX_NOT_STARTED;
+ trx->state = TRX_NOT_STARTED;
+ trx_release_descriptor(trx);
trx->rseg = NULL;
trx->undo_no = 0;
trx->last_sql_stat_start.least_undo_no = 0;
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
+
+ ut_ad(trx_sys->descr_n_used <= UT_LIST_GET_LEN(trx_sys->trx_list));
}
/********************************************************************//**
@@ -1178,7 +1329,7 @@ trx_assign_read_view(
/*=================*/
trx_t* trx) /*!< in: active transaction */
{
- ut_ad(trx->conc_state == TRX_ACTIVE);
+ ut_ad(trx->state == TRX_ACTIVE);
if (trx->read_view) {
return(trx->read_view);
@@ -1186,11 +1337,9 @@ trx_assign_read_view(
mutex_enter(&kernel_mutex);
- if (!trx->read_view) {
- trx->read_view = read_view_open_now(
- trx->id, trx->global_read_view_heap);
- trx->global_read_view = trx->read_view;
- }
+ trx->read_view = read_view_open_now(trx->id, trx->prebuilt_view, TRUE);
+ trx->prebuilt_view = trx->read_view;
+ trx->global_read_view = trx->read_view;
mutex_exit(&kernel_mutex);
@@ -1555,7 +1704,7 @@ loop:
return;
}
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
trx_start_low(trx, ULINT_UNDEFINED);
}
@@ -1851,7 +2000,7 @@ trx_mark_sql_stat_end(
{
ut_a(trx);
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx->state == TRX_NOT_STARTED) {
trx->undo_no = 0;
}
@@ -1874,7 +2023,7 @@ trx_print(
fprintf(f, "TRANSACTION " TRX_ID_FMT, (ullint) trx->id);
- switch (trx->conc_state) {
+ switch (trx->state) {
case TRX_NOT_STARTED:
fputs(", not started", f);
break;
@@ -1890,7 +2039,7 @@ trx_print(
fputs(", COMMITTED IN MEMORY", f);
break;
default:
- fprintf(f, " state %lu", (ulong) trx->conc_state);
+ fprintf(f, " state %lu", (ulong) trx->state);
}
if (*trx->op_info) {
@@ -2085,7 +2234,11 @@ trx_prepare_off_kernel(
ut_ad(mutex_own(&kernel_mutex));
/*--------------------------------------*/
- trx->conc_state = TRX_PREPARED;
+ if (UNIV_UNLIKELY(trx->state != TRX_ACTIVE)) {
+
+ trx_reserve_descriptor(trx);
+ }
+ trx->state = TRX_PREPARED;
trx_n_prepared++;
/*--------------------------------------*/
@@ -2199,7 +2352,7 @@ trx_recover_for_mysql(
trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
while (trx) {
- if (trx->conc_state == TRX_PREPARED) {
+ if (trx->state == TRX_PREPARED) {
xid_list[count] = trx->xid;
if (count == 0) {
@@ -2272,7 +2425,7 @@ trx_get_trx_by_xid(
the same */
if (trx->is_recovered
- && trx->conc_state == TRX_PREPARED
+ && trx->state == TRX_PREPARED
&& xid->gtrid_length == trx->xid.gtrid_length
&& xid->bqual_length == trx->xid.bqual_length
&& memcmp(xid->data, trx->xid.data,
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index d28d576c661..88a7f8b84e8 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -318,13 +318,16 @@ void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)),
#define INC_PTR(cs,A,B) (A)++
-int my_wildcmp_bin(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many)
+static
+int my_wildcmp_bin_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
-
+
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (*wildstr != w_many && *wildstr != w_one)
@@ -383,8 +386,8 @@ int my_wildcmp_bin(CHARSET_INFO *cs,
if (str++ == str_end)
return(-1);
{
- int tmp=my_wildcmp_bin(cs,str,str_end,wildstr,wildend,escape,w_one,
- w_many);
+ int tmp=my_wildcmp_bin_impl(cs,str,str_end,wildstr,wildend,escape,w_one,
+ w_many, recurse_level + 1);
if (tmp <= 0)
return(tmp);
}
@@ -395,6 +398,16 @@ int my_wildcmp_bin(CHARSET_INFO *cs,
return(str != str_end ? 1 : 0);
}
+int my_wildcmp_bin(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ return my_wildcmp_bin_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, 1);
+}
+
static size_t my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
uchar *dest, size_t dstlen,
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 5879bdf7978..0c0332ea3da 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -251,13 +251,16 @@ int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t)
#define likeconv(s,A) (uchar) (s)->sort_order[(uchar) (A)]
-int my_wildcmp_mb(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many)
+static
+int my_wildcmp_mb_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (*wildstr != w_many && *wildstr != w_one)
@@ -346,8 +349,8 @@ int my_wildcmp_mb(CHARSET_INFO *cs,
INC_PTR(cs,str, str_end);
}
{
- int tmp=my_wildcmp_mb(cs,str,str_end,wildstr,wildend,escape,w_one,
- w_many);
+ int tmp=my_wildcmp_mb_impl(cs,str,str_end,wildstr,wildend,escape,w_one,
+ w_many, recurse_level + 1);
if (tmp <= 0)
return (tmp);
}
@@ -358,6 +361,16 @@ int my_wildcmp_mb(CHARSET_INFO *cs,
return (str != str_end ? 1 : 0);
}
+int my_wildcmp_mb(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ return my_wildcmp_mb_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, 1);
+}
+
size_t my_numchars_mb(CHARSET_INFO *cs __attribute__((unused)),
const char *pos, const char *end)
@@ -987,14 +1000,15 @@ pad_min_max:
}
-int
-my_wildcmp_mb_bin(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many)
+static int my_wildcmp_mb_bin_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (*wildstr != w_many && *wildstr != w_one)
@@ -1081,7 +1095,9 @@ my_wildcmp_mb_bin(CHARSET_INFO *cs,
INC_PTR(cs,str, str_end);
}
{
- int tmp=my_wildcmp_mb_bin(cs,str,str_end,wildstr,wildend,escape,w_one,w_many);
+ int tmp=my_wildcmp_mb_bin_impl(cs,str,str_end,
+ wildstr,wildend,escape,
+ w_one,w_many, recurse_level+1);
if (tmp <= 0)
return (tmp);
}
@@ -1092,6 +1108,17 @@ my_wildcmp_mb_bin(CHARSET_INFO *cs,
return (str != str_end ? 1 : 0);
}
+int
+my_wildcmp_mb_bin(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ return my_wildcmp_mb_bin_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, 1);
+}
+
/*
Data was produced from EastAsianWidth.txt
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index e25c0783abf..3cd6805158e 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -847,13 +847,16 @@ cnv:
#define INC_PTR(cs,A,B) (A)++
-int my_wildcmp_8bit(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many)
+static
+int my_wildcmp_8bit_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (*wildstr != w_many && *wildstr != w_one)
@@ -913,8 +916,9 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
str++;
if (str++ == str_end) return(-1);
{
- int tmp=my_wildcmp_8bit(cs,str,str_end,wildstr,wildend,escape,w_one,
- w_many);
+ int tmp=my_wildcmp_8bit_impl(cs,str,str_end,
+ wildstr,wildend,escape,w_one,
+ w_many, recurse_level+1);
if (tmp <= 0)
return(tmp);
}
@@ -925,6 +929,16 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
return(str != str_end ? 1 : 0);
}
+int my_wildcmp_8bit(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ return my_wildcmp_8bit_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, 1);
+}
+
/*
** Calculate min_str and max_str that ranges a LIKE string.
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index e4a8d7a4067..020cfdfcbbe 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -7487,16 +7487,18 @@ static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
*/
static
-int my_wildcmp_uca(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many)
+int my_wildcmp_uca_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
int scan;
my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc;
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (1)
@@ -7603,8 +7605,8 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
if (str == str_end)
return -1;
- result= my_wildcmp_uca(cs, str, str_end, wildstr, wildend,
- escape, w_one, w_many);
+ result= my_wildcmp_uca_impl(cs, str, str_end, wildstr, wildend,
+ escape, w_one, w_many, recurse_level+1);
if (result <= 0)
return result;
@@ -7616,6 +7618,16 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
return (str != str_end ? 1 : 0);
}
+int my_wildcmp_uca(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ return my_wildcmp_uca_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, 1);
+}
+
/*
Collation language is implemented according to
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index b96ca0e5bbe..b17840bd54c 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1920,11 +1920,12 @@ my_tosort_unicode(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
** 1 if matched with wildcard
*/
-int my_wildcmp_unicode(CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many,
- MY_UNICASE_INFO *const *weights)
+static
+int my_wildcmp_unicode_impl(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many,
+ MY_UNICASE_INFO *const *weights, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
@@ -1933,6 +1934,8 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
const uchar *, const uchar *);
mb_wc= cs->cset->mb_wc;
+ if (my_string_stack_guard && my_string_stack_guard(recurse_level))
+ return 1;
while (wildstr != wildend)
{
while (1)
@@ -2054,9 +2057,9 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
return -1;
str+= scan;
- result= my_wildcmp_unicode(cs, str, str_end, wildstr, wildend,
- escape, w_one, w_many,
- weights);
+ result= my_wildcmp_unicode_impl(cs, str, str_end, wildstr, wildend,
+ escape, w_one, w_many,
+ weights, recurse_level+1);
if (result <= 0)
return result;
}
@@ -2066,6 +2069,17 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
}
+int
+my_wildcmp_unicode(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many,
+ MY_UNICASE_INFO *const *weights)
+{
+ return my_wildcmp_unicode_impl(cs, str, str_end,
+ wildstr, wildend,
+ escape, w_one, w_many, weights, 1);
+}
/*
Store sorting weights using 2 bytes per character.
diff --git a/strings/ctype.c b/strings/ctype.c
index 6b6983ada60..23f18b6617b 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -38,6 +38,8 @@
*/
+int (*my_string_stack_guard)(int)= NULL;
+
static char *mstr(char *str,const char *src,size_t l1,size_t l2)
{
l1= l1<l2 ? l1 : l2;
diff --git a/strings/decimal.c b/strings/decimal.c
index edff4c02885..4b07d8673a6 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2004, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh
index b8b27863b3d..9e9bc26e294 100644
--- a/support-files/MySQL-shared-compat.spec.sh
+++ b/support-files/MySQL-shared-compat.spec.sh
@@ -42,7 +42,7 @@ Autoreqprov: on
Version: %{version_cur}
Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Obsoletes: MySQL-shared, mysql-shared
+Obsoletes: mysql-shared
Provides: MySQL-shared
Summary: MySQL shared client libraries for MySQL %{version}, %{version41}, %{version40} and %{version3}
# We simply use the "MySQL-shared" subpackages as input sources instead of
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index 7454eacfb34..d40388dfab7 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -49,7 +49,8 @@ btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target ty
ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000
fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits
log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
-log/log0online.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
+log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
+
#
# bdb is not critical to keep up to date
#
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index bac22fc96a9..b439d2c1956 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -247,9 +247,9 @@ Distribution: %{distro_description}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/
-Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
Vendor: %{mysql_vendor}
-Provides: msqlormysql MySQL-server mysql
+Provides: msqlormysql MySQL-server
BuildRequires: %{distro_buildreq}
# Regression tests may take a long time, override the default to skip them
@@ -283,14 +283,25 @@ documentation and the manual for more information.
##############################################################################
%package -n MySQL-server%{product_suffix}
-Summary: MySQL: a very fast and reliable SQL database server
-Group: Applications/Databases
-Requires: %{distro_requires}
-Provides: msqlormysql MySQL MySQL-server
-Conflicts: mysql mysql-server mysql-advanced mysql-server-advanced
-Obsoletes: MySQL MySQL-server
-Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
-Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
+Summary: MySQL: a very fast and reliable SQL database server
+Group: Applications/Databases
+Requires: %{distro_requires}
+%if %{defined susever}
+Provides: msqlormysql MySQL MySQL-server
+Conflicts: mysql mysql-server mysql-advanced mysql-server-advanced
+Obsoletes: MySQL MySQL-server
+Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
+Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
+%else
+Obsoletes: MySQL < %{version}-%{release}
+Obsoletes: MySQL-server < %{version}-%{release}
+Obsoletes: MySQL-server-advanced < %{version}-%{release}
+Obsoletes: mysql mysql-server mysql-advanced mysql-server-advanced
+Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
+Obsoletes: MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
+Provides: msqlormysql MySQL MySQL-server MySQL-server-advanced
+Provides: mysql
+%endif
%description -n MySQL-server%{product_suffix}
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
@@ -318,13 +329,23 @@ package "MySQL-client%{product_suffix}" as well!
# ----------------------------------------------------------------------------
%package -n MySQL-client%{product_suffix}
-Summary: MySQL - Client
-Group: Applications/Databases
-Provides: MySQL-client
-Conflicts: mysql mysql-advanced
-Obsoletes: MySQL-client
-Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
-Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
+Summary: MySQL - Client
+Group: Applications/Databases
+%if %{defined susever}
+Provides: MySQL-client
+Conflicts: mysql mysql-advanced
+Obsoletes: MySQL-client
+Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
+Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
+%else
+Obsoletes: mysql mysql-advanced
+Obsoletes: MySQL-client < %{version}-%{release}
+Obsoletes: MySQL-client-advanced < %{version}-%{release}
+Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
+Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
+Provides: MySQL-client MySQL-client-advanced
+Provides: mysql
+%endif
%description -n MySQL-client%{product_suffix}
This package contains the standard MySQL clients and administration tools.
@@ -333,16 +354,28 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-test%{product_suffix}
-Summary: MySQL - Test suite
-Group: Applications/Databases
-Requires: MySQL-client perl
-Provides: MySQL-test
-Conflicts: mysql-test mysql-test-advanced
-Obsoletes: MySQL-test
-Obsoletes: mysql-bench MySQL-bench
-Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
-Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
-AutoReqProv: no
+Summary: MySQL - Test suite
+Group: Applications/Databases
+%if %{defined susever}
+Requires: MySQL-client perl
+Provides: MySQL-test
+Conflicts: mysql-test mysql-test-advanced
+Obsoletes: MySQL-test
+Obsoletes: mysql-bench MySQL-bench
+Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
+Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
+AutoReqProv: no
+%else
+Requires: MySQL-client perl
+Conflicts: mysql-test mysql-test-advanced
+Obsoletes: mysql-bench MySQL-bench
+Obsoletes: MySQL-test < %{version}-%{release}
+Obsoletes: MySQL-test-advanced < %{version}-%{release}
+Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
+Obsoletes: MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
+Provides: MySQL-test MySQL-test-advanced
+AutoReqProv: no
+%endif
%description -n MySQL-test%{product_suffix}
This package contains the MySQL regression test suite.
@@ -351,13 +384,22 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-devel%{product_suffix}
-Summary: MySQL - Development header files and libraries
-Group: Applications/Databases
-Provides: MySQL-devel
-Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
-Obsoletes: MySQL-devel
-Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
-Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
+Summary: MySQL - Development header files and libraries
+Group: Applications/Databases
+%if %{defined susever}
+Provides: MySQL-devel
+Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
+Obsoletes: MySQL-devel
+Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
+Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
+%else
+Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
+Obsoletes: MySQL-devel < %{version}-%{release}
+Obsoletes: MySQL-devel-advanced < %{version}-%{release}
+Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
+Obsoletes: MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
+Provides: MySQL-devel MySQL-devel-advanced
+%endif
%description -n MySQL-devel%{product_suffix}
This package contains the development header files and libraries necessary
@@ -367,14 +409,25 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-shared%{product_suffix}
-Summary: MySQL - Shared libraries
-Group: Applications/Databases
-Provides: MySQL-shared
-Obsoletes: MySQL-shared-standard MySQL-shared-pro
-Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
-Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
-Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
-Obsoletes: MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
+Summary: MySQL - Shared libraries
+Group: Applications/Databases
+%if %{defined susever}
+Provides: MySQL-shared
+Obsoletes: MySQL-shared-standard MySQL-shared-pro
+Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
+Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
+Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
+Obsoletes: MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
+%else
+Obsoletes: MySQL-shared-standard MySQL-shared-pro
+Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
+Obsoletes: MySQL-shared < %{version}-%{release}
+Obsoletes: MySQL-shared-advanced < %{version}-%{release}
+Obsoletes: MySQL-shared-pro-gpl-cert
+Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
+Obsoletes: MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
+Provides: MySQL-shared MySQL-shared-advanced
+%endif
%description -n MySQL-shared%{product_suffix}
This package contains the shared libraries (*.so*) which certain languages
@@ -382,15 +435,26 @@ and applications need to dynamically load and use MySQL.
# ----------------------------------------------------------------------------
%package -n MySQL-embedded%{product_suffix}
-Summary: MySQL - Embedded library
-Group: Applications/Databases
-Requires: MySQL-devel
-Provides: MySQL-embedded
-Conflicts: mysql-embedded mysql-embedded-advanced
-Obsoletes: MySQL-embedded
-Obsoletes: MySQL-embedded-pro
-Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
-Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
+Summary: MySQL - Embedded library
+Group: Applications/Databases
+%if %{defined susever}
+Requires: MySQL-devel
+Provides: MySQL-embedded
+Conflicts: mysql-embedded mysql-embedded-advanced
+Obsoletes: MySQL-embedded
+Obsoletes: MySQL-embedded-pro
+Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
+Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
+%else
+Requires: MySQL-devel
+Conflicts: mysql-embedded mysql-embedded-advanced
+Obsoletes: MySQL-embedded-pro
+Obsoletes: MySQL-embedded < %{version}-%{release}
+Obsoletes: MySQL-embedded-advanced < %{version}-%{release}
+Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
+Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
+Provides: MySQL-embedded MySQL-embedded-advanced
+%endif
%description -n MySQL-embedded%{product_suffix}
This package contains the MySQL server as an embedded library.
@@ -719,13 +783,16 @@ if [ -d $mysql_datadir ] ; then
echo "MySQL RPM upgrade to version $NEW_VERSION" > $STATUS_FILE
echo "'pre' step running at `date`" >> $STATUS_FILE
echo >> $STATUS_FILE
- echo "ERR file(s):" >> $STATUS_FILE
- ls -ltr $mysql_datadir/*.err >> $STATUS_FILE
- echo >> $STATUS_FILE
- echo "Latest 'Version' line in latest file:" >> $STATUS_FILE
- grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \
+ fcount=`ls -ltr $mysql_datadir/*.err 2>/dev/null | wc -l`
+ if [ $fcount -gt 0 ] ; then
+ echo "ERR file(s):" >> $STATUS_FILE
+ ls -ltr $mysql_datadir/*.err >> $STATUS_FILE
+ echo >> $STATUS_FILE
+ echo "Latest 'Version' line in latest file:" >> $STATUS_FILE
+ grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \
tail -1 >> $STATUS_FILE
- echo >> $STATUS_FILE
+ echo >> $STATUS_FILE
+ fi
if [ -n "$SERVER_TO_START" ] ; then
# There is only one PID file, race possibility ignored
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 72305e81c39..1f40b0dcc4f 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16903,13 +16903,14 @@ static void test_bug31418()
*/
#define LARGE_BUFFER_SIZE 2048
+#define OLD_USERNAME_CHAR_LENGTH 16
static void test_bug31669()
{
int rc;
static char buff[LARGE_BUFFER_SIZE+1];
#ifndef EMBEDDED_LIBRARY
- static char user[USERNAME_CHAR_LENGTH+1];
+ static char user[OLD_USERNAME_CHAR_LENGTH+1];
static char db[NAME_CHAR_LEN+1];
static char query[LARGE_BUFFER_SIZE*2];
#endif
@@ -16946,7 +16947,7 @@ static void test_bug31669()
myquery(rc);
memset(user, 'b', sizeof(user));
- user[USERNAME_CHAR_LENGTH]= 0;
+ user[OLD_USERNAME_CHAR_LENGTH]= 0;
memset(buff, 'c', sizeof(buff));
buff[LARGE_BUFFER_SIZE]= 0;
strxmov(query, "GRANT ALL PRIVILEGES ON *.* TO '", user, "'@'%' IDENTIFIED BY "
@@ -16965,11 +16966,11 @@ static void test_bug31669()
rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(!rc);
- user[USERNAME_CHAR_LENGTH-1]= 'a';
+ user[OLD_USERNAME_CHAR_LENGTH-1]= 'a';
rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(rc);
- user[USERNAME_CHAR_LENGTH-1]= 'b';
+ user[OLD_USERNAME_CHAR_LENGTH-1]= 'b';
buff[LARGE_BUFFER_SIZE-1]= 'd';
rc= mysql_change_user(conn, user, buff, db);
DIE_UNLESS(rc);
@@ -17739,7 +17740,11 @@ static void test_bug43560(void)
fprintf(stdout, "Skipping test_bug43560: server not DEBUG version\n");
DBUG_VOID_RETURN;
}
-
+ if (opt_unix_socket)
+ {
+ fprintf(stdout, "Skipping test_bug43560: connected via UNIX socket\n");
+ DBUG_VOID_RETURN;
+ }
/*
Set up a separate connection for this test to avoid messing up the
general MYSQL object used in other subtests. Use TCP protocol to avoid
@@ -18850,6 +18855,109 @@ static void test_bug13001491()
myquery(rc);
}
+static void test_mdev4326()
+{
+ MYSQL_STMT *stmt;
+ MYSQL_BIND bind;
+ char query[]= "SELECT * FROM mysql.user LIMIT ?";
+ char str_data[]= "1";
+ unsigned long length= 0;
+ int int_data= 1;
+ int rc, count;
+ my_bool is_null= 0;
+ my_bool error= 0;
+ myheader("test_mdev4326");
+
+ rc= mysql_change_user(mysql, opt_user, opt_password, "mysql");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "SET GLOBAL general_log = 1");
+ myquery(rc);
+
+ stmt= mysql_stmt_init(mysql);
+ check_stmt(stmt);
+
+ /* Numeric parameter test */
+
+ rc= mysql_stmt_prepare(stmt, query, strlen(query));
+ check_execute(stmt, rc);
+ check_stmt(stmt);
+ verify_param_count(stmt, 1);
+
+ memset((char *)&bind, 0, sizeof(bind));
+ bind.buffer_type= MYSQL_TYPE_LONG;
+ bind.buffer= (char *)&int_data;
+ bind.is_null= &is_null;
+ bind.length= &length;
+ bind.error= &error;
+
+ rc= mysql_stmt_bind_param(stmt, &bind);
+ check_execute(stmt, rc);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ count= 0;
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ count++;
+ DIE_UNLESS(count == 1);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ count= 0;
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ count++;
+ DIE_UNLESS(count == 1);
+ int_data= 0;
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ count= 0;
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ count++;
+ DIE_UNLESS(count == 0);
+ rc= mysql_stmt_close(stmt);
+ check_execute(stmt, rc);
+
+ /* String parameter test */
+
+ stmt= mysql_stmt_init(mysql);
+ rc= mysql_stmt_prepare(stmt, query, strlen(query));
+ check_execute(stmt, rc);
+ check_stmt(stmt);
+ verify_param_count(stmt, 1);
+
+ memset((char *)&bind, 0, sizeof(bind));
+ bind.buffer_type= MYSQL_TYPE_STRING;
+ bind.buffer= (char *)str_data;
+ length= bind.buffer_length= sizeof(str_data);
+ bind.is_null= &is_null;
+ bind.length= &length;
+ bind.error= &error;
+
+ rc= mysql_stmt_bind_param(stmt, &bind);
+ check_execute(stmt, rc);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ count= 0;
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ count++;
+ DIE_UNLESS(count == 1);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ count= 0;
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ count++;
+ DIE_UNLESS(count == 1);
+ str_data[0]= '0';
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ count= 0;
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ count++;
+ DIE_UNLESS(count == 0);
+ rc= mysql_stmt_close(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_change_user(mysql, opt_user, opt_password, current_db);
+ myquery(rc);
+}
static struct my_tests_st my_tests[]= {
{ "disable_query_logs", disable_query_logs },
@@ -19115,6 +19223,7 @@ static struct my_tests_st my_tests[]= {
{ "test_progress_reporting", test_progress_reporting },
{ "test_bug11754979", test_bug11754979 },
{ "test_bug13001491", test_bug13001491 },
+ { "test_mdev4326", test_mdev4326 },
{ 0, 0 }
};
diff --git a/vio/viossl.c b/vio/viossl.c
index 48881cc2903..ad20a6ab5c3 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -183,6 +183,9 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
SSL_clear(ssl);
SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
SSL_set_fd(ssl, vio->sd);
+#if !defined(HAVE_YASSL) && defined(SSL_OP_NO_COMPRESSION)
+ SSL_set_options(ssl, SSL_OP_NO_COMPRESSION);
+#endif
if ((r= connect_accept_func(ssl)) < 1)
{
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index 50b39adc0b1..67a17c2cc19 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -895,7 +895,7 @@ extern "C" UINT __stdcall CheckServiceUpgrades(MSIHANDLE hInstall)
Only look for services that have mysqld.exe outside of the current
installation directory.
*/
- if(strstr(props.mysqld_exe,installDir) == 0)
+ if(installDir[0] == 0 || strstr(props.mysqld_exe,installDir) == 0)
{
WcaLog(LOGMSG_STANDARD, "found service %S, major=%d, minor=%d",
info[i].lpServiceName, props.version_major, props.version_minor);
diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in
index ff1a529a2ee..da4ac6aa9ac 100644
--- a/win/packaging/extra.wxs.in
+++ b/win/packaging/extra.wxs.in
@@ -151,6 +151,9 @@
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="&amp;Next">
<Publish Event="Remove" Value="DBInstance">CreateOrUpgradeChoice = "Upgrade" </Publish>
<Publish Event="AddLocal" Value="DBInstance">CreateOrUpgradeChoice = "Create"</Publish>
+ <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="[NonExistentProperty]">CreateOrUpgradeChoice = "Create"</Publish>
+ <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="[NonExistentProperty]">CreateOrUpgradeChoice = "Create"</Publish>
+ <Publish Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1">CreateOrUpgradeChoice = "Upgrade"</Publish>
<Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
@@ -634,6 +637,7 @@
</Component>
<?if $(var.HaveUpgradeWizard) != "0" ?>
<ComponentRef Id='C.bin.mysql_upgrade_wizard.exe'/>
+ <!--
<Component Id="c.shortcuts.upgrade_wizard" Guid="*" Directory="ShortcutFolder" Transitive="yes">
<RegistryValue
Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall"
@@ -646,6 +650,7 @@
Description="Upgrades older instances of MariaDB/MySQL services to version @MAJOR_VERSION@.@MINOR_VERSION@"
Advertise="no"/>
</Component>
+ -->
<?endif?>
</Feature>
@@ -689,7 +694,7 @@
<CustomAction Id='PresetDatabaseProperties' BinaryKey='wixca.dll' DllEntry='PresetDatabaseProperties' />
<CustomAction Id="CreateDatabaseCommand" Property="CreateDatabase"
Value=
- "&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; --port=[PORT] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER]"
+ "&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; --port=[PORT] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER] --verbose-bootstrap"
Execute="immediate"
HideTarget="yes"
/>
@@ -823,7 +828,7 @@
<Property
Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Value="Launch wizard to upgrade existing MariaDB or MySQL services." />
- <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
+ <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="0"/>
<Property Id="WixShellExecTarget" Value="[#F.bin.mysql_upgrade_wizard.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
@@ -835,16 +840,16 @@
Execute="immediate" />
<InstallUISequence>
<Custom Action="CheckServiceUpgrades" After="CostFinalize">
- $C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed
+ $C.bin.mysql_upgrade_wizard.exe = 3 AND NOT Installed AND NOT OLDERVERSIONBEINGUPGRADED
</Custom>
</InstallUISequence>
<SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT"
Sequence="ui" Value="[NonExistentProperty]">
- <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed]]>
+ <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>
</SetProperty>
<SetProperty Before="ExecuteAction" Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX"
Sequence="ui" Value="[NonExistentProperty]">
- <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed]]>
+ <![CDATA[($C.bin.mysql_upgrade_wizard.exe <> 3) AND NOT Installed OR OLDERVERSIONBEINGUPGRADED]]>
</SetProperty>
<?endif ?> <!-- HaveUpgradeWizard -->
diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake
index f826c9a6633..124f85bb87e 100644
--- a/win/packaging/heidisql.cmake
+++ b/win/packaging/heidisql.cmake
@@ -1,4 +1,4 @@
-SET(HEIDISQL_BASE_NAME "HeidiSQL_7.0_Portable")
+SET(HEIDISQL_BASE_NAME "HeidiSQL_8.0_Portable")
SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip")
SET(HEIDISQL_URL "http://heidisql.googlecode.com/files/${HEIDISQL_ZIP}")
SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})