summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt17
-rw-r--r--CREDITS45
-rw-r--r--README8
-rw-r--r--client/mysql.cc77
-rw-r--r--client/mysql_upgrade.c4
-rw-r--r--cmake/build_configurations/mysql_release.cmake1
-rw-r--r--cmake/dtrace.cmake3
-rw-r--r--cmake/for_clients.cmake2
-rw-r--r--cmake/install_layout.cmake2
-rw-r--r--cmake/jemalloc.cmake49
-rw-r--r--cmake/plugin.cmake7
-rw-r--r--cmake/wsrep.cmake2
-rw-r--r--configure.cmake27
-rw-r--r--debian/additions/my.cnf2
-rwxr-xr-xdebian/additions/mysqlreport530
-rw-r--r--debian/mariadb-client-10.2.README.Debian2
-rw-r--r--extra/yassl/README11
-rw-r--r--extra/yassl/include/crypto_wrapper.hpp1
-rw-r--r--extra/yassl/include/openssl/ssl.h2
-rw-r--r--extra/yassl/src/crypto_wrapper.cpp11
-rw-r--r--extra/yassl/src/yassl_imp.cpp15
-rw-r--r--extra/yassl/src/yassl_int.cpp15
-rw-r--r--include/byte_order_generic_x86_64.h2
-rw-r--r--include/m_ctype.h13
-rw-r--r--include/my_bit.h9
-rw-r--r--include/my_global.h19
-rw-r--r--include/my_net.h6
-rw-r--r--include/mysql/service_wsrep.h6
-rw-r--r--include/probes_mysql_nodtrace.h.in (renamed from include/probes_mysql_nodtrace.h)0
-rw-r--r--include/welcome_copyright_notice.h6
-rw-r--r--include/wsrep.h9
-rw-r--r--libmysql/libmysql.c6
-rw-r--r--mysql-test/include/galera_clear_sync_point.inc1
-rw-r--r--mysql-test/include/galera_set_sync_point.inc1
-rw-r--r--mysql-test/include/galera_signal_sync_point.inc1
-rw-r--r--mysql-test/include/galera_wait_sync_point.inc6
-rw-r--r--mysql-test/include/mtr_check.sql5
-rw-r--r--mysql-test/lib/mtr_cases.pm1
-rw-r--r--mysql-test/r/alter_table_online.result9
-rw-r--r--mysql-test/r/contributors.result18
-rw-r--r--mysql-test/r/create.result16
-rw-r--r--mysql-test/r/ctype_utf8.result148
-rw-r--r--mysql-test/r/ctype_utf8mb4.result16
-rw-r--r--mysql-test/r/ctype_utf8mb4_heap.result2
-rw-r--r--mysql-test/r/ctype_utf8mb4_innodb.result2
-rw-r--r--mysql-test/r/ctype_utf8mb4_myisam.result2
-rw-r--r--mysql-test/r/derived.result345
-rw-r--r--mysql-test/r/func_str.result9
-rw-r--r--mysql-test/r/func_time.result39
-rw-r--r--mysql-test/r/group_by.result38
-rw-r--r--mysql-test/r/information_schema_inno.result5
-rw-r--r--mysql-test/r/merge_innodb.result33
-rw-r--r--mysql-test/r/mysql_upgrade_view.result60
-rw-r--r--mysql-test/r/mysqldump.result2
-rw-r--r--mysql-test/r/null.result7
-rw-r--r--mysql-test/r/second_frac-9175.result13
-rw-r--r--mysql-test/r/select_found.result15
-rw-r--r--mysql-test/r/show.result12
-rw-r--r--mysql-test/r/show_check.result4
-rw-r--r--mysql-test/r/sp.result18
-rw-r--r--mysql-test/r/ssl_cert_verify.result5
-rw-r--r--mysql-test/r/subselect.result14
-rw-r--r--mysql-test/r/subselect_extra_no_semijoin.result8
-rw-r--r--mysql-test/r/subselect_mat.result15
-rw-r--r--mysql-test/r/subselect_no_exists_to_in.result14
-rw-r--r--mysql-test/r/subselect_no_mat.result14
-rw-r--r--mysql-test/r/subselect_no_opts.result14
-rw-r--r--mysql-test/r/subselect_no_scache.result14
-rw-r--r--mysql-test/r/subselect_no_semijoin.result14
-rw-r--r--mysql-test/r/subselect_sj.result65
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result65
-rw-r--r--mysql-test/r/symlink.result3
-rw-r--r--mysql-test/r/trigger_null-8605.result19
-rw-r--r--mysql-test/r/type_date.result15
-rw-r--r--mysql-test/r/view.result20
-rw-r--r--mysql-test/std_data/ca-cert-verify.pem20
-rw-r--r--mysql-test/std_data/server-cert-verify-fail.pem19
-rw-r--r--mysql-test/std_data/server-cert-verify-pass.pem19
-rw-r--r--mysql-test/std_data/server-key-verify-fail.pem27
-rw-r--r--mysql-test/std_data/server-key-verify-pass.pem27
-rw-r--r--mysql-test/suite.pm2
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-disable.result32
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.test92
-rw-r--r--mysql-test/suite/federated/federatedx.result6
-rw-r--r--mysql-test/suite/federated/federatedx.test9
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result6
-rw-r--r--mysql-test/suite/galera/disabled.def2
-rw-r--r--mysql-test/suite/galera/galera_2nodes.cnf4
-rw-r--r--mysql-test/suite/galera/r/galera_create_function.result3
-rw-r--r--mysql-test/suite/galera/r/galera_defaults.result2
-rw-r--r--mysql-test/suite/galera/r/galera_flush.result34
-rw-r--r--mysql-test/suite/galera/r/galera_flush_local.result145
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl_drain.result2
-rw-r--r--mysql-test/suite/galera/r/galera_gcs_fragment.result24
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin.result37
-rw-r--r--mysql-test/suite/galera/r/galera_mdl_race.result38
-rw-r--r--mysql-test/suite/galera/r/galera_query_cache_sync_wait.result58
-rw-r--r--mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result42
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result2
-rw-r--r--mysql-test/suite/galera/r/galera_sync_wait_show.result39
-rw-r--r--mysql-test/suite/galera/r/galera_transaction_replay.result2
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#198.result18
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#201.result4
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#237.result10
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#247.result11
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#31.result10
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_nonprim.test1
-rw-r--r--mysql-test/suite/galera/t/galera_create_function.test8
-rw-r--r--mysql-test/suite/galera/t/galera_flush.test100
-rw-r--r--mysql-test/suite/galera/t/galera_flush_local.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_flush_local.test142
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl_drain.test11
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fragment.cnf5
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fragment.test66
-rw-r--r--mysql-test/suite/galera/t/galera_ist_restart_joiner.test4
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.test4
-rw-r--r--mysql-test/suite/galera/t/galera_mdl_race.test79
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache-master.opt2
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt1
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_sync_wait.test94
-rw-r--r--mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test78
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test7
-rw-r--r--mysql-test/suite/galera/t/galera_sync_wait_show.test68
-rw-r--r--mysql-test/suite/galera/t/galera_transaction_replay.test10
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#198.test36
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#201-master.opt1
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#201.test33
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#237.test31
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#247.test23
-rw-r--r--mysql-test/suite/galera/t/mysql-wsrep#31.test39
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result2
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test7
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-filewrite.result30
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-table.result92
-rw-r--r--mysql-test/suite/innodb/r/innodb_monitor.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result3
-rw-r--r--mysql-test/suite/innodb/r/tmpdir.result51
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-filewrite.test32
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-table.test81
-rw-r--r--mysql-test/suite/innodb/t/tmpdir.test68
-rw-r--r--mysql-test/suite/parts/t/partition_debug_innodb-master.opt2
-rw-r--r--mysql-test/suite/perfschema/r/view_table_io.result2
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_instruments.test7
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_install.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_triggers.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_unsafe_statements.result53
-rw-r--r--mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff11
-rw-r--r--mysql-test/suite/rpl/r/temporal_row-9560.result15
-rw-r--r--mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test87
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_triggers.test49
-rw-r--r--mysql-test/suite/rpl/t/rpl_unsafe_statements.test176
-rw-r--r--mysql-test/suite/rpl/t/temporal_row-9560-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/temporal_row-9560.combinations6
-rw-r--r--mysql-test/suite/rpl/t/temporal_row-9560.test20
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result35
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff35
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result16
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep.result2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test48
-rw-r--r--mysql-test/suite/vcol/inc/vcol_ins_upd.inc27
-rw-r--r--mysql-test/suite/vcol/r/alter_inplace-9045.result44
-rw-r--r--mysql-test/suite/vcol/r/innodb_autoinc_vcol.result16
-rw-r--r--mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result26
-rw-r--r--mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result26
-rw-r--r--mysql-test/suite/vcol/t/alter_inplace-9045.test31
-rw-r--r--mysql-test/suite/vcol/t/innodb_autoinc_vcol.test9
-rw-r--r--mysql-test/t/alter_table_online.test11
-rw-r--r--mysql-test/t/create.test21
-rw-r--r--mysql-test/t/ctype_utf8.test78
-rw-r--r--mysql-test/t/ctype_utf8mb4.test12
-rw-r--r--mysql-test/t/derived.test290
-rw-r--r--mysql-test/t/func_time.test18
-rw-r--r--mysql-test/t/group_by.test26
-rw-r--r--mysql-test/t/information_schema_inno.test6
-rw-r--r--mysql-test/t/merge_innodb.test31
-rw-r--r--mysql-test/t/mysql_upgrade_view.test27
-rw-r--r--mysql-test/t/null.test9
-rw-r--r--mysql-test/t/second_frac-9175.test9
-rw-r--r--mysql-test/t/select_found.test10
-rw-r--r--mysql-test/t/show.test15
-rw-r--r--mysql-test/t/ssl_cert_verify.test43
-rw-r--r--mysql-test/t/subselect.test11
-rw-r--r--mysql-test/t/subselect_mat.test16
-rw-r--r--mysql-test/t/subselect_sj.test69
-rw-r--r--mysql-test/t/symlink.test2
-rw-r--r--mysql-test/t/trigger_null-8605.test21
-rw-r--r--mysql-test/t/type_date.test17
-rw-r--r--mysql-test/t/view.test10
-rw-r--r--mysql-test/t/xa_sync.test3
-rw-r--r--mysql-test/valgrind.supp32
-rw-r--r--mysys/lf_hash.c3
-rw-r--r--mysys/my_default.c1
-rw-r--r--mysys/my_gethwaddr.c2
-rw-r--r--mysys/my_rnd.c4
-rw-r--r--mysys/my_wincond.c3
-rw-r--r--mysys/safemalloc.c2
-rw-r--r--mysys/string.c17
-rw-r--r--plugin/auth_gssapi/CMakeLists.txt9
-rw-r--r--plugin/auth_gssapi/cmake/FindGSSAPI.cmake4
-rw-r--r--plugin/auth_gssapi/gssapi_server.cc3
-rw-r--r--plugin/feedback/feedback.cc1
-rw-r--r--plugin/feedback/url_base.cc1
-rw-r--r--plugin/semisync/semisync_master.cc4
-rw-r--r--plugin/server_audit/server_audit.c12
-rw-r--r--scripts/CMakeLists.txt5
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh11
-rw-r--r--scripts/wsrep_sst_xtrabackup.sh5
-rw-r--r--sql-common/client.c89
-rw-r--r--sql/authors.h4
-rw-r--r--sql/client_settings.h2
-rw-r--r--sql/contributors.h18
-rw-r--r--sql/field.h9
-rw-r--r--sql/field_conv.cc5
-rw-r--r--sql/gcalc_slicescan.cc266
-rw-r--r--sql/gcalc_slicescan.h20
-rw-r--r--sql/gcalc_tools.cc6
-rw-r--r--sql/handler.cc12
-rw-r--r--sql/item.cc5
-rw-r--r--sql/item.h2
-rw-r--r--sql/item_cmpfunc.cc9
-rw-r--r--sql/item_cmpfunc.h2
-rw-r--r--sql/item_geofunc.cc32
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/item_timefunc.cc4
-rw-r--r--sql/log.cc2
-rw-r--r--sql/log_event.cc34
-rw-r--r--sql/mdl.cc11
-rw-r--r--sql/mysqld.cc27
-rw-r--r--sql/opt_subselect.cc14
-rw-r--r--sql/rpl_gtid.cc4
-rw-r--r--sql/rpl_reporting.cc1
-rw-r--r--sql/rpl_utility.cc43
-rw-r--r--sql/sql_admin.cc22
-rw-r--r--sql/sql_base.cc168
-rw-r--r--sql/sql_cache.cc20
-rw-r--r--sql/sql_class.cc125
-rw-r--r--sql/sql_class.h14
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_lex.cc270
-rw-r--r--sql/sql_lex.h38
-rw-r--r--sql/sql_parse.cc57
-rw-r--r--sql/sql_plugin_services.ic2
-rw-r--r--sql/sql_select.cc29
-rw-r--r--sql/sql_select.h1
-rw-r--r--sql/sql_show.cc43
-rw-r--r--sql/sql_show.h8
-rw-r--r--sql/sql_table.cc92
-rw-r--r--sql/sql_time.h3
-rw-r--r--sql/sql_type.cc16
-rw-r--r--sql/sql_update.cc9
-rw-r--r--sql/sql_view.cc3
-rw-r--r--sql/sql_yacc.yy23
-rw-r--r--sql/sys_vars.cc2
-rw-r--r--sql/sys_vars.ic11
-rw-r--r--sql/wsrep_applier.cc27
-rw-r--r--sql/wsrep_dummy.cc2
-rw-r--r--sql/wsrep_hton.cc14
-rw-r--r--sql/wsrep_mysqld.cc75
-rw-r--r--sql/wsrep_mysqld.h2
-rw-r--r--storage/connect/ha_connect.cc42
-rw-r--r--storage/connect/jsonudf.cpp57
-rw-r--r--storage/connect/jsonudf.h6
-rw-r--r--storage/connect/mysql-test/connect/r/json_udf.result4
-rw-r--r--storage/connect/mysql-test/connect/r/odbc.result20
-rw-r--r--storage/connect/mysql-test/connect/r/odbc_oracle.result68
-rw-r--r--storage/connect/mysql-test/connect/r/odbc_postgresql.result20
-rw-r--r--storage/connect/mysql-test/connect/r/odbc_sqlite3.result4810
-rw-r--r--storage/connect/mysql-test/connect/r/odbc_sqlite3_grant.result2
-rw-r--r--storage/connect/mysql-test/connect/r/odbc_xls.result8
-rw-r--r--storage/connect/mysql-test/connect/t/json_udf.inc2
-rw-r--r--storage/connect/mysql-test/connect/t/json_udf.test3
-rw-r--r--storage/connect/mysql-test/connect/t/json_udf2.inc2
-rw-r--r--storage/connect/odbconn.cpp52
-rw-r--r--storage/connect/table.cpp10
-rw-r--r--storage/connect/tabodbc.cpp22
-rw-r--r--storage/connect/valblk.h3
-rw-r--r--storage/innobase/btr/btr0btr.cc4
-rw-r--r--storage/innobase/buf/buf0buf.cc45
-rw-r--r--storage/innobase/buf/buf0dump.cc25
-rw-r--r--storage/innobase/dict/dict0boot.cc33
-rw-r--r--storage/innobase/dict/dict0dict.cc2
-rw-r--r--storage/innobase/dict/dict0stats.cc19
-rw-r--r--storage/innobase/fil/fil0crypt.cc15
-rw-r--r--storage/innobase/fts/fts0opt.cc11
-rw-r--r--storage/innobase/handler/ha_innodb.cc249
-rw-r--r--storage/innobase/handler/handler0alter.cc76
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc23
-rw-r--r--storage/innobase/include/fil0crypt.h7
-rw-r--r--storage/innobase/include/ha_prototypes.h27
-rw-r--r--storage/innobase/include/ibuf0ibuf.h6
-rw-r--r--storage/innobase/include/os0file.h29
-rw-r--r--storage/innobase/include/row0log.h5
-rw-r--r--storage/innobase/include/row0merge.h31
-rw-r--r--storage/innobase/include/srv0mon.h5
-rw-r--r--storage/innobase/include/srv0srv.h14
-rw-r--r--storage/innobase/include/univ.i2
-rw-r--r--storage/innobase/lock/lock0lock.cc2
-rw-r--r--storage/innobase/lock/lock0wait.cc39
-rw-r--r--storage/innobase/os/os0file.cc19
-rw-r--r--storage/innobase/row/row0ftsort.cc18
-rw-r--r--storage/innobase/row/row0log.cc46
-rw-r--r--storage/innobase/row/row0merge.cc328
-rw-r--r--storage/innobase/row/row0mysql.cc50
-rw-r--r--storage/innobase/srv/srv0mon.cc35
-rw-r--r--storage/innobase/srv/srv0srv.cc38
-rw-r--r--storage/innobase/srv/srv0start.cc6
-rw-r--r--storage/maria/ma_sort.c62
-rw-r--r--storage/mroonga/vendor/groonga/lib/com.c4
-rw-r--r--storage/mroonga/vendor/groonga/lib/grn_com.h6
-rw-r--r--storage/myisam/sort.c64
-rw-r--r--storage/oqgraph/ha_oqgraph.cc1
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/general.inc2
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.result86
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.test121
-rw-r--r--storage/perfschema/ha_perfschema.cc2
-rw-r--r--storage/perfschema/table_session_connect.cc5
-rw-r--r--storage/sequence/mysql-test/sequence/group_by.result8
-rw-r--r--storage/sequence/mysql-test/sequence/group_by.test7
-rw-r--r--storage/sequence/sequence.cc6
-rw-r--r--storage/sphinx/ha_sphinx.cc12
-rw-r--r--storage/sphinx/mysql-test/sphinx/sphinx.result33
-rw-r--r--storage/sphinx/mysql-test/sphinx/sphinx.test9
-rw-r--r--storage/sphinx/mysql-test/sphinx/testdata.xml9
-rw-r--r--storage/tokudb/CMakeLists.txt11
-rw-r--r--storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake2
-rw-r--r--storage/xtradb/btr/btr0btr.cc24
-rw-r--r--storage/xtradb/btr/btr0cur.cc4
-rw-r--r--storage/xtradb/buf/buf0buf.cc47
-rw-r--r--storage/xtradb/buf/buf0flu.cc22
-rw-r--r--storage/xtradb/dict/dict0boot.cc33
-rw-r--r--storage/xtradb/dict/dict0dict.cc42
-rw-r--r--storage/xtradb/fil/fil0crypt.cc15
-rw-r--r--storage/xtradb/fil/fil0fil.cc159
-rw-r--r--storage/xtradb/fsp/fsp0fsp.cc26
-rw-r--r--storage/xtradb/handler/ha_innodb.cc98
-rw-r--r--storage/xtradb/handler/handler0alter.cc192
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.cc23
-rw-r--r--storage/xtradb/include/buf0flu.h2
-rw-r--r--storage/xtradb/include/fil0crypt.h7
-rw-r--r--storage/xtradb/include/fil0fil.h43
-rw-r--r--storage/xtradb/include/ha_prototypes.h14
-rw-r--r--storage/xtradb/include/ibuf0ibuf.h6
-rw-r--r--storage/xtradb/include/row0merge.h5
-rw-r--r--storage/xtradb/include/srv0mon.h5
-rw-r--r--storage/xtradb/include/srv0srv.h12
-rw-r--r--storage/xtradb/include/univ.i4
-rw-r--r--storage/xtradb/lock/lock0wait.cc4
-rw-r--r--storage/xtradb/log/log0recv.cc4
-rw-r--r--storage/xtradb/row/row0import.cc16
-rw-r--r--storage/xtradb/row/row0log.cc17
-rw-r--r--storage/xtradb/row/row0merge.cc157
-rw-r--r--storage/xtradb/row/row0mysql.cc50
-rw-r--r--storage/xtradb/srv/srv0mon.cc35
-rw-r--r--storage/xtradb/srv/srv0srv.cc6
-rw-r--r--storage/xtradb/srv/srv0start.cc15
-rw-r--r--storage/xtradb/sync/sync0sync.cc61
-rw-r--r--strings/ctype.c28
-rw-r--r--strings/my_vsnprintf.c2
-rw-r--r--unittest/mysys/CMakeLists.txt5
-rw-r--r--unittest/mysys/dynstring-t.c74
-rw-r--r--unittest/strings/CMakeLists.txt2
-rw-r--r--vio/viosslfactories.c4
-rw-r--r--win/packaging/ca/CMakeLists.txt3
372 files changed, 10982 insertions, 4519 deletions
diff --git a/.gitignore b/.gitignore
index 733bbb45dc6..4c7efe9a119 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,6 +59,9 @@ include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
include/sql_state.h
+include/probes_mysql.d
+include/probes_mysql_dtrace.h
+include/probes_mysql_nodtrace.h
info_macros.cmake
libmysql*/libmysql*_exports_file.cc
libmysql*/merge_archives_mysql*.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0584492def3..5f8ae5b2d9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -348,11 +348,9 @@ IF(WITH_UNIT_TESTS)
ENDIF()
ENDIF()
-IF(NOT WITHOUT_SERVER)
- SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
- # Add storage engines and plugins.
- CONFIGURE_PLUGINS()
-ENDIF()
+SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
+# Add storage engines and plugins.
+CONFIGURE_PLUGINS()
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(dbug)
@@ -382,6 +380,10 @@ IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(mysql-test)
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
ADD_SUBDIRECTORY(sql-bench)
+ IF(WIN32)
+ ADD_SUBDIRECTORY(win/upgrade_wizard)
+ ADD_SUBDIRECTORY(win/packaging)
+ ENDIF()
ENDIF()
IF(UNIX)
@@ -391,10 +393,7 @@ ENDIF()
INCLUDE(cmake/abi_check.cmake)
INCLUDE(cmake/tags.cmake)
-IF(WIN32)
- ADD_SUBDIRECTORY(win/upgrade_wizard)
- ADD_SUBDIRECTORY(win/packaging)
-ENDIF()
+
INCLUDE(for_clients)
diff --git a/CREDITS b/CREDITS
index 42ecf72ca3d..1f071e4fb44 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1,25 +1,30 @@
-MariaDB is brought to you by the MariaDB foundation, a USA non profit
-organization.
+MariaDB is brought to you by the MariaDB Foundation, a non profit
+organization registered in the USA.
-The current main members and sponsors of the MariaDB foundation are:
+The current main members and sponsors of the MariaDB Foundation are:
-Automattic http://automattic.com (2014)
-SkySQL Ab http://www.skysql.com (2013, 2014)
-Booking.com http://www.booking.com (2013)
-Parallels http://www.parallels.com/products/plesk (2013)
+MariaDB Corporation http://www.mariadb.com (2013 - 2016)
+Booking.com http://www.booking.com (2013 - 2016)
+Parallels http://www.parallels.com/products/plesk (2013 - 2016)
+Automattic http://automattic.com (2014 - 2016)
+Verkkokauppa.com http://verkkokauppa.com (2015 - 2016)
+Visma http://visma.com/ (2015 - 2016)
+Webyog http://webyog.com (2015 - 2016)
+Wikimedia Foundation http://wikimedia.org (2015 - 2016)
+Acronis http://acronis.com (2016)
For a full list of supporters and sponsors see
-https://mariadb.org/en/supporters/
+https://mariadb.org/about/supporters/
-You can also do this by doing SHOW CONTRIBUTORS.
+You can also do this by running SHOW CONTRIBUTORS.
For all corporate memberships and sponsorships please contact the
-MariaDB foundation Board via foundation@mariadb.org.
+MariaDB Foundation Board via foundation@mariadb.org.
-The MariaDB foundation is responsible for the MariaDB source
+The MariaDB Foundation is responsible for the MariaDB source
repository, the official MariaDB binaries and http://mariadb.org.
-The MariaDB foundation provides also, among other things, the
+The MariaDB Foundation also provides, among other things, the
following services to the MariaDB community:
- Code reviews and applying patches for MariaDB
@@ -28,17 +33,19 @@ following services to the MariaDB community:
- Bug fixing in MariaDB (for bugs that affects a large part of the community)
- Building the official MariaDB binaries
- Maintaining http://mariadb.org
+- Documenting MariaDB in the MariaDB Knowledge Base http://mariadb.com/kb
-To be able to do the above we need help from cooperations and individuals!
+To be able to do the above we need help from corporations and individuals!
-You can help support MariaDB by be becoming a MariaDB developer or a
-member or sponsor of the MariaDB foundation!
+You can help support MariaDB by becoming a MariaDB developer or a
+member or sponsor of the MariaDB Foundation. To donate or sponsor,
+go to https://mariadb.org/donate/
-You can get a list of all main authors of MariaDB / MySQL by doing
+You can get a list of all the main authors of MariaDB / MySQL by running
SHOW AUTHORS;
-You can get a list sponsors and contributors by doing
+You can get a list sponsors and contributors by running
SHOW CONTRIBUTORS;
-You can read more about the MariaDB foundation at:
-https://mariadb.org/en/foundation/
+You can read more about the MariaDB Foundation at:
+https://mariadb.org/about/
diff --git a/README b/README
index 62cbc2a10e3..a9413f16b04 100644
--- a/README
+++ b/README
@@ -1,17 +1,17 @@
MariaDB is designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance.
-MariaDB is brought to you by the MariaDB foundation.
-Please read the file CREDITS for details about the MariaDB foundation,
+MariaDB is brought to you by the MariaDB Foundation.
+Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.
MariaDB is developed by many of the original developers of MySQL who
-now work for MariadB foundation and SkySQL Ab, and by many people in
+now work for the MariadB Foundation and the MariaDB Corporation, and by many people in
the community.
MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Corporation, Inc. For a list of developers and other contributors,
-see the Credits appendix. You can also do 'SHOW authors' to get a
+see the Credits appendix. You can also run 'SHOW authors' to get a
list of active contributors.
A description of the MariaDB project and a manual can be found at:
diff --git a/client/mysql.cc b/client/mysql.cc
index c4dbe21a465..3f1b796bedb 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1344,6 +1344,44 @@ sig_handler mysql_end(int sig)
exit(status.exit_status);
}
+/*
+ set connection-specific options and call mysql_real_connect
+*/
+static bool do_connect(MYSQL *mysql, const char *host, const char *user,
+ const char *password, const char *database, ulong flags)
+{
+ if (opt_secure_auth)
+ mysql_options(mysql, MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+ if (opt_use_ssl)
+ {
+ mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+ opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
+ mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ (char*)&opt_ssl_verify_server_cert);
+#endif
+ if (opt_protocol)
+ mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
+#ifdef HAVE_SMEM
+ if (shared_memory_base_name)
+ mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
+#endif
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
+ mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
+ mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
+ "program_name", "mysql");
+ return mysql_real_connect(mysql, host, user, password, database,
+ opt_mysql_port, opt_mysql_unix_port, flags);
+}
+
/*
This function handles sigint calls
@@ -1365,11 +1403,7 @@ sig_handler handle_sigint(int sig)
}
kill_mysql= mysql_init(kill_mysql);
- mysql_options(kill_mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
- mysql_options4(kill_mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
- "program_name", "mysql");
- if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
- "", opt_mysql_port, opt_mysql_unix_port,0))
+ if (!do_connect(kill_mysql,current_host, current_user, opt_password, "", 0))
{
tee_fprintf(stdout, "Ctrl-C -- sorry, cannot connect to server to kill query, giving up ...\n");
goto err;
@@ -4575,27 +4609,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
}
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
- if (opt_secure_auth)
- mysql_options(&mysql, MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);
if (using_opt_local_infile)
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
-#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
- if (opt_use_ssl)
- {
- mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
- opt_ssl_capath, opt_ssl_cipher);
- mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
- mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
- }
- mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
- (char*)&opt_ssl_verify_server_cert);
-#endif
- if (opt_protocol)
- mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
-#ifdef HAVE_SMEM
- if (shared_memory_base_name)
- mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
-#endif
if (safe_updates)
{
char init_command[100];
@@ -4607,18 +4622,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
- if (opt_plugin_dir && *opt_plugin_dir)
- mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
-
- if (opt_default_auth && *opt_default_auth)
- mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
-
- mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
- mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
- "program_name", "mysql");
- if (!mysql_real_connect(&mysql, host, user, password,
- database, opt_mysql_port, opt_mysql_unix_port,
- connect_flag | CLIENT_MULTI_STATEMENTS))
+ if (!do_connect(&mysql, host, user, password, database,
+ connect_flag | CLIENT_MULTI_STATEMENTS))
{
if (!silent ||
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 1062c6bd45d..2e6e8030f34 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -184,7 +184,8 @@ static const char *load_default_groups[]=
static void free_used_memory(void)
{
/* Free memory allocated by 'load_defaults' */
- free_defaults(defaults_argv);
+ if (defaults_argv)
+ free_defaults(defaults_argv);
dynstr_free(&ds_args);
dynstr_free(&conn_args);
@@ -1110,7 +1111,6 @@ int main(int argc, char **argv)
if (opt_systables_only && !opt_silent)
printf("The --upgrade-system-tables option was used, user tables won't be touched.\n");
-
/*
Read the mysql_upgrade_info file to check if mysql_upgrade
already has been run for this installation of MySQL
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 75ce57e45e0..ef9713e0556 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -94,6 +94,7 @@ ELSEIF(DEB)
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
+ SET(WITH_JEMALLOC static CACHE STRING "")
ENDIF()
IF(NOT COMPILATION_COMMENT)
diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake
index 5d0bb7ff8c9..3edcdc4c1c5 100644
--- a/cmake/dtrace.cmake
+++ b/cmake/dtrace.cmake
@@ -86,6 +86,9 @@ IF(ENABLE_DTRACE)
${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
)
+ELSE()
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/probes_mysql_nodtrace.h.in
+ ${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h COPYONLY)
ENDIF()
FUNCTION(DTRACE_INSTRUMENT target)
diff --git a/cmake/for_clients.cmake b/cmake/for_clients.cmake
index 01b4c0a84f7..dd79ea1039d 100644
--- a/cmake/for_clients.cmake
+++ b/cmake/for_clients.cmake
@@ -25,7 +25,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
# Filter out "general", it is not a library, just CMake hint
# Also, remove duplicates
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
- IF (lib MATCHES "^\\-l")
+ IF (lib MATCHES "^\\-")
SET(${var} "${${var}} ${lib} ")
ELSEIF(lib MATCHES "^/")
IF (lib MATCHES "\\.(a|so([0-9.]*)|lib|dll|dylib)$")
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index 757166b7c50..d1a261f8cef 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -137,7 +137,7 @@ SET(INSTALL_SCRIPTDIR_RPM "bin")
SET(INSTALL_SYSCONFDIR_RPM "/etc")
SET(INSTALL_SYSCONF2DIR_RPM "/etc/my.cnf.d")
#
-IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(INSTALL_LIBDIR_RPM "lib64")
SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin")
ELSE()
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 05402668c7d..5ad636d0e6c 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -3,20 +3,6 @@ INCLUDE (CheckLibraryExists)
SET(WITH_JEMALLOC auto CACHE STRING
"Build with jemalloc. Possible values are 'yes', 'no', 'static', 'auto'")
-MACRO(JEMALLOC_TRY_STATIC)
- SET(libname jemalloc_pic)
- SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
- SET(what bundled)
- CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_STATIC_JEMALLOC)
- SET(CMAKE_REQUIRED_LIBRARIES)
-ENDMACRO()
-
-MACRO(JEMALLOC_TRY_DYNAMIC)
- SET(libname jemalloc)
- SET(what system)
- CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_DYNAMIC_JEMALLOC)
-ENDMACRO()
-
MACRO (CHECK_JEMALLOC)
# compatibility with old WITH_JEMALLOC values
IF(WITH_JEMALLOC STREQUAL "bundled")
@@ -26,21 +12,30 @@ MACRO (CHECK_JEMALLOC)
SET(WITH_JEMALLOC "yes")
ENDIF()
- IF (WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto")
- JEMALLOC_TRY_DYNAMIC()
- ENDIF()
+ IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto" OR
+ WITH_JEMALLOC STREQUAL "static")
- IF (WITH_JEMALLOC STREQUAL "static" OR WITH_JEMALLOC STREQUAL "auto"
- AND NOT HAVE_DYNAMIC_JEMALLOC)
- JEMALLOC_TRY_STATIC()
- ENDIF()
+ IF(WITH_JEMALLOC STREQUAL "static")
+ SET(libname jemalloc_pic)
+ SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
+ SET(what bundled)
+ ELSE()
+ SET(libname jemalloc c)
+ SET(what system)
+ ENDIF()
+
+ FOREACH(lib ${libname})
+ CHECK_LIBRARY_EXISTS(${lib} malloc_stats_print "" HAVE_JEMALLOC_IN_${lib})
+ IF (HAVE_JEMALLOC_IN_${lib})
+ SET(LIBJEMALLOC ${lib})
+ SET(MALLOC_LIBRARY "${what} jemalloc")
+ BREAK()
+ ENDIF()
+ ENDFOREACH()
+ SET(CMAKE_REQUIRED_LIBRARIES)
- IF (libname)
- IF (HAVE_DYNAMIC_JEMALLOC OR HAVE_STATIC_JEMALLOC)
- SET(LIBJEMALLOC ${libname})
- SET(MALLOC_LIBRARY "${what} jemalloc")
- ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
- MESSAGE(FATAL_ERROR "${libname} is not found")
+ IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto")
+ MESSAGE(FATAL_ERROR "jemalloc is not found")
ENDIF()
ENDIF()
ENDMACRO()
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 8bc9df973c0..49c38b3577b 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -34,6 +34,7 @@ MACRO(MYSQL_ADD_PLUGIN)
"LINK_LIBRARIES;DEPENDENCIES"
${ARGN}
)
+ IF(NOT WITHOUT_SERVER OR ARG_CLIENT)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
@@ -236,13 +237,17 @@ MACRO(MYSQL_ADD_PLUGIN)
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
ENDIF()
+ ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
ENDMACRO()
# Add all CMake projects under storage and plugin
# subdirectories, configure sql_builtins.cc
MACRO(CONFIGURE_PLUGINS)
- FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
+ IF(NOT WITHOUT_SERVER)
+ FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
+ ENDIF()
+
FILE(GLOB dirs_plugin ${CMAKE_SOURCE_DIR}/plugin/*)
FOREACH(dir ${dirs_storage} ${dirs_plugin})
IF (EXISTS ${dir}/CMakeLists.txt)
diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake
index 64266811811..de7fb5eb946 100644
--- a/cmake/wsrep.cmake
+++ b/cmake/wsrep.cmake
@@ -26,7 +26,7 @@ ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
# Set the patch version
-SET(WSREP_PATCH_VERSION "11")
+SET(WSREP_PATCH_VERSION "13")
# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
diff --git a/configure.cmake b/configure.cmake
index 8f7ff762e13..294c5e24ca8 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -196,6 +196,7 @@ CHECK_INCLUDE_FILES (ndir.h HAVE_NDIR_H)
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H)
CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H)
+CHECK_INCLUDE_FILES (sys/poll.h HAVE_SYS_POLL_H)
CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H)
CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H)
@@ -727,16 +728,36 @@ ENDIF()
#
# Test for how the C compiler does inline, if at all
#
+# SunPro is weird, apparently it only supports inline at -xO3 or -xO4.
+# And if CMAKE_C_FLAGS has -xO4 but CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} has -xO2
+# then CHECK_C_SOURCE_COMPILES will succeed but the built will fail.
+# We must test all flags here.
+# XXX actually, we can do this for all compilers, not only SunPro
+IF (CMAKE_CXX_COMPILER_ID MATCHES "SunPro" AND
+ CMAKE_GENERATOR MATCHES "Makefiles")
+ STRING(TOUPPER "CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}" flags)
+ SET(CMAKE_REQUIRED_FLAGS "${${flags}}")
+ENDIF()
CHECK_C_SOURCE_COMPILES("
-static inline int foo(){return 0;}
+extern int bar(int x);
+static inline int foo(){return bar(1);}
int main(int argc, char *argv[]){return 0;}"
C_HAS_inline)
IF(NOT C_HAS_inline)
CHECK_C_SOURCE_COMPILES("
- static __inline int foo(){return 0;}
+ extern int bar(int x);
+ static __inline int foo(){return bar(1);}
int main(int argc, char *argv[]){return 0;}"
C_HAS___inline)
- SET(C_INLINE __inline)
+ IF(C_HAS___inline)
+ SET(C_INLINE __inline)
+ ElSE()
+ SET(C_INLINE)
+ MESSAGE(WARNING "C compiler does not support funcion inlining")
+ IF(NOT NOINLINE)
+ MESSAGE(FATAL_ERROR "Use -DNOINLINE=TRUE to allow compilation without inlining")
+ ENDIF()
+ ENDIF()
ENDIF()
IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf
index 4645e7c557a..d30ec182c8b 100644
--- a/debian/additions/my.cnf
+++ b/debian/additions/my.cnf
@@ -177,7 +177,7 @@ quote-names
max_allowed_packet = 16M
[mysql]
-#no-auto-rehash # faster start of mysql but no tab completition
+#no-auto-rehash # faster start of mysql but no tab completion
[isamchk]
key_buffer = 16M
diff --git a/debian/additions/mysqlreport b/debian/additions/mysqlreport
index 402a5be835d..772d6399437 100755
--- a/debian/additions/mysqlreport
+++ b/debian/additions/mysqlreport
@@ -1,10 +1,11 @@
#!/usr/bin/perl -w
-# mysqlreport v3.5 Apr 16 2008
+# mysqlreport v4.0 Oct 23 2015
# http://hackmysql.com/mysqlreport
-# mysqlreport makes an easy-to-read report of important MySQL status values.
+# mysqlreport makes an easy-to-read report of important MySQL/MariaDB status values.
# Copyright 2006-2008 Daniel Nichter
+# Copyright 2012-2015 Jean Weisbuch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -36,16 +37,19 @@ my ($stat_name, $stat_val, $stat_label);
my $MySQL_version;
my (%stats, %vars); # SHOW STATUS, SHOW VARIABLES
my (%DMS_vals, %Com_vals, %ib_vals);
-my ($dbh, $query);
+my $dbh;
my ($questions, $key_read_ratio, $key_write_ratio, $dms, $slow_query_t);
my ($key_cache_block_size, $key_buffer_used, $key_buffer_usage);
my ($qc_mem_used, $qc_hi_r, $qc_ip_r); # Query Cache
-my $have_innodb_vals;
my ($ib_bp_used, $ib_bp_total, $ib_bp_read_ratio);
my ($relative_live, $relative_infiles);
my $real_uptime;
my (%stats_present, %stats_past); # For relative reports
-
+my ($pagecache_read_ratio, $pagecache_write_ratio, $pagecache_block_size, $pagecache_buffer_used, $pagecache_buffer_usage); # AriaDB pagecache stats
+my ($binlog_cache_ratio, $binlog_stmt_cache_ratio); # binary log cache
+my $dbms;
+my ($rows, $rows_using_indexes);
+
GetOptions (
\%op,
"user=s",
@@ -127,13 +131,19 @@ $| = 1 if ($op{'detach'} || $relative_live);
print "tmp file: $tmpfile\n" if $op{debug};
-# Connect to MySQL
+# Connect to MySQL/MariaDB
if(!$op{'infile'} && !$relative_infiles)
{
connect_to_MySQL();
}
-$have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version()
+my $have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version()
+my $have_aria_vals = 0;
+my $have_subquerycache_vals = 0;
+my $have_binlog_vals = 0;
+my $have_tokudb_engine = 0;
+my $use_thread_pool = 0;
+my $use_xtradb = 0;
if(defined $op{'r'})
{
@@ -163,6 +173,9 @@ else
set_myisam_vals();
set_ib_vals() if $have_innodb_vals;
+ set_aria_vals() if $have_aria_vals;
+ set_subquerycache_vals() if $have_subquerycache_vals;
+ set_binlog_vals() if $have_binlog_vals;
write_report();
}
@@ -177,8 +190,8 @@ exit;
sub show_help_and_exit
{
print <<"HELP";
-mysqlreport v3.5 Apr 16 2008
-mysqlreport makes an easy-to-read report of important MySQL status values.
+mysqlreport v4.0 Oct 23 2015
+mysqlreport makes an easy-to-read report of important MySQL/MariaDB status values.
Command line options (abbreviations work):
--user USER Connect to MySQL as USER
@@ -264,6 +277,9 @@ sub collect_reports
set_myisam_vals();
set_ib_vals() if $have_innodb_vals;
+ set_aria_vals() if $have_aria_vals;
+ set_subquerycache_vals() if $have_subquerycache_vals;
+ set_binlog_vals() if $have_binlog_vals;
print "#\n# Beginning report, 0 0:0:0\n#\n";
@@ -403,6 +419,9 @@ sub relative_infile_report
set_myisam_vals();
set_ib_vals() if $have_innodb_vals;
+ set_aria_vals() if $have_aria_vals;
+ set_subquerycache_vals() if $have_subquerycache_vals;
+ set_binlog_vals() if $have_binlog_vals;
print "#\n# Beginning report, 0 0:0:0\n#\n";
@@ -422,7 +441,7 @@ sub get_vals
{
print "get_vals\n" if $op{debug};
- my @row;
+ my (@row, $query);
# Get status values
if($MySQL_version >= 50002)
@@ -434,7 +453,9 @@ sub get_vals
$query = $dbh->prepare("SHOW STATUS;");
}
$query->execute();
- while(@row = $query->fetchrow_array()) { $stats{$row[0]} = $row[1]; }
+ # To avoid problems if the variable capitalization would change (eg. TokuDB on MariaDB 5.5 => 10.0), the $stats index is forced to have its first char uppercase and the rest lowercase
+ while(@row = $query->fetchrow_array()) { $stats{ucfirst(lc($row[0]))} = $row[1]; }
+ $query->finish();
$real_uptime = $stats{'Uptime'};
}
@@ -443,18 +464,23 @@ sub get_vars
{
print "get_vars\n" if $op{debug};
- my @row;
+ my (@row, $query);
# Get server system variables
$query = $dbh->prepare("SHOW VARIABLES;");
$query->execute();
while(@row = $query->fetchrow_array()) { $vars{$row[0]} = $row[1]; }
-
+ $query->finish();
# table_cache was renamed to table_open_cache in MySQL 5.1.3
if($MySQL_version >= 50103)
{
$vars{'table_cache'} = $vars{'table_open_cache'};
}
+ # log_slow_queries was renamed to slow_query_log in MySQL 5.1.29
+ if($MySQL_version >= 50129)
+ {
+ $vars{'log_slow_queries'} = $vars{'slow_query_log'};
+ }
}
sub read_infile
@@ -507,10 +533,10 @@ sub read_infile
else { print "read_infile: ignore '$_'\n" if $op{debug}; }
last if $1 eq 'Uptime'; # exit while() if end of status values
- $_ = <INFILE>; # otherwise, read next line of status values
+ $_ = <INFILE>; # otherwise, read next line of status values
}
}
- elsif($1 eq 'back_log') # system variable values
+ elsif($1 eq 'back_log') # system variable values
{
print "read_infile: start vars\n" if $op{debug};
@@ -525,7 +551,7 @@ sub read_infile
else { print "read_infile: ignore '$_'\n" if $op{debug}; }
last if $1 eq 'wait_timeout'; # exit while() if end of vars
- $_ = <INFILE>; # otherwise, read next line of vars
+ $_ = <INFILE>; # otherwise, read next line of vars
}
}
elsif($1 eq '=') # old style, manually added system variable values
@@ -542,7 +568,7 @@ sub read_infile
}
else { print "read_infile: ignore '$_'\n" if $op{debug}; }
- $_ = <INFILE>; # otherwise, read next line of old vars
+ $_ = <INFILE>; # otherwise, read next line of old vars
}
redo;
@@ -572,25 +598,116 @@ sub get_MySQL_version
if($op{'infile'} || $relative_infiles)
{
- ($major, $minor, $patch) = ($vars{'version'} =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
+ ($major, $minor, $patch) = ($vars{'version'} =~ /^(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
+ if($vars{'version'} =~ /^\d{1,2}\.\d{1,2}\.\d{1,2}-MariaDB/) {
+ print "MariaDB detected\n" if $op{debug};
+ $dbms = "MariaDB";
+ } else {
+ $dbms = "MySQL";
+ }
}
else
{
- my @row;
+ my (@row, $query);
$query = $dbh->prepare("SHOW VARIABLES LIKE 'version';");
$query->execute();
@row = $query->fetchrow_array();
- ($major, $minor, $patch) = ($row[1] =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
+ $query->finish();
+ ($major, $minor, $patch) = ($row[1] =~ /^(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
+ if($row[1] =~ /^\d{1,2}\.\d{1,2}\.\d{1,2}-MariaDB/)
+ {
+ print "MariaDB detected\n" if $op{debug};
+ $dbms = "MariaDB";
+ }
+ else
+ {
+ $dbms = "MySQL";
+ }
}
+ # The major version number is kept as is while the minor version and the revision number are forced to 2 digits
+ # e.g.: 5.5.9 will be 50509, 10.0.5 will be 100005 and 10.1.23 will be 100123
$MySQL_version = sprintf("%d%02d%02d", $major, $minor, $patch);
+ print "Version $MySQL_version\n" if $op{debug};
# Innodb_ status values were added in 5.0.2
if($MySQL_version < 50002)
{
$have_innodb_vals = 0;
print "get_MySQL_version: no InnoDB reports because MySQL version is older than 5.0.2\n" if $op{debug};
+ } else {
+ $have_innodb_vals = $dbh->selectall_arrayref("SELECT SUPPORT FROM information_schema.engines WHERE ENGINE = 'InnoDB';", undef)->[0][0];
+ if(defined($have_innodb_vals) && ($have_innodb_vals eq "YES" || $have_innodb_vals eq "DEFAULT"))
+ {
+ print "InnoDB detected\n" if $op{debug};
+ $have_innodb_vals = 1;
+ } else {
+ print "InnoDB is not activated\n" if $op{debug};
+ $have_innodb_vals = 0;
+ }
+ }
+
+ if($dbms eq "MariaDB") {
+ $have_aria_vals = $dbh->selectall_arrayref("SELECT SUPPORT FROM information_schema.engines WHERE ENGINE = 'Aria';", undef)->[0][0];
+ if(defined($have_aria_vals) && $have_aria_vals eq "YES")
+ {
+ print "Aria engine detected\n" if $op{debug};
+ $have_aria_vals = 1;
+ } else {
+ $have_aria_vals = 0;
+ }
+
+ # MariaDB 5.3+, activated by default since 5.3.2
+ $have_subquerycache_vals = $dbh->selectall_arrayref("SELECT VARIABLE_VALUE REGEXP ',subquery_cache=on,|^subquery_cache=on,|,subquery_cache=on\$' AS SUBQUERY_CACHE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'optimizer_switch';", undef)->[0][0];
+ if(defined($have_subquerycache_vals) && $have_subquerycache_vals eq "1")
+ {
+ print "Subquery cache is activated\n" if $op{debug};
+ $have_subquerycache_vals = 1;
+ } else {
+ $have_subquerycache_vals = 0;
+ }
+ }
+
+ if($MySQL_version >= 50000)
+ {
+ # These checks use the 'information_schema' virtual database that has been added on MySQL 5.0
+
+ # MariaDB 5.5.21+ and Percona Server 5.5.30+ use the same thread pool implementation
+ $use_thread_pool = $dbh->selectall_arrayref("SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'thread_handling';", undef)->[0][0];
+ if(defined($use_thread_pool) && $use_thread_pool eq "pool-of-threads") {
+ print "Thread pool is used\n" if $op{debug};
+ $use_thread_pool = 1;
+ } else {
+ $use_thread_pool = 0;
+ }
+
+ $have_binlog_vals = $dbh->selectall_arrayref("SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'log_bin';", undef)->[0][0];
+ if(defined($have_binlog_vals) && $have_binlog_vals eq "ON")
+ {
+ print "Binary log is activated\n" if $op{debug};
+ $have_binlog_vals = 1;
+ } else {
+ $have_binlog_vals = 0;
+ }
+
+ $have_tokudb_engine = $dbh->selectall_arrayref("SELECT SUPPORT FROM information_schema.engines WHERE ENGINE = 'TokuDB';", undef)->[0][0];
+ if(defined($have_tokudb_engine) && ($have_tokudb_engine eq "YES" || $have_tokudb_engine eq "DEFAULT"))
+ {
+ print "TokuDB detected\n" if $op{debug};
+ $have_tokudb_engine = 1;
+ } else {
+ $have_tokudb_engine = 0;
+ }
+
+ $use_xtradb = $dbh->selectall_arrayref("SELECT 1 FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE = 'InnoDB' AND COMMENT LIKE 'Percona-XtraDB%';", undef)->[0][0];
+ if(defined($use_xtradb) && $use_xtradb eq "1")
+ {
+ print "XtraDB detected\n" if $op{debug};
+ $use_xtradb = 1;
+ } else {
+ $use_xtradb = 0;
+ }
}
}
@@ -598,6 +715,7 @@ sub set_myisam_vals
{
print "set_myisam_vals\n" if $op{debug};
+# should be moved elsewere
$questions = $stats{'Questions'};
$key_read_ratio = sprintf "%.2f",
@@ -638,7 +756,6 @@ sub set_myisam_vals
$dms = $DMS_vals{SELECT} + $DMS_vals{INSERT} + $DMS_vals{REPLACE} + $DMS_vals{UPDATE} + $DMS_vals{DELETE};
$slow_query_t = format_u_time($vars{long_query_time});
-
}
sub set_ib_vals
@@ -658,6 +775,46 @@ sub set_ib_vals
0);
}
+sub set_aria_vals
+{
+ print "set_aria_vals\n" if $op{debug};
+
+ $pagecache_read_ratio = sprintf "%.2f",
+ ($stats{'Aria_pagecache_read_requests'} ?
+ 100 - ($stats{'Aria_pagecache_reads'} / $stats{'Aria_pagecache_read_requests'}) * 100 :
+ 0);
+
+ $pagecache_write_ratio = sprintf "%.2f",
+ ($stats{'Aria_pagecache_write_requests'} ?
+ 100 - ($stats{'Aria_pagecache_writes'} / $stats{'Aria_pagecache_write_requests'}) * 100 :
+ 0);
+
+ $pagecache_block_size = (defined $vars{'aria_block_size'} ?
+ $vars{'aria_block_size'} :
+ 1024);
+
+ $pagecache_buffer_used = $stats{'Aria_pagecache_blocks_used'} * $pagecache_block_size;
+
+ $pagecache_buffer_usage = $vars{'aria_pagecache_buffer_size'} -
+ ($stats{'Aria_pagecache_blocks_unused'} * $pagecache_block_size);
+}
+
+sub set_subquerycache_vals
+{
+ print "set_subquerycache_vals\n" if $op{debug};
+}
+
+sub set_binlog_vals
+{
+ print "set_binlog_vals\n" if $op{debug};
+
+ if($stats{'Binlog_cache_use'} gt 0) { $binlog_cache_ratio = $stats{'Binlog_cache_disk_use'} / $stats{'Binlog_cache_use'}; }
+ else { $binlog_cache_ratio = 0; }
+
+ if(defined($stats{'Binlog_stmt_cache_use'}) && $stats{'Binlog_stmt_cache_use'} gt 0) { $binlog_stmt_cache_ratio = $stats{'Binlog_stmt_cache_disk_use'} / $stats{'Binlog_stmt_cache_use'}; }
+ else { $binlog_stmt_cache_ratio = 0; }
+}
+
sub write_relative_report
{
print "write_relative_report\n" if $op{debug};
@@ -708,6 +865,10 @@ sub write_relative_report
$stats{'Innodb_row_lock_time_max'} = $stats_present{'Innodb_row_lock_time_max'};
}
}
+ if($have_aria_vals)
+ {
+ $stats{'Aria_pagecache_blocks_used'} = $stats_present{'Aria_pagecache_blocks_used'};
+ }
get_Com_values();
@@ -715,6 +876,9 @@ sub write_relative_report
set_myisam_vals();
set_ib_vals() if $have_innodb_vals;
+ set_aria_vals() if $have_aria_vals;
+ set_subquerycache_vals() if $have_subquerycache_vals;
+ set_binlog_vals() if $have_binlog_vals;
write_report();
}
@@ -731,15 +895,27 @@ sub write_report
$~ = 'SLOW_DMS', write;
write_DMS();
write_Com();
+ write_Rows();
$~ = 'SAS', write;
write_qcache();
$~ = 'REPORT_END', write;
+ $~ = 'THREADS', write;
+ if($use_thread_pool)
+ {
+ $~ = 'THREADPOOL', write;
+ } else {
+ $~ = 'THREADPERCONNECTION', write;
+ }
$~ = 'TAB', write;
write_InnoDB() if $have_innodb_vals;
+ write_Aria() if $have_aria_vals;
+ write_Subquerycache() if $have_subquerycache_vals;
+ write_Binlog() if $have_binlog_vals;
+ write_TokuDB() if $have_tokudb_engine;
}
-sub sec_to_dhms # Seconds to days hours:minutes:seconds
+sub sec_to_dhms # Seconds to days+hours:minutes:seconds
{
my $s = shift;
my ($d, $h, $m) = (0, 0, 0);
@@ -761,7 +937,7 @@ sub sec_to_dhms # Seconds to days hours:minutes:seconds
$m = int $s / 60;
$s -= $m * 60;
- return "$d $h:$m:$s";
+ return "$d+$h:$m:$s";
}
sub make_short
@@ -782,12 +958,11 @@ sub make_short
}
# What began as a simple but great idea has become the new standard:
-# long_query_time in microseconds. For MySQL 5.1.21+ and 6.0.4+ this
-# is now standard. For 4.1 and 5.0 patches, the architects of this
-# idea provide: http://www.mysqlperformanceblog.com/mysql-patches/
+# long_query_time in microseconds. For MySQL 5.1.21+ this is now
+# standard. For 4.1 and 5.0 patches, the architects of this idea
+# provide: http://www.mysqlperformanceblog.com/mysql-patches/
# Relevant notes in MySQL manual:
# http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html
-# http://dev.mysql.com/doc/refman/6.0/en/slow-query-log.html
#
# The format_u_time sub simply beautifies long_query_time.
@@ -848,7 +1023,7 @@ sub email_report # Email given report to $op{'email'}
open SENDMAIL, "|/usr/sbin/sendmail -t";
print SENDMAIL "From: mysqlreport\n";
print SENDMAIL "To: $op{email}\n";
- print SENDMAIL "Subject: MySQL status report on " . ($mycnf{'host'} || 'localhost') . "\n\n";
+ print SENDMAIL "Subject: $dbms status report on " . ($mycnf{'host'} || 'localhost') . "\n\n";
print SENDMAIL `cat $report`;
close SENDMAIL;
}
@@ -979,6 +1154,7 @@ sub write_qcache
# ergo this method is slightly more reliable
return if not exists $vars{'query_cache_size'};
return if $vars{'query_cache_size'} == 0;
+ return if defined($vars{'query_cache_type'}) and $vars{'query_cache_type'} eq 'OFF';
$qc_mem_used = $vars{'query_cache_size'} - $stats{'Qcache_free_memory'};
$qc_hi_r = sprintf "%.2f", $stats{'Qcache_hits'} / ($stats{'Qcache_inserts'} ||= 1);
@@ -988,6 +1164,36 @@ sub write_qcache
write;
}
+sub write_Subquerycache
+{
+ print "write_Subquerycache\n" if $op{debug};
+
+ return if not defined $stats{'Subquery_cache_hit'};
+ return if $stats{'Subquery_cache_hit'} == 0 && $stats{'Subquery_cache_miss'} == 0;
+
+ $~ = 'SUBQUERYCACHE';
+ write;
+}
+
+sub write_Binlog
+{
+ print "write_Binlog\n" if $op{debug};
+
+ return if $binlog_cache_ratio == 0 && $binlog_stmt_cache_ratio == 0;
+ $~ = 'BINLOG';
+ write;
+}
+
+sub write_TokuDB
+{
+ print "write_TokuDB\n" if $op{debug};
+
+ return if $stats{'Tokudb_cachetable_size_current'} == 0;
+
+ $~ = 'TOKUDB';
+ write;
+}
+
sub write_InnoDB
{
print "write_InnoDB\n" if $op{debug};
@@ -998,6 +1204,11 @@ sub write_InnoDB
$~ = 'IB';
write;
+ if($use_xtradb)
+ {
+ $~ = 'IB_XTRADB';
+ write;
+ }
# Innodb_row_lock_ values were added in MySQL 5.0.3
if($MySQL_version >= 50003)
@@ -1005,12 +1216,44 @@ sub write_InnoDB
$~ = 'IB_LOCK';
write;
}
+ if($use_xtradb)
+ {
+ $~ = 'IB_LOCK_XTRADB';
+ write;
+ }
# Data, Pages, Rows
$~ = 'IB_DPR';
write;
}
+
+sub write_Aria
+{
+ print "write_Aria\n" if $op{debug};
+
+ return if not defined $stats{'Aria_pagecache_blocks_used'};
+
+ $~ = 'PAGECACHE_BUFF_MAX';
+ write;
+
+ if($pagecache_buffer_usage != -1) { $~ = 'PAGECACHE_BUFF_USAGE', write }
+
+ $~ = 'PAGECACHE_RATIOS';
+ write;
+}
+
+sub write_Rows
+{
+ print "write_Rows\n" if $op{debug};
+
+ $rows_using_indexes = $stats{'Handler_read_first'} + $stats{'Handler_read_key'} + $stats{'Handler_read_next'} + $stats{'Handler_read_prev'};
+ $rows = $rows_using_indexes + $stats{'Handler_read_rnd'} + $stats{'Handler_read_rnd_next'} + $stats{'Sort_rows'};
+
+ $~ = 'ROWS';
+ write;
+}
+
sub have_op
{
my $key = shift;
@@ -1043,19 +1286,17 @@ sub exit_tasks_and_cleanup
}
else
{
- if($WIN) { `del $tmpfile`; }
- else { `rm -f $tmpfile`; }
+ unlink $tmpfile;
}
if(!$op{'infile'} && !$relative_infiles)
{
if($op{'flush-status'})
{
- $query = $dbh->prepare("FLUSH STATUS;");
+ my $query = $dbh->prepare("FLUSH STATUS;");
$query->execute();
+ $query->finish();
}
-
- $query->finish();
$dbh->disconnect();
}
}
@@ -1065,19 +1306,19 @@ sub exit_tasks_and_cleanup
#
format MYSQL_TIME =
-MySQL @<<<<<<<<<<<<<<<< uptime @<<<<<<<<<<< @>>>>>>>>>>>>>>>>>>>>>>>>
-$vars{'version'}, sec_to_dhms($real_uptime), (($op{infile} || $relative_infiles) ? '' : scalar localtime)
+@<<<<<< @<<<<<<<<<<<<<<<<<< uptime @<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<
+$dbms, $vars{'version'}, sec_to_dhms($real_uptime), (($op{infile} || $relative_infiles) ? '' : scalar localtime)
.
format KEY_BUFF_MAX =
__ Key _________________________________________________________________
-Buffer used @>>>>>> of @>>>>>> %Used: @>>>>>
+Buffer used @>>>>>> of @>>>>>> %Used: @>>>>>
make_short($key_buffer_used, 1), make_short($vars{'key_buffer_size'}, 1), perc($key_buffer_used, $vars{'key_buffer_size'})
.
format KEY_BUFF_USAGE =
- Current @>>>>>> %Usage: @>>>>>
+ Current @>>>>>> %Usage: @>>>>>
make_short($key_buffer_usage, 1), perc($key_buffer_usage, $vars{'key_buffer_size'})
.
@@ -1088,166 +1329,197 @@ Read hit @>>>>>%
$key_read_ratio
__ Questions ___________________________________________________________
-Total @>>>>>>>> @>>>>>/s
+Total @>>>>>>>> @>>>>>/s
make_short($questions), t($questions)
.
format DTQ =
- @<<<<<<< @>>>>>>>> @>>>>>/s @>>>>>> @>>>>>
+ @<<<<<<< @>>>>>>>> @>>>>>/s @>>>>>> @>>>>>
$stat_name, make_short($stat_val), t($stat_val), $stat_label, perc($stat_val, $questions)
.
format SLOW_DMS =
-Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>>
+Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>>
$slow_query_t, make_short($stats{'Slow_queries'}), t($stats{'Slow_queries'}), perc($stats{'Slow_queries'}, $questions), perc($stats{'Slow_queries'}, $dms), $vars{'log_slow_queries'}
-DMS @>>>>>>>> @>>>>>/s @>>>>>
+DMS @>>>>>>>> @>>>>>/s @>>>>>
make_short($dms), t($dms), perc($dms, $questions)
.
format DMS =
- @<<<<<<< @>>>>>>>> @>>>>>/s @>>>>> @>>>>>
+ @<<<<<<< @>>>>>>>> @>>>>>/s @>>>>> @>>>>>
$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions), perc($stat_val, $dms)
.
format COM_1 =
-Com_ @>>>>>>>> @>>>>>/s @>>>>>
+Com_ @>>>>>>>> @>>>>>/s @>>>>>
make_short($stat_val), t($stat_val), perc($stat_val, $questions)
.
format COM_2 =
- @<<<<<<<<<< @>>>>>> @>>>>>/s @>>>>>
+ @<<<<<<<<<< @>>>>>> @>>>>>/s @>>>>>
$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions)
.
format SAS =
__ SELECT and Sort _____________________________________________________
-Scan @>>>>>> @>>>>/s %SELECT: @>>>>>
+Scan @>>>>>> @>>>>>/s %SELECT: @>>>>>
make_short($stats{'Select_scan'}), t($stats{'Select_scan'}), perc($stats{'Select_scan'}, $stats{'Com_select'})
-Range @>>>>>> @>>>>/s @>>>>>
+Range @>>>>>> @>>>>>/s @>>>>>
make_short($stats{'Select_range'}), t($stats{'Select_range'}), perc($stats{'Select_range'}, $stats{'Com_select'})
-Full join @>>>>>> @>>>>/s @>>>>>
+Full join @>>>>>> @>>>>>/s @>>>>>
make_short($stats{'Select_full_join'}), t($stats{'Select_full_join'}), perc($stats{'Select_full_join'}, $stats{'Com_select'})
-Range check @>>>>>> @>>>>/s @>>>>>
+Range check @>>>>>> @>>>>>/s @>>>>>
make_short($stats{'Select_range_check'}), t($stats{'Select_range_check'}), perc($stats{'Select_range_check'}, $stats{'Com_select'})
-Full rng join @>>>>>> @>>>>/s @>>>>>
+Full rng join @>>>>>> @>>>>>/s @>>>>>
make_short($stats{'Select_full_range_join'}), t($stats{'Select_full_range_join'}), perc($stats{'Select_full_range_join'}, $stats{'Com_select'})
-Sort scan @>>>>>> @>>>>/s
+Sort scan @>>>>>> @>>>>>/s
make_short($stats{'Sort_scan'}), t($stats{'Sort_scan'})
-Sort range @>>>>>> @>>>>/s
+Sort range @>>>>>> @>>>>>/s
make_short($stats{'Sort_range'}), t($stats{'Sort_range'})
-Sort mrg pass @>>>>>> @>>>>/s
+Sort mrg pass @>>>>>> @>>>>>/s
make_short($stats{'Sort_merge_passes'}), t($stats{'Sort_merge_passes'})
.
format QCACHE =
__ Query Cache _________________________________________________________
-Memory usage @>>>>>> of @>>>>>> %Used: @>>>>>
+Memory usage @>>>>>> of @>>>>>> %Usage: @>>>>>
make_short($qc_mem_used, 1), make_short($vars{'query_cache_size'}, 1), perc($qc_mem_used, $vars{'query_cache_size'})
Block Fragmnt @>>>>>%
perc($stats{'Qcache_free_blocks'}, $stats{'Qcache_total_blocks'})
-Hits @>>>>>> @>>>>/s
+Hits @>>>>>> @>>>>>/s
make_short($stats{'Qcache_hits'}), t($stats{'Qcache_hits'})
-Inserts @>>>>>> @>>>>/s
+Inserts @>>>>>> @>>>>>/s
make_short($stats{'Qcache_inserts'}), t($stats{'Qcache_inserts'})
-Insrt:Prune @>>>>>>:1 @>>>>/s
+Insrt:Prune @>>>>>>:1 @>>>>>/s
make_short($qc_ip_r), t($stats{'Qcache_inserts'} - $stats{'Qcache_lowmem_prunes'})
Hit:Insert @>>>>>>:1
$qc_hi_r, t($qc_hi_r)
.
+format SUBQUERYCACHE =
+
+__ Subquery Cache ______________________________________________________
+Hit ratio @>>>>>%
+perc($stats{'Subquery_cache_hit'} / ($stats{'Subquery_cache_hit'} + $stats{'Subquery_cache_miss'}))
+Hits @>>>>>> @>>>>>/s
+make_short($stats{'Subquery_cache_hit'}), t($stats{'Subquery_cache_hit'})
+Miss @>>>>>> @>>>>>/s
+make_short($stats{'Subquery_cache_miss'}), t($stats{'Subquery_cache_miss'})
+.
+
# Not really the end...
format REPORT_END =
__ Table Locks _________________________________________________________
-Waited @>>>>>>>> @>>>>>/s %Total: @>>>>>
+Waited @>>>>>>>> @>>>>>/s %Total: @>>>>>
make_short($stats{'Table_locks_waited'}), t($stats{'Table_locks_waited'}), perc($stats{'Table_locks_waited'}, $stats{'Table_locks_waited'} + $stats{'Table_locks_immediate'});
-Immediate @>>>>>>>> @>>>>>/s
+Immediate @>>>>>>>> @>>>>>/s
make_short($stats{'Table_locks_immediate'}), t($stats{'Table_locks_immediate'})
__ Tables ______________________________________________________________
-Open @>>>>>>>> of @>>> %Cache: @>>>>>
+Open @>>>>>>>> of @>>>>> %Cache: @>>>>>
$stats{'Open_tables'}, $vars{'table_cache'}, perc($stats{'Open_tables'}, $vars{'table_cache'})
-Opened @>>>>>>>> @>>>>>/s
+Opened @>>>>>>>> @>>>>>/s
make_short($stats{'Opened_tables'}), t($stats{'Opened_tables'})
__ Connections _________________________________________________________
-Max used @>>>>>>>> of @>>> %Max: @>>>>>
+Max used @>>>>>>>> of @>>>>> %Max: @>>>>>
$stats{'Max_used_connections'}, $vars{'max_connections'}, perc($stats{'Max_used_connections'}, $vars{'max_connections'})
-Total @>>>>>>>> @>>>>>/s
+Total @>>>>>>>> @>>>>>/s
make_short($stats{'Connections'}), t($stats{'Connections'})
__ Created Temp ________________________________________________________
-Disk table @>>>>>>>> @>>>>>/s
-make_short($stats{'Created_tmp_disk_tables'}), t($stats{'Created_tmp_disk_tables'})
-Table @>>>>>>>> @>>>>>/s Size: @>>>>>
+Disk table @>>>>>>>> @>>>>>/s %Disk: @>>>>>
+make_short($stats{'Created_tmp_disk_tables'}), t($stats{'Created_tmp_disk_tables'}), perc($stats{'Created_tmp_disk_tables'}, $stats{'Created_tmp_tables'})
+Table @>>>>>>>> @>>>>>/s Size: @>>>>>
make_short($stats{'Created_tmp_tables'}), t($stats{'Created_tmp_tables'}), make_short($vars{'tmp_table_size'}, 1, 1)
-File @>>>>>>>> @>>>>>/s
+File @>>>>>>>> @>>>>>/s
make_short($stats{'Created_tmp_files'}), t($stats{'Created_tmp_files'})
.
-format TAB =
+format THREADS =
__ Threads _____________________________________________________________
-Running @>>>>>>>> of @>>>
+Running @>>>>>>>> of @>>>>>
$stats{'Threads_running'}, $stats{'Threads_connected'}
-Cached @>>>>>>>> of @>>> %Hit: @>>>>>
-$stats{'Threads_cached'}, $vars{'thread_cache_size'}, make_short(100 - perc($stats{'Threads_created'}, $stats{'Connections'}))
-Created @>>>>>>>> @>>>>>/s
+Created @>>>>>>>> @>>>>>/s
make_short($stats{'Threads_created'}), t($stats{'Threads_created'})
-Slow @>>>>>>>> @>>>>>/s
+Slow @>>>>>>>> @>>>>>/s
$stats{'Slow_launch_threads'}, t($stats{'Slow_launch_threads'})
+.
+
+format THREADPERCONNECTION =
+Cached @>>>>>>>> of @>>>>> %Hit: @>>>>>
+$stats{'Threads_cached'}, $vars{'thread_cache_size'}, make_short(100 - perc($stats{'Threads_created'}, $stats{'Connections'}))
+.
+
+format THREADPOOL =
+Threadpool @>>>>>>>> of @>>>>> %Used: @>>>>>
+$stats{'Threadpool_threads'} + $stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}, make_short(perc($stats{'Threadpool_threads'} + $stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}))
+ Running @>>>>>>>> of @>>>>> %Running: @>>>>>
+$stats{'Threadpool_threads'}, $vars{'thread_pool_max_threads'}, make_short(perc($stats{'Threadpool_threads'}, $vars{'thread_pool_max_threads'}))
+ Idle @>>>>>>>> of @>>>>> %Idle: @>>>>>
+$stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}, make_short(perc($stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}))
+.
+
+format TAB =
__ Aborted _____________________________________________________________
-Clients @>>>>>>>> @>>>>>/s
+Clients @>>>>>>>> @>>>>>/s
make_short($stats{'Aborted_clients'}), t($stats{'Aborted_clients'})
-Connects @>>>>>>>> @>>>>>/s
+Connects @>>>>>>>> @>>>>>/s
make_short($stats{'Aborted_connects'}), t($stats{'Aborted_connects'})
__ Bytes _______________________________________________________________
-Sent @>>>>>>>> @>>>>>/s
+Sent @>>>>>>>> @>>>>>/s
make_short($stats{'Bytes_sent'}), t($stats{'Bytes_sent'})
-Received @>>>>>>>> @>>>>>/s
+Received @>>>>>>>> @>>>>>/s
make_short($stats{'Bytes_received'}), t($stats{'Bytes_received'})
.
format IB =
__ InnoDB Buffer Pool __________________________________________________
-Usage @>>>>>> of @>>>>>> %Used: @>>>>>
+Usage @>>>>>> of @>>>>>> %Usage: @>>>>>
make_short($ib_bp_used, 1), make_short($ib_bp_total, 1), perc($ib_bp_used, $ib_bp_total)
Read hit @>>>>>%
$ib_bp_read_ratio;
Pages
- Free @>>>>>>>> %Total: @>>>>>
+ Free @>>>>>>>> %Total: @>>>>>
make_short($stats{'Innodb_buffer_pool_pages_free'}), perc($stats{'Innodb_buffer_pool_pages_free'}, $stats{'Innodb_buffer_pool_pages_total'})
- Data @>>>>>>>> @>>>>> %Drty: @>>>>>
+ Data @>>>>>>>> @>>>>> %Drty: @>>>>>
make_short($stats{'Innodb_buffer_pool_pages_data'}), perc($stats{'Innodb_buffer_pool_pages_data'}, $stats{'Innodb_buffer_pool_pages_total'}), perc($stats{'Innodb_buffer_pool_pages_dirty'}, $stats{'Innodb_buffer_pool_pages_data'})
- Misc @>>>>>>>> @>>>>>
+ Misc @>>>>>>>> @>>>>>
$stats{'Innodb_buffer_pool_pages_misc'}, perc($stats{'Innodb_buffer_pool_pages_misc'}, $stats{'Innodb_buffer_pool_pages_total'})
- Latched @>>>>>>>> @>>>>>
+ Latched @>>>>>>>> @>>>>>
$stats{'Innodb_buffer_pool_pages_latched'}, perc($stats{'Innodb_buffer_pool_pages_latched'}, $stats{'Innodb_buffer_pool_pages_total'})
-Reads @>>>>>>>> @>>>>>/s
+Reads @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_buffer_pool_read_requests'}), t($stats{'Innodb_buffer_pool_read_requests'})
- From file @>>>>>>>> @>>>>>/s @>>>>>
+ From disk @>>>>>>>> @>>>>>/s %Disk: @>>>>>
make_short($stats{'Innodb_buffer_pool_reads'}), t($stats{'Innodb_buffer_pool_reads'}), perc($stats{'Innodb_buffer_pool_reads'}, $stats{'Innodb_buffer_pool_read_requests'})
- Ahead Rnd @>>>>>>>> @>>>>>/s
+ Ahead Rnd @>>>>>>>> @>>>>>/s
$stats{'Innodb_buffer_pool_read_ahead_rnd'}, t($stats{'Innodb_buffer_pool_read_ahead_rnd'})
- Ahead Sql @>>>>>>>> @>>>>>/s
-$stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'})
-Writes @>>>>>>>> @>>>>>/s
+# Ahead Sql @>>>>>>>> @>>>>>/s
+#$stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'})
+Writes @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_buffer_pool_write_requests'}), t($stats{'Innodb_buffer_pool_write_requests'})
-Flushes @>>>>>>>> @>>>>>/s
+Wait Free @>>>>>>>> @>>>>>/s %Wait: @>>>>>
+$stats{'Innodb_buffer_pool_wait_free'}, t($stats{'Innodb_buffer_pool_wait_free'}), perc($stats{'Innodb_buffer_pool_wait_free'}, $stats{'Innodb_buffer_pool_write_requests'})
+Flushes @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_buffer_pool_pages_flushed'}), t($stats{'Innodb_buffer_pool_pages_flushed'})
-Wait Free @>>>>>>>> @>>>>>/s
-$stats{'Innodb_buffer_pool_wait_free'}, t($stats{'Innodb_buffer_pool_wait_free'})
+.
+
+format IB_XTRADB =
+ LRU @>>>>>>>> @>>>>>/s %LRU: @>>>>>
+make_short($stats{'Innodb_buffer_pool_pages_lru_flushed'}), t($stats{'Innodb_buffer_pool_pages_lru_flushed'}), perc($stats{'Innodb_buffer_pool_pages_lru_flushed'}, $stats{'Innodb_buffer_pool_pages_flushed'})
.
format IB_LOCK =
__ InnoDB Lock _________________________________________________________
-Waits @>>>>>>>> @>>>>>/s
+Waits @>>>>>>>> @>>>>>/s
$stats{'Innodb_row_lock_waits'}, t($stats{'Innodb_row_lock_waits'})
Current @>>>>>>>>
$stats{'Innodb_row_lock_current_waits'}
@@ -1260,15 +1532,20 @@ $stats{'Innodb_row_lock_time_avg'}
$stats{'Innodb_row_lock_time_max'}
.
+format IB_LOCK_XTRADB =
+Trx history @>>>>>>>>
+make_short($stats{'Innodb_history_list_length'})
+.
+
format IB_DPR =
__ InnoDB Data, Pages, Rows ____________________________________________
Data
- Reads @>>>>>>>> @>>>>>/s
+ Reads @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_data_reads'}), t($stats{'Innodb_data_reads'})
- Writes @>>>>>>>> @>>>>>/s
+ Writes @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_data_writes'}), t($stats{'Innodb_data_writes'})
- fsync @>>>>>>>> @>>>>>/s
+ fsync @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_data_fsyncs'}), t($stats{'Innodb_data_fsyncs'})
Pending
Reads @>>>>>>>>
@@ -1279,20 +1556,71 @@ $stats{'Innodb_data_pending_writes'}, t($stats{'Innodb_data_pending_writes'})
$stats{'Innodb_data_pending_fsyncs'}, t($stats{'Innodb_data_pending_fsyncs'})
Pages
- Created @>>>>>>>> @>>>>>/s
+ Created @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_pages_created'}), t($stats{'Innodb_pages_created'})
- Read @>>>>>>>> @>>>>>/s
+ Read @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_pages_read'}), t($stats{'Innodb_pages_read'})
- Written @>>>>>>>> @>>>>>/s
+ Written @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_pages_written'}), t($stats{'Innodb_pages_written'})
Rows
- Deleted @>>>>>>>> @>>>>>/s
+ Deleted @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_rows_deleted'}), t($stats{'Innodb_rows_deleted'})
- Inserted @>>>>>>>> @>>>>>/s
+ Inserted @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_rows_inserted'}), t($stats{'Innodb_rows_inserted'})
- Read @>>>>>>>> @>>>>>/s
+ Read @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_rows_read'}), t($stats{'Innodb_rows_read'})
- Updated @>>>>>>>> @>>>>>/s
+ Updated @>>>>>>>> @>>>>>/s
make_short($stats{'Innodb_rows_updated'}), t($stats{'Innodb_rows_updated'})
.
+
+format PAGECACHE_BUFF_MAX =
+
+__ Aria Pagecache ______________________________________________________
+Buffer used @>>>>>> of @>>>>>> %Used: @>>>>>
+make_short($pagecache_buffer_used, 1), make_short($vars{'aria_pagecache_buffer_size'}, 1), perc($pagecache_buffer_used, $vars{'aria_pagecache_buffer_size'})
+.
+
+format PAGECACHE_BUFF_USAGE =
+ Current @>>>>>> %Usage: @>>>>>
+make_short($pagecache_buffer_usage, 1), perc($pagecache_buffer_usage, $vars{'aria_pagecache_buffer_size'})
+.
+
+format PAGECACHE_RATIOS =
+Write hit @>>>>>%
+$pagecache_write_ratio
+Read hit @>>>>>%
+$pagecache_read_ratio
+.
+
+format BINLOG =
+
+__ Binary Log Cache _____________________________________________________
+Disk use
+ Transactional @>>>>>%
+perc($binlog_cache_ratio)
+ Non transactional @>>>>>%
+perc($binlog_stmt_cache_ratio)
+.
+
+format TOKUDB =
+
+__ TokuDB ______________________________________________________________
+Cachetable @>>>>>> of @>>>>>> %Usage: @>>>>>
+make_short($stats{Tokudb_cachetable_size_current}, 1), make_short($vars{tokudb_cache_size}, 1), perc($stats{Tokudb_cachetable_size_current}, $vars{tokudb_cache_size})
+ Miss @>>>>>> @>>>>>/s
+make_short($stats{'Tokudb_cachetable_miss'}), t($stats{'Tokudb_cachetable_miss'})
+ Evictions @>>>>>> @>>>>>/s
+make_short($stats{'Tokudb_cachetable_evictions'}), t($stats{'Tokudb_cachetable_evictions'})
+.
+
+format ROWS =
+
+__ Rows ________________________________________________________________
+Rows @>>>>>>>> @>>>>>/s
+make_short($rows), t($rows)
+ Using idx @>>>>>>>> @>>>>>/s %Index: @>>>>>
+make_short($rows_using_indexes), t($rows_using_indexes), perc($rows_using_indexes,$rows)
+Rows/question @>>>>>>
+make_short($rows/$questions)
+.
diff --git a/debian/mariadb-client-10.2.README.Debian b/debian/mariadb-client-10.2.README.Debian
index b245638f9c9..64f0f509951 100644
--- a/debian/mariadb-client-10.2.README.Debian
+++ b/debian/mariadb-client-10.2.README.Debian
@@ -1,4 +1,4 @@
FAQ:
-Q: My <tab> completition is gone, why?
+Q: My <tab> completion is gone, why?
A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf!
diff --git a/extra/yassl/README b/extra/yassl/README
index bf0e1c9f40f..81d573d0b20 100644
--- a/extra/yassl/README
+++ b/extra/yassl/README
@@ -12,6 +12,17 @@ before calling SSL_new();
*** end Note ***
+yaSSL Release notes, version 2.3.9 (12/01/2015)
+ This release of yaSSL fixes two client side Diffie-Hellman problems.
+ yaSSL was only handling the cases of zero or one leading zeros for the key
+ agreement instead of potentially any number. This caused about 1 in 50,000
+ connections to fail when using DHE cipher suites. The second problem was
+ the case where a server would send a public value shorter than the prime
+ value, causing about 1 in 128 client connections to fail, and also
+ caused the yaSSL client to read off the end of memory. All client side
+ DHE cipher suite users should update.
+ Thanks to Adam Langely (agl@imperialviolet.org) for the detailed report!
+
yaSSL Release notes, version 2.3.8 (9/17/2015)
This release of yaSSL fixes a high security vulnerability. All users
SHOULD update. If using yaSSL for TLS on the server side with private
diff --git a/extra/yassl/include/crypto_wrapper.hpp b/extra/yassl/include/crypto_wrapper.hpp
index b09b662c88c..0472b304679 100644
--- a/extra/yassl/include/crypto_wrapper.hpp
+++ b/extra/yassl/include/crypto_wrapper.hpp
@@ -378,6 +378,7 @@ public:
uint get_agreedKeyLength() const;
const byte* get_agreedKey() const;
+ uint get_publicKeyLength() const;
const byte* get_publicKey() const;
void makeAgreement(const byte*, unsigned int);
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index bec22427332..84ce40b8415 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -34,7 +34,7 @@
#include "rsa.h"
-#define YASSL_VERSION "2.3.8"
+#define YASSL_VERSION "2.3.9"
#if defined(__cplusplus)
diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp
index d8bc7a75ae3..031f7560801 100644
--- a/extra/yassl/src/crypto_wrapper.cpp
+++ b/extra/yassl/src/crypto_wrapper.cpp
@@ -751,9 +751,10 @@ struct DiffieHellman::DHImpl {
byte* publicKey_;
byte* privateKey_;
byte* agreedKey_;
+ uint pubKeyLength_;
DHImpl(TaoCrypt::RandomNumberGenerator& r) : ranPool_(r), publicKey_(0),
- privateKey_(0), agreedKey_(0) {}
+ privateKey_(0), agreedKey_(0), pubKeyLength_(0) {}
~DHImpl()
{
ysArrayDelete(agreedKey_);
@@ -762,7 +763,7 @@ struct DiffieHellman::DHImpl {
}
DHImpl(const DHImpl& that) : dh_(that.dh_), ranPool_(that.ranPool_),
- publicKey_(0), privateKey_(0), agreedKey_(0)
+ publicKey_(0), privateKey_(0), agreedKey_(0), pubKeyLength_(0)
{
uint length = dh_.GetByteLength();
AllocKeys(length, length, length);
@@ -810,7 +811,7 @@ DiffieHellman::DiffieHellman(const byte* p, unsigned int pSz, const byte* g,
using TaoCrypt::Integer;
pimpl_->dh_.Initialize(Integer(p, pSz).Ref(), Integer(g, gSz).Ref());
- pimpl_->publicKey_ = NEW_YS opaque[pubSz];
+ pimpl_->publicKey_ = NEW_YS opaque[pimpl_->pubKeyLength_ = pubSz];
memcpy(pimpl_->publicKey_, pub, pubSz);
}
@@ -869,6 +870,10 @@ const byte* DiffieHellman::get_agreedKey() const
return pimpl_->agreedKey_;
}
+uint DiffieHellman::get_publicKeyLength() const
+{
+ return pimpl_->pubKeyLength_;
+}
const byte* DiffieHellman::get_publicKey() const
{
diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp
index 48d0e01b1fa..a481812b3e0 100644
--- a/extra/yassl/src/yassl_imp.cpp
+++ b/extra/yassl/src/yassl_imp.cpp
@@ -109,15 +109,12 @@ void ClientDiffieHellmanPublic::build(SSL& ssl)
uint keyLength = dhClient.get_agreedKeyLength(); // pub and agree same
alloc(keyLength, true);
- dhClient.makeAgreement(dhServer.get_publicKey(), keyLength);
+ dhClient.makeAgreement(dhServer.get_publicKey(),
+ dhServer.get_publicKeyLength());
c16toa(keyLength, Yc_);
memcpy(Yc_ + KEY_OFFSET, dhClient.get_publicKey(), keyLength);
- // because of encoding first byte might be zero, don't use it for preMaster
- if (*dhClient.get_agreedKey() == 0)
- ssl.set_preMaster(dhClient.get_agreedKey() + 1, keyLength - 1);
- else
- ssl.set_preMaster(dhClient.get_agreedKey(), keyLength);
+ ssl.set_preMaster(dhClient.get_agreedKey(), keyLength);
}
@@ -321,11 +318,7 @@ void ClientDiffieHellmanPublic::read(SSL& ssl, input_buffer& input)
}
dh.makeAgreement(Yc_, keyLength);
- // because of encoding, first byte might be 0, don't use for preMaster
- if (*dh.get_agreedKey() == 0)
- ssl.set_preMaster(dh.get_agreedKey() + 1, dh.get_agreedKeyLength() - 1);
- else
- ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength());
+ ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength());
ssl.makeMasterSecret();
}
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index 8dad9ce052c..a38b7a5c81f 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -807,6 +807,19 @@ void SSL::set_random(const opaque* random, ConnectionEnd sender)
// store client pre master secret
void SSL::set_preMaster(const opaque* pre, uint sz)
{
+ uint i(0); // trim leading zeros
+ uint fullSz(sz);
+
+ while (i++ < fullSz && *pre == 0) {
+ sz--;
+ pre++;
+ }
+
+ if (sz == 0) {
+ SetError(bad_input);
+ return;
+ }
+
secure_.use_connection().AllocPreSecret(sz);
memcpy(secure_.use_connection().pre_master_secret_, pre, sz);
}
@@ -924,6 +937,8 @@ void SSL::order_error()
// Create and store the master secret see page 32, 6.1
void SSL::makeMasterSecret()
{
+ if (GetError()) return;
+
if (isTLS())
makeTLSMasterSecret();
else {
diff --git a/include/byte_order_generic_x86_64.h b/include/byte_order_generic_x86_64.h
index a7f0a1a58bf..05c144f83cb 100644
--- a/include/byte_order_generic_x86_64.h
+++ b/include/byte_order_generic_x86_64.h
@@ -32,7 +32,7 @@
Attention: Please, note, uint3korr reads 4 bytes (not 3)!
It means, that you have to provide enough allocated space.
*/
-#if defined(HAVE_purify) && !defined(_WIN32)
+#if defined(HAVE_valgrind) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))
diff --git a/include/m_ctype.h b/include/m_ctype.h
index a55222682b0..ee49e94ef99 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -533,6 +533,7 @@ struct my_charset_handler_st
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
+extern MY_CHARSET_HANDLER my_charset_utf8_handler;
/*
@@ -889,6 +890,18 @@ uint32 my_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
const char *from, uint32 from_length,
CHARSET_INFO *from_cs, uint *errors);
+/**
+ An extended version of my_convert(), to pass non-default mb_wc() and wc_mb().
+ For example, String::copy_printable() which is used in
+ Protocol::store_warning() uses this to escape control
+ and non-convertable characters.
+*/
+uint32 my_convert_using_func(char *to, uint32 to_length, CHARSET_INFO *to_cs,
+ my_charset_conv_wc_mb mb_wc,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs,
+ my_charset_conv_mb_wc wc_mb,
+ uint *errors);
/*
Convert a string between two character sets.
Bad byte sequences as well as characters that cannot be
diff --git a/include/my_bit.h b/include/my_bit.h
index 174e0f70083..a50403c312d 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -121,6 +121,15 @@ static inline uint32 my_reverse_bits(uint32 key)
_my_bits_reverse_table[(key>>24) ];
}
+/*
+ a number with the n lowest bits set
+ an overflow-safe version of (1 << n) - 1
+*/
+static inline uint32 my_set_bits(int n)
+{
+ return (((1UL << (n - 1)) - 1) << 1) | 1;
+}
+
C_MODE_END
#endif /* MY_BIT_INCLUDED */
diff --git a/include/my_global.h b/include/my_global.h
index befc3bf4672..7ed306b8b56 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -198,20 +198,6 @@
#define likely(x) __builtin_expect(((x) != 0),1)
#define unlikely(x) __builtin_expect(((x) != 0),0)
-/*
- now let's figure out if inline functions are supported
- autoconf defines 'inline' to be empty, if not
-*/
-#define inline_test_1(X) X ## 1
-#define inline_test_2(X) inline_test_1(X)
-#if inline_test_2(inline) != 1
-#define HAVE_INLINE
-#else
-#error Compiler does not support inline!
-#endif
-#undef inline_test_2
-#undef inline_test_1
-
/* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE
@@ -452,7 +438,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#endif
#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
+#define STDERR_FILENO fileno(stderr)
#endif
#ifndef SO_EXT
@@ -823,6 +809,9 @@ inline unsigned long long my_double2ulonglong(double d)
#else
#define finite(x) (1.0 / fabs(x) > 0.0)
#endif /* HAVE_FINITE */
+#elif (__cplusplus >= 201103L)
+#include <cmath>
+static inline bool isfinite(double x) { return std::isfinite(x); }
#endif /* isfinite */
#ifndef HAVE_ISNAN
diff --git a/include/my_net.h b/include/my_net.h
index 1ebb71ead23..91d780a276d 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -36,9 +36,11 @@ C_MODE_START
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
-#endif
+#endif /* defined(HAVE_POLL_H) */
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index 6b332f89958..bc5b2c67cdc 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -104,7 +104,7 @@ extern struct wsrep_service_st {
const char * (*wsrep_thd_query_state_str_func)(THD *thd);
int (*wsrep_thd_retry_counter_func)(THD *thd);
void (*wsrep_thd_set_conflict_state_func)(THD *thd, enum wsrep_conflict_state state);
- bool (*wsrep_thd_skip_append_keys_func)(THD *thd);
+ bool (*wsrep_thd_ignore_table_func)(THD *thd);
long long (*wsrep_thd_trx_seqno_func)(THD *thd);
struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd);
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
@@ -145,7 +145,7 @@ extern struct wsrep_service_st {
#define wsrep_thd_query_state_str(T) wsrep_service->wsrep_thd_query_state_str_func(T)
#define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T)
#define wsrep_thd_set_conflict_state(T,S) wsrep_service->wsrep_thd_set_conflict_state_func(T,S)
-#define wsrep_thd_skip_append_keys(T) wsrep_service->wsrep_thd_skip_append_keys_func(T)
+#define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T)
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
#define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T)
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
@@ -206,7 +206,7 @@ void wsrep_thd_LOCK(THD *thd);
void wsrep_thd_UNLOCK(THD *thd);
void wsrep_thd_awake(THD *thd, my_bool signal);
void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state);
-bool wsrep_thd_skip_append_keys(THD *thd);
+bool wsrep_thd_ignore_table(THD *thd);
void wsrep_unlock_rollback();
#endif
diff --git a/include/probes_mysql_nodtrace.h b/include/probes_mysql_nodtrace.h.in
index 2155e8489da..2155e8489da 100644
--- a/include/probes_mysql_nodtrace.h
+++ b/include/probes_mysql_nodtrace.h.in
diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h
index 096d42446bc..e9891856221 100644
--- a/include/welcome_copyright_notice.h
+++ b/include/welcome_copyright_notice.h
@@ -1,5 +1,5 @@
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates.
- Copyright (c) 2011, 2015, MariaDB
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2016, MariaDB
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
@@ -17,7 +17,7 @@
#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_
-#define COPYRIGHT_NOTICE_CURRENT_YEAR "2015"
+#define COPYRIGHT_NOTICE_CURRENT_YEAR "2016"
/*
This define specifies copyright notice which is displayed by every MySQL
diff --git a/include/wsrep.h b/include/wsrep.h
index a91f312d0a6..0f5455c8d50 100644
--- a/include/wsrep.h
+++ b/include/wsrep.h
@@ -31,6 +31,14 @@
if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \
wsrep_to_isolation_end(thd);
+/*
+ Checks if lex->no_write_to_binlog is set for statements that use LOCAL or
+ NO_WRITE_TO_BINLOG.
+*/
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
+ if (WSREP(thd) && !thd->lex->no_write_to_binlog \
+ && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
+
#define WSREP_DEBUG(...) \
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
@@ -46,6 +54,7 @@
#define WSREP_ERROR(...)
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#endif
#endif /* WSERP_INCLUDED */
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 8af5a284b9a..69ddb155f52 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -47,9 +47,11 @@
#include <sys/select.h>
#endif
#endif /* !defined(__WIN__) */
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
-#endif
+#endif /* defined(HAVE_POLL_H) */
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/mysql-test/include/galera_clear_sync_point.inc b/mysql-test/include/galera_clear_sync_point.inc
new file mode 100644
index 00000000000..589522a55b0
--- /dev/null
+++ b/mysql-test/include/galera_clear_sync_point.inc
@@ -0,0 +1 @@
+SET GLOBAL wsrep_provider_options = 'dbug=';
diff --git a/mysql-test/include/galera_set_sync_point.inc b/mysql-test/include/galera_set_sync_point.inc
new file mode 100644
index 00000000000..5fe4e8c38c0
--- /dev/null
+++ b/mysql-test/include/galera_set_sync_point.inc
@@ -0,0 +1 @@
+--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point'
diff --git a/mysql-test/include/galera_signal_sync_point.inc b/mysql-test/include/galera_signal_sync_point.inc
new file mode 100644
index 00000000000..eaa5cdd43f5
--- /dev/null
+++ b/mysql-test/include/galera_signal_sync_point.inc
@@ -0,0 +1 @@
+--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point'
diff --git a/mysql-test/include/galera_wait_sync_point.inc b/mysql-test/include/galera_wait_sync_point.inc
new file mode 100644
index 00000000000..cf3a4980186
--- /dev/null
+++ b/mysql-test/include/galera_wait_sync_point.inc
@@ -0,0 +1,6 @@
+--let $wait_timeout = 10
+--let $wsrep_on_orig = `SELECT @@wsrep_on`
+SET SESSION wsrep_on = 0;
+--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
+--source include/wait_condition.inc
+--eval SET SESSION wsrep_on = $wsrep_on_orig
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index e54041da1bc..6b25c75276c 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -40,6 +40,11 @@ BEGIN
-- except those that was created during bootstrap
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
+ -- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script
+ -- and the suite/galera/t/galera_var_notify_cmd.test
+ -- and the wsrep_schema schema that may be created by Galera
+ SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema');
+
-- The test database should not contain any tables
SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema='test';
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 0537c9623fc..8c2b67c2fda 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -496,6 +496,7 @@ sub process_suite {
# disabled.def
parse_disabled($suite->{dir} .'/disabled.def', $suitename);
+ parse_disabled($suite->{dir} .'/t/disabled.def', $suitename);
# combinations
if (@::opt_combinations)
diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result
index 537614c710b..05d03aeae11 100644
--- a/mysql-test/r/alter_table_online.result
+++ b/mysql-test/r/alter_table_online.result
@@ -2,15 +2,9 @@ drop table if exists t1,t2,t3;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
-ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 change b new_name int;
-ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 modify e enum('a','b','c');
-ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 comment "new comment";
-ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
-alter online table t1 rename to t2;
-ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 algorithm=INPLACE, lock=NONE;
alter online table t1;
alter table t1 algorithm=INPLACE;
@@ -40,10 +34,13 @@ alter online table t1 add f int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 engine=memory;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
+alter online table t1 rename to t2;
+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
alter online table t1 drop index b;
+alter online table t1 comment "new comment";
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result
index d578d43cb62..5669c6b5269 100644
--- a/mysql-test/r/contributors.result
+++ b/mysql-test/r/contributors.result
@@ -1,15 +1,13 @@
SHOW CONTRIBUTORS;
Name Location Comment
-Booking.com http://www.booking.com Founding member of the MariaDB foundation
-SkySQL Ab http://www.skysql.com Founding member of the MariaDB foundation
-Auttomatic http://automattic.com Member of the MariaDB foundation
-Parallels http://www.parallels.com/products/plesk Founding member of the MariaDB foundation
-Verkkokauppa.com Finland Sponsor of the MariaDB foundation
-Webyog Bangalor Sponsor of the MariaDB foundation
-Percona USA Sponsor of the MariaDB foundation
-Jelastic.com Russia Sponsor of the MariaDB foundation
-Planetta.net Finland Sponsor of the MariaDB foundation
-Open query Australia Sponsor of the MariaDB foundation
+Booking.com http://www.booking.com Founding member of the MariaDB Foundation
+MariaDB Corporation https://mariadb.com Founding member of the MariaDB Foundation
+Auttomattic http://automattic.com Member of the MariaDB Foundation
+Parallels http://www.parallels.com/products/plesk Founding member of the MariaDB Foundation
+Acronis http://www.acronis.com Member of the MariaDB Foundation
+Verkkokauppa.com Finland Sponsor of the MariaDB Foundation
+Webyog Bangalore Sponsor of the MariaDB Foundation
+Wikimedia Foundation USA Sponsor of the MariaDB Foundation
Google USA Sponsoring parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 6f664d306a1..cad46f34c75 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1889,5 +1889,21 @@ Warnings:
Note 1291 Column 'a' has duplicated value '' in ENUM
drop table t1;
set @@session.collation_server=default;
+#
+# MDEV-7765: Crash (Assertion `!table || (!table->write_set ||
+# bitmap_is_set(table->write_set, field_index) ||
+# bitmap_is_set(table->vcol_set, field_index))' fails)
+# on using function over not created table
+#
+CREATE function f1() returns int
+BEGIN
+declare n int;
+set n:= (select count(*) from t1);
+return n;
+end|
+create table t1 as select f1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+drop function f1;
+End of 5.5 tests
create table t1;
ERROR 42000: A table must have at least 1 column
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 90bc6b51177..816fe654028 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
+this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
@@ -5371,11 +5371,10 @@ SET sql_mode=default;
SET NAMES utf8;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
-SELECT COUNT(*) FROM t1, t1 t2
+SELECT COUNT(*) FROM t1, t1 t2
GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
COUNT(*)
-20
-5
+25
DROP TABLE t1;
#
# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
@@ -10259,5 +10258,146 @@ Warnings:
Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`c` = 'A')
DROP TABLE t1;
#
+# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+#
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '\'', "\"";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""", N'\'', N"\"";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+ROUTINE_DEFINITION
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '''', """";
+SELECT '<tab>\t<tab>\t<tab>';
+SELECT '<nl>\n<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""", N'''', N"""";
+SELECT N'<tab>\t<tab>\t<tab>';
+SELECT N'<nl>\n<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+body_utf8
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '''', """";
+SELECT '<tab>\t<tab>\t<tab>';
+SELECT '<nl>\n<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""", N'''', N"""";
+SELECT N'<tab>\t<tab>\t<tab>';
+SELECT N'<nl>\n<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+DROP PROCEDURE p1;
+SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+ROUTINE_DEFINITION
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+body_utf8
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT 'test';
+SELECT 'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END
+DROP PROCEDURE p1;
+SET @@SQL_MODE=default;
+#
# End of 10.1 tests
#
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index ac53a7e5a4e..10d77ae1502 100644
--- a/mysql-test/r/ctype_utf8mb4.result
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
+this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
@@ -3382,5 +3382,19 @@ SET NAMES utf8mb4;
SELECT * FROM `test😁😁test`;
ERROR HY000: Invalid utf8mb4 character string: 'test\xF0\x9F\x98\x81\xF0\x9F\x98\x81test'
#
+# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+#
+SET NAMES utf8mb4;
+CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4
+RETURN CONCAT('😎','x😎','😎y','x😎y');
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
+ROUTINE_DEFINITION
+RETURN CONCAT('?','x?','?y','x?y')
+SELECT body_utf8 FROM mysql.proc WHERE name='f1';
+body_utf8
+RETURN CONCAT('?','x?','?y','x?y')
+DROP FUNCTION f1;
+#
# End of 10.1 tests
#
diff --git a/mysql-test/r/ctype_utf8mb4_heap.result b/mysql-test/r/ctype_utf8mb4_heap.result
index 5f77d417fe5..d70e009228e 100644
--- a/mysql-test/r/ctype_utf8mb4_heap.result
+++ b/mysql-test/r/ctype_utf8mb4_heap.result
@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
+this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result
index fc1d2b9d315..7d193f397ac 100644
--- a/mysql-test/r/ctype_utf8mb4_innodb.result
+++ b/mysql-test/r/ctype_utf8mb4_innodb.result
@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
+this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result
index a033138a6fe..28cf36c7492 100644
--- a/mysql-test/r/ctype_utf8mb4_myisam.result
+++ b/mysql-test/r/ctype_utf8mb4_myisam.result
@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
+this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index a59f8a6dfee..1d643333424 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -603,6 +603,351 @@ select x.id, message from (select id from t1) x left join
where coalesce(message,0) <> 0;
id message
drop table t1,t2;
+#
+# MDEV-7827: Assertion `!table || (!table->read_set ||
+# bitmap_is_set(table->read_set, field_index))' failed
+# in Field_long::val_str on EXPLAIN EXTENDED
+#
+CREATE TABLE t1 (f1 INT, f2 INT, KEY(f2)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (6,9);
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (2),(0);
+EXPLAIN EXTENDED
+SELECT f1 FROM ( SELECT * FROM t1 ) AS sq
+WHERE f1 IN (
+SELECT f3 FROM t2 WHERE f2 IN (
+SELECT f3 FROM t2 HAVING f3 >= 8
+)
+);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
+1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 sq.f2 1 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(<subquery4>); Using join buffer (flat, BNL join)
+4 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+2 DERIVED t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1276 Field or reference 'sq.f2' of SELECT #3 was resolved in SELECT #1
+Note 1003 select 6 AS `f1` from <materialize> (select `test`.`t2`.`f3` from `test`.`t2` having (`test`.`t2`.`f3` >= 8)) semi join (`test`.`t2`) where ((`test`.`t2`.`f3` = 6) and (9 = `<subquery4>`.`f3`))
+DROP TABLE t2,t1;
+#
+# MDEV-9462: Out of memory using explain on 2 empty tables
+#
+CREATE TABLE `t1` (
+`REC_GROUP` char(2) DEFAULT NULL,
+`CLIENT_INFO` text CHARACTER SET utf8,
+`NAME` text,
+`PHONE_NUMBER` text,
+`ATTENTION_NAME` text,
+`PAYMENT_TERM` text CHARACTER SET utf8,
+`CREDIT_LIMIT` decimal(12,2) DEFAULT NULL,
+`LAST_PAY_DATE` text CHARACTER SET utf8,
+`TOTAL` double DEFAULT NULL,
+`TOTAL_MCL` double DEFAULT NULL,
+`TOTAL_MFS` double DEFAULT NULL,
+`TOTAL_MIS` double DEFAULT NULL,
+`BEFORE_DUE_7_MCL` double DEFAULT NULL,
+`BEFORE_DUE_7_MFS` double DEFAULT NULL,
+`BEFORE_DUE_7_MIS` double DEFAULT NULL,
+`PER1_MCL` double DEFAULT NULL,
+`PER1_MFS` double DEFAULT NULL,
+`PER1_MIS` double DEFAULT NULL,
+`PER2_MCL` double DEFAULT NULL,
+`PER2_MFS` double DEFAULT NULL,
+`PER2_MIS` double DEFAULT NULL,
+`PER3_MCL` double DEFAULT NULL,
+`PER3_MFS` double DEFAULT NULL,
+`PER3_MIS` double DEFAULT NULL,
+`PER4_MCL` double DEFAULT NULL,
+`PER4_MFS` double DEFAULT NULL,
+`PER4_MIS` double DEFAULT NULL,
+`PER5_MCL` double DEFAULT NULL,
+`PER5_MFS` double DEFAULT NULL,
+`PER5_MIS` double DEFAULT NULL,
+`PER6_MCL` double DEFAULT NULL,
+`PER6_MFS` double DEFAULT NULL,
+`PER6_MIS` double DEFAULT NULL,
+`PER7_MCL` double DEFAULT NULL,
+`PER7_MFS` double DEFAULT NULL,
+`PER7_MIS` double DEFAULT NULL,
+`BEFORE_DUE_7` double DEFAULT NULL,
+`PER1` double DEFAULT NULL,
+`PER2` double DEFAULT NULL,
+`PER3` double DEFAULT NULL,
+`PER4` double DEFAULT NULL,
+`PER5` double DEFAULT NULL,
+`PER6` double DEFAULT NULL,
+`PER7` double DEFAULT NULL,
+`REF` varchar(30) DEFAULT NULL,
+`TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
+);
+CREATE TABLE `t2` (
+`RECEIVABLE_GROUP` char(2) DEFAULT NULL,
+`CLIENT_NUMBER` varchar(35) DEFAULT NULL,
+`CLIENT_NAME` varchar(73) DEFAULT NULL,
+`PHONE_NUMBER` char(12) DEFAULT NULL,
+`ATTENTION_NAME` char(26) DEFAULT NULL,
+`PAYMENT_TERM` varchar(26) CHARACTER SET utf8 DEFAULT NULL,
+`CREDIT_LIMIT` decimal(12,2) DEFAULT NULL,
+`LAST_PAY_DATE` varchar(42) CHARACTER SET utf8 DEFAULT NULL,
+`TOTAL` decimal(12,2) DEFAULT NULL,
+`BEFORE_DUE_7` decimal(12,2) DEFAULT NULL,
+`PER1` decimal(12,2) DEFAULT NULL,
+`PER2` decimal(12,2) DEFAULT NULL,
+`PER3` decimal(12,2) DEFAULT NULL,
+`PER4` decimal(12,2) DEFAULT NULL,
+`PER5` decimal(12,2) DEFAULT NULL,
+`PER6` decimal(12,2) DEFAULT NULL,
+`PER7` decimal(12,2) DEFAULT NULL,
+`DIVISION` varchar(3) CHARACTER SET utf8 NOT NULL,
+`CLIENT_INFO` varchar(294) CHARACTER SET utf8 DEFAULT NULL,
+`EXCHANGE_RATE` double NOT NULL,
+`REF` varchar(30) DEFAULT NULL
+);
+explain
+SELECT A.RECEIVABLE_GROUP,A.CLIENT_INFO,A.CLIENT_NAME,A.PHONE_NUMBER,A.ATTENTION_NAME,A.PAYMENT_TERM,A.CREDIT_LIMIT,A.LAST_PAY_DATE,A.TOTAL,
+COALESCE(B.TOTAL_MCL,0) AS TOTAL_MCL,
+COALESCE(C.TOTAL_MFS,0) AS TOTAL_MFS,
+COALESCE(D.TOTAL_MIS,0) AS TOTAL_MIS,
+COALESCE(F.BEFORE_DUE_7_MCL,0) AS BEFORE_DUE_7_MCL,
+COALESCE(G.BEFORE_DUE_7_MFS,0) AS BEFORE_DUE_7_MFS,
+COALESCE(H.BEFORE_DUE_7_MIS,0) AS BEFORE_DUE_7_MIS,
+COALESCE(I.PER1_MCL,0) AS PER1_MCL,
+COALESCE(J.PER1_MFS,0) AS PER1_MFS,
+COALESCE(K.PER1_MIS,0) AS PER1_MIS,
+COALESCE(L.PER2_MCL,0) AS PER2_MCL,
+COALESCE(M.PER2_MFS,0) AS PER2_MFS,
+COALESCE(N.PER2_MIS,0) AS PER2_MIS,
+COALESCE(O.PER3_MCL,0) AS PER3_MCL,
+COALESCE(P.PER3_MFS,0) AS PER3_MFS,
+COALESCE(R.PER3_MIS,0) AS PER3_MIS,
+COALESCE(S.PER4_MCL,0) AS PER4_MCL,
+COALESCE(T.PER4_MFS,0) AS PER4_MFS,
+COALESCE(U.PER4_MIS,0) AS PER4_MIS,
+COALESCE(V.PER5_MCL,0) AS PER5_MCL,
+COALESCE(X.PER5_MFS,0) AS PER5_MFS,
+COALESCE(Z.PER5_MIS,0) AS PER5_MIS,
+COALESCE(Q.PER6_MCL,0) AS PER6_MCL,
+COALESCE(Y.PER6_MFS,0) AS PER6_MFS,
+COALESCE(W.PER6_MIS,0) AS PER6_MIS,
+COALESCE(A1.PER7_MCL,0) AS PER7_MCL,
+COALESCE(B1.PER7_MFS,0) AS PER7_MFS,
+COALESCE(C1.PER7_MIS,0) AS PER7_MIS,
+A.BEFORE_DUE_7,A.PER1,A.PER2,A.PER3,A.PER4,A.PER5,A.PER6,A.PER7,
+CONCAT(A.DIVISION,'-',A.CLIENT_NUMBER) AS REF,"2" AS TYPE FROM
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,
+GROUP_CONCAT(DISTINCT CLIENT_INFO SEPARATOR '<br>') AS CLIENT_INFO,
+GROUP_CONCAT(DISTINCT CLIENT_NAME SEPARATOR '<br>') AS CLIENT_NAME,
+GROUP_CONCAT( DISTINCT `PHONE_NUMBER` SEPARATOR '<br>' ) AS PHONE_NUMBER ,
+GROUP_CONCAT( DISTINCT `ATTENTION_NAME` SEPARATOR '<br>' ) AS ATTENTION_NAME,
+GROUP_CONCAT( DISTINCT `PAYMENT_TERM` SEPARATOR '<br>' ) AS PAYMENT_TERM,
+CREDIT_LIMIT ,
+GROUP_CONCAT( `LAST_PAY_DATE` SEPARATOR '<br>' ) AS LAST_PAY_DATE,
+SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL,
+SUM( `BEFORE_DUE_7`*EXCHANGE_RATE ) AS BEFORE_DUE_7,
+SUM( `PER1`*EXCHANGE_RATE ) AS PER1,
+SUM( `PER2`*EXCHANGE_RATE ) AS PER2,
+SUM( `PER3`*EXCHANGE_RATE ) AS PER3,
+SUM( `PER4`*EXCHANGE_RATE ) AS PER4,
+SUM( `PER5`*EXCHANGE_RATE ) AS PER5,
+SUM( `PER6`*EXCHANGE_RATE ) AS PER6,
+SUM( `PER7`*EXCHANGE_RATE ) AS PER7
+FROM `t2`
+WHERE REF IS NULL GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS A
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS B ON A.CLIENT_NUMBER=B.CLIENT_NUMBER AND
+A.DIVISION=B.DIVISION AND A.RECEIVABLE_GROUP=B.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=B.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS C ON A.CLIENT_NUMBER=C.CLIENT_NUMBER
+AND
+A.DIVISION=C.DIVISION AND A.RECEIVABLE_GROUP=C.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS D ON A.CLIENT_NUMBER=D.CLIENT_NUMBER AND
+A.DIVISION=D.DIVISION AND A.RECEIVABLE_GROUP=D.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=D.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS F ON A.CLIENT_NUMBER=F.CLIENT_NUMBER AND
+A.DIVISION=F.DIVISION AND A.RECEIVABLE_GROUP=F.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=F.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS G ON A.CLIENT_NUMBER=G.CLIENT_NUMBER AND
+A.DIVISION=G.DIVISION AND A.RECEIVABLE_GROUP=G.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=G.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS H ON A.CLIENT_NUMBER=H.CLIENT_NUMBER AND
+A.DIVISION=H.DIVISION AND A.RECEIVABLE_GROUP=H.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=H.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS I ON A.CLIENT_NUMBER=I.CLIENT_NUMBER AND
+A.DIVISION=I.DIVISION AND A.RECEIVABLE_GROUP=I.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=I.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS J ON A.CLIENT_NUMBER=J.CLIENT_NUMBER AND
+A.DIVISION=J.DIVISION AND A.RECEIVABLE_GROUP=J.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=J.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS K ON A.CLIENT_NUMBER=K.CLIENT_NUMBER AND
+A.DIVISION=K.DIVISION AND A.RECEIVABLE_GROUP=K.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=K.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS L ON A.CLIENT_NUMBER=L.CLIENT_NUMBER AND
+A.DIVISION=L.DIVISION AND A.RECEIVABLE_GROUP=L.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=L.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS M ON A.CLIENT_NUMBER=M.CLIENT_NUMBER AND
+A.DIVISION=M.DIVISION AND A.RECEIVABLE_GROUP=M.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=M.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS N ON A.CLIENT_NUMBER=N.CLIENT_NUMBER AND
+A.DIVISION=N.DIVISION AND A.RECEIVABLE_GROUP=N.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=N.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS O ON A.CLIENT_NUMBER=O.CLIENT_NUMBER AND
+A.DIVISION=O.DIVISION AND A.RECEIVABLE_GROUP=O.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=O.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS P ON A.CLIENT_NUMBER=P.CLIENT_NUMBER AND
+A.DIVISION=P.DIVISION AND A.RECEIVABLE_GROUP=P.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=P.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS R ON A.CLIENT_NUMBER=R.CLIENT_NUMBER AND
+A.DIVISION=R.DIVISION AND A.RECEIVABLE_GROUP=R.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=R.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS S ON A.CLIENT_NUMBER=S.CLIENT_NUMBER AND
+A.DIVISION=S.DIVISION AND A.RECEIVABLE_GROUP=S.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=S.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS T ON A.CLIENT_NUMBER=T.CLIENT_NUMBER AND
+A.DIVISION=T.DIVISION AND A.RECEIVABLE_GROUP=T.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=T.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS U ON A.CLIENT_NUMBER=U.CLIENT_NUMBER AND
+A.DIVISION=U.DIVISION AND A.RECEIVABLE_GROUP=U.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=U.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS V ON A.CLIENT_NUMBER=V.CLIENT_NUMBER AND
+A.DIVISION=V.DIVISION AND A.RECEIVABLE_GROUP=V.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=V.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS X ON A.CLIENT_NUMBER=X.CLIENT_NUMBER AND
+A.DIVISION=X.DIVISION AND A.RECEIVABLE_GROUP=X.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=X.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Z ON A.CLIENT_NUMBER=Z.CLIENT_NUMBER AND
+A.DIVISION=Z.DIVISION AND A.RECEIVABLE_GROUP=Z.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Z.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Q ON A.CLIENT_NUMBER=Q.CLIENT_NUMBER AND
+A.DIVISION=Q.DIVISION AND A.RECEIVABLE_GROUP=Q.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Q.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Y ON A.CLIENT_NUMBER=Y.CLIENT_NUMBER AND
+A.DIVISION=Y.DIVISION AND A.RECEIVABLE_GROUP=Y.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Y.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS W ON A.CLIENT_NUMBER=W.CLIENT_NUMBER AND
+A.DIVISION=W.DIVISION AND A.RECEIVABLE_GROUP=W.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=W.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS A1 ON A.CLIENT_NUMBER=A1.CLIENT_NUMBER AND
+A.DIVISION=A1.DIVISION AND A.RECEIVABLE_GROUP=A1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=A1.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS B1 ON A.CLIENT_NUMBER=B1.CLIENT_NUMBER AND
+A.DIVISION=B1.DIVISION AND A.RECEIVABLE_GROUP=B1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=B1.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS C1 ON A.CLIENT_NUMBER=C1.CLIENT_NUMBER AND
+A.DIVISION=C1.DIVISION AND A.RECEIVABLE_GROUP=C1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C1.CREDIT_LIMIT
+ORDER BY TOTAL DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived3> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived4> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived5> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived6> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived7> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived8> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived9> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived10> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived11> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived12> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived13> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived14> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived15> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived16> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived17> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived18> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived19> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived20> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived21> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived22> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived23> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived24> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived25> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived26> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived27> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived28> system NULL NULL NULL NULL 0 const row not found
+1 PRIMARY <derived29> system NULL NULL NULL NULL 0 const row not found
+29 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+28 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+27 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+26 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+25 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+24 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+23 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+22 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+21 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+20 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+19 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+18 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+17 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+16 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+15 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+14 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+13 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+12 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+11 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+10 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+9 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+8 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+7 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+5 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+4 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+DROP TABLES t1,t2;
set optimizer_switch=@save_derived_optimizer_switch;
#
# Start of 10.1 tests
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 678b6d22028..f196571218f 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -204,7 +204,7 @@ CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
+this is test
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c')
bbbb bb bbbbbbbb aaaa bbbb
@@ -2343,7 +2343,7 @@ INSERT('abc', 3, 3, '1234')
ab1234
SELECT INSERT('abc', 4, 3, '1234');
INSERT('abc', 4, 3, '1234')
-abc1234
+abc
SELECT INSERT('abc', 5, 3, '1234');
INSERT('abc', 5, 3, '1234')
abc
@@ -2633,7 +2633,7 @@ CREATE TABLE t1 ( a TEXT );
SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt';;
SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' )
-x
+
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'b'
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;;
@@ -4579,8 +4579,7 @@ CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0),(0),(1),(0),(0);
SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, @@global.max_binlog_size);
COUNT(*)
-20
-5
+25
DROP TABLE t1;
#
# End of 10.1 tests
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 994fa8580eb..ad51010de30 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1729,6 +1729,45 @@ Warnings:
Warning 1292 Incorrect datetime value: '1'
drop table t1;
SET timestamp=DEFAULT;
+#
+# Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6
+# UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M"
+#
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"));
+UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"))
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '201506' for function str_to_date
+SELECT UNIX_TIMESTAMP('2015-06-00');
+UNIX_TIMESTAMP('2015-06-00')
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '2015-06-00'
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
+UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'))
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '0000-00-00 10:30:30' for function str_to_date
+set sql_mode= 'TRADITIONAL';
+SELECT @@sql_mode;
+@@sql_mode
+STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"));
+UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"))
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '201506' for function str_to_date
+SELECT UNIX_TIMESTAMP('2015-06-00');
+UNIX_TIMESTAMP('2015-06-00')
+NULL
+Warnings:
+Warning 1292 Incorrect datetime value: '2015-06-00'
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
+UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'))
+NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '0000-00-00 10:30:30' for function str_to_date
+set sql_mode= default;
select time('10:10:10') > 10;
time('10:10:10') > 10
1
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 7f32643b727..07773960e5a 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -2640,3 +2640,41 @@ field1 field2
DROP TABLE t1;
DROP TABLE where_subselect;
# End of Bug #58782
+#
+# MDEV-8988: Apparently valid SQL query gives wrong result (nested WHERE)
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int, c int);
+insert into t1 select A.a + 10*B.a, A.a, A.a + 10*B.a from t0 A, t0 B;
+insert into t1 values (NULL, NULL, NULL);
+create table t2 (c int, col1 int, key(c));
+insert into t2 select t1.a, 100000 from t1;
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status Table is already up to date
+explain
+select
+max(a)+ (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 101 Using temporary; Using filesort
+2 DEPENDENT SUBQUERY t2 ref c c 5 func 1
+select
+max(a) + (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+max(a) + (select col1 from t2 where t2.c=t1.c)
+NULL
+100090
+100091
+100092
+100093
+100094
+100095
+100096
+100097
+100098
+100099
+drop table t0,t1,t2;
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 838a7ad5162..7755d112f8e 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -101,3 +101,8 @@ SELECT * FROM information_schema.partitions
WHERE table_schema= 'test' AND table_name= 'v1';
DROP TABLE t1;
DROP VIEW v1;
+CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp';
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
+CREATE_OPTIONS
+row_format=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/'
+DROP TABLE t1;
diff --git a/mysql-test/r/merge_innodb.result b/mysql-test/r/merge_innodb.result
index f6057d279b1..5aa344a9391 100644
--- a/mysql-test/r/merge_innodb.result
+++ b/mysql-test/r/merge_innodb.result
@@ -35,3 +35,36 @@ c1
Ann
Alice
DROP TABLE t1, t2, t3, t4, t5;
+create table t1 (c1 varchar(100));
+create table t2 (c1 varchar(100));
+create view t3 as select * from t1;
+insert into t1 values ('ann'), ('alice');
+insert into t2 values ('bob'), ('brian');
+create temporary table t4 (c1 varchar(100)) engine=MERGE union=(t2, t1);
+create temporary table t5 (c1 varchar(100)) engine=MERGE union=(t3, t1);
+select * from t5;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+lock tables t1 read, t2 read, t3 read, t4 read;
+select * from t5;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+select * from t4;
+c1
+bob
+brian
+ann
+alice
+unlock tables;
+drop table t2;
+create view t2 as select * from t1;
+select * from t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+lock tables t1 read, t2 read, t3 read;
+select * from t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+select * from t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+select * from t4;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+unlock tables;
+drop view t2, t3;
+drop table t1;
diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result
index ef54ab6c9a5..f43f42f97fd 100644
--- a/mysql-test/r/mysql_upgrade_view.result
+++ b/mysql-test/r/mysql_upgrade_view.result
@@ -319,4 +319,64 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; REPAIR VIEW `v4` FROM MYSQL
drop table if exists kv;
drop view v1,v2,v3,v4;
+rename table mysql.event to mysql.ev_bk;
+flush tables;
+The --upgrade-system-tables option was used, user tables won't be touched.
+MySQL upgrade detected
+Phase 1/6: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.ev_bk OK
+mysql.event OK
+mysql.func OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.index_stats OK
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+
+Repairing tables
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+Phase 2/6: Fixing views from mysql
+test.v1 OK
+test.v2 OK
+test.v3 OK
+Phase 3/6: Running 'mysql_fix_privilege_tables'
+Phase 4/6: Fixing table and database names ... Skipped
+Phase 5/6: Checking and upgrading tables... Skipped
+Phase 6/6: Running 'FLUSH PRIVILEGES'
+OK
+drop table mysql.event;
+rename table mysql.ev_bk to mysql.event;
+drop view v1,v2,v3;
drop table t1;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 3646618cb1d..6652701090c 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -3715,7 +3715,7 @@ CREATE TEMPORARY TABLE `TABLES` (
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
- `CREATE_OPTIONS` varchar(255) DEFAULT NULL,
+ `CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index af24ad428ff..cd4fa259b3f 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -1524,6 +1524,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select nullif(<cache>(avg(`test`.`t1`.`a`)),0) AS `NULLIF(AVG(a),0)` from `test`.`t1`
DROP TABLE t1;
+create table t1 (col1 varchar(50));
+create view v1 AS select nullif(count(distinct col1),0) from t1;
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select nullif(count(distinct `t1`.`col1`),0) AS `nullif(count(distinct col1),0)` from `t1` latin1 latin1_swedish_ci
+drop view v1;
+drop table t1;
#
# End of 10.1 tests
#
diff --git a/mysql-test/r/second_frac-9175.result b/mysql-test/r/second_frac-9175.result
new file mode 100644
index 00000000000..dbf268b5c3b
--- /dev/null
+++ b/mysql-test/r/second_frac-9175.result
@@ -0,0 +1,13 @@
+select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
+timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456')
+31622400123456
+explain extended select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
+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 timestampdiff(MICROSECOND,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456') AS `timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456')`
+create view v1 as select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
+select * from v1;
+Name_exp_1
+31622400123456
+drop view v1;
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 92758fa134b..7b38515cf70 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -348,3 +348,18 @@ select found_rows();
found_rows()
75
drop table t1;
+create table t1(c1 int);
+insert into t1 values(1),(2),(3),(4),(5);
+select * from t1 order by c1 limit 2,1;
+c1
+3
+select found_rows();
+found_rows()
+3
+select sql_calc_found_rows * from t1 order by c1 limit 2,1;
+c1
+3
+select found_rows();
+found_rows()
+5
+drop table t1;
diff --git a/mysql-test/r/show.result b/mysql-test/r/show.result
new file mode 100644
index 00000000000..3dd7af5de05
--- /dev/null
+++ b/mysql-test/r/show.result
@@ -0,0 +1,12 @@
+show statistics;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'statistics' at line 1
+show spatial_ref_sys
+--error ER_PARSE_ERROR
+show system_variables;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'spatial_ref_sys
+--error ER_PARSE_ERROR
+show system_variables' at line 2
+show geometry_columns;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'geometry_columns' at line 1
+show nonexistent;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nonexistent' at line 1
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 6d1cbb21ac7..654b00d68ae 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -133,7 +133,7 @@ def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
-def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
+def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 2048 0 Y 0 0 8
def information_schema TABLES TABLES TABLE_COMMENT Comment 253 2048 0 N 1 0 8
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
show databases;
@@ -935,7 +935,7 @@ def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
-def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
+def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 6144 0 Y 0 0 33
def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 51c1b1924d1..9453a1da3ca 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -4326,57 +4326,57 @@ test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not BASE TABLE
-test.v1 repair error Corrupt
+test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
test.v1 optimize Error 'test.v1' is not BASE TABLE
-test.v1 optimize error Corrupt
+test.v1 optimize status Operation failed
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not BASE TABLE
-test.v1 analyze error Corrupt
+test.v1 analyze status Operation failed
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not BASE TABLE
-test.v1 repair error Corrupt
+test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
test.v1 optimize Error 'test.v1' is not BASE TABLE
-test.v1 optimize error Corrupt
+test.v1 optimize status Operation failed
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not BASE TABLE
-test.v1 analyze error Corrupt
+test.v1 analyze status Operation failed
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not BASE TABLE
-test.v1 repair error Corrupt
+test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
test.v1 optimize Error 'test.v1' is not BASE TABLE
-test.v1 optimize error Corrupt
+test.v1 optimize status Operation failed
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not BASE TABLE
-test.v1 analyze error Corrupt
+test.v1 analyze status Operation failed
drop procedure bug13012|
drop view v1|
select * from t1 order by data|
diff --git a/mysql-test/r/ssl_cert_verify.result b/mysql-test/r/ssl_cert_verify.result
new file mode 100644
index 00000000000..1da77329509
--- /dev/null
+++ b/mysql-test/r/ssl_cert_verify.result
@@ -0,0 +1,5 @@
+#T1: Host name (/CN=localhost/) as OU name in the server certificate, server certificate verification should fail.
+#T2: Host name (localhost) as common name in the server certificate, server certificate verification should pass.
+Variable_name Value
+Ssl_version TLS_VERSION
+# restart server using restart
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 75c8597590a..ac874f9943c 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -7110,6 +7110,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
+# MDEV-7122
+# Assertion `0' failed in subselect_hash_sj_engine::init
+#
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+a
+0
+0
+0
+DROP TABLE t1;
+SET SESSION big_tables=0;
+#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#
diff --git a/mysql-test/r/subselect_extra_no_semijoin.result b/mysql-test/r/subselect_extra_no_semijoin.result
index e5b36055c91..79bca388181 100644
--- a/mysql-test/r/subselect_extra_no_semijoin.result
+++ b/mysql-test/r/subselect_extra_no_semijoin.result
@@ -349,9 +349,9 @@ WHERE t.a IN (SELECT b FROM t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 MATERIALIZED t1 system NULL NULL NULL NULL 1 100.00
+3 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,0 in ( <materialize> (select 0 from dual ), <primary_index_lookup>(0 in <temporary table> on distinct_key where ((0 = `<subquery3>`.`b`))))))
+Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,<exists>(select 0 from dual where (<cache>(0) = 0))))
SELECT * FROM t2 RIGHT JOIN v1 AS t ON t.a != 0
WHERE t.a IN (SELECT b FROM t1);
a a b
@@ -362,9 +362,9 @@ WHERE t.a IN (SELECT b FROM t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t1 system NULL NULL NULL NULL 1 100.00
+2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,0 in ( <materialize> (select 0 from dual ), <primary_index_lookup>(0 in <temporary table> on distinct_key where ((0 = `<subquery2>`.`b`))))))
+Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,<exists>(select 0 from dual where (<cache>(0) = 0))))
DROP VIEW v1;
DROP TABLE t1,t2;
#
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index 976d03946e6..b5ec6082d68 100644
--- a/mysql-test/r/subselect_mat.result
+++ b/mysql-test/r/subselect_mat.result
@@ -2518,3 +2518,18 @@ a b sq
4 4 1
4 2 1
drop table t1, t2;
+#
+# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
+# UNION ALL
+#
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1),(2);
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) LIMIT 0 )
+UNION ALL
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) )
+;
+1
+1
+1
+drop table t1, t2;
diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result
index e6238af4cdc..6a5bec062c7 100644
--- a/mysql-test/r/subselect_no_exists_to_in.result
+++ b/mysql-test/r/subselect_no_exists_to_in.result
@@ -7110,6 +7110,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
+# MDEV-7122
+# Assertion `0' failed in subselect_hash_sj_engine::init
+#
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+a
+0
+0
+0
+DROP TABLE t1;
+SET SESSION big_tables=0;
+#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index 70edc6463c4..a574319b175 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -7103,6 +7103,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
+# MDEV-7122
+# Assertion `0' failed in subselect_hash_sj_engine::init
+#
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+a
+0
+0
+0
+DROP TABLE t1;
+SET SESSION big_tables=0;
+#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index c89fd132b35..62eecd568f0 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -7101,6 +7101,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
+# MDEV-7122
+# Assertion `0' failed in subselect_hash_sj_engine::init
+#
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+a
+0
+0
+0
+DROP TABLE t1;
+SET SESSION big_tables=0;
+#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index b12bf216327..174c791489c 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -7116,6 +7116,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
+# MDEV-7122
+# Assertion `0' failed in subselect_hash_sj_engine::init
+#
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+a
+0
+0
+0
+DROP TABLE t1;
+SET SESSION big_tables=0;
+#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index 54f145d5c5e..e0d62ac6d14 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -7101,6 +7101,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
+# MDEV-7122
+# Assertion `0' failed in subselect_hash_sj_engine::init
+#
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+a
+0
+0
+0
+DROP TABLE t1;
+SET SESSION big_tables=0;
+#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 18a79333e10..be252802c15 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -3003,4 +3003,69 @@ explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
+#
+# MDEV-7823: Server crashes in next_depth_first_tab on nested IN clauses with SQ inside
+#
+set @tmp_mdev7823=@@optimizer_switch;
+set optimizer_switch=default;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (8),(0);
+CREATE TABLE t3 (f3 INT);
+INSERT INTO t3 VALUES (1),(2);
+CREATE TABLE t4 (f4 INT);
+INSERT INTO t4 VALUES (0),(5);
+explain
+SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+1 PRIMARY t2 ref f2 f2 5 const 0 Using where; Using index
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 Using where
+SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
+f1 f2 f3
+1 0 1
+1 0 2
+drop table t1,t2,t3,t4;
+set optimizer_switch= @tmp_mdev7823;
+#
+# MDEV-6859: scalar subqueries in a comparison produced unexpected result
+#
+set @tmp_mdev6859=@@optimizer_switch;
+set optimizer_switch=default;
+CREATE TABLE t1 (
+project_number varchar(50) NOT NULL,
+PRIMARY KEY (project_number)
+) ENGINE=MyISAM;
+INSERT INTO t1 (project_number) VALUES ('aaa'),('bbb');
+CREATE TABLE t2 (
+id int(10) unsigned NOT NULL AUTO_INCREMENT,
+project_number varchar(50) NOT NULL,
+history_date date NOT NULL,
+country varchar(50) NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM;
+INSERT INTO t2 (id, project_number, history_date, country) VALUES
+(1, 'aaa', '2014-08-09', 'france'),(2, 'aaa', '2014-09-09', 'singapore');
+CREATE TABLE t3 (
+region varchar(50) NOT NULL,
+country varchar(50) NOT NULL
+) ENGINE=MyISAM;
+INSERT INTO t3 (region, country) VALUES ('apac', 'singapore'),('eame', 'france');
+SELECT SQL_NO_CACHE a.project_number
+FROM t1 a
+WHERE ( SELECT z.country
+FROM t2 z
+WHERE z.project_number = a.project_number AND z.history_date <= '2014-09-01'
+ORDER BY z.id DESC LIMIT 1
+) IN (
+SELECT r.country
+FROM t3 r
+WHERE r.region = 'eame'
+ );
+project_number
+aaa
+drop table t1, t2, t3;
+set optimizer_switch= @tmp_mdev6859;
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 13dc990b806..8e95b963971 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -3017,6 +3017,71 @@ explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
+#
+# MDEV-7823: Server crashes in next_depth_first_tab on nested IN clauses with SQ inside
+#
+set @tmp_mdev7823=@@optimizer_switch;
+set optimizer_switch=default;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (8),(0);
+CREATE TABLE t3 (f3 INT);
+INSERT INTO t3 VALUES (1),(2);
+CREATE TABLE t4 (f4 INT);
+INSERT INTO t4 VALUES (0),(5);
+explain
+SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+1 PRIMARY t2 ref f2 f2 5 const 0 Using where; Using index
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 Using where
+SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
+f1 f2 f3
+1 0 1
+1 0 2
+drop table t1,t2,t3,t4;
+set optimizer_switch= @tmp_mdev7823;
+#
+# MDEV-6859: scalar subqueries in a comparison produced unexpected result
+#
+set @tmp_mdev6859=@@optimizer_switch;
+set optimizer_switch=default;
+CREATE TABLE t1 (
+project_number varchar(50) NOT NULL,
+PRIMARY KEY (project_number)
+) ENGINE=MyISAM;
+INSERT INTO t1 (project_number) VALUES ('aaa'),('bbb');
+CREATE TABLE t2 (
+id int(10) unsigned NOT NULL AUTO_INCREMENT,
+project_number varchar(50) NOT NULL,
+history_date date NOT NULL,
+country varchar(50) NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM;
+INSERT INTO t2 (id, project_number, history_date, country) VALUES
+(1, 'aaa', '2014-08-09', 'france'),(2, 'aaa', '2014-09-09', 'singapore');
+CREATE TABLE t3 (
+region varchar(50) NOT NULL,
+country varchar(50) NOT NULL
+) ENGINE=MyISAM;
+INSERT INTO t3 (region, country) VALUES ('apac', 'singapore'),('eame', 'france');
+SELECT SQL_NO_CACHE a.project_number
+FROM t1 a
+WHERE ( SELECT z.country
+FROM t2 z
+WHERE z.project_number = a.project_number AND z.history_date <= '2014-09-01'
+ORDER BY z.id DESC LIMIT 1
+) IN (
+SELECT r.country
+FROM t3 r
+WHERE r.region = 'eame'
+ );
+project_number
+aaa
+drop table t1, t2, t3;
+set optimizer_switch= @tmp_mdev6859;
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/symlink.result b/mysql-test/r/symlink.result
index 279af1e44d2..b02c9a0c6f5 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -202,6 +202,9 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
+select create_options from information_schema.tables where table_name='t1';
+create_options
+DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
# CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
# options should not fail. Per documentation newly created table
# should not inherit value of these options from the original table.
diff --git a/mysql-test/r/trigger_null-8605.result b/mysql-test/r/trigger_null-8605.result
index 3b630166663..85fc51987d7 100644
--- a/mysql-test/r/trigger_null-8605.result
+++ b/mysql-test/r/trigger_null-8605.result
@@ -322,3 +322,22 @@ select * from t1;
id
0
drop table t1;
+create table t1 (a int not null, b int);
+create trigger trgi before update on t1 for each row do 1;
+insert t1 values (1,1),(2,2),(3,3),(1,4);
+create table t2 select a as c, b as d from t1;
+update t1 set a=(select count(c) from t2 where c+1=a+1 group by a);
+select * from t1;
+a b
+2 1
+1 2
+1 3
+2 4
+drop table t1, t2;
+create table t1 (a int not null);
+create table t2 (f1 int unsigned not null, f2 int);
+insert into t2 values (1, null);
+create trigger tr1 before update on t1 for each row do 1;
+create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
+update t2 set f2=1 where f1=1;
+drop table t1, t2;
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 1de9b989887..54f2aa91f2c 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -439,6 +439,15 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1;
1
drop table t1;
#
+# MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str
+#
+CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1));
+INSERT INTO t1 VALUES ('2003-04-27','a'),('1900-01-01','a');
+SELECT GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3) FROM t1;
+GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3)
+aa1900-01-01,aa2003-04-27
+DROP TABLE t1;
+#
# Start of 10.1 tests
#
#
@@ -511,12 +520,6 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01')
DROP TABLE t1;
#
-# End of 10.1 tests
-#
-#
-# Start of 10.1 tests
-#
-#
# MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
#
CREATE TABLE t1 (a DATE);
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 01a06fad00d..18bbb0da2ab 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2425,28 +2425,28 @@ CREATE VIEW v1 AS SELECT id FROM t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 optimize Error 'test.v1' is not BASE TABLE
-test.v1 optimize error Corrupt
+test.v1 optimize status Operation failed
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 analyze Error 'test.v1' is not BASE TABLE
-test.v1 analyze error Corrupt
+test.v1 analyze status Operation failed
REPAIR TABLE v1;
Table Op Msg_type Msg_text
test.v1 repair Error 'test.v1' is not BASE TABLE
-test.v1 repair error Corrupt
+test.v1 repair status Operation failed
DROP TABLE t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 optimize Error 'test.v1' is not BASE TABLE
-test.v1 optimize error Corrupt
+test.v1 optimize status Operation failed
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 analyze Error 'test.v1' is not BASE TABLE
-test.v1 analyze error Corrupt
+test.v1 analyze status Operation failed
REPAIR TABLE v1;
Table Op Msg_type Msg_text
test.v1 repair Error 'test.v1' is not BASE TABLE
-test.v1 repair error Corrupt
+test.v1 repair status Operation failed
DROP VIEW v1;
create definer = current_user() sql security invoker view v1 as select 1;
show create view v1;
@@ -5540,6 +5540,14 @@ execute stmt;
deallocate prepare stmt;
drop view v1,v2;
drop table `t1`;
+create table t1 (a int, b int);
+create view v1 as select a+b from t1;
+alter table v1 check partition p1;
+Table Op Msg_type Msg_text
+test.v1 check Error 'test.v1' is not BASE TABLE
+test.v1 check status Operation failed
+drop view v1;
+drop table t1;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/std_data/ca-cert-verify.pem b/mysql-test/std_data/ca-cert-verify.pem
new file mode 100644
index 00000000000..21d6264a0ad
--- /dev/null
+++ b/mysql-test/std_data/ca-cert-verify.pem
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDWzCCAkOgAwIBAgIJAO/QdKLEDQdXMA0GCSqGSIb3DQEBCwUAMEQxCzAJBgNV
+BAYTAklOMREwDwYDVQQIDAhLYXJuYXRrYTESMBAGA1UEBwwJQmFuZ2Fsb3JlMQ4w
+DAYDVQQKDAVNeVNRTDAeFw0xNjAxMDUxMDA1MDhaFw0yNTExMTMxMDA1MDhaMEQx
+CzAJBgNVBAYTAklOMREwDwYDVQQIDAhLYXJuYXRrYTESMBAGA1UEBwwJQmFuZ2Fs
+b3JlMQ4wDAYDVQQKDAVNeVNRTDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBAKdOCuS2CzfBTJ2x8SAzY0J7cYJfNJvMDF1cvANnhkIhtnkWt/HZ5DJ9NxeX
+q5h7FJLAi4gddqdk/tvQJw0V6gZepJr/mKVnMPivF5+oHPc9ZJQMX6B3FBNwWylm
+ACd5GKx8I/H/MXyuhQTcoV//Ab+2pI8RHeYbBsm3lHH+tX7bRU6mUFjneqMpiCkb
+JHt6BWZiWR10O6pMuGQ9+dDdsLhEV1fj3CctEPwW6rs4IZzD8xl5n+8cy7qu6eYH
+Wt/snwsTzkrufeMRqTtqelxON9eoQwYOR1oH3vNEVlcbuoJAvaWOqBROUBdf12SP
+TYSdP9nlRh7lTKQOywN4kYt6LqUCAwEAAaNQME4wHQYDVR0OBBYEFJ4c9tKaUU0P
+EjBq5G207jjXI7RAMB8GA1UdIwQYMBaAFJ4c9tKaUU0PEjBq5G207jjXI7RAMAwG
+A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABRnUyj21oFi0SGJg/K5+8Lc
+4n6OwVU/NgLOysIB0baIP/Rqeaze59xG/v9FPQgBlWcJK3RabOywx5bxAxdcus+1
+yp5j4h37Qq1/qkgqmevvdSAPa0OBQbLb+58/naV+ywUpCYZ6flLdCMH3fXuDSlSq
+qrCznextjojtWbnzrBmCmJmXWGd2gSaJDvb90ZZp/Elt3vN1sgjW0M/JEkb4MJ1r
+6nfD/FHr2lUwBHm2yk7Blovx7x4d/Ip3pglk63cNO/Rn0SBTdoVDS2LB9du3Phq2
+TZiL3NrRMGUNwmdaavyrJxaPq5D+Sfa4LYP3MMYD4KhLogNzIl299n5joyizlJw=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-cert-verify-fail.pem b/mysql-test/std_data/server-cert-verify-fail.pem
new file mode 100644
index 00000000000..4203425a344
--- /dev/null
+++ b/mysql-test/std_data/server-cert-verify-fail.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDJzCCAg8CAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCSU4xETAPBgNV
+BAgMCEthcm5hdGthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDjAMBgNVBAoMBU15U1FM
+MB4XDTE2MDEwNTEwMDgyN1oXDTI1MTExMzEwMDgyN1owbzELMAkGA1UEBhMCSU4x
+EjAQBgNVBAgMCTpLYXJuYXRrYTETMBEGA1UEBwwKOkJhbmdhbG9yZTEPMA0GA1UE
+CgwGOk15U1FMMRcwFQYDVQQLDA4vQ049bG9jYWxob3N0LzENMAsGA1UEAwwEZmFp
+bDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3wnWuJodzZYq9TAJRm
+HU7995FA3TEWdUinYTgGP79aTVQ4M9aeINlB6whWXOI8seh9Ja7C6kMzqOgYbgCl
+WlDPAVJWktFYeWXOLxbpzh1KWkS6jBkWT02t7H7JcYbil7xjlJUxLz4UOOUDUDIP
+6yqdA9VE3osESttjzj57Zm2xPqzbIHVJfORn7EexH4pryS7439p6i4XtfL31NJ8V
+07M3j3a8GqbcEqXYvcUCrLnywDQ1igP817b6ta52nbgYWiqdn0mJs535UJ/p/rSl
+D4Ae/6G3BSEY7whir6xY6vsd4KJ6w+wRCHnY0ky6OdDJVJLH1iqh7si7P3RBGkxw
+Y7MCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAggbw1jj2b7H5KDdeGJGIoOGkQAcs
+GNSJussCfdk7qnzYXKmjyNppC86jjaOrXona5f+SNCuujdu86Tv8V69EH57k4lUc
+DW7J4AD3vUb/tBzB0tsI/76Z4gm1XoCsnCGGpWd8GQAg/QNn/ZfJB2Vb/9ObN6rH
+0HV7ouB6OGZSsb71+grKiN6mDyB1lZynCGvqBxOCKFISfcRbCNFHo/pONlHaNGPE
+vjDH1bPZbEHj8owYgkdcQe0a8EbJYeQfm6fH8V8bmUcG7N60DrCnq4l1qwwVkh1S
+7RpIDgrWkU+esIIdYZIIbtDxQP1Sm7kUh++7b+bcHnyw3KtDVSCw7MIedA==
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-cert-verify-pass.pem b/mysql-test/std_data/server-cert-verify-pass.pem
new file mode 100644
index 00000000000..f8780f1f94e
--- /dev/null
+++ b/mysql-test/std_data/server-cert-verify-pass.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDEzCCAfsCAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCSU4xETAPBgNV
+BAgMCEthcm5hdGthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDjAMBgNVBAoMBU15U1FM
+MB4XDTE2MDEwNTEwMDU1OVoXDTI1MTExMzEwMDU1OVowWzELMAkGA1UEBhMCSU4x
+EjAQBgNVBAgMCTpLYXJuYXRrYTETMBEGA1UEBwwKOkJhbmdhbG9yZTEPMA0GA1UE
+CgwGOk15U1FMMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQDAmkbUwDe+nrqL8A8uwlIZk74HHCDjUAWrskKF9leEIQsB
+5exFZ8JEo1u6mdR4laQWsxizGdTPqIEidkDyyEMh4+joHgyQEPD/G3rFVW8yEFHb
+42O04O96BEPFXNPDRuX3MxI+lGbYDjxTS/WhVub4/3SqLjC28FJmEUXIHA0/A+c5
+hlYXK0u+aPAqXxHIjBgB4BxxHXZKqecmvR3LhXoVmhJmndsVfKajB27nDKc8/OTI
+H2SXb6h3nRPDXRfwB/C5i+004tEsVeIgkYshcCgLSyDdeVieUP2pm3EAmDSjmtLF
+6CgY/EBSfH+JCKFUk75bA4k8CCGzBfIeOcsKHwgFAgMBAAEwDQYJKoZIhvcNAQEL
+BQADggEBAInDuHtDkeT6dkWmRJCP56c4xiQqib2QuYUuMSrAhf07xlLHc6iHnD2X
+hCWCrja6uwF90DnPjeouKMAUe5txq/uKA8/Y/NfXN6nPiAeHLI0qnTv7Mr9TQ8zU
+DNDwRz6onlI2cS4GhrwAnlpiaxu7AjMUWHtfBFGFrgn3PawjDQpsBZNcxw1QsLc0
+E0hFrWLOd0vDETEhoRge88N7a0jqK0Rd9cvRWnvjI+IsjQMLZzKufivIHPzI9K+9
+Wtp8iRHcaBr5DpsBjgsO7dqVRbsNyaWsdHdLt+CQSGXpv7P6fq3K6nJFTBeIgSfS
+gflrHVKYZRkKDDDpX4yHNdnIqrvy4RU=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-key-verify-fail.pem b/mysql-test/std_data/server-key-verify-fail.pem
new file mode 100644
index 00000000000..af1ae1e3ae1
--- /dev/null
+++ b/mysql-test/std_data/server-key-verify-fail.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAvfCda4mh3Nlir1MAlGYdTv33kUDdMRZ1SKdhOAY/v1pNVDgz
+1p4g2UHrCFZc4jyx6H0lrsLqQzOo6BhuAKVaUM8BUlaS0Vh5Zc4vFunOHUpaRLqM
+GRZPTa3sfslxhuKXvGOUlTEvPhQ45QNQMg/rKp0D1UTeiwRK22POPntmbbE+rNsg
+dUl85GfsR7EfimvJLvjf2nqLhe18vfU0nxXTszePdrwaptwSpdi9xQKsufLANDWK
+A/zXtvq1rnaduBhaKp2fSYmznflQn+n+tKUPgB7/obcFIRjvCGKvrFjq+x3gonrD
+7BEIedjSTLo50MlUksfWKqHuyLs/dEEaTHBjswIDAQABAoIBAQCSUyNzDPydXvsf
+hhoUOParPAvU4tuETYDdD9Vdi7Lgf3jDQOjulbNIq/ec3KuBvrBwIrk9APvn+YxO
+AUP9S2Vgi5jBDeDdVgNv4n90b3pSJk2UVQJI8V72wN5Ibnf/KeErSKvWo6V5daq/
+AuZtKsZIdd3WFtA62HuyuBjTGc23Alj1C0EKnN0Rx1uBwDvx/OVQ266Us/x8jJqW
+ZxIOfcvfNzBQEa5hAzbQCReVaC+rBLRAcMM2yGP7aDa+8cRkwuVlSqpX8CXBdLoU
+PqmU49etcW72Rb1AFt9WgEu1Oh9UYbHFSB+FEbO8IGcGBsuYHf9zkxQyjpy/iKyT
+H5dTu7YBAoGBAOWqEGepZVrfB+P6X18n3vbJhgYmF0sa0mCmwkFYgk36yNqsZ8at
+lQjm5mbn4wjEKHIcQ/T1taq73W471M+PxMnn0WTwoG5jsyarZGgy6/95YXiyZtQe
+qgA4P3aKkCteRP22DjG7uxmm9Hoqx8Z31vfRTLAHN1IEHPHHkg/J3gPTAoGBANO4
+aqKeY4vcDvVkvxVbADrw++tZGwA+RuxfO4HKKru59VdA2PsAxhXwb3Dfejwj7hYW
+yE9edHjGpMr1+dpf8YJYs7qjajHe1HxBOYqQGHycIdw+Gv56R4HpaS9eW3x8l/Pi
+b4xnAodv2qIriACOe7br+rll4wKX46Wt64zdvpShAoGAT0r3HQM0Vjp4u/J+qRjX
+9za+yjKuiiS5i9snaG5JlujGHhG2Rrc5pHgsBk17alRnbnZp1BJdZZQ1MFEB+aO2
+mssp1YLqsRJFEU3NfdhO+MaMq6JUtFnd8fN5ndDbU83ZXgtUPUGGqKWm9OL+VHyd
+wLQHmSL0q6F16Ngxirf0qjcCgYEAtSmiJVA+gdhk/FmeoBlkEwtNpM50Kjsf2PaM
+Jrzk4Al5A5Y7lFvPI8q+sOio4XklKsWH1VJPe2EOdZUQnGlocE6SS+u03MN9Mm1l
+XUl7inTXDGwgEQx0z5b4KE4nHlhGdauWI5+pLFbrz8RL9Z32AkneGnIyU2/AnW46
+lijQAMECgYEAmgp/88ndIw49RCtMhYhtXQ87AsEAP6kzXQyKppDkn0os+xI5igIL
+i/UDxB33hx3yjrUZwoGDV9MwlMhZNX5Tf5bwjPmmh1NR6KdEpPt5AkklX4s6uil2
+Bxl1P5l1jl/PbEYtv5LDZKIPANWRzViMSIWqjUWlbdqE7/vjx+Oo+cc=
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/server-key-verify-pass.pem b/mysql-test/std_data/server-key-verify-pass.pem
new file mode 100644
index 00000000000..7ecc44f6d48
--- /dev/null
+++ b/mysql-test/std_data/server-key-verify-pass.pem
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAwJpG1MA3vp66i/APLsJSGZO+Bxwg41AFq7JChfZXhCELAeXs
+RWfCRKNbupnUeJWkFrMYsxnUz6iBInZA8shDIePo6B4MkBDw/xt6xVVvMhBR2+Nj
+tODvegRDxVzTw0bl9zMSPpRm2A48U0v1oVbm+P90qi4wtvBSZhFFyBwNPwPnOYZW
+FytLvmjwKl8RyIwYAeAccR12SqnnJr0dy4V6FZoSZp3bFXymowdu5wynPPzkyB9k
+l2+od50Tw10X8AfwuYvtNOLRLFXiIJGLIXAoC0sg3XlYnlD9qZtxAJg0o5rSxego
+GPxAUnx/iQihVJO+WwOJPAghswXyHjnLCh8IBQIDAQABAoIBAHPQUSc9LkgBSks7
+XuXPE28t1+aOk3gcdkx4NGg5aQaal/PcPea+LaL4WAAs4AZidPjxWLjZn43+1SfT
+09opcbS/Rx3Mc+FtTn0YGQrwBJ0mExMV+K6bU2Ubi2TyHKQfzciHfUEEG5Nve/ba
+hikuCFVRxuVOQRzABcw6NqvNsmlg892lfw6/+RDwMBcz7ocwzmiOUoIxgjyFo9G4
+aJvRmHLij5892H6qveik+A/Xr+8leGQHiQET2wW/F9MFP5ypIT7aeE6remeZH7fG
+f4/Zfei/TE4xK2ElNR/91byzeKIVY4vjtTndAiBuqpfYuICb40MC02LNW5Oe6VN2
+3mQ6EgECgYEA7O4ndBnbs/00gyTGyNg6I+3wRTibhNH4R8RZFJiLfKRKOlUiLhUo
++bQeO4bCQ6YY++TYDvMEXTlA3jow9R9Mj2AWc6bNmQmJd/065QyFHftywT66I+V4
+rz1ohSJyHXcv4DxqNk3o3Vb4N8GFjZKcodSgTv2Lk+9ipDYFcQiZop0CgYEA0BrF
+SIyLTnjoVht/7RbIGEqhMQUiz5mx7qQ1TPB+YTG77G2xXJNg5d6S7WT4LN+cqbxN
+YdndIbW4NdV7bH7FlG9q7jfkuZ+AY2BPU047tcDeyO0HYYEhVY+EyZqHci/26mvt
+JrawdqS5HQS1y/rKfytm7YBGTvqoNZHvOHc6aokCgYEAxcjlbJkte+pyzMuFmiJP
+HrFBczeXM+BoJ9j0GCpjvvAS+vEYsGl/pDvFRSHwx7I/hv/5kTkzOnNSAHGJbwbq
+zYGEHJVxakC43k6pvI2gDnBa0pD/qHmmLnvP5dvkcU6Oy90DOUP+kc9JNJo7V/y8
+/qdWD7q+qwcaTETAdCSexE0CgYA/DN1Y7bwHOnqqHArWOmDFe1b7EyNI4rgWJYpA
+lVy09eyJ5XInKj/hZV3+rujCL723b2XCj89/tx7osJWEeaRDJL6xDh4uXzT25uch
+xkIw/w6Asc/aqtT+p00EB92hqwaUX76qTA+K4r1zHUo3UvSnMu8sZgDnTOpJ0L05
+zmXUgQKBgDT+IFrAzOty4B0mJncTCC/TulpW704bEZwNJfQSdtiBQr/vqoXygBQc
+bHfpncpSfhzHB5lhRUv02TqXgl53D70nM7JD5nx98WYTTBxsbvxPlt4gBRZkfgq5
+tHKclAArc1SbfW5Z8oYyl7h33LQJK116QSyiIIGieH5VXNPwnqUs
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm
index a7c0b2d4ff1..ea07af7376c 100644
--- a/mysql-test/suite.pm
+++ b/mysql-test/suite.pm
@@ -58,7 +58,7 @@ sub skip_combinations {
return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
# eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation
eval { connect $sock, sockaddr_in6(7, Socket::IN6ADDR_LOOPBACK) };
- return $! != 101;
+ return $@ eq "";
}
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
new file mode 100644
index 00000000000..63ff1dcda71
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -0,0 +1,32 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+create table t5 (
+`intcol1` int(32) DEFAULT NULL,
+`intcol2` int(32) DEFAULT NULL,
+`charcol1` varchar(128) DEFAULT NULL,
+`charcol2` varchar(128) DEFAULT NULL,
+`charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+insert into t5 values (1,2,'maria','db','encryption');
+CREATE TABLE `t1` (
+`intcol1` int(32) DEFAULT NULL,
+`intcol2` int(32) DEFAULT NULL,
+`charcol1` varchar(128) DEFAULT NULL,
+`charcol2` varchar(128) DEFAULT NULL,
+`charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB;
+insert into t1 values (1,2,'maria','db','encryption');
+alter table t1 encrypted='yes' `encryption_key_id`=1;
+select * from t1;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+select * from t5;
+ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
+drop table t1;
+drop table t5;
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
new file mode 100644
index 00000000000..42d8008d1aa
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -0,0 +1,92 @@
+-- source include/have_innodb.inc
+# embedded does not support restart
+-- source include/not_embedded.inc
+-- source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+-- source include/not_crashrep.inc
+-- source filekeys_plugin_exists.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+#
+# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
+#
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+# Suppression for builds where file_key_management plugin is linked statically
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys1.txt
+1;770A8A65DA156D24EE2A093277530142
+4;770A8A65DA156D24EE2A093277530143
+EOF
+
+--exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+create table t5 (
+ `intcol1` int(32) DEFAULT NULL,
+ `intcol2` int(32) DEFAULT NULL,
+ `charcol1` varchar(128) DEFAULT NULL,
+ `charcol2` varchar(128) DEFAULT NULL,
+ `charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+insert into t5 values (1,2,'maria','db','encryption');
+
+CREATE TABLE `t1` (
+ `intcol1` int(32) DEFAULT NULL,
+ `intcol2` int(32) DEFAULT NULL,
+ `charcol1` varchar(128) DEFAULT NULL,
+ `charcol2` varchar(128) DEFAULT NULL,
+ `charcol3` varchar(128) DEFAULT NULL
+) ENGINE=InnoDB;
+
+insert into t1 values (1,2,'maria','db','encryption');
+alter table t1 encrypted='yes' `encryption_key_id`=1;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--innodb-encrypt-tables=OFF" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1296
+select * from t1;
+--error 1296
+select * from t5;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+drop table t1;
+drop table t5;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result
index 0b0b39f0abd..4d5d94443f3 100644
--- a/mysql-test/suite/federated/federatedx.result
+++ b/mysql-test/suite/federated/federatedx.result
@@ -2164,6 +2164,12 @@ DROP TABLE federated.t1;
End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
+#
+# MDEV-9346 - The federatedx and spider engine make mysqld crash when
+# they are configured withtout username
+#
+CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
+ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test
index 87ef49e66e8..29d1eaddc26 100644
--- a/mysql-test/suite/federated/federatedx.test
+++ b/mysql-test/suite/federated/federatedx.test
@@ -2001,4 +2001,13 @@ SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection default;
+--echo #
+--echo # MDEV-9346 - The federatedx and spider engine make mysqld crash when
+--echo # they are configured withtout username
+--echo #
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--error ER_CANT_CREATE_FEDERATED_TABLE
+eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
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 66a90f1dc87..e992b79321e 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -363,7 +363,7 @@ def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 N
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
@@ -906,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
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 810157494d9..87eecaf41e9 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
@@ -363,7 +363,7 @@ def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 N
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
@@ -906,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
-3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 1b4ad503b29..53fb95680e9 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -47,7 +47,7 @@ UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
-CREATE_OPTIONS varchar(255) YES NULL
+CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SHOW CREATE TABLE information_schema.TABLES;
Table Create Table
@@ -71,7 +71,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
- `CREATE_OPTIONS` varchar(255) DEFAULT NULL,
+ `CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TABLES;
@@ -95,7 +95,7 @@ UPDATE_TIME datetime YES NULL
CHECK_TIME datetime YES NULL
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
-CREATE_OPTIONS varchar(255) YES NULL
+CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SELECT table_catalog, table_schema, table_name
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 85d8614c91f..9391f97732b 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -27,3 +27,5 @@ galera_ssl_upgrade : TODO: investigate
mysql-wsrep#90 : TODO: investigate
galera_flush : mysql-wsrep/issues/229
galera_transaction_read_only : mysql-wsrep/issues/229
+galera_gcs_fragment : Incorrect arguments to SET
+galera_flush_local : Fails sporadically
diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf
index f9e5be1901e..1dbaad4f699 100644
--- a/mysql-test/suite/galera/galera_2nodes.cnf
+++ b/mysql-test/suite/galera/galera_2nodes.cnf
@@ -17,7 +17,7 @@ wsrep-sync-wait=7
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-cluster-address=gcomm://
-wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
@@ -26,7 +26,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
diff --git a/mysql-test/suite/galera/r/galera_create_function.result b/mysql-test/suite/galera/r/galera_create_function.result
index 10020712286..8e4a823d00f 100644
--- a/mysql-test/suite/galera/r/galera_create_function.result
+++ b/mysql-test/suite/galera/r/galera_create_function.result
@@ -24,6 +24,9 @@ f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTIO
MODIFIES SQL DATA
COMMENT 'f1_comment'
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT 1 FROM DUAL;
+1
+1
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1
diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result
index a0fe1b622e6..6879ecf67fc 100644
--- a/mysql-test/suite/galera/r/galera_defaults.result
+++ b/mysql-test/suite/galera/r/galera_defaults.result
@@ -50,7 +50,7 @@ WSREP_SST_DONOR
WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync
WSREP_SYNC_WAIT 7
-<BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
+<BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
diff --git a/mysql-test/suite/galera/r/galera_flush.result b/mysql-test/suite/galera/r/galera_flush.result
index 8ff32fdfff4..71226432eda 100644
--- a/mysql-test/suite/galera/r/galera_flush.result
+++ b/mysql-test/suite/galera/r/galera_flush.result
@@ -1,3 +1,4 @@
+DROP TABLE IF EXISTS t1, t2;
FLUSH DES_KEY_FILE;
wsrep_last_committed_diff
1
@@ -26,6 +27,37 @@ CREATE TABLE t2 (f1 INTEGER);
FLUSH TABLES t2;
wsrep_last_committed_diff
1
+FLUSH ERROR LOGS;
+wsrep_last_committed_diff
+1
+FLUSH SLOW LOGS;
+wsrep_last_committed_diff
+1
+FLUSH GENERAL LOGS;
+wsrep_last_committed_diff
+1
+FLUSH ENGINE LOGS;
+wsrep_last_committed_diff
+1
+FLUSH RELAY LOGS;
+wsrep_last_committed_diff
+1
+SET @userstat_old= @@userstat;
+SET GLOBAL userstat=ON;
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+wsrep_last_committed_diff
+1
+SET @old_thread_statistics= @@global.thread_statistics;
+SET GLOBAL thread_statistics= ON;
+FLUSH THREAD_STATISTICS;
+wsrep_last_committed_diff
+1
+FLUSH CHANGED_PAGE_BITMAPS;
+wsrep_last_committed_diff
+1
CREATE TABLE t1 (f1 INTEGER);
FLUSH LOGS;
FLUSH TABLES WITH READ LOCK;
@@ -52,3 +84,5 @@ wsrep_last_committed_diff
1
DROP TABLE t1;
DROP TABLE t2;
+SET GLOBAL userstat= @userstat_old;
+SET GLOBAL thread_statistics= @old_thread_statistics;
diff --git a/mysql-test/suite/galera/r/galera_flush_local.result b/mysql-test/suite/galera/r/galera_flush_local.result
new file mode 100644
index 00000000000..3fdd541b513
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_flush_local.result
@@ -0,0 +1,145 @@
+DROP TABLE IF EXISTS t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+FLUSH LOCAL DES_KEY_FILE;
+FLUSH LOCAL HOSTS;
+FLUSH LOCAL QUERY CACHE;
+FLUSH LOCAL STATUS;
+FLUSH LOCAL PRIVILEGES;
+FLUSH LOCAL USER_RESOURCES;
+FLUSH LOCAL TABLES;
+FLUSH LOCAL TABLES t2;
+FLUSH LOCAL ERROR LOGS;
+FLUSH LOCAL SLOW LOGS;
+FLUSH LOCAL GENERAL LOGS;
+FLUSH LOCAL ENGINE LOGS;
+FLUSH LOCAL RELAY LOGS;
+FLUSH LOCAL CLIENT_STATISTICS;
+FLUSH LOCAL INDEX_STATISTICS;
+FLUSH LOCAL TABLE_STATISTICS;
+FLUSH LOCAL USER_STATISTICS;
+FLUSH LOCAL LOGS;
+FLUSH LOCAL BINARY LOGS;
+FLUSH LOCAL TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+FLUSH LOCAL TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1;
+ANALYZE LOCAL TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+OPTIMIZE LOCAL TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+REPAIR LOCAL TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+wsrep_last_committed_diff
+1
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+DROP TABLE t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+set wsrep_on=0;
+FLUSH DES_KEY_FILE;
+FLUSH HOSTS;
+FLUSH QUERY CACHE;
+FLUSH STATUS;
+FLUSH PRIVILEGES;
+FLUSH USER_RESOURCES;
+FLUSH TABLES;
+FLUSH TABLES t2;
+FLUSH ERROR LOGS;
+FLUSH SLOW LOGS;
+FLUSH GENERAL LOGS;
+FLUSH ENGINE LOGS;
+FLUSH RELAY LOGS;
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+FLUSH LOGS;
+FLUSH BINARY LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+FLUSH TABLES t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+FLUSH TABLES t1;
+ANALYZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+OPTIMIZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+REPAIR TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+wsrep_last_committed_diff
+1
+wsrep_last_committed_diff2
+1
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+set wsrep_on=1;
+DROP TABLE t1, t2, x1, x2;
diff --git a/mysql-test/suite/galera/r/galera_ftwrl_drain.result b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
index a4879838d11..d704699925b 100644
--- a/mysql-test/suite/galera/r/galera_ftwrl_drain.result
+++ b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
@@ -2,6 +2,8 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
diff --git a/mysql-test/suite/galera/r/galera_gcs_fragment.result b/mysql-test/suite/galera/r/galera_gcs_fragment.result
new file mode 100644
index 00000000000..0c9c1819f60
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gcs_fragment.result
@@ -0,0 +1,24 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
+SET GLOBAL wsrep_cluster_address='';
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
+SET SESSION wsrep_retry_autocommit=0;
+INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+SELECT * FROM t1;
+f1 f2
+2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+SELECT * FROM t1;
+f1 f2
+2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result
index 6411a1e3043..4772f347375 100644
--- a/mysql-test/suite/galera/r/galera_log_bin.result
+++ b/mysql-test/suite/galera/r/galera_log_bin.result
@@ -16,19 +16,19 @@ Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000002 # Gtid # # GTID 0-1-1
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2
-mysqld-bin.000002 # Table_map # # table_id: 48 (test.t1)
-mysqld-bin.000002 # Write_rows_v1 # # table_id: 48 flags: STMT_END_F
-mysqld-bin.000002 # Xid # # COMMIT /* xid=2 */
+mysqld-bin.000002 # Table_map # # table_id: # (test.t1)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-3
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4
-mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
-mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
-mysqld-bin.000002 # Xid # # COMMIT /* xid=4 */
+mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
-mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
-mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
-mysqld-bin.000002 # Xid # # COMMIT /* xid=5 */
+mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-6
mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
@@ -39,20 +39,21 @@ Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000003 # Gtid # # GTID 0-1-1
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2
-mysqld-bin.000003 # Table_map # # table_id: 30 (test.t1)
-mysqld-bin.000003 # Write_rows_v1 # # table_id: 30 flags: STMT_END_F
-mysqld-bin.000003 # Xid # # COMMIT /* xid=2 */
+mysqld-bin.000003 # Table_map # # table_id: # (test.t1)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # GTID 0-1-3
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4
-mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
-mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
-mysqld-bin.000003 # Xid # # COMMIT /* xid=4 */
+mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
-mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
-mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
-mysqld-bin.000003 # Xid # # COMMIT /* xid=5 */
+mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # GTID 0-1-6
mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
DROP TABLE t1;
DROP TABLE t2;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_mdl_race.result b/mysql-test/suite/galera/r/galera_mdl_race.result
new file mode 100644
index 00000000000..535f20de7f1
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_mdl_race.result
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+LOCK TABLE t2 WRITE;
+SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SELECT * FROM t2;;
+SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
+UNLOCK TABLES;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+COUNT(*) = 1
+1
+DROP TABLE t1;
+DROP TABLE t2;
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result b/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
new file mode 100644
index 00000000000..856abbb43be
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
@@ -0,0 +1,58 @@
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1;
+MAX(id)
+1
+INSERT INTO t1 VALUES (2);
+SELECT MAX(id) FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+FLUSH QUERY CACHE;
+SET SESSION wsrep_sync_wait = 7;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "RESET";
+INSERT INTO t1 VALUES (3);
+SELECT MAX(id) FROM t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+INSERT INTO t1 VALUES (4);
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1;
+MAX(id)
+4
+SET SESSION wsrep_sync_wait = 7;
+FLUSH STATUS;
+SELECT MAX(id) FROM t1;
+MAX(id)
+4
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+INSERT INTO t1 VALUES (5);
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1 ;
+SET GLOBAL DEBUG = "";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+MAX(id)
+5
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+VARIABLE_VALUE = 1
+1
diff --git a/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result b/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
new file mode 100644
index 00000000000..62e327ffdee
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_desync=0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+SET wsrep_OSU_method=RSU;
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
+SET GLOBAL wsrep_desync=1;
+ERROR HY000: Operation 'desync' failed for SET GLOBAL wsrep_desync=1
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL,
+ `f2` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+CALL mtr.add_suppression("Protocol violation");
+CALL mtr.add_suppression("desync failed");
+CALL mtr.add_suppression("Protocol violation");
diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
index 93557cc91d4..7d30b356aa9 100644
--- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
@@ -104,3 +104,5 @@ CALL mtr.add_suppression("Can't open and lock privilege tables");
CALL mtr.add_suppression("Info table is not ready to be used");
CALL mtr.add_suppression("Native table .* has the wrong structure");
DROP USER sslsst;
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-test/suite/galera/r/galera_sync_wait_show.result
new file mode 100644
index 00000000000..c719aaab5d8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sync_wait_show.result
@@ -0,0 +1,39 @@
+SET SESSION wsrep_sync_wait = 1;
+CREATE DATABASE db1;
+SHOW CREATE DATABASE db1;
+Database Create Database
+db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */
+DROP DATABASE db1;
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 FROM DUAL latin1 latin1_swedish_ci latin1_swedish_ci
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+SHOW PROCEDURE CODE p1;
+Pos Instruction
+0 stmt 0 "SELECT 1 FROM DUAL"
+DROP PROCEDURE p1;
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP FUNCTION f1;
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+SHOW FUNCTION CODE f1;
+Pos Instruction
+0 freturn 3 123
+DROP FUNCTION f1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
+SHOW CREATE TRIGGER tr1;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
+DROP TABLE t1;
+CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
+SHOW CREATE EVENT event1;
+Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
+event1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP EVENT event1;
diff --git a/mysql-test/suite/galera/r/galera_transaction_replay.result b/mysql-test/suite/galera/r/galera_transaction_replay.result
index 54ea8db699d..bfafa506fe6 100644
--- a/mysql-test/suite/galera/r/galera_transaction_replay.result
+++ b/mysql-test/suite/galera/r/galera_transaction_replay.result
@@ -10,6 +10,8 @@ f1 f2
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
COMMIT;;
SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#198.result b/mysql-test/suite/galera/r/mysql-wsrep#198.result
new file mode 100644
index 00000000000..25ba2cb615c
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#198.result
@@ -0,0 +1,18 @@
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+LOCK TABLE t2 WRITE;
+OPTIMIZE TABLE t1,t2;;
+REPAIR TABLE t1,t2;;
+SET SESSION wsrep_sync_wait = 0;
+INSERT INTO t2 VALUES (1);
+UNLOCK TABLES;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+Table Op Msg_type Msg_text
+test.t1 repair note The storage engine for the table doesn't support repair
+test.t2 repair note The storage engine for the table doesn't support repair
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#201.result b/mysql-test/suite/galera/r/mysql-wsrep#201.result
new file mode 100644
index 00000000000..1c0998e35ac
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#201.result
@@ -0,0 +1,4 @@
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (DEFAULT);
+SET GLOBAL query_cache_size=1355776;
+SET SESSION wsrep_sync_wait = 7;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#237.result b/mysql-test/suite/galera/r/mysql-wsrep#237.result
new file mode 100644
index 00000000000..3fd9aed1480
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#237.result
@@ -0,0 +1,10 @@
+CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
+INSERT INTO t values (1);;
+SET SESSION wsrep_sync_wait = 0;
+FLUSH TABLES;
+SELECT SLEEP(1);
+SLEEP(1)
+0
+SET DEBUG_SYNC= 'now SIGNAL continue';
+DROP TABLE t;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#247.result b/mysql-test/suite/galera/r/mysql-wsrep#247.result
new file mode 100644
index 00000000000..1b00f511f03
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#247.result
@@ -0,0 +1,11 @@
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+CREATE TABLE t1 (i int primary key);
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync ON
+SET GLOBAL wsrep_desync=0;
+DROP TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+Variable_name Value
+wsrep_desync OFF
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#31.result b/mysql-test/suite/galera/r/mysql-wsrep#31.result
new file mode 100644
index 00000000000..a21bb3eccfd
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#31.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES('test');
+CREATE DATABASE db;
+Shutting down server 2 ...
+Recovering server 2 ...
+Performing --wsrep-recover ...
+Restarting server ...
+Using --wsrep-start-position when starting mysqld ...
+DROP TABLE t1;
+DROP DATABASE db;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
index b7b656383fd..5914e52d851 100644
--- a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
+++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
@@ -26,6 +26,7 @@ SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
--connection node_2
+--sleep 1
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_create_function.test b/mysql-test/suite/galera/t/galera_create_function.test
index fd4903a7b83..0d7cec0114f 100644
--- a/mysql-test/suite/galera/t/galera_create_function.test
+++ b/mysql-test/suite/galera/t/galera_create_function.test
@@ -33,6 +33,8 @@ RETURN 123;
SHOW CREATE FUNCTION f1;
--connection node_2
+# Work around codership/mysql-wsrep#228 - SHOW CREATE FUNCTION not covered by wsrep_sync_wait
+SELECT 1 FROM DUAL;
SHOW CREATE FUNCTION f1;
--connection node_1
@@ -49,9 +51,3 @@ DROP FUNCTION f1;
DROP FUNCTION f2;
DROP USER 'user1';
-
-
-
-
-
-
diff --git a/mysql-test/suite/galera/t/galera_flush.test b/mysql-test/suite/galera/t/galera_flush.test
index 3ba5edbae6f..77e95f62fda 100644
--- a/mysql-test/suite/galera/t/galera_flush.test
+++ b/mysql-test/suite/galera/t/galera_flush.test
@@ -7,6 +7,9 @@
--source include/have_perfschema.inc
--source include/have_query_cache.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
#
# The following FLUSH statements should be replicated
#
@@ -101,6 +104,101 @@ FLUSH TABLES t2;
--enable_query_log
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH ERROR LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH SLOW LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH GENERAL LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH ENGINE LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH RELAY LOGS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+--connection node_1
+SET @userstat_old= @@userstat;
+SET GLOBAL userstat=ON;
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 4 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_1
+SET @old_thread_statistics= @@global.thread_statistics;
+SET GLOBAL thread_statistics= ON;
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH THREAD_STATISTICS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH CHANGED_PAGE_BITMAPS;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+
#
# The following statements should not be replicated: FLUSH LOGS, FLUSH TABLES WITH LOCKS
#
@@ -171,3 +269,5 @@ FLUSH TABLES t1;
--connection node_1
DROP TABLE t1;
DROP TABLE t2;
+SET GLOBAL userstat= @userstat_old;
+SET GLOBAL thread_statistics= @old_thread_statistics;
diff --git a/mysql-test/suite/galera/t/galera_flush_local.opt b/mysql-test/suite/galera/t/galera_flush_local.opt
new file mode 100644
index 00000000000..45a0ca24dc7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush_local.opt
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1000000 --userstat=1 --wsrep_replicate_myisam=true
diff --git a/mysql-test/suite/galera/t/galera_flush_local.test b/mysql-test/suite/galera/t/galera_flush_local.test
new file mode 100644
index 00000000000..768f4ea4f1b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush_local.test
@@ -0,0 +1,142 @@
+#
+# Test that various FLUSH LOCAL commands are replicated. Whenever possible, check the slave for the effects.
+# PXC-391
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, x1, x2;
+--enable_warnings
+#
+# The following FLUSH LOCAL statements should *not* be replicated
+#
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+FLUSH LOCAL DES_KEY_FILE;
+FLUSH LOCAL HOSTS;
+FLUSH LOCAL QUERY CACHE;
+FLUSH LOCAL STATUS;
+FLUSH LOCAL PRIVILEGES;
+FLUSH LOCAL USER_RESOURCES;
+FLUSH LOCAL TABLES;
+FLUSH LOCAL TABLES t2;
+FLUSH LOCAL ERROR LOGS;
+FLUSH LOCAL SLOW LOGS;
+FLUSH LOCAL GENERAL LOGS;
+FLUSH LOCAL ENGINE LOGS;
+FLUSH LOCAL RELAY LOGS;
+FLUSH LOCAL CLIENT_STATISTICS;
+FLUSH LOCAL INDEX_STATISTICS;
+FLUSH LOCAL TABLE_STATISTICS;
+FLUSH LOCAL USER_STATISTICS;
+FLUSH LOCAL LOGS;
+FLUSH LOCAL BINARY LOGS;
+FLUSH LOCAL TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH LOCAL TABLES t1;
+UNLOCK TABLES;
+FLUSH LOCAL TABLES t1;
+ANALYZE LOCAL TABLE t1, t2;
+OPTIMIZE LOCAL TABLE t1, t2;
+REPAIR LOCAL TABLE x1, x2;
+--connection node_2
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff;
+--enable_query_log
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+
+--connection node_1
+DROP TABLE t1, t2, x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+
+--connection node_2
+--let $wsrep_last_committed_before2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--connection node_1
+set wsrep_on=0;
+FLUSH DES_KEY_FILE;
+FLUSH HOSTS;
+FLUSH QUERY CACHE;
+FLUSH STATUS;
+FLUSH PRIVILEGES;
+FLUSH USER_RESOURCES;
+FLUSH TABLES;
+FLUSH TABLES t2;
+FLUSH ERROR LOGS;
+FLUSH SLOW LOGS;
+FLUSH GENERAL LOGS;
+FLUSH ENGINE LOGS;
+FLUSH RELAY LOGS;
+FLUSH CLIENT_STATISTICS;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+FLUSH USER_STATISTICS;
+FLUSH LOGS;
+FLUSH BINARY LOGS;
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 WITH READ LOCK;
+UNLOCK TABLES;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+LOCK TABLES t1 WRITE;
+FLUSH TABLES t1;
+UNLOCK TABLES;
+LOCK TABLES t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES t1;
+UNLOCK TABLES;
+FLUSH TABLES t1;
+ANALYZE TABLE t1, t2;
+OPTIMIZE TABLE t1, t2;
+REPAIR TABLE x1, x2;
+--connection node_2
+--let $wsrep_last_committed_after2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before2 AS wsrep_last_committed_diff;
+--eval SELECT $wsrep_last_committed_after2 = $wsrep_last_committed_before + 9 AS wsrep_last_committed_diff2;
+--enable_query_log
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+--connection node_1
+set wsrep_on=1;
+DROP TABLE t1, t2, x1, x2;
diff --git a/mysql-test/suite/galera/t/galera_ftwrl_drain.test b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
index f022a9437c2..690e890cdea 100644
--- a/mysql-test/suite/galera/t/galera_ftwrl_drain.test
+++ b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
@@ -18,7 +18,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
--connection node_2
-SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_set_sync_point.inc
--connection node_1
INSERT INTO t1 VALUES (1);
@@ -27,8 +29,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
# Wait until applier has blocked
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_slave_enter_sync'
---source include/wait_condition.inc
+--source include/galera_wait_sync_point.inc
SELECT COUNT(*) = 0 FROM t1;
@@ -41,8 +42,8 @@ SELECT COUNT(*) = 0 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Init' AND INFO = 'FLUSH TABLES WITH READ LOCK'
--source include/wait_condition.inc
-SET GLOBAL wsrep_provider_options = 'dbug=';
-SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
--connection node_2a
--reap
diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.cnf b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf
new file mode 100644
index 00000000000..aae3fee5904
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64'
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64'
diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.test b/mysql-test/suite/galera/t/galera_gcs_fragment.test
new file mode 100644
index 00000000000..ae1e0d8bab0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_fragment.test
@@ -0,0 +1,66 @@
+# Test fragmentation over configuration changes
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Prepare table
+CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
+
+# Stop node2
+
+# Disconnect node_2 from group
+--connection node_2
+--let $wsrep_cluster_address_orig = `select @@wsrep_cluster_address`
+SET GLOBAL wsrep_cluster_address='';
+
+# Connection for sync points
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET SESSION wsrep_sync_wait=0;
+
+# Set breakpoint in gcs after first fragment send
+
+--let $galera_sync_point = gcs_core_after_frag_send
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit=0;
+--send INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+
+--connection node_1a
+--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+
+# Restart node_2, wait until it joins the group and then make INSERT
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'
+--enable_query_log
+SET SESSION wsrep_on = 0;
+--source include/galera_wait_ready.inc
+SET SESSION wsrep_on = 1;
+
+INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+# Signal node_1 to continue
+--connection node_1a
+--source include/galera_signal_sync_point.inc
+
+# Deadlock error should be returned since write set send was
+# interrupted by gcs
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+# Do additional insert to verify that node_1 remain operational
+INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+
+# Nodes node_1 and node_2 should now contain rows 2 and 3
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
index 69446f0f86a..eae28bdbcd7 100644
--- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
@@ -27,7 +27,9 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
--connection node_2
# Make sure IST will block ...
-SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
+--let $galera_sync_point = recv_IST_after_apply_trx
+--source include/galera_set_sync_point.inc
+
SET SESSION wsrep_sync_wait = 0;
diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test
index e36bd7e6025..d2d3987d711 100644
--- a/mysql-test/suite/galera/t/galera_log_bin.test
+++ b/mysql-test/suite/galera/t/galera_log_bin.test
@@ -23,13 +23,17 @@ ALTER TABLE t1 ADD COLUMN f2 INTEGER;
FLUSH LOGS;
--replace_column 2 # 4 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,18;
--connection node_2
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--replace_column 2 # 4 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,18;
DROP TABLE t1;
DROP TABLE t2;
+--connection node_1
+RESET MASTER;
diff --git a/mysql-test/suite/galera/t/galera_mdl_race.test b/mysql-test/suite/galera/t/galera_mdl_race.test
new file mode 100644
index 00000000000..508b85add4b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_mdl_race.test
@@ -0,0 +1,79 @@
+#
+# This test tests a potential race condition in MDL locking
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+
+# block access to t2
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+LOCK TABLE t2 WRITE;
+
+# Block before MLD lock wait
+--connection node_1
+ SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
+--send SELECT * FROM t2;
+
+# Wait for SELECT to be blocked
+--connection node_1a
+#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIS WHERE STATE = 'System lock';
+#--source include/wait_condition.inc
+#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+#--source include/wait_condition.inc
+
+# block applier to wait after BF victim is locked
+SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
+
+--sleep 3
+
+# Unblock the SELECT, to enter wsrep_thd_is_BF
+--connection node_1a
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
+
+--sleep 3
+
+# unblock applier to try to BF the SELECT
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
+
+
+# table lock is not needed anymore
+--sleep 3
+UNLOCK TABLES;
+
+# SELECT succeeds
+--connection node_1
+
+--error ER_LOCK_DEADLOCK
+--reap
+
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--connection node_1a
+SET DEBUG_SYNC = "RESET";
+
diff --git a/mysql-test/suite/galera/t/galera_query_cache-master.opt b/mysql-test/suite/galera/t/galera_query_cache-master.opt
index cb983993b91..915a36c0937 100644
--- a/mysql-test/suite/galera/t/galera_query_cache-master.opt
+++ b/mysql-test/suite/galera/t/galera_query_cache-master.opt
@@ -1,3 +1 @@
--query_cache_type=1 --query_cache_size=1355776
-
-
diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt b/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
new file mode 100644
index 00000000000..915a36c0937
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt
@@ -0,0 +1 @@
+--query_cache_type=1 --query_cache_size=1355776
diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
new file mode 100644
index 00000000000..6b14118d5fc
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
@@ -0,0 +1,94 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/have_query_cache.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1; # first lookup miss
+
+#
+# Query cache hit, wait timeout
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (2);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT MAX(id) FROM t1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+FLUSH QUERY CACHE;
+SET SESSION wsrep_sync_wait = 7;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+SET DEBUG_SYNC = "RESET";
+
+#
+# Query cache miss, wait timeout
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT MAX(id) FROM t1;
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+#
+# Query cache miss
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (4);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 7;
+SELECT MAX(id) FROM t1;
+SET SESSION wsrep_sync_wait = 7;
+
+#
+# Query cache hit
+#
+
+FLUSH STATUS;
+SELECT MAX(id) FROM t1;
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+
+#
+# Query cache invalidated
+#
+
+--connection node_1
+INSERT INTO t1 VALUES (5);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 7;
+--send SELECT MAX(id) FROM t1
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+--connection node_2
+--reap
+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
+
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
+DROP TABLE t1;
+
+--connection node_2a
+SET DEBUG_SYNC = "RESET";
diff --git a/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
new file mode 100644
index 00000000000..36ec8563cbe
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test
@@ -0,0 +1,78 @@
+#
+# Test manipulating wsrep_desync while an RSU operation is in progress
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+# First, test wsrep_desync 1 > 0 during DDL
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=1;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_desync=0;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SHOW CREATE TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+SET wsrep_OSU_method=TOI;
+
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+
+# Next, test wsrep_desync 0 > 1 during DDL, currently not allowed
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync=0;
+SET wsrep_OSU_method=RSU;
+
+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_1a
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: alter_table_before_open_tables'
+--source include/wait_condition.inc
+
+# This transition is currently not allowed
+--error ER_CANNOT_USER
+SET GLOBAL wsrep_desync=1;
+SET GLOBAL wsrep_desync=0;
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+SHOW CREATE TABLE t1;
+
+# Restore old state
+SET wsrep_OSU_method=TOI;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+
+CALL mtr.add_suppression("Protocol violation");
+CALL mtr.add_suppression("desync failed");
+
+--connection node_2
+CALL mtr.add_suppression("Protocol violation");
+
+
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
index 0b3edeb75ff..c813e04169f 100644
--- a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
@@ -20,3 +20,10 @@ SET GLOBAL wsrep_sst_auth = 'sslsst:';
--source suite/galera/include/galera_sst_restore.inc
DROP USER sslsst;
+
+--connection node_2
+# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
+# Otherwise MTR's check_testcases complains
+
+SET GLOBAL general_log = ON;
+SET GLOBAL slow_query_log = ON;
diff --git a/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-test/suite/galera/t/galera_sync_wait_show.test
new file mode 100644
index 00000000000..0d0207a2ebe
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sync_wait_show.test
@@ -0,0 +1,68 @@
+#
+# Test that the various SHOW commands obey wsrep_sync_wait - codership/mysql-wsrep#228
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 1;
+
+
+--connection node_1
+CREATE DATABASE db1;
+
+--connection node_2
+SHOW CREATE DATABASE db1;
+DROP DATABASE db1;
+
+
+--connection node_1
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+
+--connection node_2
+SHOW CREATE PROCEDURE p1;
+DROP PROCEDURE p1;
+
+
+
+--connection node_1
+CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
+
+--connection node_2
+SHOW PROCEDURE CODE p1;
+DROP PROCEDURE p1;
+
+
+
+--connection node_1
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+
+--connection node_2
+SHOW CREATE FUNCTION f1;
+DROP FUNCTION f1;
+
+
+--connection node_1
+CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
+
+--connection node_2
+SHOW FUNCTION CODE f1;
+DROP FUNCTION f1;
+
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
+
+--connection node_2
+SHOW CREATE TRIGGER tr1;
+DROP TABLE t1;
+
+
+--connection node_1
+CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
+
+--connection node_2
+SHOW CREATE EVENT event1;
+DROP EVENT event1;
diff --git a/mysql-test/suite/galera/t/galera_transaction_replay.test b/mysql-test/suite/galera/t/galera_transaction_replay.test
index 632aa5cc0d5..bd5288a51c6 100644
--- a/mysql-test/suite/galera/t/galera_transaction_replay.test
+++ b/mysql-test/suite/galera/t/galera_transaction_replay.test
@@ -23,7 +23,8 @@ SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
# Block the commit
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
-SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
--connection node_1
--send COMMIT;
@@ -31,8 +32,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
# Wait until commit is blocked
--connection node_1a
SET SESSION wsrep_sync_wait = 0;
---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'commit_monitor_enter_sync'
---source include/wait_condition.inc
+--source include/galera_wait_sync_point.inc
# Issue a conflicting update on node #2
--connection node_2
@@ -48,8 +48,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
# Unblock the commit
--connection node_1a
-SET GLOBAL wsrep_provider_options = 'dbug=';
-SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
# Commit succeeds
--connection node_1
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#198.test b/mysql-test/suite/galera/t/mysql-wsrep#198.test
new file mode 100644
index 00000000000..2b05c4ff4d9
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#198.test
@@ -0,0 +1,36 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+
+--connection node_2
+LOCK TABLE t2 WRITE;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--send OPTIMIZE TABLE t1,t2;
+
+--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2b
+--send REPAIR TABLE t1,t2;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock'
+--source include/wait_condition.inc
+
+--connection node_1
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+UNLOCK TABLES;
+
+--connection node_2a
+--reap
+
+--connection node_2b
+--reap
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt b/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
new file mode 100644
index 00000000000..a00258bc48c
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt
@@ -0,0 +1 @@
+--query_cache_type=1
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201.test b/mysql-test/suite/galera/t/mysql-wsrep#201.test
new file mode 100644
index 00000000000..e9327540195
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#201.test
@@ -0,0 +1,33 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_query_cache.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (DEFAULT);
+
+--connection node_2
+--let $qcache_size_orig = `SELECT @@GLOBAL.query_cache_size`
+SET GLOBAL query_cache_size=1355776;
+SET SESSION wsrep_sync_wait = 7;
+
+--disable_query_log
+
+--let $count = 500
+while ($count)
+{
+ --connection node_1
+ INSERT INTO t1 VALUES (DEFAULT);
+ --let $val1 = `SELECT LAST_INSERT_ID()`
+ --connection node_2
+ --let $val2 = `SELECT MAX(id) FROM t1`
+ --let $val3 = `SELECT $val1 != $val2`
+ if ($val3)
+ {
+ --echo $val1 $val2
+ --die wsrep_sync_wait failed
+ }
+ --dec $count
+}
+
+--eval SET GLOBAL query_cache_size = $qcache_size_orig
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#237.test b/mysql-test/suite/galera/t/mysql-wsrep#237.test
new file mode 100644
index 00000000000..7a65cb52ae9
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#237.test
@@ -0,0 +1,31 @@
+# hang because of replicated FLUSH TABLE command
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+SET DEBUG_SYNC = 'wsrep_before_replication WAIT_FOR continue';
+--send INSERT INTO t values (1);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: wsrep_before_replication'
+--source include/wait_condition.inc
+
+--connection node_2
+FLUSH TABLES;
+
+
+--connection node_1a
+SELECT SLEEP(1);
+
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--connection node_1
+--reap
+
+DROP TABLE t;
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#247.test b/mysql-test/suite/galera/t/mysql-wsrep#247.test
new file mode 100644
index 00000000000..8bcd58607a1
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#247.test
@@ -0,0 +1,23 @@
+#
+# codership/mysql-wsrep/247 MW-246 -
+# DDL with RSU fails if node is desynced upfont
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+SET GLOBAL wsrep_desync=1;
+
+SET wsrep_OSU_method=RSU;
+
+CREATE TABLE t1 (i int primary key);
+
+SHOW VARIABLES LIKE 'wsrep_desync';
+
+SET GLOBAL wsrep_desync=0;
+--sleep 1
+DROP TABLE t1;
+SHOW VARIABLES LIKE 'wsrep_desync';
+
diff --git a/mysql-test/suite/galera/t/mysql-wsrep#31.test b/mysql-test/suite/galera/t/mysql-wsrep#31.test
new file mode 100644
index 00000000000..eaace5d50dd
--- /dev/null
+++ b/mysql-test/suite/galera/t/mysql-wsrep#31.test
@@ -0,0 +1,39 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES('test');
+CREATE DATABASE db;
+
+--connection node_2
+--let $expected_position_uuid = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
+--let $expected_position_seqno = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--let $expected_position = $expected_position_uuid:$expected_position_seqno
+
+--echo Shutting down server 2 ...
+--source include/shutdown_mysqld.inc
+
+--echo Recovering server 2 ...
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+if ($galera_wsrep_start_position != $expected_position)
+{
+ die(Expected position: $expected_position, found $galera_wsrep_start_position);
+}
+
+--echo Restarting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+--source include/wait_until_ready.inc
+
+--connection node_1
+DROP TABLE t1;
+DROP DATABASE db;
+
+
diff --git a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
index 1ecea5db5ab..6c66bf4a891 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
@@ -16,8 +16,8 @@ CREATE TABLE t2 (f1 LONGTEXT);
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
-SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
SELECT COUNT(*) = 30 FROM t1;
COUNT(*) = 30
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
index 0668c246624..7d8bbb39e35 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
@@ -38,7 +38,8 @@ INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
INSERT INTO t1 VALUES (21), (22), (23), (24), (25);
# Make sure IST will block ...
-SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers';
+--let $galera_sync_point = ist_sender_send_after_get_buffers
+--source include/galera_set_sync_point.inc
# ... and restart providers to force IST
--connection node_2
@@ -70,8 +71,8 @@ INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024));
# Unlock IST and wait for it to complete
-SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
-SET GLOBAL wsrep_provider_options = 'dbug=';
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
diff --git a/mysql-test/suite/innodb/r/innodb-alter-filewrite.result b/mysql-test/suite/innodb/r/innodb-alter-filewrite.result
deleted file mode 100644
index 444b09ad440..00000000000
--- a/mysql-test/suite/innodb/r/innodb-alter-filewrite.result
+++ /dev/null
@@ -1,30 +0,0 @@
-CREATE TABLE `test_wo_keys` (
-`f01` int AUTO_INCREMENT,
-`f02` bigint, `f03` bigint, `f04` enum('a','b'),
-`f05` date, `f06` int, `f07` int, `f08` double, `f09` int,
-`f10` bigint, `f11` double, `f12` enum('a','b','c','d','e'),
-`f13` int, `f14` int, `f15` varchar(255), `f16` int, `f17` int, `f18` int,
-`f19` double, `f20` double, `f21` double, `f22` double, `f23` double, `f24` tinyint,
-`f25` double, `f26` double, `f27` double, `f28` double, `f29` int unsigned,
-`f30` int unsigned, `f31` bigint, `f32` int unsigned, `f33` bigint,
-`f34` int unsigned, `f35` int unsigned,
-PRIMARY KEY `f01` (`f01`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-show status like '%merge_buffers%';
-Variable_name Value
-Innodb_os_merge_buffers_written 0
-Innodb_os_merge_buffers_read 0
-Innodb_os_merge_buffers_merged 0
-ALTER TABLE test_wo_keys
-ADD KEY `f06` (`f06`), ADD KEY `f05` (`f05`), ADD KEY `f04` (`f04`), ADD KEY `f23` (`f23`),
-ADD KEY `f10` (`f10`), ADD KEY `f11` (`f11`), ADD KEY `f09` (`f09`), ADD KEY `f22` (`f22`),
-ADD KEY `f21` (`f21`), ADD KEY `f07` (`f07`), ADD KEY `f08` (`f08`), ADD KEY `f18` (`f18`),
-ADD KEY `f19` (`f19`), ADD KEY `f20` (`f20`), ADD KEY `f29` (`f29`,`f31`,`f33`),
-ADD KEY `f35` (`f35`), ADD KEY `f25` (`f25`), ADD KEY `f26` (`f26`),
-ADD KEY `f27` (`f27`), ADD KEY `f28` (`f28`);
-show status like '%merge_buffers%';
-Variable_name Value
-Innodb_os_merge_buffers_written 0
-Innodb_os_merge_buffers_read 0
-Innodb_os_merge_buffers_merged 0
-DROP TABLE test_wo_keys;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-table.result b/mysql-test/suite/innodb/r/innodb-alter-table.result
index 2c76a2640e0..514b8b7935f 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-table.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-table.result
@@ -43,3 +43,95 @@ KEY `mdl_courmodu_gro_ix` (`groupingid`)
# Inserting 2701 rows into the table...
ALTER TABLE moodle19.mdl_course_modules ADD stefantest LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci AFTER showdescription;
drop database moodle19;
+use test;
+CREATE TABLE `w_findispmon05u` (
+`atpkey` INT(11) NOT NULL DEFAULT '0',
+`atzo05` INT(11) NULL DEFAULT NULL,
+`pos` BIGINT(21) NULL DEFAULT NULL,
+`f5BnvB` INT(9) NULL DEFAULT NULL,
+`f5atbvb` INT(11) NULL DEFAULT NULL,
+`f5atbwmg` INT(11) NULL DEFAULT NULL,
+`f5pBneu` BIGINT(12) NULL DEFAULT NULL,
+`atbwdt` INT(11) NULL DEFAULT NULL,
+`atbwzt` INT(11) NULL DEFAULT NULL,
+`atbart` VARCHAR(10) NULL DEFAULT NULL
+)
+COLLATE='utf8_general_ci'
+ENGINE=InnoDB;
+ALTER TABLE `w_findispmon05u`
+CHANGE COLUMN `atpkey` `f5atpkey` INT(11) NOT NULL DEFAULT '0' FIRST,
+CHANGE COLUMN `atzo05` `f5atzo05` INT(11) NULL DEFAULT NULL AFTER `f5atpkey`,
+CHANGE COLUMN `atbwdt` `f5atbwdt` INT(11) NULL DEFAULT NULL AFTER `f5pBneu`,
+CHANGE COLUMN `atbwzt` `f5atbwzt` INT(11) NULL DEFAULT NULL AFTER `f5atbwdt`,
+CHANGE COLUMN `atbart` `f5atbart` VARCHAR(10) NULL DEFAULT NULL AFTER `f5atbwzt`,
+ADD INDEX `atpkey` (`f5atpkey`),
+ADD INDEX `inatkey` (`f5atzo05`, `pos`),
+ADD INDEX `pos` (`pos`, `f5atzo05`);
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE `w_findispmon05u`;
+Table Create Table
+w_findispmon05u CREATE TABLE `w_findispmon05u` (
+ `f5atpkey` int(11) NOT NULL DEFAULT '0',
+ `f5atzo05` int(11) DEFAULT NULL,
+ `pos` bigint(21) DEFAULT NULL,
+ `f5BnvB` int(9) DEFAULT NULL,
+ `f5atbvb` int(11) DEFAULT NULL,
+ `f5atbwmg` int(11) DEFAULT NULL,
+ `f5pBneu` bigint(12) DEFAULT NULL,
+ `f5atbwdt` int(11) DEFAULT NULL,
+ `f5atbwzt` int(11) DEFAULT NULL,
+ `f5atbart` varchar(10) DEFAULT NULL,
+ KEY `atpkey` (`f5atpkey`),
+ KEY `inatkey` (`f5atzo05`,`pos`),
+ KEY `pos` (`pos`,`f5atzo05`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+DROP TABLE `w_findispmon05u`;
+CREATE TABLE t (
+a INT NOT NULL,
+b INT NOT NULL,
+PRIMARY KEY (a)
+) ENGINE=INNODB;
+ALTER TABLE t
+CHANGE COLUMN b c INT NOT NULL,
+ADD UNIQUE INDEX (c);
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL,
+ `c` int(11) NOT NULL,
+ PRIMARY KEY (`a`),
+ UNIQUE KEY `c` (`c`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t
+CHANGE COLUMN c b INT NOT NULL,
+ADD UNIQUE INDEX (c);
+ERROR 42000: Key column 'c' doesn't exist in table
+DROP TABLE t;
+CREATE TABLE parent (
+a INT NOT NULL,
+b INT NOT NULL,
+PRIMARY KEY (a)
+) ENGINE=INNODB;
+CREATE TABLE child (
+a INT NOT NULL,
+b INT NOT NULL,
+PRIMARY KEY (a)
+) ENGINE=INNODB;
+ALTER TABLE child
+CHANGE COLUMN b c INT NOT NULL,
+ADD FOREIGN KEY (c) REFERENCES parent(a);
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE child;
+Table Create Table
+child CREATE TABLE `child` (
+ `a` int(11) NOT NULL,
+ `c` int(11) NOT NULL,
+ PRIMARY KEY (`a`),
+ KEY `c` (`c`),
+ CONSTRAINT `child_ibfk_1` FOREIGN KEY (`c`) REFERENCES `parent` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE child, parent;
diff --git a/mysql-test/suite/innodb/r/innodb_monitor.result b/mysql-test/suite/innodb/r/innodb_monitor.result
index 31c6123c964..8c580348e1a 100644
--- a/mysql-test/suite/innodb/r/innodb_monitor.result
+++ b/mysql-test/suite/innodb/r/innodb_monitor.result
@@ -130,9 +130,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -281,9 +278,6 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -322,9 +316,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index f6e35699d39..db7be5c9586 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -165,9 +165,6 @@ os_log_bytes_written os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL di
os_log_fsyncs os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of fsync log writes (innodb_os_log_fsyncs)
os_log_pending_fsyncs os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pending fsync write (innodb_os_log_pending_fsyncs)
os_log_pending_writes os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pending log file writes (innodb_os_log_pending_writes)
-os_merge_blocks_written os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of merge blocks written (innodb_os_merge_blocks_written)
-os_merge_blocks_read os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of merge blocks read (innodb_os_merge_blocks_read)
-os_merge_blocks_merged os 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of merge blocks merged (innodb_os_merge_blocks_merged)
trx_rw_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of read-write transactions committed
trx_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of read-only transactions committed
trx_nl_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of non-locking auto-commit read-only transactions committed
diff --git a/mysql-test/suite/innodb/r/tmpdir.result b/mysql-test/suite/innodb/r/tmpdir.result
new file mode 100644
index 00000000000..f9475c1b7f8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/tmpdir.result
@@ -0,0 +1,51 @@
+#
+# Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
+# WHERE INNODB WRITES TEMP FILES
+#
+# If innodb_tmpdir is NULL or "", temporary file will be created in
+# server configuration variable location(--tmpdir)
+create table t1(a int primary key)engine=innodb;
+show session variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+alter table t1 add column b int not null;
+set global innodb_tmpdir=NULL;
+# Connection con1
+show session variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+alter table t1 add key(b);
+drop table t1;
+# innodb_tmpdir with invalid path.
+create table t1(a int primary key)engine=innodb;
+set global innodb_tmpdir='wrong_value';
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'wrong_value'
+show warnings;
+Level Code Message
+Warning 1210 InnoDB: Path doesn't exist.
+Error 1231 Variable 'innodb_tmpdir' can't be set to the value of 'wrong_value'
+drop table t1;
+# innodb_tmpdir with mysql data directory path.
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+set global innodb_tmpdir = @@global.datadir;
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'MYSQL_DATADIR'
+show warnings;
+Level Code Message
+Warning 1210 InnoDB: Path Location should not be same as mysql data directory location.
+Error 1231 DATADIR/data/'
+drop table t1;
+# innodb_tmpdir with valid location.
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+set @tmpdir = @@global.tmpdir;
+set global innodb_tmpdir = @tmpdir;
+show session variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+# Connection con3
+alter table t1 add fulltext(b);
+set global innodb_tmpdir=NULL;
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-filewrite.test b/mysql-test/suite/innodb/t/innodb-alter-filewrite.test
deleted file mode 100644
index d0372056937..00000000000
--- a/mysql-test/suite/innodb/t/innodb-alter-filewrite.test
+++ /dev/null
@@ -1,32 +0,0 @@
---source include/have_innodb.inc
-
-#
-# MDEV-8696: Adding indexes on empty table is slow with large innodb_sort_buffer_size.
-#
-
-CREATE TABLE `test_wo_keys` (
-`f01` int AUTO_INCREMENT,
-`f02` bigint, `f03` bigint, `f04` enum('a','b'),
-`f05` date, `f06` int, `f07` int, `f08` double, `f09` int,
-`f10` bigint, `f11` double, `f12` enum('a','b','c','d','e'),
-`f13` int, `f14` int, `f15` varchar(255), `f16` int, `f17` int, `f18` int,
-`f19` double, `f20` double, `f21` double, `f22` double, `f23` double, `f24` tinyint,
-`f25` double, `f26` double, `f27` double, `f28` double, `f29` int unsigned,
-`f30` int unsigned, `f31` bigint, `f32` int unsigned, `f33` bigint,
-`f34` int unsigned, `f35` int unsigned,
-PRIMARY KEY `f01` (`f01`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-show status like '%merge_buffers%';
-
-ALTER TABLE test_wo_keys
-ADD KEY `f06` (`f06`), ADD KEY `f05` (`f05`), ADD KEY `f04` (`f04`), ADD KEY `f23` (`f23`),
-ADD KEY `f10` (`f10`), ADD KEY `f11` (`f11`), ADD KEY `f09` (`f09`), ADD KEY `f22` (`f22`),
-ADD KEY `f21` (`f21`), ADD KEY `f07` (`f07`), ADD KEY `f08` (`f08`), ADD KEY `f18` (`f18`),
-ADD KEY `f19` (`f19`), ADD KEY `f20` (`f20`), ADD KEY `f29` (`f29`,`f31`,`f33`),
-ADD KEY `f35` (`f35`), ADD KEY `f25` (`f25`), ADD KEY `f26` (`f26`),
-ADD KEY `f27` (`f27`), ADD KEY `f28` (`f28`);
-
-show status like '%merge_buffers%';
-
-DROP TABLE test_wo_keys;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-table.test b/mysql-test/suite/innodb/t/innodb-alter-table.test
index 2be2a30194d..2ad9c8791cb 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-table.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-table.test
@@ -57,3 +57,84 @@ while ($num)
ALTER TABLE moodle19.mdl_course_modules ADD stefantest LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci AFTER showdescription;
drop database moodle19;
+
+#
+# Mdev-9469: Incorrect key file on alter table
+#
+use test;
+
+CREATE TABLE `w_findispmon05u` (
+`atpkey` INT(11) NOT NULL DEFAULT '0',
+`atzo05` INT(11) NULL DEFAULT NULL,
+`pos` BIGINT(21) NULL DEFAULT NULL,
+`f5BnvB` INT(9) NULL DEFAULT NULL,
+`f5atbvb` INT(11) NULL DEFAULT NULL,
+`f5atbwmg` INT(11) NULL DEFAULT NULL,
+`f5pBneu` BIGINT(12) NULL DEFAULT NULL,
+`atbwdt` INT(11) NULL DEFAULT NULL,
+`atbwzt` INT(11) NULL DEFAULT NULL,
+`atbart` VARCHAR(10) NULL DEFAULT NULL
+)
+COLLATE='utf8_general_ci'
+ENGINE=InnoDB;
+ALTER TABLE `w_findispmon05u`
+CHANGE COLUMN `atpkey` `f5atpkey` INT(11) NOT NULL DEFAULT '0' FIRST,
+CHANGE COLUMN `atzo05` `f5atzo05` INT(11) NULL DEFAULT NULL AFTER `f5atpkey`,
+CHANGE COLUMN `atbwdt` `f5atbwdt` INT(11) NULL DEFAULT NULL AFTER `f5pBneu`,
+CHANGE COLUMN `atbwzt` `f5atbwzt` INT(11) NULL DEFAULT NULL AFTER `f5atbwdt`,
+CHANGE COLUMN `atbart` `f5atbart` VARCHAR(10) NULL DEFAULT NULL AFTER `f5atbwzt`,
+ADD INDEX `atpkey` (`f5atpkey`),
+ADD INDEX `inatkey` (`f5atzo05`, `pos`),
+ADD INDEX `pos` (`pos`, `f5atzo05`);
+
+SHOW WARNINGS;
+SHOW CREATE TABLE `w_findispmon05u`;
+
+DROP TABLE `w_findispmon05u`;
+
+CREATE TABLE t (
+ a INT NOT NULL,
+ b INT NOT NULL,
+ PRIMARY KEY (a)
+) ENGINE=INNODB;
+
+ALTER TABLE t
+ CHANGE COLUMN b c INT NOT NULL,
+ ADD UNIQUE INDEX (c);
+
+SHOW WARNINGS;
+SHOW CREATE TABLE t;
+
+# this should fail
+--error 1072
+ALTER TABLE t
+ CHANGE COLUMN c b INT NOT NULL,
+ ADD UNIQUE INDEX (c);
+
+DROP TABLE t;
+
+#
+# Check Foreign Keys
+#
+CREATE TABLE parent (
+ a INT NOT NULL,
+ b INT NOT NULL,
+ PRIMARY KEY (a)
+) ENGINE=INNODB;
+
+CREATE TABLE child (
+ a INT NOT NULL,
+ b INT NOT NULL,
+ PRIMARY KEY (a)
+) ENGINE=INNODB;
+
+ALTER TABLE child
+ CHANGE COLUMN b c INT NOT NULL,
+ ADD FOREIGN KEY (c) REFERENCES parent(a);
+
+SHOW WARNINGS;
+
+SHOW CREATE TABLE child;
+
+DROP TABLE child, parent;
+
diff --git a/mysql-test/suite/innodb/t/tmpdir.test b/mysql-test/suite/innodb/t/tmpdir.test
new file mode 100644
index 00000000000..abe455adda5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/tmpdir.test
@@ -0,0 +1,68 @@
+--source include/have_innodb.inc
+--source include/count_sessions.inc
+
+if (`select plugin_auth_version <= "5.6.28-MariaDB-76.1" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB as of 5.6.28-MariaDB-76.1 or earlier
+}
+
+--echo #
+--echo # Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
+--echo # WHERE INNODB WRITES TEMP FILES
+--echo #
+
+--echo # If innodb_tmpdir is NULL or "", temporary file will be created in
+--echo # server configuration variable location(--tmpdir)
+
+create table t1(a int primary key)engine=innodb;
+show session variables like 'innodb_tmpdir';
+alter table t1 add column b int not null;
+set global innodb_tmpdir=NULL;
+--echo # Connection con1
+connect (con1,localhost,root);
+show session variables like 'innodb_tmpdir';
+alter table t1 add key(b);
+connection default;
+disconnect con1;
+drop table t1;
+
+--echo # innodb_tmpdir with invalid path.
+
+create table t1(a int primary key)engine=innodb;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir='wrong_value';
+show warnings;
+drop table t1;
+
+
+--echo # innodb_tmpdir with mysql data directory path.
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+--replace_result $MYSQLD_DATADIR MYSQL_DATADIR
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir = @@global.datadir;
+--replace_regex /.*mysqld.1/DATADIR/
+show warnings;
+drop table t1;
+
+--echo # innodb_tmpdir with valid location.
+let $MYSQL_TMP_DIR= `select @@tmpdir`;
+create table t1(a text, b text, fulltext(a,b))engine=innodb;
+insert into t1 values('test1', 'test2');
+insert into t1 values('text1', 'text2');
+set @tmpdir = @@global.tmpdir;
+set global innodb_tmpdir = @tmpdir;
+show session variables like 'innodb_tmpdir';
+--echo # Connection con3
+connect (con3,localhost,root);
+# Following alter using innodb_tmpdir as a path to create temporary files
+alter table t1 add fulltext(b);
+disconnect con3;
+connection default;
+set global innodb_tmpdir=NULL;
+drop table t1;
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/parts/t/partition_debug_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_innodb-master.opt
index 6daff4c7c6b..5253df4563a 100644
--- a/mysql-test/suite/parts/t/partition_debug_innodb-master.opt
+++ b/mysql-test/suite/parts/t/partition_debug_innodb-master.opt
@@ -1 +1 @@
---loose-innodb-file-format-check --loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file
+--loose-innodb-file-format-check --loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
diff --git a/mysql-test/suite/perfschema/r/view_table_io.result b/mysql-test/suite/perfschema/r/view_table_io.result
index 5f17b5ae9e1..db6acf65c73 100644
--- a/mysql-test/suite/perfschema/r/view_table_io.result
+++ b/mysql-test/suite/perfschema/r/view_table_io.result
@@ -52,7 +52,7 @@ insert into marker set a = 1;
optimize table test.v1;
Table Op Msg_type Msg_text
test.v1 optimize Error 'test.v1' is not BASE TABLE
-test.v1 optimize error Corrupt
+test.v1 optimize status Operation failed
insert into marker set a = 1;
select * from test.v1;
a b
diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test
index 8a4f11ba51f..6b4fe89a1cf 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test
@@ -88,3 +88,10 @@ UNLOCK TABLES;
--echo
UPDATE performance_schema.setup_instruments SET timed='NO'
ORDER BY RAND();
+
+# MTR is configured to start with everything set to ON,
+# so we need to restore it after the previous update
+--disable_query_log
+update performance_schema.setup_instruments set timed='YES';
+--enable_query_log
+
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_install.result b/mysql-test/suite/plugins/r/feedback_plugin_install.result
index c52fdb8f85b..ee74435e05a 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_install.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_install.result
@@ -8,6 +8,7 @@ select * from information_schema.feedback where variable_name like 'feed%'
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK used 1
FEEDBACK version 1.1
+FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
diff --git a/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result b/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result
new file mode 100644
index 00000000000..b03c0057a69
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result
@@ -0,0 +1,29 @@
+include/master-slave.inc
+[connection master]
+Test case 1:- table name with one character latin name.
+SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"` (a INT)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("INSERT INTO `",REPEAT(CHAR(131),1),"` VALUES (1)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1), "`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+Test case 2:- table name and database names with one character latin name.
+SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1),"` (a INT)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("INSERT INTO `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1),"` VALUES (1)");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1), "`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`");
+PREPARE STMT FROM @s;
+EXECUTE stmt;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_triggers.result b/mysql-test/suite/rpl/r/rpl_row_triggers.result
index 7f37805b635..b4ae9861633 100644
--- a/mysql-test/suite/rpl/r/rpl_row_triggers.result
+++ b/mysql-test/suite/rpl/r/rpl_row_triggers.result
@@ -237,4 +237,50 @@ a b
3 30
set global slave_run_triggers_for_rbr = @slave_run_triggers_for_rbr.saved;
drop table t1, tlog;
+#
+# MDEV-8411 Assertion `is_stat_field || !table || (!table->write_set ||
+# bitmap_is_set(table->write_set, field_index) ||
+# bitmap_is_set(table->vcol_set, field_index))'
+# failed in Field_timestamp::store_TIME_with_warning
+#
+#
+# Create table on master, replicate it on slave.
+#
+connection master;
+set @binlog_row_image.saved = @@binlog_row_image;
+set binlog_row_image = MINIMAL;
+create table t1 (pk int primary key, f int);
+connection slave;
+#
+# Create a trigger on the slave.
+#
+create trigger tr before update on t1 for each row set new.f = 1000;
+set @old_slave_run_triggers_for_rbr = @@global.slave_run_triggers_for_rbr;
+set global slave_run_triggers_for_rbr = YES;
+connection master;
+#
+# Update the table to have the trigger fire on the slave.,
+#
+insert into t1 values (1,1),(2,2);
+update t1 set pk=pk+10;
+select * from t1;
+pk f
+11 1
+12 2
+connection slave;
+#
+# Check to see if slave has the table updated.
+#
+select * from t1;
+pk f
+11 1000
+12 1000
+#
+# Cleanup
+#
+set global slave_run_triggers_for_rbr = @old_slave_run_triggers_for_rbr;
+connection master;
+set binlog_row_image = @binlog_row_image.saved;
+drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
new file mode 100644
index 00000000000..2efb3eba2b1
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
@@ -0,0 +1,53 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TRIGGER trig1 AFTER INSERT ON t1
+FOR EACH ROW
+INSERT INTO t2(i) VALUES(new.i);
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+INSERT INTO t1(i) VALUES(2);
+START TRANSACTION;
+LOCK TABLES t1 WRITE, t2 WRITE;
+INSERT INTO t1(i) VALUES(3);
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1,t2;
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+INSERT INTO t1 values (1), (2), (3);
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+INSERT INTO t2(i) SELECT i FROM t1;
+START TRANSACTION;
+LOCK TABLES t2 WRITE, t1 READ;
+INSERT INTO t2(i) SELECT i FROM t1;
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1,t2;
+CREATE TABLE t1(i int, id INT AUTO_INCREMENT, PRIMARY KEY (i, id)) ENGINE=MYISAM;
+INSERT INTO t1 (i) values (1);
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i) values (2);
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+UNLOCK TABLES;
+COMMIT;
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff b/mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff
new file mode 100644
index 00000000000..550f64173a7
--- /dev/null
+++ b/mysql-test/suite/rpl/r/temporal_row-9560,old2new.rdiff
@@ -0,0 +1,11 @@
+--- suite/rpl/r/temporal_row-9560.result
++++ suite/rpl/r/temporal_row-9560.reject
+@@ -7,7 +7,7 @@
+ insert into t1 values ('2016-02-15 12:50:06.123');
+ select @@mysql56_temporal_format;
+ @@mysql56_temporal_format
+-0
++1
+ select * from t1;
+ ts
+ 2016-02-15 12:50:06.123
diff --git a/mysql-test/suite/rpl/r/temporal_row-9560.result b/mysql-test/suite/rpl/r/temporal_row-9560.result
new file mode 100644
index 00000000000..c6a57d43fd0
--- /dev/null
+++ b/mysql-test/suite/rpl/r/temporal_row-9560.result
@@ -0,0 +1,15 @@
+include/master-slave.inc
+[connection master]
+select @@mysql56_temporal_format;
+@@mysql56_temporal_format
+0
+create table t1 (ts timestamp(3), t time(3), dt datetime(3));
+insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
+select @@mysql56_temporal_format;
+@@mysql56_temporal_format
+0
+select * from t1;
+ts t dt
+2016-02-15 12:50:06.123 12:50:06.123 2016-02-15 12:50:06.123
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test b/mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test
new file mode 100644
index 00000000000..a93fcbac82f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_autogen_query_multi_byte_char.test
@@ -0,0 +1,87 @@
+###############################################################################
+# Bug#21205695 DROP TABLE MAY CAUSE SLAVES TO BREAK
+#
+# Problem:
+# ========
+# 1) Drop table queries are re-generated by server
+# before writing the events(queries) into binlog
+# for various reasons. If table name/db name contains
+# a non regular characters (like latin characters),
+# the generated query is wrong. Hence it breaks the
+# replication.
+# 2) In the edge case, when table name contains
+# 64 latin characters (latin takes 2 bytes), server is
+# throwing an assert (M_TBLLEN < 128)
+#
+# 3) In the edge case, when db name contains 64 latin
+# characters, binlog contents are interpreted wrongly
+# which is leading to replication issues.
+#
+###############################################################################
+
+--source include/not_windows.inc
+--source include/master-slave.inc
+
+--let iter=1
+# Change iteration to 4 after fixing Bug #22280214
+while ($iter <= 2)
+{
+ --connection master
+ if ($iter == 1)
+ {
+ --echo Test case 1:- table name with one character latin name.
+ --let $tblname= REPEAT(CHAR(131),1)
+ }
+ if ($iter == 2)
+ {
+ --echo Test case 2:- table name and database names with one character latin name.
+ --let $tblname= REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1)
+ --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`")
+ PREPARE STMT FROM @s; EXECUTE stmt;
+ }
+ # After fixing Bug #22280214 DATADIR LOCATION IS LIMITING
+ # IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be
+ # uncommented.
+ #if ($iter == 3)
+ #{
+ # --echo Test case 3:- table name and database names with 64 latin characters name.
+ # --let $tblname= REPEAT(CHAR(131),64),"`.`", REPEAT(CHAR(131),64)
+ # --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),64),"`")
+ # PREPARE STMT FROM @s; EXECUTE stmt;
+ #}
+ #if ($iter == 4)
+ #{
+ # --echo Test case 4:- table name and database names with 64 Euro(€) characters.
+ # --let $tblname= REPEAT(CHAR(226,130,172),64),"`.`", REPEAT(CHAR(226,130,172),64)
+ # --eval SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(226,130,172),64),"`")
+ # PREPARE STMT FROM @s; EXECUTE stmt;
+ #}
+ --eval SET @s:=CONCAT("CREATE TABLE `",$tblname,"` (a INT)")
+ PREPARE STMT FROM @s; EXECUTE stmt;
+ --eval SET @s:=CONCAT("INSERT INTO `",$tblname,"` VALUES (1)")
+ PREPARE STMT FROM @s; EXECUTE stmt;
+ --eval SET @s:=CONCAT("DROP TABLE `",$tblname, "`")
+ PREPARE STMT FROM @s; EXECUTE stmt;
+ if ($iter == 2)
+ {
+ --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`")
+ PREPARE STMT FROM @s; EXECUTE stmt;
+ }
+ # After fixing Bug #22280214 DATADIR LOCATION IS LIMITING
+ # IDENTIFIER MAX LENGTH, the following two tests (iter 3 and 4) can be
+ # uncommented.
+ #if ($iter == 3)
+ #{
+ # --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),64),"`")
+ # PREPARE STMT FROM @s; EXECUTE stmt;
+ #}
+ #if ($iter == 4)
+ #{
+ # --eval SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(226,130,172),64),"`")
+ # PREPARE STMT FROM @s; EXECUTE stmt;
+ #}
+ --sync_slave_with_master
+ --inc $iter
+}
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_triggers.test b/mysql-test/suite/rpl/t/rpl_row_triggers.test
index e3c90d874f0..173ddebba12 100644
--- a/mysql-test/suite/rpl/t/rpl_row_triggers.test
+++ b/mysql-test/suite/rpl/t/rpl_row_triggers.test
@@ -276,5 +276,54 @@ drop table t1, tlog;
sync_slave_with_master;
+--echo #
+--echo # MDEV-8411 Assertion `is_stat_field || !table || (!table->write_set ||
+--echo # bitmap_is_set(table->write_set, field_index) ||
+--echo # bitmap_is_set(table->vcol_set, field_index))'
+--echo # failed in Field_timestamp::store_TIME_with_warning
+--echo #
+--enable_connect_log
+--echo #
+--echo # Create table on master, replicate it on slave.
+--echo #
+--connection master
+set @binlog_row_image.saved = @@binlog_row_image;
+set binlog_row_image = MINIMAL;
+create table t1 (pk int primary key, f int);
+
+--sync_slave_with_master
+--echo #
+--echo # Create a trigger on the slave.
+--echo #
+create trigger tr before update on t1 for each row set new.f = 1000;
+set @old_slave_run_triggers_for_rbr = @@global.slave_run_triggers_for_rbr;
+set global slave_run_triggers_for_rbr = YES;
+
+--connection master
+--echo #
+--echo # Update the table to have the trigger fire on the slave.,
+--echo #
+insert into t1 values (1,1),(2,2);
+update t1 set pk=pk+10;
+select * from t1;
+
+--sync_slave_with_master
+--echo #
+--echo # Check to see if slave has the table updated.
+--echo #
+select * from t1;
+
+--echo #
+--echo # Cleanup
+--echo #
+
+set global slave_run_triggers_for_rbr = @old_slave_run_triggers_for_rbr;
+
+--connection master
+set binlog_row_image = @binlog_row_image.saved;
+drop table t1;
+
+--sync_slave_with_master
+--disable_connect_log
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_unsafe_statements.test b/mysql-test/suite/rpl/t/rpl_unsafe_statements.test
new file mode 100644
index 00000000000..cbb4b54a220
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_unsafe_statements.test
@@ -0,0 +1,176 @@
+################################################################################
+# Bug#17047208 REPLICATION DIFFERENCE FOR MULTIPLE TRIGGERS
+# Problem: If DML invokes a trigger or a stored function that inserts into an
+# AUTO_INCREMENT column, that DML has to be marked as 'unsafe' statement. If the
+# tables are locked in the transaction prior to DML statement (using LOCK
+# TABLES), then the DML statement is not marked as 'unsafe' statement.
+
+# Steps to reproduce the reported test case (BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS)
+# Case-1:
+# > Create a trigger on a table and do a insert in the trigger that updates
+# auto increment column
+# > A DML that executes the trigger in step.1 and check that DML is marked
+# as unsafe and DML is written into binlog using row format (in MBR)
+# > Execute the step 2 by locking the required tables prior to DML and check
+# that DML is marked as unsafe and DML is written into binlog using row
+# format (in MBR)
+#
+# This test script also adds test cases to cover few other unsafe statements.
+# Case-2: BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT
+# Case-3: BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST
+# Case-4: BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS
+################################################################################
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+# Case-1: BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS
+# Statement is unsafe because it invokes a trigger or a
+# stored function that inserts into an AUTO_INCREMENT column.
+
+# Step-1.1: Create two tables, one with AUTO_INCREMENT column.
+CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+
+# Step-1.2: Create a trigger that inserts into an AUTO_INCREMENT column.
+CREATE TRIGGER trig1 AFTER INSERT ON t1
+FOR EACH ROW
+ INSERT INTO t2(i) VALUES(new.i);
+
+# Step-1.3: Create some gap in auto increment value on master's t2 table
+# but not on slave (by doing rollback). Just in case if the unsafe statements
+# are written in statement format, diff tables will fail.
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+
+# Step-1.4: Insert a tuple into table t1 that triggers trig1 which inserts
+# into an AUTO_INCREMENT column.
+INSERT INTO t1(i) VALUES(2);
+
+# Step-1.5: Repeat step 1.4 but using 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t1 WRITE, t2 WRITE;
+INSERT INTO t1(i) VALUES(3);
+UNLOCK TABLES;
+COMMIT;
+
+# Step-1.6: Sync slave with master
+--sync_slave_with_master
+
+# Step-1.7: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+--let $diff_tables=master:t2, slave:t2
+--source include/diff_tables.inc
+
+# Step-1.8: Cleanup
+--connection master
+DROP TABLE t1,t2;
+
+# Case-2: BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT
+# Statements writing to a table with an auto-increment column after selecting
+# from another table are unsafe because the order in which rows are retrieved
+# determines what (if any) rows will be written. This order cannot be
+# predicted and may differ on master and the slave.
+
+# Step-2.1: Create two tables, one with AUTO_INCREMENT column.
+CREATE TABLE t1(i INT) ENGINE=INNODB;
+CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
+
+# Step-2.2: Create some tuples in table t1.
+INSERT INTO t1 values (1), (2), (3);
+
+# Step-2.3: Create some gap in auto increment value on master's t2 table
+# but not on slave (by doing rollback). Just in case if the unsafe statements
+# are written in statement format, diff tables will fail.
+START TRANSACTION;
+INSERT INTO t2(i) VALUES (1);
+ROLLBACK;
+
+# Step-2.4: Insert into t2 (table with an auto-increment) by selecting tuples
+# from table t1.
+INSERT INTO t2(i) SELECT i FROM t1;
+
+# Step-2.5: Repeat step 2.4 but now with 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t2 WRITE, t1 READ;
+INSERT INTO t2(i) SELECT i FROM t1;
+UNLOCK TABLES;
+COMMIT;
+
+# Step-2.6: Sync slave with master
+--sync_slave_with_master
+
+# Step-2.7: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+--let $diff_tables=master:t2, slave:t2
+--source include/diff_tables.inc
+
+# Step-2.8: Cleanup
+--connection master
+DROP TABLE t1,t2;
+
+# Case-3: BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST
+# INSERT into autoincrement field which is not the first part in the
+# composed primary key is unsafe
+#
+# Step-3.1: Create a table with auto increment column and a composed primary key
+# (second column is auto increment column). Such a definition is allowed only
+# with 'myisam' engine.
+CREATE TABLE t1(i int, id INT AUTO_INCREMENT, PRIMARY KEY (i, id)) ENGINE=MYISAM;
+
+# Step-3.2: Inserting into such a table is unsafe.
+INSERT INTO t1 (i) values (1);
+
+# Step-3.3: Repeat step 3.2, now with 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i) values (2);
+UNLOCK TABLES;
+COMMIT;
+
+# Step-3.4: Sync slave with master
+--sync_slave_with_master
+
+# Step-3.5: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+# Step-3.6: Cleanup
+--connection master
+DROP TABLE t1;
+
+# Case-4: BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS
+# INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY
+# is unsafe Statement
+
+# Step-4.1: Create a table with two unique keys
+CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
+
+# Step-4.2: Inserting into such a table is unsafe.
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+
+# Step-4.3: Repeat step 3.2, now with 'LOCK TABLES' logic.
+START TRANSACTION;
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
+UNLOCK TABLES;
+COMMIT;
+
+# Step-4.4: Sync slave with master
+--sync_slave_with_master
+
+# Step-4.5: Diff master-slave tables to make sure everything is in sync.
+--let $diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+
+# Step-4.6: Cleanup
+--connection master
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/temporal_row-9560-master.opt b/mysql-test/suite/rpl/t/temporal_row-9560-master.opt
new file mode 100644
index 00000000000..07c4494e8b6
--- /dev/null
+++ b/mysql-test/suite/rpl/t/temporal_row-9560-master.opt
@@ -0,0 +1 @@
+--disable-mysql56-temporal-format
diff --git a/mysql-test/suite/rpl/t/temporal_row-9560.combinations b/mysql-test/suite/rpl/t/temporal_row-9560.combinations
new file mode 100644
index 00000000000..b1c360f8615
--- /dev/null
+++ b/mysql-test/suite/rpl/t/temporal_row-9560.combinations
@@ -0,0 +1,6 @@
+[old2old]
+--disable-mysql56-temporal-format
+
+[old2new]
+--enable-mysql56-temporal-format
+
diff --git a/mysql-test/suite/rpl/t/temporal_row-9560.test b/mysql-test/suite/rpl/t/temporal_row-9560.test
new file mode 100644
index 00000000000..00fb59bc088
--- /dev/null
+++ b/mysql-test/suite/rpl/t/temporal_row-9560.test
@@ -0,0 +1,20 @@
+#
+# MDEV-9560 Mariadb 10.1 Crashes when replicating from 10.0
+#
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+select @@mysql56_temporal_format;
+create table t1 (ts timestamp(3), t time(3), dt datetime(3));
+insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
+
+sync_slave_with_master;
+
+select @@mysql56_temporal_format;
+select * from t1;
+
+connection master;
+drop table t1;
+
+source include/rpl_end.inc;
+
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
index d3d36b2d40e..6c7051dc3d0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
@@ -130,9 +130,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -281,9 +278,6 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -322,9 +316,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
index d3d36b2d40e..6c7051dc3d0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
@@ -130,9 +130,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -281,9 +278,6 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -322,9 +316,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
index d3d36b2d40e..6c7051dc3d0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
@@ -130,9 +130,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -281,9 +278,6 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -322,9 +316,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
index d3d36b2d40e..6c7051dc3d0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
@@ -130,9 +130,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -281,9 +278,6 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -322,9 +316,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
-os_merge_blocks_written disabled
-os_merge_blocks_read disabled
-os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";
diff --git a/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result b/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result
new file mode 100644
index 00000000000..be10c93b56b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result
@@ -0,0 +1,35 @@
+SET @start_global_value = @@global.innodb_tmpdir;
+SELECT @start_global_value;
+@start_global_value
+NULL
+select @@session.innodb_tmpdir;
+@@session.innodb_tmpdir
+NULL
+show global variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+show session variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+select * from information_schema.global_variables where variable_name='innodb_tmpdir';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_TMPDIR
+select * from information_schema.session_variables where variable_name='innodb_tmpdir';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_TMPDIR
+set global innodb_tmpdir=@@global.tmpdir;
+set session innodb_tmpdir=@@global.tmpdir;
+set global innodb_tmpdir=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_tmpdir'
+set global innodb_tmpdir=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_tmpdir'
+set global innodb_tmpdir=repeat('a',1000);
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+show warnings;
+Level Code Message
+Warning 1210 Path length should not exceed 512 bytes
+Error 1231 Variable 'innodb_tmpdir' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+SET @@global.innodb_tmpdir = @start_global_value;
+SELECT @@global.innodb_tmpdir;
+@@global.innodb_tmpdir
+NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
index 520728d3def..a9e975313db 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
@@ -571,14 +571,21 @@
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-@@ -2203,6 +2637,34 @@
+@@ -2203,14 +2637,28 @@
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+-VARIABLE_NAME INNODB_TMPDIR
+-SESSION_VALUE
+-GLOBAL_VALUE
+VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
-+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE
+-VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE VARCHAR
+-VARIABLE_COMMENT Directory for temporary non-tablespace files.
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
@@ -597,16 +604,10 @@
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force log tracker to catch up with checkpoint now
-+NUMERIC_MIN_VALUE NULL
-+NUMERIC_MAX_VALUE NULL
-+NUMERIC_BLOCK_SIZE NULL
-+ENUM_VALUE_LIST NULL
-+READ_ONLY NO
-+COMMAND_LINE_ARGUMENT OPTIONAL
- VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
- SESSION_VALUE NULL
- GLOBAL_VALUE OFF
-@@ -2280,7 +2742,7 @@
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2294,7 +2742,7 @@
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -615,7 +616,7 @@
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-@@ -2301,6 +2763,20 @@
+@@ -2315,6 +2763,20 @@
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
@@ -636,7 +637,7 @@
VARIABLE_NAME INNODB_USE_MTFLUSH
SESSION_VALUE NULL
GLOBAL_VALUE OFF
-@@ -2315,6 +2791,20 @@
+@@ -2329,6 +2791,20 @@
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
@@ -657,12 +658,12 @@
VARIABLE_NAME INNODB_USE_SYS_MALLOC
SESSION_VALUE NULL
GLOBAL_VALUE ON
-@@ -2345,12 +2835,12 @@
+@@ -2359,12 +2835,12 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
--GLOBAL_VALUE 5.6.27
-+GLOBAL_VALUE 5.6.26-76.0
+-GLOBAL_VALUE 5.6.29
++GLOBAL_VALUE 5.6.28-76.1
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index b2e31ab3979..0ddc401e618 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -2203,6 +2203,20 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_TMPDIR
+SESSION_VALUE
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Directory for temporary non-tablespace files.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
SESSION_VALUE NULL
GLOBAL_VALUE OFF
@@ -2345,7 +2359,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
-GLOBAL_VALUE 5.6.27
+GLOBAL_VALUE 5.6.29
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
index 3dd9cc541c4..4d7b03690af 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
@@ -367,7 +367,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME WSREP_PATCH_VERSION
SESSION_VALUE NULL
-GLOBAL_VALUE wsrep_25.11
+GLOBAL_VALUE wsrep_25.13
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test b/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
new file mode 100644
index 00000000000..3c547152e27
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
@@ -0,0 +1,48 @@
+--source include/have_innodb.inc
+
+if (`select plugin_auth_version <= "5.6.28-MariaDB-76.1" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB as of 5.6.28-MariaDB-76.1 or earlier
+}
+
+SET @start_global_value = @@global.innodb_tmpdir;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@session.innodb_tmpdir;
+
+show global variables like 'innodb_tmpdir';
+show session variables like 'innodb_tmpdir';
+
+select * from information_schema.global_variables where variable_name='innodb_tmpdir';
+select * from information_schema.session_variables where variable_name='innodb_tmpdir';
+#
+# Show that it is writable
+#
+
+set global innodb_tmpdir=@@global.tmpdir;
+set session innodb_tmpdir=@@global.tmpdir;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_tmpdir=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_tmpdir=1e1;
+
+#
+# path len more than 512
+#
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir=repeat('a',1000);
+show warnings;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_tmpdir = @start_global_value;
+SELECT @@global.innodb_tmpdir;
diff --git a/mysql-test/suite/vcol/inc/vcol_ins_upd.inc b/mysql-test/suite/vcol/inc/vcol_ins_upd.inc
index 8d0a51f42c0..d9a1e062870 100644
--- a/mysql-test/suite/vcol/inc/vcol_ins_upd.inc
+++ b/mysql-test/suite/vcol/inc/vcol_ins_upd.inc
@@ -287,3 +287,30 @@ select * from t1;
set sql_warnings = 0;
drop table t1;
+
+--echo #
+--echo # MDEV-9093: Persistent computed column is not updated when
+--echo # update query contains join
+--echo #
+
+CREATE TABLE `t1` (
+ `id` bigint(20) NOT NULL,
+ `name` varchar(254) DEFAULT NULL,
+ `name_hash` varchar(64) AS (sha1(name)) PERSISTENT,
+ PRIMARY KEY (`id`)
+);
+
+insert into t1(id,name) values (2050, 'name1'),(2051, 'name2'),(2041, 'name3');
+
+create table t2 (id bigint);
+insert into t2 values (2050),(2051),(2041);
+
+select * from t1;
+
+update t1 join t2 using(id) set name = concat(name,
+'+1') where t1.id in (2051,2041);
+
+select * from t1;
+
+drop table t1,t2;
+
diff --git a/mysql-test/suite/vcol/r/alter_inplace-9045.result b/mysql-test/suite/vcol/r/alter_inplace-9045.result
new file mode 100644
index 00000000000..1560d830f42
--- /dev/null
+++ b/mysql-test/suite/vcol/r/alter_inplace-9045.result
@@ -0,0 +1,44 @@
+create table t1(id int auto_increment primary key, handle int, data bigint not null default 0) engine = innodb;
+insert into t1(handle) values(12),(54),(NULL);
+select *, md5(handle) from t1;
+id handle data md5(handle)
+1 12 0 c20ad4d76fe97759aa27a0c99bff6710
+2 54 0 a684eceee76fc522773286a895bc8436
+3 NULL 0 NULL
+alter table t1 add index handle(handle), algorithm=inplace;
+alter table t1 add column hash varchar(32) as (md5(handle)) persistent, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+alter table t1 add column hash varchar(32) as (md5(handle)) persistent, add unique index hash(hash), algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+alter table t1 add column hash varchar(32) as (md5(handle)) persistent, add unique index hash(hash), algorithm=copy;
+select * from t1;
+id handle data hash
+1 12 0 c20ad4d76fe97759aa27a0c99bff6710
+2 54 0 a684eceee76fc522773286a895bc8436
+3 NULL 0 NULL
+alter table t1 modify column hash varchar(32) as (md5(handle+1)) persistent, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+alter table t1 modify column hash varchar(32) as (md5(handle+1)) persistent, algorithm=copy;
+select * from t1;
+id handle data hash
+1 12 0 c51ce410c124a10e0db5e4b97fc2af39
+2 54 0 b53b3a3d6ab90ce0268229151c9bde11
+3 NULL 0 NULL
+alter table t1 modify column handle int not null, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+alter table t1 modify column handle int not null, algorithm=copy;
+Warnings:
+Warning 1265 Data truncated for column 'handle' at row 3
+select * from t1;
+id handle data hash
+1 12 0 c51ce410c124a10e0db5e4b97fc2af39
+2 54 0 b53b3a3d6ab90ce0268229151c9bde11
+3 0 0 c4ca4238a0b923820dcc509a6f75849b
+alter table t1 drop index handle, algorithm=inplace;
+create index data on t1(data) algorithm=inplace;
+alter table t1 drop column data, algorithm=inplace;
+alter table t1 add column sha varchar(32) as (sha1(handle)) persistent, algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+alter table t1 add column sha varchar(32), algorithm=inplace;
+alter table t1 drop column hash, algorithm=inplace;
+drop table t1;
diff --git a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result
new file mode 100644
index 00000000000..f2d6b4105ff
--- /dev/null
+++ b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result
@@ -0,0 +1,16 @@
+create table t1 (c2 int as (-c1), c1 int primary key auto_increment) engine=innodb;
+insert into t1(c1) values (null),(null),(null);
+select * from t1;
+c2 c1
+-1 1
+-2 2
+-3 3
+alter table t1 auto_increment = 3;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c2` int(11) AS (-c1) VIRTUAL,
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result
index 44fcae7a6e5..af03cc4d482 100644
--- a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result
@@ -425,3 +425,29 @@ select * from t1;
a b c d
set sql_warnings = 0;
drop table t1;
+#
+# MDEV-9093: Persistent computed column is not updated when
+# update query contains join
+#
+CREATE TABLE `t1` (
+`id` bigint(20) NOT NULL,
+`name` varchar(254) DEFAULT NULL,
+`name_hash` varchar(64) AS (sha1(name)) PERSISTENT,
+PRIMARY KEY (`id`)
+);
+insert into t1(id,name) values (2050, 'name1'),(2051, 'name2'),(2041, 'name3');
+create table t2 (id bigint);
+insert into t2 values (2050),(2051),(2041);
+select * from t1;
+id name name_hash
+2041 name3 1aefcd1b0f39da45fa1fd7236f683c907c15ef82
+2050 name1 9b46b0dd3a8083c070c3b9953bb5f3f95c5ab4da
+2051 name2 39ea84acf1fef629fef18a9c6f5799bba32ecc25
+update t1 join t2 using(id) set name = concat(name,
+'+1') where t1.id in (2051,2041);
+select * from t1;
+id name name_hash
+2041 name3+1 93c9096df48221428de46e146abc9f4f94bf7d2e
+2050 name1 9b46b0dd3a8083c070c3b9953bb5f3f95c5ab4da
+2051 name2+1 fd4f236320db3956a5ec073c5ec39707d7f05708
+drop table t1,t2;
diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
index 66745862c22..351dfd2858c 100644
--- a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
@@ -363,3 +363,29 @@ select * from t1;
a b c d
set sql_warnings = 0;
drop table t1;
+#
+# MDEV-9093: Persistent computed column is not updated when
+# update query contains join
+#
+CREATE TABLE `t1` (
+`id` bigint(20) NOT NULL,
+`name` varchar(254) DEFAULT NULL,
+`name_hash` varchar(64) AS (sha1(name)) PERSISTENT,
+PRIMARY KEY (`id`)
+);
+insert into t1(id,name) values (2050, 'name1'),(2051, 'name2'),(2041, 'name3');
+create table t2 (id bigint);
+insert into t2 values (2050),(2051),(2041);
+select * from t1;
+id name name_hash
+2050 name1 9b46b0dd3a8083c070c3b9953bb5f3f95c5ab4da
+2051 name2 39ea84acf1fef629fef18a9c6f5799bba32ecc25
+2041 name3 1aefcd1b0f39da45fa1fd7236f683c907c15ef82
+update t1 join t2 using(id) set name = concat(name,
+'+1') where t1.id in (2051,2041);
+select * from t1;
+id name name_hash
+2050 name1 9b46b0dd3a8083c070c3b9953bb5f3f95c5ab4da
+2051 name2+1 fd4f236320db3956a5ec073c5ec39707d7f05708
+2041 name3+1 93c9096df48221428de46e146abc9f4f94bf7d2e
+drop table t1,t2;
diff --git a/mysql-test/suite/vcol/t/alter_inplace-9045.test b/mysql-test/suite/vcol/t/alter_inplace-9045.test
new file mode 100644
index 00000000000..8f59ba75bce
--- /dev/null
+++ b/mysql-test/suite/vcol/t/alter_inplace-9045.test
@@ -0,0 +1,31 @@
+#
+# MDEV-9045 Inconsistent handling of "ALGORITHM=INPLACE" with PERSISTENT generated columns
+#
+--source include/have_innodb.inc
+
+create table t1(id int auto_increment primary key, handle int, data bigint not null default 0) engine = innodb;
+insert into t1(handle) values(12),(54),(NULL);
+select *, md5(handle) from t1;
+alter table t1 add index handle(handle), algorithm=inplace;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t1 add column hash varchar(32) as (md5(handle)) persistent, algorithm=inplace;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t1 add column hash varchar(32) as (md5(handle)) persistent, add unique index hash(hash), algorithm=inplace;
+alter table t1 add column hash varchar(32) as (md5(handle)) persistent, add unique index hash(hash), algorithm=copy;
+select * from t1;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t1 modify column hash varchar(32) as (md5(handle+1)) persistent, algorithm=inplace;
+alter table t1 modify column hash varchar(32) as (md5(handle+1)) persistent, algorithm=copy;
+select * from t1;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t1 modify column handle int not null, algorithm=inplace;
+alter table t1 modify column handle int not null, algorithm=copy;
+select * from t1;
+alter table t1 drop index handle, algorithm=inplace;
+create index data on t1(data) algorithm=inplace;
+alter table t1 drop column data, algorithm=inplace;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table t1 add column sha varchar(32) as (sha1(handle)) persistent, algorithm=inplace;
+alter table t1 add column sha varchar(32), algorithm=inplace;
+alter table t1 drop column hash, algorithm=inplace;
+drop table t1;
diff --git a/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test b/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test
new file mode 100644
index 00000000000..2f2ac3d08e1
--- /dev/null
+++ b/mysql-test/suite/vcol/t/innodb_autoinc_vcol.test
@@ -0,0 +1,9 @@
+--source include/have_innodb.inc
+
+create table t1 (c2 int as (-c1), c1 int primary key auto_increment) engine=innodb;
+insert into t1(c1) values (null),(null),(null);
+select * from t1;
+alter table t1 auto_increment = 3;
+show create table t1;
+drop table t1;
+
diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test
index e8cc285918c..6386a1551e1 100644
--- a/mysql-test/t/alter_table_online.test
+++ b/mysql-test/t/alter_table_online.test
@@ -7,22 +7,16 @@
drop table if exists t1,t2,t3;
--enable_warnings
#
-# Test of things that can not be done online
+# Test of things that can be done online
#
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify b int default 5;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 change b new_name int;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify e enum('a','b','c');
---error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 comment "new comment";
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 rename to t2;
# No OPs
@@ -68,11 +62,14 @@ alter online table t1 modify c varchar(100);
alter online table t1 add f int;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter online table t1 engine=memory;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter online table t1 rename to t2;
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
alter online table t1 drop index b;
+alter online table t1 comment "new comment";
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 6751c92f0be..10ee41ca2aa 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1737,6 +1737,27 @@ create table t1(a enum('',''));
drop table t1;
set @@session.collation_server=default;
+--echo #
+--echo # MDEV-7765: Crash (Assertion `!table || (!table->write_set ||
+--echo # bitmap_is_set(table->write_set, field_index) ||
+--echo # bitmap_is_set(table->vcol_set, field_index))' fails)
+--echo # on using function over not created table
+--echo #
+
+DELIMITER |;
+CREATE function f1() returns int
+BEGIN
+ declare n int;
+ set n:= (select count(*) from t1);
+ return n;
+end|
+DELIMITER ;|
+-- error ER_NO_SUCH_TABLE
+create table t1 as select f1();
+drop function f1;
+
+--echo End of 5.5 tests
+
#
# MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS
#
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 014194d78e7..85ffed943cf 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1583,7 +1583,7 @@ SET NAMES utf8;
SET NAMES utf8;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
-SELECT COUNT(*) FROM t1, t1 t2
+SELECT COUNT(*) FROM t1, t1 t2
GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
DROP TABLE t1;
@@ -1872,5 +1872,81 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+--echo #
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """", '\'', "\"";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""", N'\'', N"\"";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+DELIMITER ;$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+DROP PROCEDURE p1;
+
+SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
+SELECT '''', """";
+SELECT '<tab> <tab>\t<tab>';
+SELECT '<nl>
+<nl>\n<nl>';
+SELECT 'test';
+SELECT 'tëst';
+SELECT 'test\0';
+SELECT 'tëst\0';
+SELECT _binary'test';
+SELECT _binary'test\0';
+SELECT N'''', N"""";
+SELECT N'<tab> <tab>\t<tab>';
+SELECT N'<nl>
+<nl>\n<nl>';
+SELECT N'test';
+SELECT N'tëst';
+SELECT N'test\0';
+SELECT N'tëst\0';
+END$$
+DELIMITER ;$$
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
+SELECT body_utf8 FROM mysql.proc WHERE name='p1';
+DROP PROCEDURE p1;
+SET @@SQL_MODE=default;
+
+
+# TODO: Uncomment the below test whe we fix:
+# MDEV-9623INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION does not handle binary literals well
+#
+#SET NAMES binary;
+#CREATE FUNCTION f1() RETURNS TEXT RETURN CONCAT('i','й');
+#SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+#WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
+#SELECT body_utf8 FROM mysql.proc WHERE name='f1';
+#DROP FUNCTION f1;
+#SET NAMES utf8;
+
+
+--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/ctype_utf8mb4.test b/mysql-test/t/ctype_utf8mb4.test
index 3f2b6000597..2fe9b5e6544 100644
--- a/mysql-test/t/ctype_utf8mb4.test
+++ b/mysql-test/t/ctype_utf8mb4.test
@@ -1905,5 +1905,17 @@ SET NAMES utf8mb4;
SELECT * FROM `test😁😁test`;
--echo #
+--echo # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
+--echo #
+# Non-BMP characters should be replaced to '?' in ROUTINE_DEFINITION/body_utf8
+SET NAMES utf8mb4;
+CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4
+RETURN CONCAT('😎','x😎','😎y','x😎y');
+SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
+SELECT body_utf8 FROM mysql.proc WHERE name='f1';
+DROP FUNCTION f1;
+
+--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 38636b0e971..c78613e4304 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -538,6 +538,296 @@ select x.id, message from (select id from t1) x left join
where coalesce(message,0) <> 0;
drop table t1,t2;
+--echo #
+--echo # MDEV-7827: Assertion `!table || (!table->read_set ||
+--echo # bitmap_is_set(table->read_set, field_index))' failed
+--echo # in Field_long::val_str on EXPLAIN EXTENDED
+--echo #
+
+CREATE TABLE t1 (f1 INT, f2 INT, KEY(f2)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (6,9);
+
+CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (2),(0);
+
+EXPLAIN EXTENDED
+SELECT f1 FROM ( SELECT * FROM t1 ) AS sq
+WHERE f1 IN (
+ SELECT f3 FROM t2 WHERE f2 IN (
+ SELECT f3 FROM t2 HAVING f3 >= 8
+ )
+);
+
+DROP TABLE t2,t1;
+
+--echo #
+--echo # MDEV-9462: Out of memory using explain on 2 empty tables
+--echo #
+
+CREATE TABLE `t1` (
+ `REC_GROUP` char(2) DEFAULT NULL,
+ `CLIENT_INFO` text CHARACTER SET utf8,
+ `NAME` text,
+ `PHONE_NUMBER` text,
+ `ATTENTION_NAME` text,
+ `PAYMENT_TERM` text CHARACTER SET utf8,
+ `CREDIT_LIMIT` decimal(12,2) DEFAULT NULL,
+ `LAST_PAY_DATE` text CHARACTER SET utf8,
+ `TOTAL` double DEFAULT NULL,
+ `TOTAL_MCL` double DEFAULT NULL,
+ `TOTAL_MFS` double DEFAULT NULL,
+ `TOTAL_MIS` double DEFAULT NULL,
+ `BEFORE_DUE_7_MCL` double DEFAULT NULL,
+ `BEFORE_DUE_7_MFS` double DEFAULT NULL,
+ `BEFORE_DUE_7_MIS` double DEFAULT NULL,
+ `PER1_MCL` double DEFAULT NULL,
+ `PER1_MFS` double DEFAULT NULL,
+ `PER1_MIS` double DEFAULT NULL,
+ `PER2_MCL` double DEFAULT NULL,
+ `PER2_MFS` double DEFAULT NULL,
+ `PER2_MIS` double DEFAULT NULL,
+ `PER3_MCL` double DEFAULT NULL,
+ `PER3_MFS` double DEFAULT NULL,
+ `PER3_MIS` double DEFAULT NULL,
+ `PER4_MCL` double DEFAULT NULL,
+ `PER4_MFS` double DEFAULT NULL,
+ `PER4_MIS` double DEFAULT NULL,
+ `PER5_MCL` double DEFAULT NULL,
+ `PER5_MFS` double DEFAULT NULL,
+ `PER5_MIS` double DEFAULT NULL,
+ `PER6_MCL` double DEFAULT NULL,
+ `PER6_MFS` double DEFAULT NULL,
+ `PER6_MIS` double DEFAULT NULL,
+ `PER7_MCL` double DEFAULT NULL,
+ `PER7_MFS` double DEFAULT NULL,
+ `PER7_MIS` double DEFAULT NULL,
+ `BEFORE_DUE_7` double DEFAULT NULL,
+ `PER1` double DEFAULT NULL,
+ `PER2` double DEFAULT NULL,
+ `PER3` double DEFAULT NULL,
+ `PER4` double DEFAULT NULL,
+ `PER5` double DEFAULT NULL,
+ `PER6` double DEFAULT NULL,
+ `PER7` double DEFAULT NULL,
+ `REF` varchar(30) DEFAULT NULL,
+ `TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
+);
+
+
+CREATE TABLE `t2` (
+ `RECEIVABLE_GROUP` char(2) DEFAULT NULL,
+ `CLIENT_NUMBER` varchar(35) DEFAULT NULL,
+ `CLIENT_NAME` varchar(73) DEFAULT NULL,
+ `PHONE_NUMBER` char(12) DEFAULT NULL,
+ `ATTENTION_NAME` char(26) DEFAULT NULL,
+ `PAYMENT_TERM` varchar(26) CHARACTER SET utf8 DEFAULT NULL,
+ `CREDIT_LIMIT` decimal(12,2) DEFAULT NULL,
+ `LAST_PAY_DATE` varchar(42) CHARACTER SET utf8 DEFAULT NULL,
+ `TOTAL` decimal(12,2) DEFAULT NULL,
+ `BEFORE_DUE_7` decimal(12,2) DEFAULT NULL,
+ `PER1` decimal(12,2) DEFAULT NULL,
+ `PER2` decimal(12,2) DEFAULT NULL,
+ `PER3` decimal(12,2) DEFAULT NULL,
+ `PER4` decimal(12,2) DEFAULT NULL,
+ `PER5` decimal(12,2) DEFAULT NULL,
+ `PER6` decimal(12,2) DEFAULT NULL,
+ `PER7` decimal(12,2) DEFAULT NULL,
+ `DIVISION` varchar(3) CHARACTER SET utf8 NOT NULL,
+ `CLIENT_INFO` varchar(294) CHARACTER SET utf8 DEFAULT NULL,
+ `EXCHANGE_RATE` double NOT NULL,
+ `REF` varchar(30) DEFAULT NULL
+);
+
+explain
+SELECT A.RECEIVABLE_GROUP,A.CLIENT_INFO,A.CLIENT_NAME,A.PHONE_NUMBER,A.ATTENTION_NAME,A.PAYMENT_TERM,A.CREDIT_LIMIT,A.LAST_PAY_DATE,A.TOTAL,
+COALESCE(B.TOTAL_MCL,0) AS TOTAL_MCL,
+COALESCE(C.TOTAL_MFS,0) AS TOTAL_MFS,
+COALESCE(D.TOTAL_MIS,0) AS TOTAL_MIS,
+COALESCE(F.BEFORE_DUE_7_MCL,0) AS BEFORE_DUE_7_MCL,
+COALESCE(G.BEFORE_DUE_7_MFS,0) AS BEFORE_DUE_7_MFS,
+COALESCE(H.BEFORE_DUE_7_MIS,0) AS BEFORE_DUE_7_MIS,
+COALESCE(I.PER1_MCL,0) AS PER1_MCL,
+COALESCE(J.PER1_MFS,0) AS PER1_MFS,
+COALESCE(K.PER1_MIS,0) AS PER1_MIS,
+COALESCE(L.PER2_MCL,0) AS PER2_MCL,
+COALESCE(M.PER2_MFS,0) AS PER2_MFS,
+COALESCE(N.PER2_MIS,0) AS PER2_MIS,
+COALESCE(O.PER3_MCL,0) AS PER3_MCL,
+COALESCE(P.PER3_MFS,0) AS PER3_MFS,
+COALESCE(R.PER3_MIS,0) AS PER3_MIS,
+COALESCE(S.PER4_MCL,0) AS PER4_MCL,
+COALESCE(T.PER4_MFS,0) AS PER4_MFS,
+COALESCE(U.PER4_MIS,0) AS PER4_MIS,
+COALESCE(V.PER5_MCL,0) AS PER5_MCL,
+COALESCE(X.PER5_MFS,0) AS PER5_MFS,
+COALESCE(Z.PER5_MIS,0) AS PER5_MIS,
+COALESCE(Q.PER6_MCL,0) AS PER6_MCL,
+COALESCE(Y.PER6_MFS,0) AS PER6_MFS,
+COALESCE(W.PER6_MIS,0) AS PER6_MIS,
+COALESCE(A1.PER7_MCL,0) AS PER7_MCL,
+COALESCE(B1.PER7_MFS,0) AS PER7_MFS,
+COALESCE(C1.PER7_MIS,0) AS PER7_MIS,
+A.BEFORE_DUE_7,A.PER1,A.PER2,A.PER3,A.PER4,A.PER5,A.PER6,A.PER7,
+CONCAT(A.DIVISION,'-',A.CLIENT_NUMBER) AS REF,"2" AS TYPE FROM
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,
+GROUP_CONCAT(DISTINCT CLIENT_INFO SEPARATOR '<br>') AS CLIENT_INFO,
+GROUP_CONCAT(DISTINCT CLIENT_NAME SEPARATOR '<br>') AS CLIENT_NAME,
+GROUP_CONCAT( DISTINCT `PHONE_NUMBER` SEPARATOR '<br>' ) AS PHONE_NUMBER ,
+GROUP_CONCAT( DISTINCT `ATTENTION_NAME` SEPARATOR '<br>' ) AS ATTENTION_NAME,
+GROUP_CONCAT( DISTINCT `PAYMENT_TERM` SEPARATOR '<br>' ) AS PAYMENT_TERM,
+CREDIT_LIMIT ,
+GROUP_CONCAT( `LAST_PAY_DATE` SEPARATOR '<br>' ) AS LAST_PAY_DATE,
+SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL,
+SUM( `BEFORE_DUE_7`*EXCHANGE_RATE ) AS BEFORE_DUE_7,
+SUM( `PER1`*EXCHANGE_RATE ) AS PER1,
+SUM( `PER2`*EXCHANGE_RATE ) AS PER2,
+SUM( `PER3`*EXCHANGE_RATE ) AS PER3,
+SUM( `PER4`*EXCHANGE_RATE ) AS PER4,
+SUM( `PER5`*EXCHANGE_RATE ) AS PER5,
+SUM( `PER6`*EXCHANGE_RATE ) AS PER6,
+SUM( `PER7`*EXCHANGE_RATE ) AS PER7
+FROM `t2`
+WHERE REF IS NULL GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS A
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS B ON A.CLIENT_NUMBER=B.CLIENT_NUMBER AND
+A.DIVISION=B.DIVISION AND A.RECEIVABLE_GROUP=B.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=B.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS C ON A.CLIENT_NUMBER=C.CLIENT_NUMBER
+AND
+A.DIVISION=C.DIVISION AND A.RECEIVABLE_GROUP=C.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS D ON A.CLIENT_NUMBER=D.CLIENT_NUMBER AND
+A.DIVISION=D.DIVISION AND A.RECEIVABLE_GROUP=D.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=D.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS F ON A.CLIENT_NUMBER=F.CLIENT_NUMBER AND
+A.DIVISION=F.DIVISION AND A.RECEIVABLE_GROUP=F.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=F.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS G ON A.CLIENT_NUMBER=G.CLIENT_NUMBER AND
+A.DIVISION=G.DIVISION AND A.RECEIVABLE_GROUP=G.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=G.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS H ON A.CLIENT_NUMBER=H.CLIENT_NUMBER AND
+A.DIVISION=H.DIVISION AND A.RECEIVABLE_GROUP=H.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=H.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS I ON A.CLIENT_NUMBER=I.CLIENT_NUMBER AND
+A.DIVISION=I.DIVISION AND A.RECEIVABLE_GROUP=I.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=I.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS J ON A.CLIENT_NUMBER=J.CLIENT_NUMBER AND
+A.DIVISION=J.DIVISION AND A.RECEIVABLE_GROUP=J.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=J.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS K ON A.CLIENT_NUMBER=K.CLIENT_NUMBER AND
+A.DIVISION=K.DIVISION AND A.RECEIVABLE_GROUP=K.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=K.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS L ON A.CLIENT_NUMBER=L.CLIENT_NUMBER AND
+A.DIVISION=L.DIVISION AND A.RECEIVABLE_GROUP=L.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=L.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS M ON A.CLIENT_NUMBER=M.CLIENT_NUMBER AND
+A.DIVISION=M.DIVISION AND A.RECEIVABLE_GROUP=M.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=M.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS N ON A.CLIENT_NUMBER=N.CLIENT_NUMBER AND
+A.DIVISION=N.DIVISION AND A.RECEIVABLE_GROUP=N.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=N.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS O ON A.CLIENT_NUMBER=O.CLIENT_NUMBER AND
+A.DIVISION=O.DIVISION AND A.RECEIVABLE_GROUP=O.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=O.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS P ON A.CLIENT_NUMBER=P.CLIENT_NUMBER AND
+A.DIVISION=P.DIVISION AND A.RECEIVABLE_GROUP=P.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=P.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS R ON A.CLIENT_NUMBER=R.CLIENT_NUMBER AND
+A.DIVISION=R.DIVISION AND A.RECEIVABLE_GROUP=R.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=R.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS S ON A.CLIENT_NUMBER=S.CLIENT_NUMBER AND
+A.DIVISION=S.DIVISION AND A.RECEIVABLE_GROUP=S.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=S.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS T ON A.CLIENT_NUMBER=T.CLIENT_NUMBER AND
+A.DIVISION=T.DIVISION AND A.RECEIVABLE_GROUP=T.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=T.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS U ON A.CLIENT_NUMBER=U.CLIENT_NUMBER AND
+A.DIVISION=U.DIVISION AND A.RECEIVABLE_GROUP=U.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=U.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS V ON A.CLIENT_NUMBER=V.CLIENT_NUMBER AND
+A.DIVISION=V.DIVISION AND A.RECEIVABLE_GROUP=V.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=V.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS X ON A.CLIENT_NUMBER=X.CLIENT_NUMBER AND
+A.DIVISION=X.DIVISION AND A.RECEIVABLE_GROUP=X.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=X.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Z ON A.CLIENT_NUMBER=Z.CLIENT_NUMBER AND
+A.DIVISION=Z.DIVISION AND A.RECEIVABLE_GROUP=Z.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Z.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Q ON A.CLIENT_NUMBER=Q.CLIENT_NUMBER AND
+A.DIVISION=Q.DIVISION AND A.RECEIVABLE_GROUP=Q.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Q.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Y ON A.CLIENT_NUMBER=Y.CLIENT_NUMBER AND
+A.DIVISION=Y.DIVISION AND A.RECEIVABLE_GROUP=Y.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Y.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS W ON A.CLIENT_NUMBER=W.CLIENT_NUMBER AND
+A.DIVISION=W.DIVISION AND A.RECEIVABLE_GROUP=W.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=W.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MCL
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS A1 ON A.CLIENT_NUMBER=A1.CLIENT_NUMBER AND
+A.DIVISION=A1.DIVISION AND A.RECEIVABLE_GROUP=A1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=A1.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MFS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS B1 ON A.CLIENT_NUMBER=B1.CLIENT_NUMBER AND
+A.DIVISION=B1.DIVISION AND A.RECEIVABLE_GROUP=B1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=B1.CREDIT_LIMIT
+LEFT JOIN
+(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MIS
+FROM `t2`
+WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS C1 ON A.CLIENT_NUMBER=C1.CLIENT_NUMBER AND
+A.DIVISION=C1.DIVISION AND A.RECEIVABLE_GROUP=C1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C1.CREDIT_LIMIT
+ORDER BY TOTAL DESC;
+
+DROP TABLES t1,t2;
+
set optimizer_switch=@save_derived_optimizer_switch;
--echo #
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 8541f62023f..18293f31dd2 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1043,6 +1043,24 @@ select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
drop table t1;
SET timestamp=DEFAULT;
+--echo #
+--echo # Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6
+--echo # UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M"
+--echo #
+
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"));
+SELECT UNIX_TIMESTAMP('2015-06-00');
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
+
+set sql_mode= 'TRADITIONAL';
+SELECT @@sql_mode;
+
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"));
+SELECT UNIX_TIMESTAMP('2015-06-00');
+SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
+
+set sql_mode= default;
+
select time('10:10:10') > 10;
select time('10:10:10') > 1010;
select time('10:10:09') > 101010;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 531cec6b730..fe9308cd20a 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1767,3 +1767,29 @@ DROP TABLE where_subselect;
--echo # End of Bug #58782
+--echo #
+--echo # MDEV-8988: Apparently valid SQL query gives wrong result (nested WHERE)
+--echo #
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int, b int, c int);
+insert into t1 select A.a + 10*B.a, A.a, A.a + 10*B.a from t0 A, t0 B;
+insert into t1 values (NULL, NULL, NULL);
+
+create table t2 (c int, col1 int, key(c));
+insert into t2 select t1.a, 100000 from t1;
+analyze table t2;
+
+explain
+select
+ max(a)+ (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+
+select
+ max(a) + (select col1 from t2 where t2.c=t1.c)
+from t1
+group by t1.b;
+
+drop table t0,t1,t2;
diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test
index 657d0effd7e..9a9658e9027 100644
--- a/mysql-test/t/information_schema_inno.test
+++ b/mysql-test/t/information_schema_inno.test
@@ -109,3 +109,9 @@ CREATE TABLE t1 engine = InnoDB AS
DROP TABLE t1;
DROP VIEW v1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
+DROP TABLE t1;
diff --git a/mysql-test/t/merge_innodb.test b/mysql-test/t/merge_innodb.test
index 7f0b1a0c36e..9f87f241d00 100644
--- a/mysql-test/t/merge_innodb.test
+++ b/mysql-test/t/merge_innodb.test
@@ -39,3 +39,34 @@ SELECT * FROM t2;
SELECT * FROM t1;
DROP TABLE t1, t2, t3, t4, t5;
+#
+# Bug#20691429 temporary merge over view under lock tables
+#
+create table t1 (c1 varchar(100));
+create table t2 (c1 varchar(100));
+create view t3 as select * from t1;
+insert into t1 values ('ann'), ('alice');
+insert into t2 values ('bob'), ('brian');
+create temporary table t4 (c1 varchar(100)) engine=MERGE union=(t2, t1);
+create temporary table t5 (c1 varchar(100)) engine=MERGE union=(t3, t1);
+--error ER_WRONG_MRG_TABLE
+select * from t5;
+lock tables t1 read, t2 read, t3 read, t4 read;
+--error ER_WRONG_MRG_TABLE
+select * from t5;
+select * from t4;
+unlock tables;
+drop table t2;
+create view t2 as select * from t1;
+--error ER_WRONG_MRG_TABLE
+select * from t4;
+lock tables t1 read, t2 read, t3 read;
+--error ER_WRONG_MRG_TABLE
+select * from t4;
+--error ER_WRONG_MRG_TABLE
+select * from t4;
+--error ER_WRONG_MRG_TABLE
+select * from t4;
+unlock tables;
+drop view t2, t3;
+drop table t1;
diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test
index 49a90264f11..7afe1ad250d 100644
--- a/mysql-test/t/mysql_upgrade_view.test
+++ b/mysql-test/t/mysql_upgrade_view.test
@@ -158,5 +158,30 @@ rename table mysql.ev_bk to mysql.event;
drop table if exists kv;
drop view v1,v2,v3,v4;
-drop table t1;
+#
+# MDEV-9453 mysql_upgrade.exe error when mysql is migrated to mariadb
+# (mysql_upgrade.exe --upgrade-system-tables fails on fixing views)
+#
+
+# Make it look like a MySQL directory again
+
+rename table mysql.event to mysql.ev_bk;
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYI $MYSQLD_DATADIR/mysql/event.MYI
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYD $MYSQLD_DATADIR/mysql/event.MYD
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.frm $MYSQLD_DATADIR/mysql/event.frm
+
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm
+--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm
+
+flush tables;
+
+--replace_result $MYSQLTEST_VARDIR var
+--exec $MYSQL_UPGRADE --force --upgrade-system-tables 2>&1
+
+# back to mariadb default
+drop table mysql.event;
+rename table mysql.ev_bk to mysql.event;
+drop view v1,v2,v3;
+drop table t1;
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index b60f11ab534..8857195d0e1 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -949,6 +949,15 @@ EXPLAIN EXTENDED SELECT NULLIF(AVG(a),0) FROM t1;
DROP TABLE t1;
+#
+# MDEV-9576 syntax error on view with nullif and count
+#
+create table t1 (col1 varchar(50));
+create view v1 AS select nullif(count(distinct col1),0) from t1;
+show create view v1;
+drop view v1;
+drop table t1;
+
--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/second_frac-9175.test b/mysql-test/t/second_frac-9175.test
new file mode 100644
index 00000000000..91baf997459
--- /dev/null
+++ b/mysql-test/t/second_frac-9175.test
@@ -0,0 +1,9 @@
+#
+# MDEV-9175 Query parser tansforms MICROSECOND into SECOND_FRAC, which does not work
+#
+
+select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
+explain extended select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
+create view v1 as select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
+select * from v1;
+drop view v1;
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 88940eaf2b8..33613697722 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -277,3 +277,13 @@ select sql_calc_found_rows * from t1 ignore index (i) where i = 0 order by v lim
select found_rows();
drop table t1;
+#
+# MDEV-9390 Function found_rows() gives incorrect result where the previous SELECT contains ORDER BY clause
+#
+create table t1(c1 int);
+insert into t1 values(1),(2),(3),(4),(5);
+select * from t1 order by c1 limit 2,1;
+select found_rows();
+select sql_calc_found_rows * from t1 order by c1 limit 2,1;
+select found_rows();
+drop table t1;
diff --git a/mysql-test/t/show.test b/mysql-test/t/show.test
new file mode 100644
index 00000000000..3101f443264
--- /dev/null
+++ b/mysql-test/t/show.test
@@ -0,0 +1,15 @@
+#
+# MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
+# MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
+# MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
+#
+--error ER_PARSE_ERROR
+show statistics;
+--error ER_PARSE_ERROR
+show spatial_ref_sys
+--error ER_PARSE_ERROR
+show system_variables;
+--error ER_PARSE_ERROR
+show geometry_columns;
+--error ER_PARSE_ERROR
+show nonexistent;
diff --git a/mysql-test/t/ssl_cert_verify.test b/mysql-test/t/ssl_cert_verify.test
new file mode 100644
index 00000000000..83f621b7ca9
--- /dev/null
+++ b/mysql-test/t/ssl_cert_verify.test
@@ -0,0 +1,43 @@
+# Want to skip this test from Valgrind execution
+--source include/no_valgrind_without_big.inc
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+-- source include/have_ssl_communication.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+let $ssl_verify_fail_path = --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-key-verify-fail.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert-verify-fail.pem;
+let $ssl_verify_pass_path = --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-key-verify-pass.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert-verify-pass.pem;
+
+--echo #T1: Host name (/CN=localhost/) as OU name in the server certificate, server certificate verification should fail.
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:" $ssl_verify_fail_path > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1
+--exec $MYSQL --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-verify-server-cert -e "SHOW STATUS like 'Ssl_version'"
+
+--echo #T2: Host name (localhost) as common name in the server certificate, server certificate verification should pass.
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:" $ssl_verify_pass_path > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--replace_result TLSv1.2 TLS_VERSION TLSv1.1 TLS_VERSION TLSv1 TLS_VERSION
+--exec $MYSQL --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-verify-server-cert -e "SHOW STATUS like 'Ssl_version'"
+
+--echo # restart server using restart
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart: " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index a862870e9ff..7a7c01e78bd 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -5968,6 +5968,17 @@ deallocate prepare stmt;
drop table t1,t2,t3,t4;
--echo #
+--echo # MDEV-7122
+--echo # Assertion `0' failed in subselect_hash_sj_engine::init
+--echo #
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+DROP TABLE t1;
+SET SESSION big_tables=0;
+
+--echo #
--echo # MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
--echo # m_lock_type != 2' failed in handler::ha_index_read_map
--echo #
diff --git a/mysql-test/t/subselect_mat.test b/mysql-test/t/subselect_mat.test
index 09c6b3e1747..9c7c9683d0b 100644
--- a/mysql-test/t/subselect_mat.test
+++ b/mysql-test/t/subselect_mat.test
@@ -254,3 +254,19 @@ SELECT a, b, (a, b) NOT IN (SELECT a, b FROM t2) as sq
FROM t1;
drop table t1, t2;
+
+--echo #
+--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
+--echo # UNION ALL
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1),(2);
+
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) LIMIT 0 )
+UNION ALL
+( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) )
+;
+
+drop table t1, t2;
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index c2b93c919dd..b6d6e0a5172 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -2704,5 +2704,74 @@ explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
drop table t1;
+--echo #
+--echo # MDEV-7823: Server crashes in next_depth_first_tab on nested IN clauses with SQ inside
+--echo #
+set @tmp_mdev7823=@@optimizer_switch;
+set optimizer_switch=default;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (f2 INT, KEY(f2));
+INSERT INTO t2 VALUES (8),(0);
+
+CREATE TABLE t3 (f3 INT);
+INSERT INTO t3 VALUES (1),(2);
+
+CREATE TABLE t4 (f4 INT);
+INSERT INTO t4 VALUES (0),(5);
+
+explain
+SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
+SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
+
+drop table t1,t2,t3,t4;
+set optimizer_switch= @tmp_mdev7823;
+
+--echo #
+--echo # MDEV-6859: scalar subqueries in a comparison produced unexpected result
+--echo #
+set @tmp_mdev6859=@@optimizer_switch;
+set optimizer_switch=default;
+CREATE TABLE t1 (
+ project_number varchar(50) NOT NULL,
+ PRIMARY KEY (project_number)
+) ENGINE=MyISAM;
+
+INSERT INTO t1 (project_number) VALUES ('aaa'),('bbb');
+
+CREATE TABLE t2 (
+ id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ project_number varchar(50) NOT NULL,
+ history_date date NOT NULL,
+ country varchar(50) NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=MyISAM;
+
+INSERT INTO t2 (id, project_number, history_date, country) VALUES
+(1, 'aaa', '2014-08-09', 'france'),(2, 'aaa', '2014-09-09', 'singapore');
+
+CREATE TABLE t3 (
+ region varchar(50) NOT NULL,
+ country varchar(50) NOT NULL
+) ENGINE=MyISAM;
+
+INSERT INTO t3 (region, country) VALUES ('apac', 'singapore'),('eame', 'france');
+
+SELECT SQL_NO_CACHE a.project_number
+FROM t1 a
+WHERE ( SELECT z.country
+ FROM t2 z
+ WHERE z.project_number = a.project_number AND z.history_date <= '2014-09-01'
+ ORDER BY z.id DESC LIMIT 1
+ ) IN (
+ SELECT r.country
+ FROM t3 r
+ WHERE r.region = 'eame'
+ );
+
+drop table t1, t2, t3;
+set optimizer_switch= @tmp_mdev6859;
+
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 20585dd9ab7..065be302237 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -292,6 +292,8 @@ eval create table t1 (a int primary key) engine=myisam
index directory="$MYSQLTEST_VARDIR/run";
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select create_options from information_schema.tables where table_name='t1';
--echo # CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
--echo # options should not fail. Per documentation newly created table
--echo # should not inherit value of these options from the original table.
diff --git a/mysql-test/t/trigger_null-8605.test b/mysql-test/t/trigger_null-8605.test
index f4935b9c975..c9b0257afc8 100644
--- a/mysql-test/t/trigger_null-8605.test
+++ b/mysql-test/t/trigger_null-8605.test
@@ -339,3 +339,24 @@ insert t1 values (0);
select * from t1;
drop table t1;
+#
+# MDEV-9500 Bug after upgrade to 10.1.10 (and 10.1.11)
+#
+create table t1 (a int not null, b int);
+create trigger trgi before update on t1 for each row do 1;
+insert t1 values (1,1),(2,2),(3,3),(1,4);
+create table t2 select a as c, b as d from t1;
+update t1 set a=(select count(c) from t2 where c+1=a+1 group by a);
+select * from t1;
+drop table t1, t2;
+
+#
+# MDEV-9535 Trigger doing "SET NEW.auctionStart = NOW();" on a timestamp kills MariaDB server.
+#
+create table t1 (a int not null);
+create table t2 (f1 int unsigned not null, f2 int);
+insert into t2 values (1, null);
+create trigger tr1 before update on t1 for each row do 1;
+create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
+update t2 set f2=1 where f1=1;
+drop table t1, t2;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 34437df2f2c..52ca2c85b15 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -386,6 +386,14 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1;
drop table t1;
--echo #
+--echo # MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str
+--echo #
+CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1));
+INSERT INTO t1 VALUES ('2003-04-27','a'),('1900-01-01','a');
+SELECT GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3) FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # Start of 10.1 tests
--echo #
@@ -402,15 +410,6 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02');
DROP TABLE t1;
-
---echo #
---echo # End of 10.1 tests
---echo #
-
---echo #
---echo # Start of 10.1 tests
---echo #
-
--echo #
--echo # MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
--echo #
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index fb4992023f0..1d1b64d323e 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5491,6 +5491,16 @@ deallocate prepare stmt;
drop view v1,v2;
drop table `t1`;
+
+#
+# Bug#19817021
+#
+create table t1 (a int, b int);
+create view v1 as select a+b from t1;
+alter table v1 check partition p1;
+drop view v1;
+drop table t1;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/t/xa_sync.test b/mysql-test/t/xa_sync.test
index 8a995c4a184..bb95af7c0ba 100644
--- a/mysql-test/t/xa_sync.test
+++ b/mysql-test/t/xa_sync.test
@@ -25,10 +25,9 @@ while ($i)
disconnect con1;
disable_query_log;
echo # Waiting for thread to get deleted;
- while (`SELECT VARIABLE_VALUE!=2 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='max_used_connections'`)
+ while (`SELECT count(*)!=2 FROM INFORMATION_SCHEMA.PROCESSLIST`)
{
real_sleep 0.1;
- FLUSH STATUS;
}
enable_query_log;
SET debug_sync='now SIGNAL go';
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 9a3301900ae..b5c9b62049b 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1,5 +1,5 @@
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates.
-# Copyright (c) 2008-2011, Monty Program Ab
+# Copyright (c) 2005, 2015, Oracle and/or its affiliates.
+# Copyright (c) 2008, 2016, MariaDB
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -1091,8 +1091,8 @@
# write_keys() and find_all_keys().
# They both return ha_rows, which is platform dependent.
#
-# The '...' wildcards are for 'fun:inline_mysql_file_write' which *may*
-# be inlined.
+# The '...' wildcards are for 'fun:inline_mysql_file_write' and
+# 'fun:find_all_keys' which *may* be inlined.
{
Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / one
Memcheck:Param
@@ -1103,7 +1103,7 @@
fun:my_b_flush_io_cache
fun:_my_b_write
fun:_Z*10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
- fun:_Z*13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_
+ ...
fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
}
@@ -1287,28 +1287,6 @@
}
{
- GitHub codership/galera#308
- Memcheck:Leak
- match-leak-kinds: definite
- fun:malloc
- fun:_ZNK6galera13ReplicatorSMM9stats_getEv
- fun:_ZL28export_wsrep_status_to_mysqlP3THD
- fun:_Z17wsrep_show_statusP3THDP17st_mysql_show_varPc
- fun:_ZL17show_status_arrayP3THDPKcP17st_mysql_show_var13enum_var_typeP17system_status_varS2_P5TABLEbP4Item
- fun:_Z11fill_statusP3THDP10TABLE_LISTP4Item
- fun:_ZL13do_fill_tableP3THDP10TABLE_LISTP13st_join_table
- fun:_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state
- fun:_ZN4JOIN14prepare_resultEPP4ListI4ItemE
- fun:_ZN4JOIN4execEv
- fun:_ZL20mysql_execute_selectP3THDP13st_select_lexb
- fun:_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex
- fun:_Z13handle_selectP3THDP13select_resultm
- fun:_ZL21execute_sqlcom_selectP3THDP10TABLE_LIST
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
-}
-
-{
GitHub codership/mysql-wsrep#176
Memcheck:Leak
fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 10fe5ae40c4..6be11edbfcf 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2016, MariaDB
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/my_default.c b/mysys/my_default.c
index 0ce01960630..34ba9eef218 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -576,6 +576,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
handle_default_option, (void *) &ctx,
dirs)))
{
+ delete_dynamic(&args);
free_root(&alloc,MYF(0));
DBUG_RETURN(error);
}
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index 208f2ff902a..0fad7f90552 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -72,7 +72,7 @@ err:
return res;
}
-#elif defined(__linux__) || defined(__sun__)
+#elif defined(__linux__) || defined(__sun)
#include <net/if.h>
#include <sys/ioctl.h>
#include <net/if_arp.h>
diff --git a/mysys/my_rnd.c b/mysys/my_rnd.c
index 14f212e2f32..ad7bda0b42b 100644
--- a/mysys/my_rnd.c
+++ b/mysys/my_rnd.c
@@ -95,7 +95,3 @@ double my_rnd_ssl(struct my_rnd_struct *rand_st)
return my_rnd(rand_st);
}
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index c761064dd96..07ba4f5c587 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2016, MariaDB
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/safemalloc.c b/mysys/safemalloc.c
index 5d19647c989..2a484dd1c56 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -375,7 +375,7 @@ void sf_report_leaked_memory(my_thread_id id)
{
my_thread_id tid = irem->thread_id && irem->flags & MY_THREAD_SPECIFIC ?
irem->thread_id : 0;
- fprintf(stderr, "Warning: %4lu bytes lost at %p, allocated by T@%lu at ",
+ fprintf(stderr, "Warning: %4lu bytes lost at %p, allocated by T@%llu at ",
(ulong) irem->datasize, (char*) (irem + 1), tid);
print_stack(irem->frame);
total+= irem->datasize;
diff --git a/mysys/string.c b/mysys/string.c
index cc73d18c601..a0fa3a02e17 100644
--- a/mysys/string.c
+++ b/mysys/string.c
@@ -142,16 +142,16 @@ my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n)
my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
{
#ifdef __WIN__
- const char *quote_str= "\"";
- const uint quote_len= 1;
+ LEX_CSTRING quote= { C_STRING_WITH_LEN("\"") };
+ LEX_CSTRING replace= { C_STRING_WITH_LEN("\\\"") };
#else
- const char *quote_str= "\'";
- const uint quote_len= 1;
+ LEX_CSTRING quote= { C_STRING_WITH_LEN("\'") };
+ LEX_CSTRING replace= { C_STRING_WITH_LEN("'\"'\"'") };
#endif /* __WIN__ */
my_bool ret= TRUE;
va_list dirty_text;
- ret&= dynstr_append_mem(str, quote_str, quote_len); /* Leading quote */
+ ret&= dynstr_append_mem(str, quote.str, quote.length); /* Leading quote */
va_start(dirty_text, append);
while (append != NullS)
{
@@ -159,18 +159,17 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
const char *next_pos= cur_pos;
/* Search for quote in each string and replace with escaped quote */
- while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0')
+ while(*(next_pos= strcend(cur_pos, quote.str[0])) != '\0')
{
ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos));
- ret&= dynstr_append_mem(str ,"\\", 1);
- ret&= dynstr_append_mem(str, quote_str, quote_len);
+ ret&= dynstr_append_mem(str, replace.str, replace.length);
cur_pos= next_pos + 1;
}
ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos));
append= va_arg(dirty_text, char *);
}
va_end(dirty_text);
- ret&= dynstr_append_mem(str, quote_str, quote_len); /* Trailing quote */
+ ret&= dynstr_append_mem(str, quote.str, quote.length); /* Trailing quote */
return ret;
}
diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt
index f85d0deaea1..7d9e58e165f 100644
--- a/plugin/auth_gssapi/CMakeLists.txt
+++ b/plugin/auth_gssapi/CMakeLists.txt
@@ -17,6 +17,15 @@ ELSE()
SET(GSSAPI_CLIENT gssapi_client.cc)
SET(GSSAPI_SERVER gssapi_server.cc)
SET(GSSAPI_ERRMSG gssapi_errmsg.cc)
+
+ SET(CMAKE_REQUIRED_INCLUDES ${GSSAPI_INCS})
+ SET(CMAKE_REQUIRED_LIBRARIES ${GSSAPI_LIBS})
+ INCLUDE(CheckCXXSymbolExists)
+ CHECK_CXX_SYMBOL_EXISTS(krb5_free_unparsed_name "krb5.h" HAVE_KRB5_FREE_UNPARSED_NAME)
+ IF(HAVE_KRB5_FREE_UNPARSED_NAME)
+ ADD_DEFINITIONS(-DHAVE_KRB5_FREE_UNPARSED_NAME=1)
+ ENDIF()
+
ELSE()
# Can't build plugin
RETURN()
diff --git a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
index 78111fc2368..cc8e62d1ca7 100644
--- a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
+++ b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
@@ -39,7 +39,7 @@ if(GSSAPI_LIBS AND GSSAPI_FLAVOR)
else(GSSAPI_LIBS AND GSSAPI_FLAVOR)
- find_program(KRB5_CONFIG NAMES krb5-config PATHS
+ find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
/opt/local/bin
ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
)
@@ -95,4 +95,4 @@ else(GSSAPI_LIBS AND GSSAPI_FLAVOR)
endif(KRB5_CONFIG)
-endif(GSSAPI_LIBS AND GSSAPI_FLAVOR) \ No newline at end of file
+endif(GSSAPI_LIBS AND GSSAPI_FLAVOR)
diff --git a/plugin/auth_gssapi/gssapi_server.cc b/plugin/auth_gssapi/gssapi_server.cc
index ed042a026b1..ac75a4f1593 100644
--- a/plugin/auth_gssapi/gssapi_server.cc
+++ b/plugin/auth_gssapi/gssapi_server.cc
@@ -31,6 +31,9 @@ static void log_error( OM_uint32 major, OM_uint32 minor, const char *msg)
Generate default principal service name formatted as principal name "mariadb/server.fqdn@REALM"
*/
#include <krb5.h>
+#ifndef HAVE_KRB5_FREE_UNPARSED_NAME
+#define krb5_free_unparsed_name(a,b) krb5_xfree(b)
+#endif
static char* get_default_principal_name()
{
static char default_name[1024];
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index 28a907a9d93..c7861d99004 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -376,7 +376,6 @@ static MYSQL_SYSVAR_STR(http_proxy, http_proxy,
PLUGIN_VAR_READONLY | PLUGIN_VAR_RQCMDARG,
"Proxy server host:port.", NULL, NULL,0);
-
#ifndef DBUG_OFF
static MYSQL_SYSVAR_ULONG(debug_startup_interval, debug_startup_interval,
PLUGIN_VAR_RQCMDARG, "for debugging only",
diff --git a/plugin/feedback/url_base.cc b/plugin/feedback/url_base.cc
index ad99249c268..6afbcd7c8f4 100644
--- a/plugin/feedback/url_base.cc
+++ b/plugin/feedback/url_base.cc
@@ -48,7 +48,6 @@ Url* Url::create(const char *url, size_t url_length)
return self;
}
-
int Url::parse_proxy_server(const char *proxy_server, size_t proxy_length,
LEX_STRING *host, LEX_STRING *port)
{
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index bbe4e3fb7a4..7901853c3f8 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -1,6 +1,6 @@
/* Copyright (C) 2007 Google Inc.
- Copyright (c) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+ Copyright (c) 2008, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2016, MariaDB
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/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 6e61cdb246b..9df0d75e3c6 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -535,10 +535,14 @@ static struct st_mysql_show_var audit_status[]=
#if defined(HAVE_PSI_INTERFACE) && !defined(FLOGGER_NO_PSI)
/* These belong to the service initialization */
static PSI_mutex_key key_LOCK_operations;
+static PSI_mutex_key key_LOCK_bigbuffer;
static PSI_mutex_info mutex_key_list[]=
-{{ &key_LOCK_operations, "SERVER_AUDIT_plugin::lock_operations",
-{{ &key_LOCK_bigbuffer, "SERVER_AUDIT_plugin::lock_bigbuffer",
- PSI_FLAG_GLOBAL}};
+{
+ { &key_LOCK_operations, "SERVER_AUDIT_plugin::lock_operations",
+ PSI_FLAG_GLOBAL},
+ { &key_LOCK_bigbuffer, "SERVER_AUDIT_plugin::lock_bigbuffer",
+ PSI_FLAG_GLOBAL}
+};
#endif
static mysql_mutex_t lock_operations;
static mysql_mutex_t lock_bigbuffer;
@@ -2843,7 +2847,7 @@ void __attribute__ ((constructor)) audit_plugin_so_init(void)
}
memset(locinfo_ini_value, 'O', sizeof(locinfo_ini_value)-1);
- locinfo_ini_value[sizeof(locinfo_ini_value)]= 0;
+ locinfo_ini_value[sizeof(locinfo_ini_value)-1]= 0;
exit:
#ifdef _WIN32
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 224e34de73b..eeb44b75322 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -296,11 +296,6 @@ SET(ADD_GIS_SP_EOL "|")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/maria_add_gis_sp.sql.in
${CMAKE_CURRENT_BINARY_DIR}/maria_add_gis_sp.sql ESCAPE_QUOTES @ONLY)
-INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/maria_add_gis_sp.sql
- DESTINATION ${INSTALL_BINDIR}
- COMPONENT Server
- )
-
SET(ADD_GIS_SP_SET_DELIMITER "")
SET(ADD_GIS_SP_RESET_DELIMITER "")
SET(ADD_GIS_SP_EOL ";")
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 2b432cb1089..4cd21d3c216 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -250,7 +250,11 @@ parse_cnf()
{
local group=$1
local var=$2
- reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2-)
+ # print the default settings for given group using my_print_default.
+ # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
+ # then grep for needed variable
+ # finally get the variable value (if variables has been specified multiple time use the last value only)
+ reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
if [[ -z $reval ]];then
[[ -n $3 ]] && reval=$3
fi
@@ -699,9 +703,8 @@ then
INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
fi
- if [ -n "$WSREP_SST_OPT_PSWD" ]; then
-# INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
- export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
+ if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
+ INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
else
# Empty password, used for testing, debugging etc.
INNOEXTRA+=" --password="
diff --git a/scripts/wsrep_sst_xtrabackup.sh b/scripts/wsrep_sst_xtrabackup.sh
index 1ef3c3f3ce1..2247edec7fd 100644
--- a/scripts/wsrep_sst_xtrabackup.sh
+++ b/scripts/wsrep_sst_xtrabackup.sh
@@ -442,9 +442,8 @@ then
INNOEXTRA+=" --user=$WSREP_SST_OPT_USER"
fi
- if [ -n "$WSREP_SST_OPT_PSWD" ]; then
-# INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
- export MYSQL_PWD="$WSREP_SST_OPT_PSWD"
+ if [ -n "${WSREP_SST_OPT_PSWD:-}" ]; then
+ INNOEXTRA+=" --password=$WSREP_SST_OPT_PSWD"
else
# Empty password, used for testing, debugging etc.
INNOEXTRA+=" --password="
diff --git a/sql-common/client.c b/sql-common/client.c
index 7571e5c0b1d..b96231fcc13 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,5 +1,5 @@
-/* Copyright (c) 2003, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -1755,38 +1755,39 @@ mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const char **errptr)
{
SSL *ssl;
- X509 *server_cert;
- X509_NAME *x509sn;
- int cn_pos;
- X509_NAME_ENTRY *cn_entry;
- ASN1_STRING *cn_asn1;
- const char *cn_str;
+ X509 *server_cert= NULL;
+ char *cn= NULL;
+ int cn_loc= -1;
+ ASN1_STRING *cn_asn1= NULL;
+ X509_NAME_ENTRY *cn_entry= NULL;
+ X509_NAME *subject= NULL;
+ int ret_validation= 1;
+
DBUG_ENTER("ssl_verify_server_cert");
DBUG_PRINT("enter", ("server_hostname: %s", server_hostname));
if (!(ssl= (SSL*)vio->ssl_arg))
{
*errptr= "No SSL pointer found";
- DBUG_RETURN(1);
+ goto error;
}
if (!server_hostname)
{
*errptr= "No server hostname supplied";
- DBUG_RETURN(1);
+ goto error;
}
if (!(server_cert= SSL_get_peer_certificate(ssl)))
{
*errptr= "Could not get server certificate";
- DBUG_RETURN(1);
+ goto error;
}
if (X509_V_OK != SSL_get_verify_result(ssl))
{
*errptr= "Failed to verify the server certificate";
- X509_free(server_cert);
- DBUG_RETURN(1);
+ goto error;
}
/*
We already know that the certificate exchanged was valid; the SSL library
@@ -1794,33 +1795,57 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c
are what we expect.
*/
- x509sn= X509_get_subject_name(server_cert);
-
- if ((cn_pos= X509_NAME_get_index_by_NID(x509sn, NID_commonName, -1)) < 0)
- goto err;
+ /*
+ Some notes for future development
+ We should check host name in alternative name first and then if needed check in common name.
+ Currently yssl doesn't support alternative name.
+ openssl 1.0.2 support X509_check_host method for host name validation, we may need to start using
+ X509_check_host in the future.
+ */
- if (!(cn_entry= X509_NAME_get_entry(x509sn, cn_pos)))
- goto err;
+ subject= X509_get_subject_name(server_cert);
+ cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1);
+ if (cn_loc < 0)
+ {
+ *errptr= "Failed to get CN location in the certificate subject";
+ goto error;
+ }
- if (!(cn_asn1 = X509_NAME_ENTRY_get_data(cn_entry)))
- goto err;
+ cn_entry= X509_NAME_get_entry(subject, cn_loc);
+ if (cn_entry == NULL)
+ {
+ *errptr= "Failed to get CN entry using CN location";
+ goto error;
+ }
- cn_str = (char *)ASN1_STRING_data(cn_asn1);
+ cn_asn1 = X509_NAME_ENTRY_get_data(cn_entry);
+ if (cn_asn1 == NULL)
+ {
+ *errptr= "Failed to get CN from CN entry";
+ goto error;
+ }
- /* Make sure there is no embedded \0 in the CN */
- if ((size_t)ASN1_STRING_length(cn_asn1) != strlen(cn_str))
- goto err;
+ cn= (char *) ASN1_STRING_data(cn_asn1);
- if (strcmp(cn_str, server_hostname))
- goto err;
+ if ((size_t)ASN1_STRING_length(cn_asn1) != strlen(cn))
+ {
+ *errptr= "NULL embedded in the certificate CN";
+ goto error;
+ }
- X509_free (server_cert);
- DBUG_RETURN(0);
+ DBUG_PRINT("info", ("Server hostname in cert: %s", cn));
+ if (!strcmp(cn, server_hostname))
+ {
+ /* Success */
+ ret_validation= 0;
+ }
-err:
- X509_free(server_cert);
*errptr= "SSL certificate validation failure";
- DBUG_RETURN(1);
+
+error:
+ if (server_cert != NULL)
+ X509_free (server_cert);
+ DBUG_RETURN(ret_validation);
}
#endif /* HAVE_OPENSSL */
diff --git a/sql/authors.h b/sql/authors.h
index cc9889bcdbc..3a8f5497248 100644
--- a/sql/authors.h
+++ b/sql/authors.h
@@ -56,7 +56,7 @@ struct show_table_authors_st show_table_authors[]= {
"Unicode and character sets" },
{ "Alexey Botchkov (Holyfoot)", "Izhevsk, Russia",
"GIS extensions, embedded server, precision math"},
- { "Daniel Bartholomew", "Raleigh, USA", "MariaDB documentation"},
+ { "Daniel Bartholomew", "Raleigh, USA", "MariaDB documentation, Buildbot, releases"},
{ "Colin Charles", "Selangor, Malesia", "MariaDB documentation, talks at a LOT of conferences"},
{ "Sergey Vojtovich", "Izhevsk, Russia",
"initial implementation of plugin architecture, maintained native storage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache"},
@@ -73,6 +73,8 @@ struct show_table_authors_st show_table_authors[]= {
{ "Pavel Ivanov", "USA", "Some patches and bug fixes"},
{ "Konstantin Osipov", "Moscow, Russia",
"Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0)" },
+ { "Ian Gilfillan", "South Africa", "MariaDB documentation"},
+ { "Federico Razolli", "Italy", "MariaDB documentation Italian translation"},
/* People working on MySQL code base (not NDB) */
{ "Guilhem Bichot", "Bordeaux, France", "Replication (since 4.0)" },
diff --git a/sql/client_settings.h b/sql/client_settings.h
index cc90d6a174d..486862b276d 100644
--- a/sql/client_settings.h
+++ b/sql/client_settings.h
@@ -37,7 +37,7 @@
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
CLIENT_CONNECT_ATTRS)
-#define read_user_name(A) {}
+#define read_user_name(A) A[0]= 0
#undef _CUSTOMCONFIG_
#define mysql_server_init(a,b,c) mysql_client_plugin_init()
diff --git a/sql/contributors.h b/sql/contributors.h
index 2479f611727..255decd19cc 100644
--- a/sql/contributors.h
+++ b/sql/contributors.h
@@ -37,18 +37,16 @@ struct show_table_contributors_st {
struct show_table_contributors_st show_table_contributors[]= {
/* MariaDB foundation members, in contribution, size , time order */
- {"Booking.com", "http://www.booking.com", "Founding member of the MariaDB foundation"},
- {"SkySQL Ab", "http://www.skysql.com", "Founding member of the MariaDB foundation"},
- {"Auttomatic", "http://automattic.com", "Member of the MariaDB foundation"},
- {"Parallels", "http://www.parallels.com/products/plesk", "Founding member of the MariaDB foundation"},
+ {"Booking.com", "http://www.booking.com", "Founding member of the MariaDB Foundation"},
+ {"MariaDB Corporation", "https://mariadb.com", "Founding member of the MariaDB Foundation"},
+ {"Auttomattic", "http://automattic.com", "Member of the MariaDB Foundation"},
+ {"Parallels", "http://www.parallels.com/products/plesk", "Founding member of the MariaDB Foundation"},
+ {"Acronis", "http://www.acronis.com", "Member of the MariaDB Foundation"},
/* Smaller sponsors, newer per year */
- {"Verkkokauppa.com", "Finland", "Sponsor of the MariaDB foundation"},
- {"Webyog", "Bangalor", "Sponsor of the MariaDB foundation"},
- {"Percona", "USA", "Sponsor of the MariaDB foundation"},
- {"Jelastic.com", "Russia", "Sponsor of the MariaDB foundation"},
- {"Planetta.net", "Finland", "Sponsor of the MariaDB foundation"},
- {"Open query", "Australia", "Sponsor of the MariaDB foundation"},
+ {"Verkkokauppa.com", "Finland", "Sponsor of the MariaDB Foundation"},
+ {"Webyog", "Bangalore", "Sponsor of the MariaDB Foundation"},
+ {"Wikimedia Foundation", "USA", "Sponsor of the MariaDB Foundation"},
/* Sponsors of important features */
{"Google", "USA", "Sponsoring parallel replication and GTID" },
diff --git a/sql/field.h b/sql/field.h
index 435ea20825a..8869c16cb98 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -609,6 +609,13 @@ public:
{
in_partitioning_expr= TRUE;
}
+ bool is_equal(Virtual_column_info* vcol)
+ {
+ return field_type == vcol->get_real_type()
+ && stored_in_db == vcol->is_stored()
+ && expr_str.length == vcol->expr_str.length
+ && memcmp(expr_str.str, vcol->expr_str.str, expr_str.length) == 0;
+ }
};
class Field: public Value_source
@@ -3159,7 +3166,7 @@ public:
int store_field(Field *from)
{ // Be sure the value is stored
from->val_str(&value);
- if (!value.is_alloced() && from->is_updatable())
+ if (table->copy_blobs || (!value.is_alloced() && from->is_updatable()))
value.copy();
return store(value.ptr(), value.length(), from->charset());
}
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index ecad05c7530..6823329132d 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -1,6 +1,5 @@
-/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2016, MariaDB
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/sql/gcalc_slicescan.cc b/sql/gcalc_slicescan.cc
index ed533abdaf4..f62c413fd35 100644
--- a/sql/gcalc_slicescan.cc
+++ b/sql/gcalc_slicescan.cc
@@ -49,14 +49,14 @@ typedef int (*sc_compare_func)(const void*, const void*);
static Gcalc_scan_iterator::point *eq_sp(const Gcalc_heap::Info *pi)
{
GCALC_DBUG_ASSERT(pi->type == Gcalc_heap::nt_eq_node);
- return (Gcalc_scan_iterator::point *) pi->eq_data;
+ return (Gcalc_scan_iterator::point *) pi->node.eq.data;
}
static Gcalc_scan_iterator::intersection_info *i_data(const Gcalc_heap::Info *pi)
{
GCALC_DBUG_ASSERT(pi->type == Gcalc_heap::nt_intersection);
- return (Gcalc_scan_iterator::intersection_info *) pi->intersection_data;
+ return (Gcalc_scan_iterator::intersection_info *) pi->node.intersection.data;
}
@@ -103,8 +103,8 @@ const char *gcalc_ev_name(int ev)
static int gcalc_pi_str(char *str, const Gcalc_heap::Info *pi, const char *postfix)
{
return sprintf(str, "%s %d %d | %s %d %d%s",
- GCALC_SIGN(pi->ix[0]) ? "-":"", FIRST_DIGIT(pi->ix[0]),pi->ix[1],
- GCALC_SIGN(pi->iy[0]) ? "-":"", FIRST_DIGIT(pi->iy[0]),pi->iy[1],
+ GCALC_SIGN(pi->node.shape.ix[0]) ? "-":"", FIRST_DIGIT(pi->node.shape.ix[0]),pi->node.shape.ix[1],
+ GCALC_SIGN(pi->node.shape.iy[0]) ? "-":"", FIRST_DIGIT(pi->node.shape.iy[0]),pi->node.shape.iy[1],
postfix);
}
@@ -594,8 +594,8 @@ void Gcalc_scan_iterator::intersection_info::do_calc_t()
Gcalc_coord1 a2_a1x, a2_a1y;
Gcalc_coord2 x1y2, x2y1;
- gcalc_sub_coord1(a2_a1x, edge_b->pi->ix, edge_a->pi->ix);
- gcalc_sub_coord1(a2_a1y, edge_b->pi->iy, edge_a->pi->iy);
+ gcalc_sub_coord1(a2_a1x, edge_b->pi->node.shape.ix, edge_a->pi->node.shape.ix);
+ gcalc_sub_coord1(a2_a1y, edge_b->pi->node.shape.iy, edge_a->pi->node.shape.iy);
GCALC_DBUG_ASSERT(!gcalc_is_zero(edge_a->dy, GCALC_COORD_BASE) ||
!gcalc_is_zero(edge_b->dy, GCALC_COORD_BASE));
@@ -619,7 +619,7 @@ void Gcalc_scan_iterator::intersection_info::do_calc_y()
Gcalc_coord3 a_tb, b_ta;
gcalc_mul_coord(a_tb, GCALC_COORD_BASE3,
- t_b, GCALC_COORD_BASE2, edge_a->pi->iy, GCALC_COORD_BASE);
+ t_b, GCALC_COORD_BASE2, edge_a->pi->node.shape.iy, GCALC_COORD_BASE);
gcalc_mul_coord(b_ta, GCALC_COORD_BASE3,
t_a, GCALC_COORD_BASE2, edge_a->dy, GCALC_COORD_BASE);
@@ -635,7 +635,7 @@ void Gcalc_scan_iterator::intersection_info::do_calc_x()
Gcalc_coord3 a_tb, b_ta;
gcalc_mul_coord(a_tb, GCALC_COORD_BASE3,
- t_b, GCALC_COORD_BASE2, edge_a->pi->ix, GCALC_COORD_BASE);
+ t_b, GCALC_COORD_BASE2, edge_a->pi->node.shape.ix, GCALC_COORD_BASE);
gcalc_mul_coord(b_ta, GCALC_COORD_BASE3,
t_a, GCALC_COORD_BASE2, edge_a->dx, GCALC_COORD_BASE);
@@ -656,7 +656,7 @@ static int cmp_node_isc(const Gcalc_heap::Info *node,
inf->calc_y_exp();
gcalc_mul_coord(exp, GCALC_COORD_BASE3,
- inf->t_b, GCALC_COORD_BASE2, node->iy, GCALC_COORD_BASE);
+ inf->t_b, GCALC_COORD_BASE2, node->node.shape.iy, GCALC_COORD_BASE);
result= gcalc_cmp_coord(exp, inf->y_exp, GCALC_COORD_BASE3);
#ifdef GCALC_CHECK_WITH_FLOAT
@@ -664,18 +664,18 @@ static int cmp_node_isc(const Gcalc_heap::Info *node,
isc->calc_xy_ld(&int_x, &int_y);
if (result < 0)
{
- if (!de_check(int_y, node->y) && node->y > int_y)
- GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscy %g < %LG", node->y, int_y));
+ if (!de_check(int_y, node->node.shape.y) && node->node.shape.y > int_y)
+ GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscy %g < %LG", node->node.shape.y, int_y));
}
else if (result > 0)
{
- if (!de_check(int_y, node->y) && node->y < int_y)
- GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscy %g > %LG", node->y, int_y));
+ if (!de_check(int_y, node->node.shape.y) && node->node.shape.y < int_y)
+ GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscy %g > %LG", node->node.shape.y, int_y));
}
else
{
- if (!de_check(int_y, node->y))
- GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscy %g == %LG", node->y, int_y));
+ if (!de_check(int_y, node->node.shape.y))
+ GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscy %g == %LG", node->node.shape.y, int_y));
}
#endif /*GCALC_CHECK_WITH_FLOAT*/
if (result)
@@ -684,27 +684,27 @@ static int cmp_node_isc(const Gcalc_heap::Info *node,
inf->calc_x_exp();
gcalc_mul_coord(exp, GCALC_COORD_BASE3,
- inf->t_b, GCALC_COORD_BASE2, node->ix, GCALC_COORD_BASE);
+ inf->t_b, GCALC_COORD_BASE2, node->node.shape.ix, GCALC_COORD_BASE);
result= gcalc_cmp_coord(exp, inf->x_exp, GCALC_COORD_BASE3);
#ifdef GCALC_CHECK_WITH_FLOAT
if (result < 0)
{
- if (!de_check(int_x, node->x) && node->x > int_x)
+ if (!de_check(int_x, node->node.shape.x) && node->node.shape.x > int_x)
GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscx failed %g < %LG",
- node->x, int_x));
+ node->node.shape.x, int_x));
}
else if (result > 0)
{
- if (!de_check(int_x, node->x) && node->x < int_x)
+ if (!de_check(int_x, node->node.shape.x) && node->node.shape.x < int_x)
GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscx failed %g > %LG",
- node->x, int_x));
+ node->node.shape.x, int_x));
}
else
{
- if (!de_check(int_x, node->x))
+ if (!de_check(int_x, node->node.shape.x))
GCALC_DBUG_PRINT(("floatcheck cmp_nod_iscx failed %g == %LG",
- node->x, int_x));
+ node->node.shape.x, int_x));
}
#endif /*GCALC_CHECK_WITH_FLOAT*/
exit:
@@ -844,13 +844,13 @@ Gcalc_heap::Info *Gcalc_heap::new_point_info(double x, double y,
return NULL;
*m_hook= result;
m_hook= &result->next;
- result->x= x;
- result->y= y;
- result->shape= shape;
- result->top_node= 1;
+ result->node.shape.x= x;
+ result->node.shape.y= y;
+ result->node.shape.shape= shape;
+ result->node.shape.top_node= 1;
result->type= nt_shape_node;
- gcalc_set_double(result->ix, x, coord_extent);
- gcalc_set_double(result->iy, y, coord_extent);
+ gcalc_set_double(result->node.shape.ix, x, coord_extent);
+ gcalc_set_double(result->node.shape.iy, y, coord_extent);
m_n_points++;
return result;
@@ -864,11 +864,11 @@ static Gcalc_heap::Info *new_intersection(
if (!isc)
return 0;
isc->type= Gcalc_heap::nt_intersection;
- isc->p1= ii->edge_a->pi;
- isc->p2= ii->edge_a->next_pi;
- isc->p3= ii->edge_b->pi;
- isc->p4= ii->edge_b->next_pi;
- isc->intersection_data= ii;
+ isc->node.intersection.p1= ii->edge_a->pi;
+ isc->node.intersection.p2= ii->edge_a->next_pi;
+ isc->node.intersection.p3= ii->edge_b->pi;
+ isc->node.intersection.p4= ii->edge_b->next_pi;
+ isc->node.intersection.data= ii;
return isc;
}
@@ -881,46 +881,46 @@ static Gcalc_heap::Info *new_eq_point(
if (!eqp)
return 0;
eqp->type= Gcalc_heap::nt_eq_node;
- eqp->node= p;
- eqp->eq_data= edge;
+ eqp->node.eq.node= p;
+ eqp->node.eq.data= edge;
return eqp;
}
void Gcalc_heap::Info::calc_xy(double *x, double *y) const
{
- double b0_x= p2->x - p1->x;
- double b0_y= p2->y - p1->y;
- double b1_x= p4->x - p3->x;
- double b1_y= p4->y - p3->y;
+ double b0_x= node.intersection.p2->node.shape.x - node.intersection.p1->node.shape.x;
+ double b0_y= node.intersection.p2->node.shape.y - node.intersection.p1->node.shape.y;
+ double b1_x= node.intersection.p4->node.shape.x - node.intersection.p3->node.shape.x;
+ double b1_y= node.intersection.p4->node.shape.y - node.intersection.p3->node.shape.y;
double b0xb1= b0_x * b1_y - b0_y * b1_x;
- double t= (p3->x - p1->x) * b1_y - (p3->y - p1->y) * b1_x;
+ double t= (node.intersection.p3->node.shape.x - node.intersection.p1->node.shape.x) * b1_y - (node.intersection.p3->node.shape.y - node.intersection.p1->node.shape.y) * b1_x;
t/= b0xb1;
- *x= p1->x + b0_x * t;
- *y= p1->y + b0_y * t;
+ *x= node.intersection.p1->node.shape.x + b0_x * t;
+ *y= node.intersection.p1->node.shape.y + b0_y * t;
}
#ifdef GCALC_CHECK_WITH_FLOAT
void Gcalc_heap::Info::calc_xy_ld(long double *x, long double *y) const
{
- long double b0_x= ((long double) p2->x) - p1->x;
- long double b0_y= ((long double) p2->y) - p1->y;
- long double b1_x= ((long double) p4->x) - p3->x;
- long double b1_y= ((long double) p4->y) - p3->y;
+ long double b0_x= ((long double) p2->node.shape.x) - p1->node.shape.x;
+ long double b0_y= ((long double) p2->node.shape.y) - p1->node.shape.y;
+ long double b1_x= ((long double) p4->node.shape.x) - p3->node.shape.x;
+ long double b1_y= ((long double) p4->node.shape.y) - p3->node.shape.y;
long double b0xb1= b0_x * b1_y - b0_y * b1_x;
- long double ax= ((long double) p3->x) - p1->x;
- long double ay= ((long double) p3->y) - p1->y;
+ long double ax= ((long double) p3->node.shape.x) - p1->node.shape.x;
+ long double ay= ((long double) p3->node.shape.y) - p1->node.shape.y;
long double t_a= ax * b1_y - ay * b1_x;
- long double hx= (b0xb1 * (long double) p1->x + b0_x * t_a);
- long double hy= (b0xb1 * (long double) p1->y + b0_y * t_a);
+ long double hx= (b0xb1 * (long double) p1->node.shape.x + b0_x * t_a);
+ long double hy= (b0xb1 * (long double) p1->node.shape.y + b0_y * t_a);
if (fabs(b0xb1) < 1e-15)
{
- *x= p1->x;
- *y= p1->y;
+ *x= p1->node.shape.x;
+ *y= p1->node.shape.y;
return;
}
@@ -933,10 +933,10 @@ void Gcalc_heap::Info::calc_xy_ld(long double *x, long double *y) const
static int cmp_point_info(const Gcalc_heap::Info *i0,
const Gcalc_heap::Info *i1)
{
- int cmp_y= gcalc_cmp_coord1(i0->iy, i1->iy);
+ int cmp_y= gcalc_cmp_coord1(i0->node.shape.iy, i1->node.shape.iy);
if (cmp_y)
return cmp_y;
- return gcalc_cmp_coord1(i0->ix, i1->ix);
+ return gcalc_cmp_coord1(i0->node.shape.ix, i1->node.shape.ix);
}
@@ -944,11 +944,11 @@ static inline void trim_node(Gcalc_heap::Info *node, Gcalc_heap::Info *prev_node
{
if (!node)
return;
- node->top_node= 0;
- GCALC_DBUG_ASSERT((node->left == prev_node) || (node->right == prev_node));
- if (node->left == prev_node)
- node->left= node->right;
- node->right= NULL;
+ node->node.shape.top_node= 0;
+ GCALC_DBUG_ASSERT((node->node.shape.left == prev_node) || (node->node.shape.right == prev_node));
+ if (node->node.shape.left == prev_node)
+ node->node.shape.left= node->node.shape.right;
+ node->node.shape.right= NULL;
GCALC_DBUG_ASSERT(cmp_point_info(node, prev_node));
}
@@ -972,8 +972,8 @@ void Gcalc_heap::prepare_operation()
/* TODO - move this to the 'normal_scan' loop */
for (cur= get_first(); cur; cur= cur->get_next())
{
- trim_node(cur->left, cur);
- trim_node(cur->right, cur);
+ trim_node(cur->node.shape.left, cur);
+ trim_node(cur->node.shape.right, cur);
}
}
@@ -995,7 +995,7 @@ int Gcalc_shape_transporter::int_single_point(gcalc_shape_info Info,
Gcalc_heap::Info *point= m_heap->new_point_info(x, y, Info);
if (!point)
return 1;
- point->left= point->right= 0;
+ point->node.shape.left= point->node.shape.right= 0;
return 0;
}
@@ -1018,9 +1018,9 @@ int Gcalc_shape_transporter::int_add_point(gcalc_shape_info Info,
m_heap->free_point_info(point, hook);
return 0;
}
- GCALC_DBUG_ASSERT(!m_prev || m_prev->x != x || m_prev->y != y);
- m_prev->left= point;
- point->right= m_prev;
+ GCALC_DBUG_ASSERT(!m_prev || m_prev->node.shape.x != x || m_prev->node.shape.y != y);
+ m_prev->node.shape.left= point;
+ point->node.shape.right= m_prev;
}
else
m_first= point;
@@ -1040,16 +1040,16 @@ void Gcalc_shape_transporter::int_complete()
/* simple point */
if (m_first == m_prev)
{
- m_first->right= m_first->left= NULL;
+ m_first->node.shape.right= m_first->node.shape.left= NULL;
return;
}
/* line */
if (m_shape_started == 1)
{
- m_first->right= NULL;
- m_prev->left= m_prev->right;
- m_prev->right= NULL;
+ m_first->node.shape.right= NULL;
+ m_prev->node.shape.left= m_prev->node.shape.right;
+ m_prev->node.shape.right= NULL;
return;
}
@@ -1057,32 +1057,32 @@ void Gcalc_shape_transporter::int_complete()
if (cmp_point_info(m_first, m_prev) == 0)
{
/* Coinciding points, remove the last one from the list */
- m_prev->right->left= m_first;
- m_first->right= m_prev->right;
+ m_prev->node.shape.right->node.shape.left= m_first;
+ m_first->node.shape.right= m_prev->node.shape.right;
m_heap->free_point_info(m_prev, m_prev_hook);
}
else
{
- GCALC_DBUG_ASSERT(m_prev->x != m_first->x || m_prev->y != m_first->y);
- m_first->right= m_prev;
- m_prev->left= m_first;
+ GCALC_DBUG_ASSERT(m_prev->node.shape.x != m_first->node.shape.x || m_prev->node.shape.y != m_first->node.shape.y);
+ m_first->node.shape.right= m_prev;
+ m_prev->node.shape.left= m_first;
}
}
inline void calc_dx_dy(Gcalc_scan_iterator::point *p)
{
- gcalc_sub_coord1(p->dx, p->next_pi->ix, p->pi->ix);
- gcalc_sub_coord1(p->dy, p->next_pi->iy, p->pi->iy);
+ gcalc_sub_coord1(p->dx, p->next_pi->node.shape.ix, p->pi->node.shape.ix);
+ gcalc_sub_coord1(p->dy, p->next_pi->node.shape.iy, p->pi->node.shape.iy);
if (GCALC_SIGN(p->dx[0]))
{
- p->l_border= &p->next_pi->ix;
- p->r_border= &p->pi->ix;
+ p->l_border= &p->next_pi->node.shape.ix;
+ p->r_border= &p->pi->node.shape.ix;
}
else
{
- p->r_border= &p->next_pi->ix;
- p->l_border= &p->pi->ix;
+ p->r_border= &p->next_pi->node.shape.ix;
+ p->l_border= &p->pi->node.shape.ix;
}
}
@@ -1143,10 +1143,10 @@ int Gcalc_scan_iterator::point::cmp_dx_dy(const Gcalc_heap::Info *p1,
const Gcalc_heap::Info *p4)
{
Gcalc_coord1 dx_a, dy_a, dx_b, dy_b;
- gcalc_sub_coord1(dx_a, p2->ix, p1->ix);
- gcalc_sub_coord1(dy_a, p2->iy, p1->iy);
- gcalc_sub_coord1(dx_b, p4->ix, p3->ix);
- gcalc_sub_coord1(dy_b, p4->iy, p3->iy);
+ gcalc_sub_coord1(dx_a, p2->node.shape.ix, p1->node.shape.ix);
+ gcalc_sub_coord1(dy_a, p2->node.shape.iy, p1->node.shape.iy);
+ gcalc_sub_coord1(dx_b, p4->node.shape.ix, p3->node.shape.ix);
+ gcalc_sub_coord1(dy_b, p4->node.shape.iy, p3->node.shape.iy);
return cmp_dx_dy(dx_a, dy_a, dx_b, dy_b);
}
@@ -1168,8 +1168,8 @@ void Gcalc_scan_iterator::point::calc_x(long double *x, long double y,
*x= ix;
}
else
- *x= (ddy * (long double) pi->x + gcalc_get_double(dx, GCALC_COORD_BASE) *
- (y - pi->y)) / ddy;
+ *x= (ddy * (long double) pi->node.shape.x + gcalc_get_double(dx, GCALC_COORD_BASE) *
+ (y - pi->node.shape.y)) / ddy;
}
#endif /*GCALC_CHECK_WITH_FLOAT*/
@@ -1280,7 +1280,7 @@ int Gcalc_scan_iterator::arrange_event(int do_sorting, int n_intersections)
int Gcalc_heap::Info::equal_pi(const Info *pi) const
{
if (type == nt_intersection)
- return equal_intersection;
+ return node.intersection.equal;
if (pi->type == nt_eq_node)
return 1;
if (type == nt_eq_node || pi->type == nt_intersection)
@@ -1322,7 +1322,7 @@ int Gcalc_scan_iterator::step()
#ifndef GCALC_DBUG_OFF
if (m_cur_pi->type == Gcalc_heap::nt_intersection &&
m_cur_pi->get_next()->type == Gcalc_heap::nt_intersection &&
- m_cur_pi->equal_intersection)
+ m_cur_pi->node.intersection.equal)
GCALC_DBUG_ASSERT(cmp_intersections(m_cur_pi, m_cur_pi->get_next()) == 0);
#endif /*GCALC_DBUG_OFF*/
GCALC_DBUG_CHECK_COUNTER();
@@ -1377,23 +1377,23 @@ static int node_on_right(const Gcalc_heap::Info *node,
Gcalc_coord2 ax_by, ay_bx;
int result;
- gcalc_sub_coord1(a_x, node->ix, edge_a->ix);
- gcalc_sub_coord1(a_y, node->iy, edge_a->iy);
- gcalc_sub_coord1(b_x, edge_b->ix, edge_a->ix);
- gcalc_sub_coord1(b_y, edge_b->iy, edge_a->iy);
+ gcalc_sub_coord1(a_x, node->node.shape.ix, edge_a->node.shape.ix);
+ gcalc_sub_coord1(a_y, node->node.shape.iy, edge_a->node.shape.iy);
+ gcalc_sub_coord1(b_x, edge_b->node.shape.ix, edge_a->node.shape.ix);
+ gcalc_sub_coord1(b_y, edge_b->node.shape.iy, edge_a->node.shape.iy);
gcalc_mul_coord1(ax_by, a_x, b_y);
gcalc_mul_coord1(ay_bx, a_y, b_x);
result= gcalc_cmp_coord(ax_by, ay_bx, GCALC_COORD_BASE2);
#ifdef GCALC_CHECK_WITH_FLOAT
{
- long double dx= gcalc_get_double(edge_b->ix, GCALC_COORD_BASE) -
- gcalc_get_double(edge_a->ix, GCALC_COORD_BASE);
- long double dy= gcalc_get_double(edge_b->iy, GCALC_COORD_BASE) -
- gcalc_get_double(edge_a->iy, GCALC_COORD_BASE);
- long double ax= gcalc_get_double(node->ix, GCALC_COORD_BASE) -
- gcalc_get_double(edge_a->ix, GCALC_COORD_BASE);
- long double ay= gcalc_get_double(node->iy, GCALC_COORD_BASE) -
- gcalc_get_double(edge_a->iy, GCALC_COORD_BASE);
+ long double dx= gcalc_get_double(edge_b->node.shape.ix, GCALC_COORD_BASE) -
+ gcalc_get_double(edge_a->node.shape.ix, GCALC_COORD_BASE);
+ long double dy= gcalc_get_double(edge_b->node.shape.iy, GCALC_COORD_BASE) -
+ gcalc_get_double(edge_a->node.shape.iy, GCALC_COORD_BASE);
+ long double ax= gcalc_get_double(node->node.shape.ix, GCALC_COORD_BASE) -
+ gcalc_get_double(edge_a->node.shape.ix, GCALC_COORD_BASE);
+ long double ay= gcalc_get_double(node->node.shape.iy, GCALC_COORD_BASE) -
+ gcalc_get_double(edge_a->node.shape.iy, GCALC_COORD_BASE);
long double d= ax * dy - ay * dx;
if (result == 0)
GCALC_DBUG_ASSERT(de_check(d, 0.0));
@@ -1412,8 +1412,8 @@ static int cmp_tops(const Gcalc_heap::Info *top_node,
{
int cmp_res_a, cmp_res_b;
- cmp_res_a= gcalc_cmp_coord1(edge_a->ix, top_node->ix);
- cmp_res_b= gcalc_cmp_coord1(edge_b->ix, top_node->ix);
+ cmp_res_a= gcalc_cmp_coord1(edge_a->node.shape.ix, top_node->node.shape.ix);
+ cmp_res_b= gcalc_cmp_coord1(edge_b->node.shape.ix, top_node->node.shape.ix);
if (cmp_res_a <= 0 && cmp_res_b > 0)
return -1;
@@ -1438,26 +1438,26 @@ int Gcalc_scan_iterator::insert_top_node()
if (!sp0)
GCALC_DBUG_RETURN(1);
sp0->pi= m_cur_pi;
- sp0->next_pi= m_cur_pi->left;
+ sp0->next_pi= m_cur_pi->node.shape.left;
#ifndef GCALC_DBUG_OFF
sp0->thread= m_cur_thread++;
#endif /*GCALC_DBUG_OFF*/
- if (m_cur_pi->left)
+ if (m_cur_pi->node.shape.left)
{
calc_dx_dy(sp0);
- if (m_cur_pi->right)
+ if (m_cur_pi->node.shape.right)
{
if (!(sp1= new_slice_point()))
GCALC_DBUG_RETURN(1);
sp1->event= sp0->event= scev_two_threads;
sp1->pi= m_cur_pi;
- sp1->next_pi= m_cur_pi->right;
+ sp1->next_pi= m_cur_pi->node.shape.right;
#ifndef GCALC_DBUG_OFF
sp1->thread= m_cur_thread++;
#endif /*GCALC_DBUG_OFF*/
calc_dx_dy(sp1);
/* We have two threads so should decide which one will be first */
- cmp_res= cmp_tops(m_cur_pi, m_cur_pi->left, m_cur_pi->right);
+ cmp_res= cmp_tops(m_cur_pi, m_cur_pi->node.shape.left, m_cur_pi->node.shape.right);
if (cmp_res > 0)
{
point *tmp= sp0;
@@ -1467,7 +1467,7 @@ int Gcalc_scan_iterator::insert_top_node()
else if (cmp_res == 0)
{
/* Exactly same direction of the edges. */
- cmp_res= gcalc_cmp_coord1(m_cur_pi->left->iy, m_cur_pi->right->iy);
+ cmp_res= gcalc_cmp_coord1(m_cur_pi->node.shape.left->node.shape.iy, m_cur_pi->node.shape.right->node.shape.iy);
if (cmp_res != 0)
{
if (cmp_res < 0)
@@ -1483,7 +1483,7 @@ int Gcalc_scan_iterator::insert_top_node()
}
else
{
- cmp_res= gcalc_cmp_coord1(m_cur_pi->left->ix, m_cur_pi->right->ix);
+ cmp_res= gcalc_cmp_coord1(m_cur_pi->node.shape.left->node.shape.ix, m_cur_pi->node.shape.right->node.shape.ix);
if (cmp_res != 0)
{
if (cmp_res < 0)
@@ -1517,7 +1517,7 @@ int Gcalc_scan_iterator::insert_top_node()
/* We need to find the place to insert. */
for (; sp; prev_hook= sp->next_ptr(), sp=sp->get_next())
{
- if (sp->event || gcalc_cmp_coord1(*sp->r_border, m_cur_pi->ix) < 0)
+ if (sp->event || gcalc_cmp_coord1(*sp->r_border, m_cur_pi->node.shape.ix) < 0)
continue;
cmp_res= node_on_right(m_cur_pi, sp->pi, sp->next_pi);
if (cmp_res == 0)
@@ -1743,7 +1743,7 @@ int Gcalc_scan_iterator::node_scan()
GCALC_DBUG_PRINT(("node for %d", sp->thread));
/* Handle the point itself. */
sp->pi= cur_pi;
- sp->next_pi= cur_pi->left;
+ sp->next_pi= cur_pi->node.shape.left;
sp->event= scev_point;
calc_dx_dy(sp);
@@ -1794,7 +1794,7 @@ void Gcalc_scan_iterator::intersection_scan()
ii->edge_a->event= ii->edge_b->event= scev_intersection;
ii->edge_a->ev_pi= ii->edge_b->ev_pi= m_cur_pi;
free_item(ii);
- m_cur_pi->intersection_data= NULL;
+ m_cur_pi->node.intersection.data= NULL;
GCALC_DBUG_VOID_RETURN;
}
@@ -1813,7 +1813,7 @@ int Gcalc_scan_iterator::add_intersection(point *sp_a, point *sp_b,
!(ii= new_intersection(m_heap, i_calc)))
GCALC_DBUG_RETURN(1);
- ii->equal_intersection= 0;
+ ii->node.intersection.equal= 0;
for (;
pi_from->get_next() != sp_a->next_pi &&
@@ -1824,7 +1824,7 @@ int Gcalc_scan_iterator::add_intersection(point *sp_a, point *sp_b,
if (skip_next)
{
if (cur->type == Gcalc_heap::nt_intersection)
- skip_next= cur->equal_intersection;
+ skip_next= cur->node.intersection.equal;
else
skip_next= 0;
continue;
@@ -1832,7 +1832,7 @@ int Gcalc_scan_iterator::add_intersection(point *sp_a, point *sp_b,
if (cur->type == Gcalc_heap::nt_intersection)
{
cmp_res= cmp_intersections(cur, ii);
- skip_next= cur->equal_intersection;
+ skip_next= cur->node.intersection.equal;
}
else if (cur->type == Gcalc_heap::nt_eq_node)
continue;
@@ -1840,7 +1840,7 @@ int Gcalc_scan_iterator::add_intersection(point *sp_a, point *sp_b,
cmp_res= cmp_node_isc(cur, ii);
if (cmp_res == 0)
{
- ii->equal_intersection= 1;
+ ii->node.intersection.equal= 1;
break;
}
else if (cmp_res > 0)
@@ -1881,13 +1881,13 @@ void calc_t(Gcalc_coord2 t_a, Gcalc_coord2 t_b,
Gcalc_coord2 x1y2, x2y1;
Gcalc_coord1 dya, dyb;
- gcalc_sub_coord1(a2_a1x, p3->ix, p1->ix);
- gcalc_sub_coord1(a2_a1y, p3->iy, p1->iy);
+ gcalc_sub_coord1(a2_a1x, p3->node.shape.ix, p1->node.shape.ix);
+ gcalc_sub_coord1(a2_a1y, p3->node.shape.iy, p1->node.shape.iy);
- gcalc_sub_coord1(dxa, p2->ix, p1->ix);
- gcalc_sub_coord1(dya, p2->iy, p1->iy);
- gcalc_sub_coord1(dxb, p4->ix, p3->ix);
- gcalc_sub_coord1(dyb, p4->iy, p3->iy);
+ gcalc_sub_coord1(dxa, p2->node.shape.ix, p1->node.shape.ix);
+ gcalc_sub_coord1(dya, p2->node.shape.iy, p1->node.shape.iy);
+ gcalc_sub_coord1(dxb, p4->node.shape.ix, p3->node.shape.ix);
+ gcalc_sub_coord1(dyb, p4->node.shape.iy, p3->node.shape.iy);
gcalc_mul_coord1(x1y2, dxa, dyb);
gcalc_mul_coord1(x2y1, dya, dxb);
@@ -1908,11 +1908,11 @@ double Gcalc_scan_iterator::get_y() const
Gcalc_coord2 t_a, t_b;
Gcalc_coord3 a_tb, b_ta, y_exp;
calc_t(t_a, t_b, dxa, dya,
- state.pi->p1, state.pi->p2, state.pi->p3, state.pi->p4);
+ state.pi->node.intersection.p1, state.pi->node.intersection.p2, state.pi->node.intersection.p3, state.pi->node.intersection.p4);
gcalc_mul_coord(a_tb, GCALC_COORD_BASE3,
- t_b, GCALC_COORD_BASE2, state.pi->p1->iy, GCALC_COORD_BASE);
+ t_b, GCALC_COORD_BASE2, state.pi->node.intersection.p1->node.shape.iy, GCALC_COORD_BASE);
gcalc_mul_coord(b_ta, GCALC_COORD_BASE3,
t_a, GCALC_COORD_BASE2, dya, GCALC_COORD_BASE);
@@ -1922,7 +1922,7 @@ double Gcalc_scan_iterator::get_y() const
get_pure_double(t_b, GCALC_COORD_BASE2)) / m_heap->coord_extent;
}
else
- return state.pi->y;
+ return state.pi->node.shape.y;
}
@@ -1934,11 +1934,11 @@ double Gcalc_scan_iterator::get_event_x() const
Gcalc_coord2 t_a, t_b;
Gcalc_coord3 a_tb, b_ta, x_exp;
calc_t(t_a, t_b, dxa, dya,
- state.pi->p1, state.pi->p2, state.pi->p3, state.pi->p4);
+ state.pi->node.intersection.p1, state.pi->node.intersection.p2, state.pi->node.intersection.p3, state.pi->node.intersection.p4);
gcalc_mul_coord(a_tb, GCALC_COORD_BASE3,
- t_b, GCALC_COORD_BASE2, state.pi->p1->ix, GCALC_COORD_BASE);
+ t_b, GCALC_COORD_BASE2, state.pi->node.intersection.p1->node.shape.ix, GCALC_COORD_BASE);
gcalc_mul_coord(b_ta, GCALC_COORD_BASE3,
t_a, GCALC_COORD_BASE2, dxa, GCALC_COORD_BASE);
@@ -1948,7 +1948,7 @@ double Gcalc_scan_iterator::get_event_x() const
get_pure_double(t_b, GCALC_COORD_BASE2)) / m_heap->coord_extent;
}
else
- return state.pi->x;
+ return state.pi->node.shape.x;
}
double Gcalc_scan_iterator::get_h() const
@@ -1961,7 +1961,7 @@ double Gcalc_scan_iterator::get_h() const
state.pi->calc_xy(&x, &next_y);
}
else
- next_y= state.pi->next ? state.pi->get_next()->y : 0.0;
+ next_y= state.pi->next ? state.pi->get_next()->node.shape.y : 0.0;
return next_y - cur_y;
}
@@ -1970,11 +1970,11 @@ double Gcalc_scan_iterator::get_sp_x(const point *sp) const
{
double dy;
if (sp->event & (scev_end | scev_two_ends | scev_point))
- return sp->pi->x;
- dy= sp->next_pi->y - sp->pi->y;
+ return sp->pi->node.shape.x;
+ dy= sp->next_pi->node.shape.y - sp->pi->node.shape.y;
if (fabs(dy) < 1e-12)
- return sp->pi->x;
- return sp->pi->x + (sp->next_pi->x - sp->pi->x) * dy;
+ return sp->pi->node.shape.x;
+ return sp->pi->node.shape.x + (sp->next_pi->node.shape.x - sp->pi->node.shape.x) * dy;
}
diff --git a/sql/gcalc_slicescan.h b/sql/gcalc_slicescan.h
index 55de497f1ee..5a0399bc8da 100644
--- a/sql/gcalc_slicescan.h
+++ b/sql/gcalc_slicescan.h
@@ -188,7 +188,7 @@ public:
double x,y;
Gcalc_coord1 ix, iy;
int top_node;
- };
+ } shape;
struct
{
/* nt_intersection */
@@ -197,21 +197,21 @@ public:
const Info *p2;
const Info *p3;
const Info *p4;
- void *intersection_data;
- int equal_intersection;
- };
+ void *data;
+ int equal;
+ } intersection;
struct
{
/* nt_eq_node */
const Info *node;
- void *eq_data;
- };
- };
+ void *data;
+ } eq;
+ } node;
bool is_bottom() const
- { GCALC_DBUG_ASSERT(type == nt_shape_node); return !left; }
+ { GCALC_DBUG_ASSERT(type == nt_shape_node); return !node.shape.left; }
bool is_top() const
- { GCALC_DBUG_ASSERT(type == nt_shape_node); return top_node; }
+ { GCALC_DBUG_ASSERT(type == nt_shape_node); return node.shape.top_node; }
bool is_single_node() const
{ return is_bottom() && is_top(); }
@@ -383,7 +383,7 @@ public:
inline const point *c_get_next() const
{ return (const point *)next; }
inline bool is_bottom() const { return !next_pi; }
- gcalc_shape_info get_shape() const { return pi->shape; }
+ gcalc_shape_info get_shape() const { return pi->node.shape.shape; }
inline point *get_next() { return (point *)next; }
inline const point *get_next() const { return (const point *)next; }
/* Compare the dx_dy parameters regarding the horiz_dir */
diff --git a/sql/gcalc_tools.cc b/sql/gcalc_tools.cc
index 5aac8a71249..da0252c6b67 100644
--- a/sql/gcalc_tools.cc
+++ b/sql/gcalc_tools.cc
@@ -1278,7 +1278,7 @@ inline int Gcalc_operation_reducer::get_single_result(res_point *res,
GCALC_DBUG_RETURN(1);
}
else
- if (storage->single_point(res->pi->x, res->pi->y))
+ if (storage->single_point(res->pi->node.shape.x, res->pi->node.shape.y))
GCALC_DBUG_RETURN(1);
free_result(res);
GCALC_DBUG_RETURN(0);
@@ -1304,8 +1304,8 @@ int Gcalc_operation_reducer::get_result_thread(res_point *cur,
}
else
{
- x= cur->pi->x;
- y= cur->pi->y;
+ x= cur->pi->node.shape.x;
+ y= cur->pi->node.shape.y;
}
if (storage->add_point(x, y))
GCALC_DBUG_RETURN(1);
diff --git a/sql/handler.cc b/sql/handler.cc
index 993d337a4bb..718bae8ea52 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -4224,7 +4224,7 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table,
IS_EQUAL_PACK_LENGTH : IS_EQUAL_YES;
if (table->file->check_if_incompatible_data(create_info, table_changes)
== COMPATIBLE_DATA_YES)
- DBUG_RETURN(HA_ALTER_INPLACE_EXCLUSIVE_LOCK);
+ DBUG_RETURN(HA_ALTER_INPLACE_NO_LOCK);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
@@ -5604,15 +5604,17 @@ inline bool handler::check_table_binlog_row_based(bool binlog_row)
bool handler::check_table_binlog_row_based_internal(bool binlog_row)
{
- THD *thd;
+ THD *thd= table->in_use;
+#ifdef WITH_WSREP
/* only InnoDB tables will be replicated through binlog emulation */
if (binlog_row &&
- WSREP_EMULATE_BINLOG(thd) &&
- table->file->partition_ht()->db_type != DB_TYPE_INNODB)
+ ((WSREP_EMULATE_BINLOG(thd) &&
+ table->file->partition_ht()->db_type != DB_TYPE_INNODB) ||
+ (thd->wsrep_ignore_table == true)))
return 0;
+#endif
- thd= table->in_use;
return (table->s->cached_row_logging_check &&
thd->is_current_stmt_binlog_format_row() &&
/*
diff --git a/sql/item.cc b/sql/item.cc
index 55bd62188b4..e47974408f4 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
@@ -2339,7 +2339,7 @@ bool Item_field::update_table_bitmaps_processor(uchar *arg)
static inline void set_field_to_new_field(Field **field, Field **new_field)
{
- if (*field)
+ if (*field && (*field)->table == new_field[0]->table)
{
Field *newf= new_field[(*field)->field_index];
if ((*field)->ptr == newf->ptr)
@@ -2352,6 +2352,7 @@ bool Item_field::switch_to_nullable_fields_processor(uchar *arg)
Field **new_fields= (Field **)arg;
set_field_to_new_field(&field, new_fields);
set_field_to_new_field(&result_field, new_fields);
+ maybe_null= field && field->maybe_null();
return 0;
}
diff --git a/sql/item.h b/sql/item.h
index d0e4372d53f..9954b0ab31d 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2,7 +2,7 @@
#define SQL_ITEM_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index dc457ed6484..44dc8ff9e09 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -2579,7 +2579,7 @@ Item_func_nullif::fix_length_and_dec()
args[0] and args[2] should still point to the same original l_expr.
*/
DBUG_ASSERT(args[0] == args[2] || thd->stmt_arena->is_stmt_execute());
- if (args[0]->type() == SUM_FUNC_ITEM)
+ if (args[0]->type() == SUM_FUNC_ITEM && !thd->lex->context_analysis_only)
{
/*
NULLIF(l_expr, r_expr)
@@ -2703,7 +2703,8 @@ Item_func_nullif::fix_length_and_dec()
m_cache->setup(current_thd, args[0]);
m_cache->store(args[0]);
m_cache->set_used_tables(args[0]->used_tables());
- args[0]= args[2]= m_cache;
+ thd->change_item_tree(&args[0], m_cache);
+ thd->change_item_tree(&args[2], m_cache);
}
set_handler_by_field_type(args[2]->field_type());
collation.set(args[2]->collation);
@@ -2751,7 +2752,7 @@ void Item_func_nullif::print(String *str, enum_query_type query_type)
Note, the EXPLAIN EXTENDED and EXPLAIN FORMAT=JSON routines
do pass QT_ITEM_FUNC_NULLIF_TO_CASE to print().
*/
- DBUG_ASSERT(args[0] == args[2]);
+ DBUG_ASSERT(args[0] == args[2] || current_thd->lex->context_analysis_only);
str->append(func_name());
str->append('(');
args[2]->print(str, query_type);
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index af9e008375a..717e9e59ddf 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1,7 +1,7 @@
#ifndef ITEM_CMPFUNC_INCLUDED
#define ITEM_CMPFUNC_INCLUDED
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 352c9fd93b9..39d06fd7a26 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -436,7 +436,7 @@ String *Item_func_convexhull::val_str(String *str_value)
if (!cur_pi->get_next())
{
/* Single point. */
- if (res_receiver.single_point(cur_pi->x, cur_pi->y))
+ if (res_receiver.single_point(cur_pi->node.shape.x, cur_pi->node.shape.y))
goto mem_error;
goto build_result;
}
@@ -461,8 +461,8 @@ String *Item_func_convexhull::val_str(String *str_value)
{
/* We only have 2 nodes in the result, so we create a polyline. */
if (res_receiver.start_shape(Gcalc_function::shape_line) ||
- res_receiver.add_point(left_first->pi->x, left_first->pi->y) ||
- res_receiver.add_point(left_cur->pi->x, left_cur->pi->y) ||
+ res_receiver.add_point(left_first->pi->node.shape.x, left_first->pi->node.shape.y) ||
+ res_receiver.add_point(left_cur->pi->node.shape.x, left_cur->pi->node.shape.y) ||
res_receiver.complete_shape())
goto mem_error;
@@ -475,7 +475,7 @@ String *Item_func_convexhull::val_str(String *str_value)
while (left_first)
{
- if (res_receiver.add_point(left_first->pi->x, left_first->pi->y))
+ if (res_receiver.add_point(left_first->pi->node.shape.x, left_first->pi->node.shape.y))
goto mem_error;
left_first= left_first->get_next();
}
@@ -485,7 +485,7 @@ String *Item_func_convexhull::val_str(String *str_value)
right_cur= right_cur->prev;
while (right_cur->prev)
{
- if (res_receiver.add_point(right_cur->pi->x, right_cur->pi->y))
+ if (res_receiver.add_point(right_cur->pi->node.shape.x, right_cur->pi->node.shape.y))
goto mem_error;
right_cur= right_cur->prev;
}
@@ -1105,10 +1105,10 @@ static double count_edge_t(const Gcalc_heap::Info *ea,
double &ex, double &ey, double &vx, double &vy,
double &e_sqrlen)
{
- ex= eb->x - ea->x;
- ey= eb->y - ea->y;
- vx= v->x - ea->x;
- vy= v->y - ea->y;
+ ex= eb->node.shape.x - ea->node.shape.x;
+ ey= eb->node.shape.y - ea->node.shape.y;
+ vx= v->node.shape.x - ea->node.shape.x;
+ vy= v->node.shape.y - ea->node.shape.y;
e_sqrlen= ex * ex + ey * ey;
return (ex * vx + ey * vy) / e_sqrlen;
}
@@ -1124,8 +1124,8 @@ static double distance_to_line(double ex, double ey, double vx, double vy,
static double distance_points(const Gcalc_heap::Info *a,
const Gcalc_heap::Info *b)
{
- double x= a->x - b->x;
- double y= a->y - b->y;
+ double x= a->node.shape.x - b->node.shape.x;
+ double y= a->node.shape.y - b->node.shape.y;
return sqrt(x * x + y * y);
}
@@ -2333,7 +2333,7 @@ double Item_func_distance::val_real()
continue;
count_distance:
- if (cur_point->shape >= obj2_si)
+ if (cur_point->node.shape.shape >= obj2_si)
continue;
cur_point_edge= !cur_point->is_bottom();
@@ -2341,13 +2341,13 @@ count_distance:
{
/* We only check vertices of object 2 */
if (dist_point->type != Gcalc_heap::nt_shape_node ||
- dist_point->shape < obj2_si)
+ dist_point->node.shape.shape < obj2_si)
continue;
/* if we have an edge to check */
- if (dist_point->left)
+ if (dist_point->node.shape.left)
{
- t= count_edge_t(dist_point, dist_point->left, cur_point,
+ t= count_edge_t(dist_point, dist_point->node.shape.left, cur_point,
ex, ey, vx, vy, e_sqrlen);
if ((t>0.0) && (t<1.0))
{
@@ -2358,7 +2358,7 @@ count_distance:
}
if (cur_point_edge)
{
- t= count_edge_t(cur_point, cur_point->left, dist_point,
+ t= count_edge_t(cur_point, cur_point->node.shape.left, dist_point,
ex, ey, vx, vy, e_sqrlen);
if ((t>0.0) && (t<1.0))
{
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index e22718029e5..7c1c5f7da7d 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1564,7 +1564,7 @@ String *Item_func_insert::val_str(String *str)
length= res->charpos((int) length, (uint32) start);
/* Re-testing with corrected params */
- if (start > res->length())
+ if (start + 1 > res->length()) // remember, start = args[1].val_int() - 1
return res; /* purecov: inspected */ // Wrong param; skip insert
if (length > res->length() - start)
length= res->length() - start;
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 6444f672176..f22716d3d81 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -5329,6 +5329,7 @@ int subselect_hash_sj_engine::exec()
item_in->reset();
item_in->make_const();
item_in->set_first_execution();
+ thd->lex->current_select= save_select;
DBUG_RETURN(FALSE);
}
@@ -5372,6 +5373,7 @@ int subselect_hash_sj_engine::exec()
item_in->null_value= 1;
item_in->make_const();
item_in->set_first_execution();
+ thd->lex->current_select= save_select;
DBUG_RETURN(FALSE);
}
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 4cc9f6dc5bc..16edb35c392 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -2995,7 +2995,7 @@ void Item_func_timestamp_diff::print(String *str, enum_query_type query_type)
str->append(STRING_WITH_LEN("SECOND"));
break;
case INTERVAL_MICROSECOND:
- str->append(STRING_WITH_LEN("SECOND_FRAC"));
+ str->append(STRING_WITH_LEN("MICROSECOND"));
break;
default:
break;
diff --git a/sql/log.cc b/sql/log.cc
index 7f162b92118..33bd48b3c21 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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/sql/log_event.cc b/sql/log_event.cc
index ff2f9594922..e99ef164064 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2014, Monty Program Ab.
+ Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -3525,7 +3525,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
slave_proxy_id= thread_id = uint4korr(buf + Q_THREAD_ID_OFFSET);
exec_time = uint4korr(buf + Q_EXEC_TIME_OFFSET);
- db_len = (uint)buf[Q_DB_LEN_OFFSET]; // TODO: add a check of all *_len vars
+ db_len = (uchar)buf[Q_DB_LEN_OFFSET]; // TODO: add a check of all *_len vars
error_code = uint2korr(buf + Q_ERR_CODE_OFFSET);
/*
@@ -9895,7 +9895,18 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
}
#ifdef HAVE_QUERY_CACHE
+#ifdef WITH_WSREP
+ /*
+ Moved invalidation right before the call to rows_event_stmt_cleanup(),
+ to avoid query cache being polluted with stale entries.
+ */
+ if (! (WSREP(thd) && (thd->wsrep_exec_mode == REPL_RECV)))
+ {
+#endif /* WITH_WSREP */
query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock);
+#ifdef WITH_WSREP
+ }
+#endif /* WITH_WSREP */
#endif
}
@@ -10087,6 +10098,14 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
/* remove trigger's tables */
if (slave_run_triggers_for_rbr)
restore_empty_query_table_list(thd->lex);
+
+#if defined(WITH_WSREP) && defined(HAVE_QUERY_CACHE)
+ if (WSREP(thd) && thd->wsrep_exec_mode == REPL_RECV)
+ {
+ query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock);
+ }
+#endif /* WITH_WSREP && HAVE_QUERY_CACHE */
+
if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rgi, thd)))
slave_rows_error_report(ERROR_LEVEL,
thd->is_error() ? 0 : error,
@@ -11128,8 +11147,8 @@ bool Table_map_log_event::write_data_body()
DBUG_ASSERT(m_dbnam != NULL);
DBUG_ASSERT(m_tblnam != NULL);
/* We use only one byte per length for storage in event: */
- DBUG_ASSERT(m_dblen < 128);
- DBUG_ASSERT(m_tbllen < 128);
+ DBUG_ASSERT(m_dblen <= MY_MIN(NAME_LEN, 255));
+ DBUG_ASSERT(m_tbllen <= MY_MIN(NAME_LEN, 255));
uchar const dbuf[]= { (uchar) m_dblen };
uchar const tbuf[]= { (uchar) m_tbllen };
@@ -11352,6 +11371,7 @@ bool Rows_log_event::process_triggers(trg_event_type event,
{
bool result;
DBUG_ENTER("Rows_log_event::process_triggers");
+ m_table->triggers->mark_fields_used(event);
if (slave_run_triggers_for_rbr == SLAVE_RUN_TRIGGERS_FOR_RBR_YES)
{
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
@@ -12316,7 +12336,11 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
process_triggers(TRG_EVENT_DELETE, TRG_ACTION_BEFORE, FALSE))
error= HA_ERR_GENERIC; // in case if error is not set yet
if (!error)
+ {
+ m_table->mark_columns_per_binlog_row_image();
error= m_table->file->ha_delete_row(m_table->record[0]);
+ m_table->default_column_bitmaps();
+ }
if (invoke_triggers && !error &&
process_triggers(TRG_EVENT_DELETE, TRG_ACTION_AFTER, FALSE))
error= HA_ERR_GENERIC; // in case if error is not set yet
diff --git a/sql/mdl.cc b/sql/mdl.cc
index ab4f5288d4a..61591ec9f57 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1064,7 +1064,16 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
wait_result != ETIMEDOUT && wait_result != ETIME)
{
#ifdef WITH_WSREP
- if (wsrep_thd_is_BF(owner->get_thd(), true))
+ // Allow tests to block the applier thread using the DBUG facilities
+ DBUG_EXECUTE_IF("sync.wsrep_before_mdl_wait",
+ {
+ const char act[]=
+ "now "
+ "wait_for signal.wsrep_before_mdl_wait";
+ DBUG_ASSERT(!debug_sync_set_action((owner->get_thd()),
+ STRING_WITH_LEN(act)));
+ };);
+ if (wsrep_thd_is_BF(owner->get_thd(), false))
{
wait_result= mysql_cond_wait(&m_COND_wait_status, &m_LOCK_wait_status);
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e819f003ab9..bd456bbe85e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2015, MariaDB
+ Copyright (c) 2008, 2016, MariaDB
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
@@ -1501,7 +1501,6 @@ static openssl_lock_t *openssl_dynlock_create(const char *, int);
static void openssl_dynlock_destroy(openssl_lock_t *, const char *, int);
static void openssl_lock_function(int, int, const char *, int);
static void openssl_lock(int, openssl_lock_t *, const char *, int);
-static unsigned long openssl_id_function();
#endif
char *des_key_file;
#ifndef EMBEDDED_LIBRARY
@@ -4730,7 +4729,6 @@ static int init_thread_environment()
CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy);
CRYPTO_set_dynlock_lock_callback(openssl_lock);
CRYPTO_set_locking_callback(openssl_lock_function);
- CRYPTO_set_id_callback(openssl_id_function);
#endif
#endif
mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect);
@@ -4767,12 +4765,6 @@ static int init_thread_environment()
#if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL)
-static unsigned long openssl_id_function()
-{
- return (unsigned long) pthread_self();
-}
-
-
static openssl_lock_t *openssl_dynlock_create(const char *file, int line)
{
openssl_lock_t *lock= new openssl_lock_t;
@@ -8753,7 +8745,7 @@ static int mysql_init_variables(void)
executed_events= 0;
global_query_id= 1;
global_thread_id= 0;
- strmov(server_version, MYSQL_SERVER_VERSION);
+ strnmov(server_version, MYSQL_SERVER_VERSION, sizeof(server_version)-1);
threads.empty();
thread_cache.empty();
key_caches.empty();
@@ -9673,17 +9665,20 @@ void set_server_version(void)
{
if (!IS_SYSVAR_AUTOSIZE(&server_version_ptr))
return;
- char *end= strxmov(server_version, MYSQL_SERVER_VERSION,
- MYSQL_SERVER_SUFFIX_STR, NullS);
+ char *version_end= server_version+sizeof(server_version)-1;
+ char *end= strxnmov(server_version, sizeof(server_version)-1,
+ MYSQL_SERVER_VERSION,
+ MYSQL_SERVER_SUFFIX_STR, NullS);
#ifdef EMBEDDED_LIBRARY
- end= strmov(end, "-embedded");
+ end= strnmov(end, "-embedded", (version_end-end));
#endif
#ifndef DBUG_OFF
if (!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug"))
- end= strmov(end, "-debug");
+ end= strnmov(end, "-debug", (version_end-end));
#endif
if (opt_log || global_system_variables.sql_log_slow || opt_bin_log)
- strmov(end, "-log"); // This may slow down system
+ strnmov(end, "-log", (version_end-end)); // This may slow down system
+ *end= 0;
}
@@ -9989,7 +9984,7 @@ void refresh_status(THD *thd)
Set max_used_connections to the number of currently open
connections. This is not perfect, but status data is not exact anyway.
*/
- max_used_connections= thread_count-delayed_insert_threads;
+ max_used_connections= connection_count + extra_connection_count;
}
#ifdef HAVE_PSI_INTERFACE
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index fa04f6d2637..c1052869c8f 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -833,12 +833,14 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
in_subs->sjm_scan_allowed= FALSE;
bool all_are_fields= TRUE;
+ uint32 total_key_length = 0;
for (uint i= 0; i < elements; i++)
{
Item *outer= in_subs->left_expr->element_index(i);
Item *inner= it++;
all_are_fields &= (outer->real_item()->type() == Item::FIELD_ITEM &&
inner->real_item()->type() == Item::FIELD_ITEM);
+ total_key_length += inner->max_length;
if (outer->cmp_type() != inner->cmp_type())
DBUG_RETURN(FALSE);
switch (outer->cmp_type()) {
@@ -869,6 +871,15 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
}
}
+ /*
+ Make sure that create_tmp_table will not fail due to too long keys.
+ See MDEV-7122. This check is performed inside create_tmp_table also and
+ we must do it so that we know the table has keys created.
+ */
+ if (total_key_length > tmp_table_max_key_length() ||
+ elements > tmp_table_max_key_parts())
+ DBUG_RETURN(FALSE);
+
in_subs->types_allow_materialization= TRUE;
in_subs->sjm_scan_allowed= all_are_fields;
DBUG_PRINT("info",("subquery_types_allow_materialization: ok, allowed"));
@@ -5533,7 +5544,8 @@ bool JOIN::choose_subquery_plan(table_map join_tables)
outer join has not been optimized yet).
*/
if (outer_join && outer_join->table_count > 0 && // (1)
- outer_join->join_tab) // (2)
+ outer_join->join_tab && // (2)
+ !in_subs->const_item())
{
/*
TODO:
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 47c0f4e3fb7..f54ef2b0081 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -567,7 +567,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
Updates in slave state table should not be appended to galera transaction
writeset.
*/
- thd->wsrep_skip_append_keys= true;
+ thd->wsrep_ignore_table= true;
#endif
if (!in_transaction)
@@ -685,7 +685,7 @@ IF_DBUG(dbug_break:, )
end:
#ifdef WITH_WSREP
- thd->wsrep_skip_append_keys= false;
+ thd->wsrep_ignore_table= false;
#endif
if (table_opened)
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc
index 49708df40f7..ad949402511 100644
--- a/sql/rpl_reporting.cc
+++ b/sql/rpl_reporting.cc
@@ -59,6 +59,7 @@ Slave_reporting_capability::report(loglevel level, int err_code,
report_function= sql_print_information;
break;
default:
+ va_end(args);
DBUG_ASSERT(0); // should not come here
return; // don't crash production builds, just do nothing
}
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 244363e43ac..bdf5b7dea80 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -15,6 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
+#include <my_bit.h>
#include "rpl_utility.h"
#include "log_event.h"
@@ -23,30 +24,6 @@
#include "sql_select.h"
/**
- Function to compare two size_t integers for their relative
- order. Used below.
- */
-int compare(size_t a, size_t b)
-{
- if (a < b)
- return -1;
- if (b < a)
- return 1;
- return 0;
-}
-
-
-/**
- Max value for an unsigned integer of 'bits' bits.
-
- The somewhat contorted expression is to avoid overflow.
- */
-uint32 uint_max(int bits) {
- return (((1UL << (bits - 1)) - 1) << 1) | 1;
-}
-
-
-/**
Calculate display length for MySQL56 temporal data types from their metadata.
It contains fractional precision in the low 16-bit word.
*/
@@ -121,20 +98,22 @@ max_display_length_for_field(enum_field_types sql_type, unsigned int metadata)
return 3;
case MYSQL_TYPE_DATE:
- case MYSQL_TYPE_TIME:
return 3;
+ case MYSQL_TYPE_TIME:
+ return MIN_TIME_WIDTH;
+
case MYSQL_TYPE_TIME2:
return max_display_length_for_temporal2_field(MIN_TIME_WIDTH, metadata);
case MYSQL_TYPE_TIMESTAMP:
- return 4;
+ return MAX_DATETIME_WIDTH;
case MYSQL_TYPE_TIMESTAMP2:
return max_display_length_for_temporal2_field(MAX_DATETIME_WIDTH, metadata);
case MYSQL_TYPE_DATETIME:
- return 8;
+ return MAX_DATETIME_WIDTH;
case MYSQL_TYPE_DATETIME2:
return max_display_length_for_temporal2_field(MAX_DATETIME_WIDTH, metadata);
@@ -160,10 +139,10 @@ max_display_length_for_field(enum_field_types sql_type, unsigned int metadata)
*/
case MYSQL_TYPE_TINY_BLOB:
- return uint_max(1 * 8);
+ return my_set_bits(1 * 8);
case MYSQL_TYPE_MEDIUM_BLOB:
- return uint_max(3 * 8);
+ return my_set_bits(3 * 8);
case MYSQL_TYPE_BLOB:
/*
@@ -171,11 +150,11 @@ max_display_length_for_field(enum_field_types sql_type, unsigned int metadata)
blobs are of type MYSQL_TYPE_BLOB. In that case, we have to look
at the length instead to decide what the max display size is.
*/
- return uint_max(metadata * 8);
+ return my_set_bits(metadata * 8);
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_GEOMETRY:
- return uint_max(4 * 8);
+ return my_set_bits(4 * 8);
default:
return ~(uint32) 0;
@@ -205,7 +184,7 @@ int compare_lengths(Field *field, enum_field_types source_type, uint16 metadata)
" target_length: %lu, target_type: %u",
(unsigned long) source_length, source_type,
(unsigned long) target_length, field->real_type()));
- int result= compare(source_length, target_length);
+ int result= source_length < target_length ? -1 : source_length > target_length;
DBUG_PRINT("result", ("%d", result));
DBUG_RETURN(result);
}
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index d8ca8633baa..8b58f062a3e 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates.
- Copyright (c) 2012, 2015, MariaDB
+/* Copyright (c) 2010, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2016, MariaDB
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
@@ -288,7 +288,8 @@ static inline bool table_not_corrupt_error(uint sql_errno)
sql_errno == ER_LOCK_WAIT_TIMEOUT ||
sql_errno == ER_LOCK_DEADLOCK ||
sql_errno == ER_CANT_LOCK_LOG_TABLE ||
- sql_errno == ER_OPEN_AS_READONLY);
+ sql_errno == ER_OPEN_AS_READONLY ||
+ sql_errno == ER_WRONG_OBJECT);
}
@@ -399,7 +400,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
lex->query_tables_last= &table->next_global;
lex->query_tables_own_last= 0;
- if (view_operator_func == NULL)
+ /*
+ CHECK TABLE command is allowed for views as well. Check on alter flags
+ to differentiate from ALTER TABLE...CHECK PARTITION on which view is not
+ allowed.
+ */
+ if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION ||
+ view_operator_func == NULL)
{
table->required_type=FRMTYPE_TABLE;
DBUG_ASSERT(!lex->only_view);
@@ -1199,9 +1206,8 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
FALSE, UINT_MAX, FALSE))
goto error;
+ WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
thd->enable_slow_log= opt_log_slow_admin_statements;
- WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL);
-
res= mysql_admin_table(thd, first_table, &m_lex->check_opt,
"analyze", lock_type, 1, 0, 0, 0,
&handler::ha_analyze, 0);
@@ -1256,7 +1262,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd)
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
- WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
+ WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
thd->enable_slow_log= opt_log_slow_admin_statements;
res= (specialflag & SPECIAL_NO_NEW_FUNC) ?
mysql_recreate_table(thd, first_table, true) :
@@ -1290,7 +1296,7 @@ bool Sql_cmd_repair_table::execute(THD *thd)
FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
- WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
+ WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "repair",
TL_WRITE, 1,
MY_TEST(m_lex->check_opt.sql_flags & TT_USEFRM),
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 34a618aba98..d65b6235f01 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
@@ -168,11 +168,6 @@ static bool check_and_update_table_version(THD *thd, TABLE_LIST *tables,
TABLE_SHARE *table_share);
static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry);
static bool auto_repair_table(THD *thd, TABLE_LIST *table_list);
-static bool
-has_write_table_with_auto_increment(TABLE_LIST *tables);
-static bool
-has_write_table_with_auto_increment_and_select(TABLE_LIST *tables);
-static bool has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables);
/**
@@ -2295,6 +2290,16 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx)
*/
if (dd_frm_is_view(thd, path))
{
+ /*
+ If parent_l of the table_list is non null then a merge table
+ has this view as child table, which is not supported.
+ */
+ if (table_list->parent_l)
+ {
+ my_error(ER_WRONG_MRG_TABLE, MYF(0));
+ DBUG_RETURN(true);
+ }
+
if (!tdc_open_view(thd, table_list, alias, key, key_length,
CHECK_METADATA_VERSION))
{
@@ -5417,65 +5422,6 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
*(ptr++)= table->table;
}
- /*
- DML statements that modify a table with an auto_increment column based on
- rows selected from a table are unsafe as the order in which the rows are
- fetched fron the select tables cannot be determined and may differ on
- master and slave.
- */
- if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
- has_write_table_with_auto_increment_and_select(tables))
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
- /* Todo: merge all has_write_table_auto_inc with decide_logging_format */
- if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables)
- {
- if (has_write_table_auto_increment_not_first_in_pk(tables))
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST);
- }
-
-#ifdef NOT_USED_IN_MARIADB
- /*
- INSERT...ON DUPLICATE KEY UPDATE on a table with more than one unique keys
- can be unsafe.
- */
- uint unique_keys= 0;
- for (TABLE_LIST *query_table= tables; query_table && unique_keys <= 1;
- query_table= query_table->next_global)
- if(query_table->table)
- {
- uint keys= query_table->table->s->keys, i= 0;
- unique_keys= 0;
- for (KEY* keyinfo= query_table->table->s->key_info;
- i < keys && unique_keys <= 1; i++, keyinfo++)
- {
- if (keyinfo->flags & HA_NOSAME)
- unique_keys++;
- }
- if (!query_table->placeholder() &&
- query_table->lock_type >= TL_WRITE_ALLOW_WRITE &&
- unique_keys > 1 && thd->lex->sql_command == SQLCOM_INSERT &&
- /* Duplicate key update is not supported by INSERT DELAYED */
- thd->get_command() != COM_DELAYED_INSERT &&
- thd->lex->duplicates == DUP_UPDATE)
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_TWO_KEYS);
- }
-#endif
-
- /* We have to emulate LOCK TABLES if we are statement needs prelocking. */
- if (thd->lex->requires_prelocking())
- {
-
- /*
- A query that modifies autoinc column in sub-statement can make the
- master and slave inconsistent.
- We can solve these problems in mixed mode by switching to binlogging
- if at least one updated table is used by sub-statement
- */
- if (thd->wsrep_binlog_format() != BINLOG_FORMAT_ROW && tables &&
- has_write_table_with_auto_increment(thd->lex->first_not_own_table()))
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS);
- }
-
DEBUG_SYNC(thd, "before_lock_tables_takes_lock");
if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start),
@@ -9270,98 +9216,6 @@ bool is_equal(const LEX_STRING *a, const LEX_STRING *b)
return a->length == b->length && !strncmp(a->str, b->str, a->length);
}
-
-/*
- Tells if two (or more) tables have auto_increment columns and we want to
- lock those tables with a write lock.
-
- SYNOPSIS
- has_two_write_locked_tables_with_auto_increment
- tables Table list
-
- NOTES:
- Call this function only when you have established the list of all tables
- which you'll want to update (including stored functions, triggers, views
- inside your statement).
-*/
-
-static bool
-has_write_table_with_auto_increment(TABLE_LIST *tables)
-{
- for (TABLE_LIST *table= tables; table; table= table->next_global)
- {
- /* we must do preliminary checks as table->table may be NULL */
- if (!table->placeholder() &&
- table->table->found_next_number_field &&
- (table->lock_type >= TL_WRITE_ALLOW_WRITE))
- return 1;
- }
-
- return 0;
-}
-
-/*
- checks if we have select tables in the table list and write tables
- with auto-increment column.
-
- SYNOPSIS
- has_two_write_locked_tables_with_auto_increment_and_select
- tables Table list
-
- RETURN VALUES
-
- -true if the table list has atleast one table with auto-increment column
-
-
- and atleast one table to select from.
- -false otherwise
-*/
-
-static bool
-has_write_table_with_auto_increment_and_select(TABLE_LIST *tables)
-{
- bool has_select= false;
- bool has_auto_increment_tables = has_write_table_with_auto_increment(tables);
- for(TABLE_LIST *table= tables; table; table= table->next_global)
- {
- if (!table->placeholder() &&
- (table->lock_type <= TL_READ_NO_INSERT))
- {
- has_select= true;
- break;
- }
- }
- return(has_select && has_auto_increment_tables);
-}
-
-/*
- Tells if there is a table whose auto_increment column is a part
- of a compound primary key while is not the first column in
- the table definition.
-
- @param tables Table list
-
- @return true if the table exists, fais if does not.
-*/
-
-static bool
-has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables)
-{
- for (TABLE_LIST *table= tables; table; table= table->next_global)
- {
- /* we must do preliminary checks as table->table may be NULL */
- if (!table->placeholder() &&
- table->table->found_next_number_field &&
- (table->lock_type >= TL_WRITE_ALLOW_WRITE)
- && table->table->s->next_number_keypart != 0)
- return 1;
- }
-
- return 0;
-}
-
-
-
/*
Open and lock system tables for read.
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 03505dec0cf..91dd8ad7325 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1933,6 +1933,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
(int)flags.autocommit));
memcpy((uchar *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
(uchar*) &flags, QUERY_CACHE_FLAGS_SIZE);
+
+#ifdef WITH_WSREP
+ bool once_more;
+ once_more= true;
+lookup:
+#endif /* WITH_WSREP */
+
query_block = (Query_cache_block *) my_hash_search(&queries, (uchar*) sql,
tot_length);
/* Quick abort on unlocked data */
@@ -1945,6 +1952,19 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
}
DBUG_PRINT("qcache", ("Query in query hash 0x%lx", (ulong)query_block));
+#ifdef WITH_WSREP
+ if (once_more && WSREP_CLIENT(thd) && wsrep_must_sync_wait(thd))
+ {
+ unlock();
+ if (wsrep_sync_wait(thd))
+ goto err;
+ if (try_lock(thd, Query_cache::TIMEOUT))
+ goto err;
+ once_more= false;
+ goto lookup;
+ }
+#endif /* WITH_WSREP */
+
/* Now lock and test that nothing changed while blocks was unlocked */
BLOCK_LOCK_RD(query_block);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index c1f64c89e1b..38289b188b2 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2015, MariaDB
+ Copyright (c) 2008, 2016, MariaDB
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
@@ -896,7 +896,7 @@ THD::THD(bool is_wsrep_applier)
wsrep_po_handle(WSREP_PO_INITIALIZER),
wsrep_po_cnt(0),
wsrep_apply_format(0),
- wsrep_skip_append_keys(false)
+ wsrep_ignore_table(false)
#endif
{
ulong tmp;
@@ -1021,6 +1021,7 @@ THD::THD(bool is_wsrep_applier)
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
wsrep_info[sizeof(wsrep_info) - 1] = '\0'; /* make sure it is 0-terminated */
+ wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
#endif
/* Call to init() below requires fully initialized Open_tables_state. */
reset_open_tables_state(this);
@@ -1441,7 +1442,8 @@ void THD::init(void)
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
-#endif
+ wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
+#endif /* WITH_WSREP */
if (variables.sql_log_bin)
variables.option_bits|= OPTION_BIN_LOG;
@@ -2204,6 +2206,10 @@ void THD::cleanup_after_query()
rgi_slave->cleanup_after_query();
#endif
+#ifdef WITH_WSREP
+ wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+#endif /* WITH_WSREP */
+
DBUG_VOID_RETURN;
}
@@ -5450,6 +5456,94 @@ int xid_cache_iterate(THD *thd, my_hash_walk_action action, void *arg)
&argument);
}
+/*
+ Tells if two (or more) tables have auto_increment columns and we want to
+ lock those tables with a write lock.
+
+ SYNOPSIS
+ has_two_write_locked_tables_with_auto_increment
+ tables Table list
+
+ NOTES:
+ Call this function only when you have established the list of all tables
+ which you'll want to update (including stored functions, triggers, views
+ inside your statement).
+*/
+
+static bool
+has_write_table_with_auto_increment(TABLE_LIST *tables)
+{
+ for (TABLE_LIST *table= tables; table; table= table->next_global)
+ {
+ /* we must do preliminary checks as table->table may be NULL */
+ if (!table->placeholder() &&
+ table->table->found_next_number_field &&
+ (table->lock_type >= TL_WRITE_ALLOW_WRITE))
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ checks if we have select tables in the table list and write tables
+ with auto-increment column.
+
+ SYNOPSIS
+ has_two_write_locked_tables_with_auto_increment_and_select
+ tables Table list
+
+ RETURN VALUES
+
+ -true if the table list has atleast one table with auto-increment column
+
+
+ and atleast one table to select from.
+ -false otherwise
+*/
+
+static bool
+has_write_table_with_auto_increment_and_select(TABLE_LIST *tables)
+{
+ bool has_select= false;
+ bool has_auto_increment_tables = has_write_table_with_auto_increment(tables);
+ for(TABLE_LIST *table= tables; table; table= table->next_global)
+ {
+ if (!table->placeholder() &&
+ (table->lock_type <= TL_READ_NO_INSERT))
+ {
+ has_select= true;
+ break;
+ }
+ }
+ return(has_select && has_auto_increment_tables);
+}
+
+/*
+ Tells if there is a table whose auto_increment column is a part
+ of a compound primary key while is not the first column in
+ the table definition.
+
+ @param tables Table list
+
+ @return true if the table exists, fais if does not.
+*/
+
+static bool
+has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables)
+{
+ for (TABLE_LIST *table= tables; table; table= table->next_global)
+ {
+ /* we must do preliminary checks as table->table may be NULL */
+ if (!table->placeholder() &&
+ table->table->found_next_number_field &&
+ (table->lock_type >= TL_WRITE_ALLOW_WRITE)
+ && table->table->s->next_number_keypart != 0)
+ return 1;
+ }
+
+ return 0;
+}
/**
Decide on logging format to use for the statement and issue errors
@@ -5634,6 +5728,31 @@ int THD::decide_logging_format(TABLE_LIST *tables)
}
#endif
+ if (wsrep_binlog_format() != BINLOG_FORMAT_ROW && tables)
+ {
+ /*
+ DML statements that modify a table with an auto_increment column based on
+ rows selected from a table are unsafe as the order in which the rows are
+ fetched fron the select tables cannot be determined and may differ on
+ master and slave.
+ */
+ if (has_write_table_with_auto_increment_and_select(tables))
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
+
+ if (has_write_table_auto_increment_not_first_in_pk(tables))
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_NOT_FIRST);
+
+ /*
+ A query that modifies autoinc column in sub-statement can make the
+ master and slave inconsistent.
+ We can solve these problems in mixed mode by switching to binlogging
+ if at least one updated table is used by sub-statement
+ */
+ if (lex->requires_prelocking() &&
+ has_write_table_with_auto_increment(lex->first_not_own_table()))
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS);
+ }
+
/*
Get the capabilities vector for all involved storage engines and
mask out the flags for the binary log.
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 2c8270055db..4ab94b08970 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -3992,7 +3992,13 @@ public:
#endif /* GTID_SUPPORT */
void *wsrep_apply_format;
char wsrep_info[128]; /* string for dynamic proc info */
- bool wsrep_skip_append_keys;
+ /*
+ When enabled, do not replicate/binlog updates from the current table that's
+ being processed. At the moment, it is used to keep mysql.gtid_slave_pos
+ table updates from being replicated to other nodes via galera replication.
+ */
+ bool wsrep_ignore_table;
+ wsrep_gtid_t wsrep_sync_wait_gtid;
#endif /* WITH_WSREP */
/* Handling of timeouts for commands */
@@ -4495,10 +4501,14 @@ public:
#define TMP_ENGINE_COLUMNDEF MARIA_COLUMNDEF
#define TMP_ENGINE_HTON maria_hton
#define TMP_ENGINE_NAME "Aria"
+inline uint tmp_table_max_key_length() { return maria_max_key_length(); }
+inline uint tmp_table_max_key_parts() { return maria_max_key_segments(); }
#else
#define TMP_ENGINE_COLUMNDEF MI_COLUMNDEF
#define TMP_ENGINE_HTON myisam_hton
#define TMP_ENGINE_NAME "MyISAM"
+inline uint tmp_table_max_key_length() { return MI_MAX_KEY_LENGTH; }
+inline uint tmp_table_max_key_parts() { return MI_MAX_KEY_SEG; }
#endif
/*
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index b8a8a921367..f77d8cb1984 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4257,6 +4257,8 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
DBUG_RETURN(1);
table->mark_columns_needed_for_insert();
table->file->extra(HA_EXTRA_WRITE_CACHE);
+ // Mark table as used
+ table->query_id= thd->query_id;
DBUG_RETURN(0);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index f0bc582985b..e93ba7fc10f 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -324,9 +324,7 @@ void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr)
DBUG_ASSERT(begin_ptr);
DBUG_ASSERT(m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length);
- uint body_utf8_length=
- (m_buf_length / thd->variables.character_set_client->mbminlen) *
- my_charset_utf8_bin.mbmaxlen;
+ uint body_utf8_length= get_body_utf8_maximum_length(thd);
m_body_utf8= (char *) thd->alloc(body_utf8_length + 1);
m_body_utf8_ptr= m_body_utf8;
@@ -335,6 +333,22 @@ void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr)
m_cpp_utf8_processed_ptr= begin_ptr;
}
+
+uint Lex_input_stream::get_body_utf8_maximum_length(THD *thd)
+{
+ /*
+ String literals can grow during escaping:
+ 1a. Character string '<TAB>' can grow to '\t', 3 bytes to 4 bytes growth.
+ 1b. Character string '1000 times <TAB>' grows from
+ 1002 to 2002 bytes (including quotes), which gives a little bit
+ less than 2 times growth.
+ "2" should be a reasonable multiplier that safely covers escaping needs.
+ */
+ return (m_buf_length / thd->variables.character_set_client->mbminlen) *
+ my_charset_utf8_bin.mbmaxlen * 2/*for escaping*/;
+}
+
+
/**
@brief The operation appends unprocessed part of pre-processed buffer till
the given pointer (ptr) and sets m_cpp_utf8_processed_ptr to end_ptr.
@@ -402,15 +416,15 @@ void Lex_input_stream::body_utf8_append(const char *ptr)
operation.
*/
-void Lex_input_stream::body_utf8_append_literal(THD *thd,
- const LEX_STRING *txt,
- CHARSET_INFO *txt_cs,
- const char *end_ptr)
+void Lex_input_stream::body_utf8_append_ident(THD *thd,
+ const LEX_STRING *txt,
+ const char *end_ptr)
{
if (!m_cpp_utf8_processed_ptr)
return;
LEX_STRING utf_txt;
+ CHARSET_INFO *txt_cs= thd->charset();
if (!my_charset_same(txt_cs, &my_charset_utf8_general_ci))
{
@@ -434,6 +448,189 @@ void Lex_input_stream::body_utf8_append_literal(THD *thd,
m_cpp_utf8_processed_ptr= end_ptr;
}
+
+
+
+extern "C" {
+
+/**
+ Escape a character. Consequently puts "escape" and "wc" characters into
+ the destination utf8 string.
+ @param cs - the character set (utf8)
+ @param escape - the escape character (backslash, single quote, double quote)
+ @param wc - the character to be escaped
+ @param str - the destination string
+ @param end - the end of the destination string
+ @returns - a code according to the wc_mb() convension.
+*/
+int my_wc_mb_utf8_with_escape(CHARSET_INFO *cs, my_wc_t escape, my_wc_t wc,
+ uchar *str, uchar *end)
+{
+ DBUG_ASSERT(escape > 0);
+ if (str + 1 >= end)
+ return MY_CS_TOOSMALL2; // Not enough space, need at least two bytes.
+ *str= escape;
+ int cnvres= my_charset_utf8_handler.wc_mb(cs, wc, str + 1, end);
+ if (cnvres > 0)
+ return cnvres + 1; // The character was normally put
+ if (cnvres == MY_CS_ILUNI)
+ return MY_CS_ILUNI; // Could not encode "wc" (e.g. non-BMP character)
+ DBUG_ASSERT(cnvres <= MY_CS_TOOSMALL);
+ return cnvres - 1; // Not enough space
+}
+
+
+/**
+ Optionally escape a character.
+ If "escape" is non-zero, then both "escape" and "wc" are put to
+ the destination string. Otherwise, only "wc" is put.
+ @param cs - the character set (utf8)
+ @param wc - the character to be optionally escaped
+ @param escape - the escape character, or 0
+ @param ewc - the escaped replacement of "wc" (e.g. 't' for '\t')
+ @param str - the destination string
+ @param end - the end of the destination string
+ @returns - a code according to the wc_mb() conversion.
+*/
+int my_wc_mb_utf8_opt_escape(CHARSET_INFO *cs,
+ my_wc_t wc, my_wc_t escape, my_wc_t ewc,
+ uchar *str, uchar *end)
+{
+ return escape ? my_wc_mb_utf8_with_escape(cs, escape, ewc, str, end) :
+ my_charset_utf8_handler.wc_mb(cs, wc, str, end);
+}
+
+/**
+ Encode a character with optional backlash escaping and quote escaping.
+ Quote marks are escaped using another quote mark.
+ Additionally, if "escape" is non-zero, then special characters are
+ also escaped using "escape".
+ Otherwise (if "escape" is zero, e.g. in case of MODE_NO_BACKSLASH_ESCAPES),
+ then special characters are not escaped and handled as normal characters.
+
+ @param cs - the character set (utf8)
+ @param wc - the character to be encoded
+ @param str - the destination string
+ @param end - the end of the destination string
+ @param sep - the string delimiter (e.g. ' or ")
+ @param escape - the escape character (backslash, or 0)
+ @returns - a code according to the wc_mb() convension.
+*/
+int my_wc_mb_utf8_escape(CHARSET_INFO *cs, my_wc_t wc, uchar *str, uchar *end,
+ my_wc_t sep, my_wc_t escape)
+{
+ DBUG_ASSERT(escape == 0 || escape == '\\');
+ DBUG_ASSERT(sep == '"' || sep == '\'');
+ switch (wc) {
+ case 0: return my_wc_mb_utf8_opt_escape(cs, wc, escape, '0', str, end);
+ case '\t': return my_wc_mb_utf8_opt_escape(cs, wc, escape, 't', str, end);
+ case '\r': return my_wc_mb_utf8_opt_escape(cs, wc, escape, 'r', str, end);
+ case '\n': return my_wc_mb_utf8_opt_escape(cs, wc, escape, 'n', str, end);
+ case '\032': return my_wc_mb_utf8_opt_escape(cs, wc, escape, 'Z', str, end);
+ case '\'':
+ case '\"':
+ if (wc == sep)
+ return my_wc_mb_utf8_with_escape(cs, wc, wc, str, end);
+ }
+ return my_charset_utf8_handler.wc_mb(cs, wc, str, end); // No escaping needed
+}
+
+
+/** wc_mb() compatible routines for all sql_mode and delimiter combinations */
+int my_wc_mb_utf8_escape_single_quote_and_backslash(CHARSET_INFO *cs,
+ my_wc_t wc,
+ uchar *str, uchar *end)
+{
+ return my_wc_mb_utf8_escape(cs, wc, str, end, '\'', '\\');
+}
+
+
+int my_wc_mb_utf8_escape_double_quote_and_backslash(CHARSET_INFO *cs,
+ my_wc_t wc,
+ uchar *str, uchar *end)
+{
+ return my_wc_mb_utf8_escape(cs, wc, str, end, '"', '\\');
+}
+
+
+int my_wc_mb_utf8_escape_single_quote(CHARSET_INFO *cs, my_wc_t wc,
+ uchar *str, uchar *end)
+{
+ return my_wc_mb_utf8_escape(cs, wc, str, end, '\'', 0);
+}
+
+
+int my_wc_mb_utf8_escape_double_quote(CHARSET_INFO *cs, my_wc_t wc,
+ uchar *str, uchar *end)
+{
+ return my_wc_mb_utf8_escape(cs, wc, str, end, '"', 0);
+}
+
+}; // End of extern "C"
+
+
+/**
+ Get an escaping function, depending on the current sql_mode and the
+ string separator.
+*/
+my_charset_conv_wc_mb
+Lex_input_stream::get_escape_func(THD *thd, my_wc_t sep) const
+{
+ return thd->backslash_escapes() ?
+ (sep == '"' ? my_wc_mb_utf8_escape_double_quote_and_backslash:
+ my_wc_mb_utf8_escape_single_quote_and_backslash) :
+ (sep == '"' ? my_wc_mb_utf8_escape_double_quote:
+ my_wc_mb_utf8_escape_single_quote);
+}
+
+
+/**
+ Append a text literal to the end of m_body_utf8.
+ The string is escaped according to the current sql_mode and the
+ string delimiter (e.g. ' or ").
+
+ @param thd - current THD
+ @param txt - the string to be appended to m_body_utf8.
+ Note, the string must be already unescaped.
+ @param cs - the character set of the string
+ @param end_ptr - m_cpp_utf8_processed_ptr will be set to this value
+ (see body_utf8_append_ident for details)
+ @param sep - the string delimiter (single or double quote)
+*/
+void Lex_input_stream::body_utf8_append_escape(THD *thd,
+ const LEX_STRING *txt,
+ CHARSET_INFO *cs,
+ const char *end_ptr,
+ my_wc_t sep)
+{
+ DBUG_ASSERT(sep == '\'' || sep == '"');
+ if (!m_cpp_utf8_processed_ptr)
+ return;
+ uint errors;
+ /**
+ We previously alloced m_body_utf8 to be able to store the query with all
+ strings properly escaped. See get_body_utf8_maximum_length().
+ So here we have guaranteedly enough space to append any string literal
+ with escaping. Passing txt->length*2 as "available space" is always safe.
+ For better safety purposes we could calculate get_body_utf8_maximum_length()
+ every time we append a string, but this would affect performance negatively,
+ so let's check that we don't get beyond the allocated buffer in
+ debug build only.
+ */
+ DBUG_ASSERT(m_body_utf8 + get_body_utf8_maximum_length(thd) >=
+ m_body_utf8_ptr + txt->length * 2);
+ uint32 cnv_length= my_convert_using_func(m_body_utf8_ptr, txt->length * 2,
+ &my_charset_utf8_general_ci,
+ get_escape_func(thd, sep),
+ txt->str, txt->length,
+ cs, cs->cset->mb_wc,
+ &errors);
+ m_body_utf8_ptr+= cnv_length;
+ *m_body_utf8_ptr= 0;
+ m_cpp_utf8_processed_ptr= end_ptr;
+}
+
+
void Lex_input_stream::add_digest_token(uint token, LEX_YYSTYPE yylval)
{
if (m_digest != NULL)
@@ -796,14 +993,14 @@ Lex_input_stream::unescape(CHARSET_INFO *cs, char *to,
Fix sometimes to do only one scan of the string
*/
-bool Lex_input_stream::get_text(LEX_STRING *dst, int pre_skip, int post_skip)
+bool Lex_input_stream::get_text(LEX_STRING *dst, uint sep,
+ int pre_skip, int post_skip)
{
- reg1 uchar c,sep;
+ reg1 uchar c;
uint found_escape=0;
CHARSET_INFO *cs= m_thd->charset();
tok_bitmap= 0;
- sep= yyGetLast(); // String should end with this
while (! eof())
{
c= yyGet();
@@ -1168,6 +1365,8 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
return((int) c);
case MY_LEX_IDENT_OR_NCHAR:
+ {
+ uint sep;
if (lip->yyPeek() != '\'')
{
state= MY_LEX_IDENT;
@@ -1175,14 +1374,20 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
}
/* Found N'string' */
lip->yySkip(); // Skip '
- if (lip->get_text(&yylval->lex_str, 2, 1))
+ if (lip->get_text(&yylval->lex_str, (sep= lip->yyGetLast()), 2, 1))
{
state= MY_LEX_CHAR; // Read char by char
break;
}
+
+ lip->body_utf8_append(lip->m_cpp_text_start);
+ lip->body_utf8_append_escape(thd, &yylval->lex_str,
+ national_charset_info,
+ lip->m_cpp_text_end, sep);
+
lex->text_string_is_7bit= (lip->tok_bitmap & 0x80) ? 0 : 1;
return(NCHAR_STRING);
-
+ }
case MY_LEX_IDENT_OR_HEX:
if (lip->yyPeek() == '\'')
{ // Found x'hex-number'
@@ -1285,8 +1490,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
lip->body_utf8_append(lip->m_cpp_text_start);
- lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
- lip->m_cpp_text_end);
+ lip->body_utf8_append_ident(thd, &yylval->lex_str, lip->m_cpp_text_end);
return(result_state); // IDENT or IDENT_QUOTED
@@ -1390,8 +1594,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
lip->body_utf8_append(lip->m_cpp_text_start);
- lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
- lip->m_cpp_text_end);
+ lip->body_utf8_append_ident(thd, &yylval->lex_str, lip->m_cpp_text_end);
return(result_state);
@@ -1434,8 +1637,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
lip->body_utf8_append(lip->m_cpp_text_start);
- lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
- lip->m_cpp_text_end);
+ lip->body_utf8_append_ident(thd, &yylval->lex_str, lip->m_cpp_text_end);
return(IDENT_QUOTED);
}
@@ -1540,23 +1742,23 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
}
/* " used for strings */
case MY_LEX_STRING: // Incomplete text string
- if (lip->get_text(&yylval->lex_str, 1, 1))
+ {
+ uint sep;
+ if (lip->get_text(&yylval->lex_str, (sep= lip->yyGetLast()), 1, 1))
{
state= MY_LEX_CHAR; // Read char by char
break;
}
-
+ CHARSET_INFO *strcs= lip->m_underscore_cs ? lip->m_underscore_cs : cs;
lip->body_utf8_append(lip->m_cpp_text_start);
- lip->body_utf8_append_literal(thd, &yylval->lex_str,
- lip->m_underscore_cs ? lip->m_underscore_cs : cs,
- lip->m_cpp_text_end);
-
+ lip->body_utf8_append_escape(thd, &yylval->lex_str, strcs,
+ lip->m_cpp_text_end, sep);
lip->m_underscore_cs= NULL;
lex->text_string_is_7bit= (lip->tok_bitmap & 0x80) ? 0 : 1;
return(TEXT_STRING);
-
+ }
case MY_LEX_COMMENT: // Comment
lex->select_lex.options|= OPTION_FOUND_COMMENT;
while ((c = lip->yyGet()) != '\n' && c) ;
@@ -1805,8 +2007,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
lip->body_utf8_append(lip->m_cpp_text_start);
- lip->body_utf8_append_literal(thd, &yylval->lex_str, cs,
- lip->m_cpp_text_end);
+ lip->body_utf8_append_ident(thd, &yylval->lex_str, lip->m_cpp_text_end);
return(result_state);
}
@@ -3915,6 +4116,19 @@ void SELECT_LEX::update_used_tables()
tl->on_expr->update_used_tables();
tl->on_expr->walk(&Item::eval_not_null_tables, 0, NULL);
}
+ /*
+ - There is no need to check sj_on_expr, because merged semi-joins inject
+ sj_on_expr into the parent's WHERE clase.
+ - For non-merged semi-joins (aka JTBMs), we need to check their
+ left_expr. There is no need to check the rest of the subselect, we know
+ it is uncorrelated and so cannot refer to any tables in this select.
+ */
+ if (tl->jtbm_subselect)
+ {
+ Item *left_expr= tl->jtbm_subselect->left_expr;
+ left_expr->walk(&Item::update_table_bitmaps_processor, FALSE, NULL);
+ }
+
embedding= tl->embedding;
while (embedding)
{
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 9eddd6d61ee..bda4ceb7b91 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2016, MariaDB
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
@@ -1072,6 +1072,13 @@ private:
index_clause_map current_index_hint_clause;
/* a list of USE/FORCE/IGNORE INDEX */
List<Index_hint> *index_hints;
+
+public:
+ inline void add_where_field(st_select_lex *sel)
+ {
+ DBUG_ASSERT(this != sel);
+ select_n_where_fields+= sel->select_n_where_fields;
+ }
};
typedef class st_select_lex SELECT_LEX;
@@ -1407,6 +1414,11 @@ public:
return get_stmt_unsafe_flags() != 0;
}
+ inline bool is_stmt_unsafe(enum_binlog_stmt_unsafe unsafe)
+ {
+ return binlog_stmt_flags & (1 << unsafe);
+ }
+
/**
Flag the current (top-level) statement as unsafe.
The flag will be reset after the statement has finished.
@@ -1803,6 +1815,7 @@ class Lex_input_stream
{
size_t unescape(CHARSET_INFO *cs, char *to,
const char *str, const char *end, int sep);
+ my_charset_conv_wc_mb get_escape_func(THD *thd, my_wc_t sep) const;
public:
Lex_input_stream()
{
@@ -2073,14 +2086,23 @@ public:
return (uint) (m_body_utf8_ptr - m_body_utf8);
}
+ /**
+ Get the maximum length of the utf8-body buffer.
+ The utf8 body can grow because of the character set conversion and escaping.
+ */
+ uint get_body_utf8_maximum_length(THD *thd);
+
void body_utf8_start(THD *thd, const char *begin_ptr);
void body_utf8_append(const char *ptr);
void body_utf8_append(const char *ptr, const char *end_ptr);
- void body_utf8_append_literal(THD *thd,
- const LEX_STRING *txt,
- CHARSET_INFO *txt_cs,
- const char *end_ptr);
-
+ void body_utf8_append_ident(THD *thd,
+ const LEX_STRING *txt,
+ const char *end_ptr);
+ void body_utf8_append_escape(THD *thd,
+ const LEX_STRING *txt,
+ CHARSET_INFO *txt_cs,
+ const char *end_ptr,
+ my_wc_t sep);
/** Current thread. */
THD *m_thd;
@@ -2101,7 +2123,7 @@ public:
/** LALR(2) resolution, value of the look ahead token.*/
LEX_YYSTYPE lookahead_yylval;
- bool get_text(LEX_STRING *to, int pre_skip, int post_skip);
+ bool get_text(LEX_STRING *to, uint sep, int pre_skip, int post_skip);
void add_digest_token(uint token, LEX_YYSTYPE yylval);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b73a26b89bc..78f9a9b286a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4518,6 +4518,11 @@ end_with_restore_list:
db_name.str= db_name_buff;
db_name.length= lex->name.length;
strmov(db_name.str, lex->name.str);
+
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
+
if (check_db_name(&db_name))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db_name.str);
@@ -4571,6 +4576,9 @@ end_with_restore_list:
/* lex->unit.cleanup() is called outside, no need to call it here */
break;
case SQLCOM_SHOW_CREATE_EVENT:
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
res= Events::show_create_event(thd, lex->spname->m_db,
lex->spname->m_name);
break;
@@ -4799,16 +4807,29 @@ end_with_restore_list:
#ifdef WITH_WSREP
if (lex->type & (
- REFRESH_GRANT |
- REFRESH_HOSTS |
- REFRESH_DES_KEY_FILE |
+ REFRESH_GRANT |
+ REFRESH_HOSTS |
+#ifdef HAVE_OPENSSL
+ REFRESH_DES_KEY_FILE |
+#endif
+ /*
+ Write all flush log statements except
+ FLUSH LOGS
+ FLUSH BINARY LOGS
+ Check reload_acl_and_cache for why.
+ */
+ REFRESH_RELAY_LOG |
+ REFRESH_SLOW_LOG |
+ REFRESH_GENERAL_LOG |
+ REFRESH_ENGINE_LOG |
+ REFRESH_ERROR_LOG |
#ifdef HAVE_QUERY_CACHE
- REFRESH_QUERY_CACHE_FREE |
+ REFRESH_QUERY_CACHE_FREE |
#endif /* HAVE_QUERY_CACHE */
- REFRESH_STATUS |
- REFRESH_USER_RESOURCES))
+ REFRESH_STATUS |
+ REFRESH_USER_RESOURCES))
{
- WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+ WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL)
}
#endif /* WITH_WSREP*/
@@ -4842,11 +4863,11 @@ end_with_restore_list:
*/
if (first_table)
{
- WSREP_TO_ISOLATION_BEGIN(NULL, NULL, first_table);
+ WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
}
else
{
- WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
+ WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL);
}
}
#endif /* WITH_WSREP */
@@ -5451,12 +5472,18 @@ create_sp_error:
}
case SQLCOM_SHOW_CREATE_PROC:
{
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
if (sp_show_create_routine(thd, TYPE_ENUM_PROCEDURE, lex->spname))
goto error;
break;
}
case SQLCOM_SHOW_CREATE_FUNC:
{
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
if (sp_show_create_routine(thd, TYPE_ENUM_FUNCTION, lex->spname))
goto error;
break;
@@ -5469,6 +5496,9 @@ create_sp_error:
stored_procedure_type type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE ?
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
if (sp_cache_routine(thd, type, lex->spname, FALSE, &sp))
goto error;
if (!sp || sp->show_routine_code(thd))
@@ -5493,6 +5523,9 @@ create_sp_error:
goto error;
}
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
+#endif /* WITH_WSREP */
if (show_create_trigger(thd, lex->spname))
goto error; /* Error has been already logged. */
@@ -7339,6 +7372,12 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
sql_statement_info[SQLCOM_SELECT].m_key);
status_var_increment(thd->status_var.com_stat[SQLCOM_SELECT]);
thd->update_stats();
+#ifdef WITH_WSREP
+ if (WSREP_CLIENT(thd))
+ {
+ thd->wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ }
+#endif /* WITH_WSREP */
}
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic
index da0cc17250b..c3dfde18ab6 100644
--- a/sql/sql_plugin_services.ic
+++ b/sql/sql_plugin_services.ic
@@ -133,7 +133,7 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_thd_query_state_str,
wsrep_thd_retry_counter,
wsrep_thd_set_conflict_state,
- wsrep_thd_skip_append_keys,
+ wsrep_thd_ignore_table,
wsrep_thd_trx_seqno,
wsrep_thd_ws_handle,
wsrep_trx_is_aborting,
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8c4e8812d72..b1e46478aa6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015 Oracle and/or its affiliates.
- Copyright (c) 2009, 2015 MariaDB
+ Copyright (c) 2009, 2016 MariaDB
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
@@ -9236,7 +9236,7 @@ static void add_not_null_conds(JOIN *join)
if (!referred_tab)
continue;
if (!(notnull= new (join->thd->mem_root)
- Item_func_isnotnull(join->thd, not_null_item)))
+ Item_func_isnotnull(join->thd, item)))
DBUG_VOID_RETURN;
/*
We need to do full fix_fields() call here in order to have correct
@@ -17117,6 +17117,12 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
goto err;
bzero(seg, sizeof(*seg) * keyinfo->user_defined_key_parts);
+ /*
+ Note that a similar check is performed during
+ subquery_types_allow_materialization. See MDEV-7122 for more details as
+ to why. Whenever this changes, it must be updated there as well, for
+ all tmp_table engines.
+ */
if (keyinfo->key_length > table->file->max_key_length() ||
keyinfo->user_defined_key_parts > table->file->max_key_parts() ||
share->uniques)
@@ -17316,6 +17322,12 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
goto err;
bzero(seg, sizeof(*seg) * keyinfo->user_defined_key_parts);
+ /*
+ Note that a similar check is performed during
+ subquery_types_allow_materialization. See MDEV-7122 for more details as
+ to why. Whenever this changes, it must be updated there as well, for
+ all tmp_table engines.
+ */
if (keyinfo->key_length > table->file->max_key_length() ||
keyinfo->user_defined_key_parts > table->file->max_key_parts() ||
share->uniques)
@@ -18783,7 +18795,18 @@ int join_read_key2(THD *thd, JOIN_TAB *tab, TABLE *table, TABLE_REF *table_ref)
}
}
+ /*
+ The following is needed when one makes ref (or eq_ref) access from row
+ comparisons: one must call row->bring_value() to get the new values.
+ */
+ if (tab && tab->bush_children)
+ {
+ TABLE_LIST *emb_sj_nest= tab->bush_children->start->emb_sj_nest;
+ emb_sj_nest->sj_subq_pred->left_expr->bring_value();
+ }
+
/* TODO: Why don't we do "Late NULLs Filtering" here? */
+
if (cmp_buffer_with_ref(thd, table, table_ref) ||
(table->status & (STATUS_GARBAGE | STATUS_NO_PARENT | STATUS_NULL_ROW)))
{
@@ -21194,7 +21217,7 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
&examined_rows, &found_rows,
join->explain->ops_tracker.report_sorting(thd));
table->sort.found_records= filesort_retval;
- tab->records= found_rows; // For SQL_CALC_ROWS
+ tab->records= join->select_options & OPTION_FOUND_ROWS ? found_rows : filesort_retval;
if (quick_created)
{
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 1b1bb6ded71..95550f56450 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -33,7 +33,6 @@
#include "records.h" /* READ_RECORD */
#include "opt_range.h" /* SQL_SELECT, QUICK_SELECT_I */
-
/* Values in optimize */
#define KEY_OPTIMIZE_EXISTS 1
#define KEY_OPTIMIZE_REF_OR_NULL 2
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index f4dd24a1d0f..f40e12974b0 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -1450,20 +1450,17 @@ static const char *require_quotes(const char *name, uint name_length)
}
-/*
- Quote the given identifier if needed and append it to the target string.
- If the given identifier is empty, it will be quoted.
-
- SYNOPSIS
- append_identifier()
- thd thread handler
- packet target string
- name the identifier to be appended
- name_length length of the appending identifier
+/**
+ Convert and quote the given identifier if needed and append it to the
+ target string. If the given identifier is empty, it will be quoted.
+ @thd thread handler
+ @packet target string
+ @name the identifier to be appended
+ @length length of the appending identifier
- RETURN VALUES
- true Error
- false Ok
+ @return
+ 0 success
+ 1 error
*/
bool
@@ -5036,6 +5033,15 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
}
append_create_options(thd, &str, share->option_list, false, 0);
+ if (file)
+ {
+ HA_CREATE_INFO create_info;
+ memset(&create_info, 0, sizeof(create_info));
+ file->update_create_info(&create_info);
+ append_directory(thd, &str, "DATA", create_info.data_file_name);
+ append_directory(thd, &str, "INDEX", create_info.index_file_name);
+ }
+
if (str.length())
table->field[19]->store(str.ptr()+1, str.length()-1, cs);
@@ -7345,12 +7351,14 @@ static my_bool find_schema_table_in_plugin(THD *thd, plugin_ref plugin,
# pointer to 'schema_tables' element
*/
-ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name)
+ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name,
+ bool *in_plugin)
{
schema_table_ref schema_table_a;
ST_SCHEMA_TABLE *schema_table= schema_tables;
DBUG_ENTER("find_schema_table");
+ *in_plugin= false;
for (; schema_table->table_name; schema_table++)
{
if (!my_strcasecmp(system_charset_info,
@@ -7359,6 +7367,7 @@ ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name)
DBUG_RETURN(schema_table);
}
+ *in_plugin= true;
schema_table_a.table_name= table_name;
if (plugin_foreach(thd, find_schema_table_in_plugin,
MYSQL_INFORMATION_SCHEMA_PLUGIN, &schema_table_a))
@@ -8280,8 +8289,8 @@ ST_FIELD_INFO tables_fields_info[]=
OPEN_FRM_ONLY},
{"CHECKSUM", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum", OPEN_FULL_TABLE},
- {"CREATE_OPTIONS", 255, MYSQL_TYPE_STRING, 0, 1, "Create_options",
- OPEN_FRM_ONLY},
+ {"CREATE_OPTIONS", 2048, MYSQL_TYPE_STRING, 0, 1, "Create_options",
+ OPEN_FULL_TABLE},
{"TABLE_COMMENT", TABLE_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
"Comment", OPEN_FRM_ONLY},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
diff --git a/sql/sql_show.h b/sql/sql_show.h
index ecb7e9468ea..9dae78e7f0e 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2012, 2016, MariaDB
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
@@ -117,7 +118,10 @@ bool schema_table_store_record(THD *thd, TABLE *table);
void initialize_information_schema_acl();
COND *make_cond_for_info_schema(THD *thd, COND *cond, TABLE_LIST *table);
-ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name);
+ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name, bool *in_plugin);
+static inline ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name)
+{ bool unused; return find_schema_table(thd, table_name, &unused); }
+
ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
int make_schema_select(THD *thd, SELECT_LEX *sel,
ST_SCHEMA_TABLE *schema_table);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8ea9db41ce4..b4cebb4f7a9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
@@ -2232,7 +2232,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
const char *comment_start;
uint32 comment_len;
- built_query.set_charset(system_charset_info);
+ built_query.set_charset(thd->charset());
if (if_exists)
built_query.append("DROP TABLE IF EXISTS ");
else
@@ -3448,8 +3448,31 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
else
{
/* Field redefined */
+
+ /*
+ If we are replacing a BIT field, revert the increment
+ of total_uneven_bit_length that was done above.
+ */
+ if (sql_field->sql_type == MYSQL_TYPE_BIT &&
+ file->ha_table_flags() & HA_CAN_BIT_FIELD)
+ total_uneven_bit_length-= sql_field->length & 7;
+
sql_field->def= dup_field->def;
sql_field->sql_type= dup_field->sql_type;
+
+ /*
+ If we are replacing a field with a BIT field, we need
+ to initialize pack_flag. Note that we do not need to
+ increment total_uneven_bit_length here as this dup_field
+ has already been processed.
+ */
+ if (sql_field->sql_type == MYSQL_TYPE_BIT)
+ {
+ sql_field->pack_flag= FIELDFLAG_NUMBER;
+ if (!(file->ha_table_flags() & HA_CAN_BIT_FIELD))
+ sql_field->pack_flag|= FIELDFLAG_TREAT_BIT_AS_CHAR;
+ }
+
sql_field->charset= (dup_field->charset ?
dup_field->charset :
create_info->default_table_charset);
@@ -6167,6 +6190,7 @@ static bool fill_alter_inplace_info(THD *thd,
c) flags passed to storage engine contain more detailed information
about nature of changes than those provided from parser.
*/
+ bool maybe_alter_vcol= false;
for (f_ptr= table->field; (field= *f_ptr); f_ptr++)
{
/* Clear marker for renamed or dropped field
@@ -6190,7 +6214,8 @@ static bool fill_alter_inplace_info(THD *thd,
/*
Check if type of column has changed to some incompatible type.
*/
- switch (field->is_equal(new_field))
+ uint is_equal= field->is_equal(new_field);
+ switch (is_equal)
{
case IS_EQUAL_NO:
/* New column type is incompatible with old one. */
@@ -6242,6 +6267,20 @@ static bool fill_alter_inplace_info(THD *thd,
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE;
}
+ /*
+ Check if the column is computed and either
+ is stored or is used in the partitioning expression.
+ */
+ if (field->vcol_info &&
+ (field->stored_in_db() || field->vcol_info->is_in_partitioning_expr()))
+ {
+ if (is_equal == IS_EQUAL_NO ||
+ !field->vcol_info->is_equal(new_field->vcol_info))
+ ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
+ else
+ maybe_alter_vcol= true;
+ }
+
/* Check if field was renamed */
if (my_strcasecmp(system_charset_info, field->field_name,
new_field->field_name))
@@ -6305,32 +6344,37 @@ static bool fill_alter_inplace_info(THD *thd,
}
}
+ if (maybe_alter_vcol)
+ {
+ /*
+ No virtual column was altered, but perhaps one of the other columns was,
+ and that column was part of the vcol expression?
+ We don't detect this correctly (FIXME), so let's just say that a vcol
+ *might* be affected if any other column was altered.
+ */
+ if (ha_alter_info->handler_flags &
+ ( Alter_inplace_info::ALTER_COLUMN_TYPE
+ | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE
+ | Alter_inplace_info::ALTER_COLUMN_OPTION ))
+ ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
+ }
+
new_field_it.init(alter_info->create_list);
while ((new_field= new_field_it++))
{
- Virtual_column_info *vcol_info;
- if (new_field->field)
- vcol_info= new_field->field->vcol_info;
- else
+ if (! new_field->field)
{
- vcol_info= new_field->vcol_info;
/*
Field is not present in old version of table and therefore was added.
Again corresponding storage engine flag should be already set.
*/
DBUG_ASSERT(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN);
- }
- /*
- Check if the altered column is computed and either
- is stored or is used in the partitioning expression.
- TODO: Mark such a column with an alter flag only if
- the defining expression has changed.
- */
- if (vcol_info &&
- (vcol_info->stored_in_db || vcol_info->is_in_partitioning_expr()))
- {
- ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
+ if (new_field->vcol_info &&
+ (new_field->stored_in_db() || new_field->vcol_info->is_in_partitioning_expr()))
+ {
+ ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_VCOL;
+ }
}
}
@@ -6917,7 +6961,7 @@ static bool mysql_inplace_alter_table(THD *thd,
MDL_request *target_mdl_request,
Alter_table_ctx *alter_ctx)
{
- Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN);
+ Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN | MYSQL_OPEN_IGNORE_KILLED);
handlerton *db_type= table->s->db_type();
MDL_ticket *mdl_ticket= table->mdl_ticket;
HA_CREATE_INFO *create_info= ha_alter_info->create_info;
@@ -9143,13 +9187,13 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
error, but still worth reporting as it might indicate serious
problem with server.
*/
- goto err_with_mdl;
+ goto err_with_mdl_after_alter;
}
end_inplace:
if (thd->locked_tables_list.reopen_tables(thd))
- goto err_with_mdl;
+ goto err_with_mdl_after_alter;
THD_STAGE_INFO(thd, stage_end);
@@ -9230,6 +9274,10 @@ err_new_table_cleanup:
DBUG_RETURN(true);
+err_with_mdl_after_alter:
+ /* the table was altered. binlog the operation */
+ write_bin_log(thd, true, thd->query(), thd->query_length());
+
err_with_mdl:
/*
An error happened while we were holding exclusive name metadata lock
diff --git a/sql/sql_time.h b/sql/sql_time.h
index 5a985710ee1..e0cab5cfa66 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2016, MariaDB
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/sql/sql_type.cc b/sql/sql_type.cc
index 4e492e7099d..d85664568a1 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -433,10 +433,8 @@ Field *Type_handler_timestamp::make_conversion_table_field(TABLE *table,
const Field *target)
const
{
- // We assume TIMESTAMP(0)
- return new(table->in_use->mem_root)
- Field_timestamp(NULL, MAX_DATETIME_WIDTH, (uchar *) "", 1,
- Field::NONE, TMPNAME, table->s);
+ return new_Field_timestamp(table->in_use->mem_root, NULL, (uchar *) "", 1,
+ Field::NONE, TMPNAME, table->s, target->decimals());
}
@@ -476,9 +474,8 @@ Field *Type_handler_time::make_conversion_table_field(TABLE *table,
const Field *target)
const
{
- return new(table->in_use->mem_root)
- Field_time(NULL, MAX_TIME_WIDTH, (uchar *) "", 1,
- Field::NONE, TMPNAME);
+ return new_Field_time(table->in_use->mem_root, NULL, (uchar *) "", 1,
+ Field::NONE, TMPNAME, target->decimals());
}
@@ -497,9 +494,8 @@ Field *Type_handler_datetime::make_conversion_table_field(TABLE *table,
const Field *target)
const
{
- return new(table->in_use->mem_root)
- Field_datetime(NULL, MAX_DATETIME_WIDTH, (uchar *) "", 1,
- Field::NONE, TMPNAME);
+ return new_Field_datetime(table->in_use->mem_root, NULL, (uchar *) "", 1,
+ Field::NONE, TMPNAME, target->decimals());
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index f343a17ee11..55e5cf2c526 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -368,6 +368,9 @@ int mysql_update(THD *thd,
if (check_unique_table(thd, table_list))
DBUG_RETURN(TRUE);
+ switch_to_nullable_trigger_fields(fields, table);
+ switch_to_nullable_trigger_fields(values, table);
+
/* Apply the IN=>EXISTS transformation to all subqueries and optimize them. */
if (select_lex->optimize_unflattened_subqueries(false))
DBUG_RETURN(TRUE);
@@ -455,8 +458,6 @@ int mysql_update(THD *thd,
}
init_ftfuncs(thd, select_lex, 1);
- switch_to_nullable_trigger_fields(fields, table);
- switch_to_nullable_trigger_fields(values, table);
table->mark_columns_needed_for_update();
table->update_const_key_parts(conds);
@@ -2431,6 +2432,10 @@ int multi_update::do_updates()
int error;
if (table->default_field && (error= table->update_default_fields()))
goto err2;
+ if (table->vfield &&
+ update_virtual_fields(thd, table,
+ (table->triggers ? VCOL_UPDATE_ALL : VCOL_UPDATE_FOR_WRITE)))
+ goto err2;
if ((error= cur_table->view_check_option(thd, ignore)) !=
VIEW_CHECK_OK)
{
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 62e6790a142..5e6071b125d 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1535,8 +1535,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
/* Fields in this view can be used in upper select in case of merge. */
if (table->select_lex)
- table->select_lex->select_n_where_fields+=
- lex->select_lex.select_n_where_fields;
+ table->select_lex->add_where_field(&lex->select_lex);
}
/*
This method has a dependency on the proper lock type being set,
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 1899dd60f88..4ef9bf2382d 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -10911,15 +10911,6 @@ table_factor:
sel->add_joined_table($$);
lex->pop_context();
lex->nest_level--;
- /*
- Fields in derived table can be used in upper select in
- case of merge. We do not add HAVING fields because we do
- not merge such derived. We do not add union because
- also do not merge them
- */
- if (!sel->next_select())
- $2->select_n_where_fields+=
- sel->select_n_where_fields;
}
/*else if (($3->select_lex &&
$3->select_lex->master_unit()->is_union() &&
@@ -10940,6 +10931,15 @@ table_factor:
nest_level is the same as in the outer query */
$$= $3;
}
+ /*
+ Fields in derived table can be used in upper select in
+ case of merge. We do not add HAVING fields because we do
+ not merge such derived. We do not add union because
+ also do not merge them
+ */
+ if ($$ && $$->derived &&
+ !$$->derived->first_select()->next_select())
+ $$->select_lex->add_where_field($$->derived->first_select());
}
;
@@ -12806,9 +12806,10 @@ show_param:
| IDENT_sys remember_tok_start wild_and_where
{
LEX *lex= Lex;
+ bool in_plugin;
lex->sql_command= SQLCOM_SHOW_GENERIC;
- ST_SCHEMA_TABLE *table= find_schema_table(thd, $1.str);
- if (!table || !table->old_format)
+ ST_SCHEMA_TABLE *table= find_schema_table(thd, $1.str, &in_plugin);
+ if (!table || !table->old_format || !in_plugin)
{
my_parse_error(thd, ER_SYNTAX_ERROR, $2);
MYSQL_YYABORT;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 1284cbb66cb..9ba955c5bc6 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -5059,7 +5059,7 @@ static Sys_var_set Sys_log_slow_filter(
"Log only certain types of queries",
SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
log_slow_filter_names,
- DEFAULT(MAX_SET(array_elements(log_slow_filter_names)-1)));
+ DEFAULT(my_set_bits(array_elements(log_slow_filter_names)-1)));
static const char *default_regex_flags_names[]=
{
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index 2badd5d997a..373f5834838 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -1094,9 +1094,6 @@ public:
}
};
-// overflow-safe (1 << X)-1
-#define MAX_SET(X) ((((1UL << ((X)-1))-1) << 1) | 1)
-
/**
The class for flagset variables - a variant of SET that allows in-place
editing (turning on/off individual bits). String representations looks like
@@ -1131,7 +1128,7 @@ public:
global_var(ulonglong)= def_val;
SYSVAR_ASSERT(typelib.count > 1);
SYSVAR_ASSERT(typelib.count <= 65);
- SYSVAR_ASSERT(def_val < MAX_SET(typelib.count));
+ SYSVAR_ASSERT(def_val < my_set_bits(typelib.count));
SYSVAR_ASSERT(strcmp(values[typelib.count-1], "default") == 0);
SYSVAR_ASSERT(size == sizeof(ulonglong));
}
@@ -1179,7 +1176,7 @@ public:
{
longlong tmp=var->value->val_int();
if ((tmp < 0 && ! var->value->unsigned_flag)
- || (ulonglong)tmp > MAX_SET(typelib.count))
+ || (ulonglong)tmp > my_set_bits(typelib.count))
return true;
else
var->save_result.ulonglong_value= tmp;
@@ -1240,7 +1237,7 @@ public:
global_var(ulonglong)= def_val;
SYSVAR_ASSERT(typelib.count > 0);
SYSVAR_ASSERT(typelib.count <= 64);
- SYSVAR_ASSERT(def_val <= MAX_SET(typelib.count));
+ SYSVAR_ASSERT(def_val <= my_set_bits(typelib.count));
SYSVAR_ASSERT(size == sizeof(ulonglong));
}
bool do_check(THD *thd, set_var *var)
@@ -1278,7 +1275,7 @@ public:
{
longlong tmp=var->value->val_int();
if ((tmp < 0 && ! var->value->unsigned_flag)
- || (ulonglong)tmp > MAX_SET(typelib.count))
+ || (ulonglong)tmp > my_set_bits(typelib.count))
return true;
else
var->save_result.ulonglong_value= tmp;
diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc
index e098fc95897..cf1feb49f41 100644
--- a/sql/wsrep_applier.cc
+++ b/sql/wsrep_applier.cc
@@ -19,6 +19,7 @@
#include "log_event.h" // class THD, EVENT_LEN_OFFSET, etc.
#include "wsrep_applier.h"
+#include "debug_sync.h"
/*
read the first event from (*buf). The size of the (*buf) is (*buf_len).
@@ -220,6 +221,16 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx,
{
THD* const thd((THD*)ctx);
+ // Allow tests to block the applier thread using the DBUG facilities.
+ DBUG_EXECUTE_IF("sync.wsrep_apply_cb",
+ {
+ const char act[]=
+ "now "
+ "wait_for signal.wsrep_apply_cb";
+ DBUG_ASSERT(!debug_sync_set_action(thd,
+ STRING_WITH_LEN(act)));
+ };);
+
thd->wsrep_trx_meta = *meta;
#ifdef WSREP_PROC_INFO
@@ -279,8 +290,7 @@ wsrep_cb_status_t wsrep_apply_cb(void* const ctx,
return rcode;
}
-static wsrep_cb_status_t wsrep_commit(THD* const thd,
- wsrep_seqno_t const global_seqno)
+static wsrep_cb_status_t wsrep_commit(THD* const thd)
{
#ifdef WSREP_PROC_INFO
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
@@ -299,7 +309,11 @@ static wsrep_cb_status_t wsrep_commit(THD* const thd,
#ifdef GTID_SUPPORT
thd->variables.gtid_next.set_automatic();
#endif /* GTID_SUPPORT */
- // TODO: mark snapshot with global_seqno.
+ if (thd->wsrep_apply_toi)
+ {
+ wsrep_set_SE_checkpoint(thd->wsrep_trx_meta.gtid.uuid,
+ thd->wsrep_trx_meta.gtid.seqno);
+ }
}
#ifdef WSREP_PROC_INFO
@@ -313,8 +327,7 @@ static wsrep_cb_status_t wsrep_commit(THD* const thd,
return rcode;
}
-static wsrep_cb_status_t wsrep_rollback(THD* const thd,
- wsrep_seqno_t const global_seqno)
+static wsrep_cb_status_t wsrep_rollback(THD* const thd)
{
#ifdef WSREP_PROC_INFO
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
@@ -351,9 +364,9 @@ wsrep_cb_status_t wsrep_commit_cb(void* const ctx,
wsrep_cb_status_t rcode;
if (commit)
- rcode = wsrep_commit(thd, meta->gtid.seqno);
+ rcode = wsrep_commit(thd);
else
- rcode = wsrep_rollback(thd, meta->gtid.seqno);
+ rcode = wsrep_rollback(thd);
wsrep_set_apply_format(thd, NULL);
thd->mdl_context.release_transactional_locks();
diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc
index 603cd8ec5ea..0aa7f9b0aad 100644
--- a/sql/wsrep_dummy.cc
+++ b/sql/wsrep_dummy.cc
@@ -116,7 +116,7 @@ int wsrep_thd_retry_counter(THD *)
void wsrep_thd_set_conflict_state(THD *, enum wsrep_conflict_state)
{ }
-bool wsrep_thd_skip_append_keys(THD *)
+bool wsrep_thd_ignore_table(THD *)
{ return 0; }
longlong wsrep_thd_trx_seqno(THD *)
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 5e3f7402aa4..fa34a5bbc55 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -22,6 +22,7 @@
#include "wsrep_xid.h"
#include <cstdio>
#include <cstdlib>
+#include "debug_sync.h"
extern ulonglong thd_to_trx_id(THD *thd);
@@ -67,6 +68,17 @@ void wsrep_register_hton(THD* thd, bool all)
if (WSREP(thd) && thd->wsrep_exec_mode != TOTAL_ORDER &&
!thd->wsrep_apply_toi)
{
+ if (thd->wsrep_exec_mode == LOCAL_STATE &&
+ (thd_sql_command(thd) == SQLCOM_OPTIMIZE ||
+ thd_sql_command(thd) == SQLCOM_ANALYZE ||
+ thd_sql_command(thd) == SQLCOM_REPAIR) &&
+ thd->lex->no_write_to_binlog == 1)
+ {
+ WSREP_DEBUG("Skipping wsrep_register_hton for LOCAL sql admin command : %s",
+ thd->query());
+ return;
+ }
+
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt;
for (Ha_trx_info *i= trans->ha_list; i; i = i->next())
{
@@ -317,6 +329,8 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
}
+ DEBUG_SYNC(thd, "wsrep_before_replication");
+
if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK);
if (thd->wsrep_exec_mode == REPL_RECV) {
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 0ba02214b8b..f84ebe4dbb9 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -940,19 +940,24 @@ bool wsrep_start_replication()
return true;
}
+bool wsrep_must_sync_wait (THD* thd, uint mask)
+{
+ return (thd->variables.wsrep_sync_wait & mask) &&
+ thd->variables.wsrep_on &&
+ !thd->in_active_multi_stmt_transaction() &&
+ thd->wsrep_conflict_state != REPLAYING &&
+ thd->wsrep_sync_wait_gtid.seqno == WSREP_SEQNO_UNDEFINED;
+}
+
bool wsrep_sync_wait (THD* thd, uint mask)
{
- if ((thd->variables.wsrep_sync_wait & mask) &&
- thd->variables.wsrep_on &&
- !thd->in_active_multi_stmt_transaction() &&
- thd->wsrep_conflict_state != REPLAYING)
+ if (wsrep_must_sync_wait(thd, mask))
{
WSREP_DEBUG("wsrep_sync_wait: thd->variables.wsrep_sync_wait = %u, mask = %u",
thd->variables.wsrep_sync_wait, mask);
// This allows autocommit SELECTs and a first SELECT after SET AUTOCOMMIT=0
// TODO: modify to check if thd has locked any rows.
- wsrep_gtid_t gtid;
- wsrep_status_t ret= wsrep->causal_read (wsrep, &gtid);
+ wsrep_status_t ret= wsrep->causal_read (wsrep, &thd->wsrep_sync_wait_gtid);
if (unlikely(WSREP_OK != ret))
{
@@ -1460,16 +1465,19 @@ static int wsrep_RSU_begin(THD *thd, char *db_, char *table_)
WSREP_DEBUG("RSU BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd),
thd->wsrep_exec_mode, thd->query() );
- ret = wsrep->desync(wsrep);
- if (ret != WSREP_OK)
+ if (!wsrep_desync)
{
- WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
- ret,
- (thd->db ? thd->db : "(null)"),
- thd->query());
- my_error(ER_LOCK_DEADLOCK, MYF(0));
- return(ret);
+ ret = wsrep->desync(wsrep);
+ if (ret != WSREP_OK)
+ {
+ WSREP_WARN("RSU desync failed %d for schema: %s, query: %s",
+ ret, (thd->db ? thd->db : "(null)"), thd->query());
+ my_error(ER_LOCK_DEADLOCK, MYF(0));
+ return(ret);
+ }
}
+ else
+ WSREP_DEBUG("RSU desync skipped: %d", wsrep_desync);
mysql_mutex_lock(&LOCK_wsrep_replaying);
wsrep_replaying++;
mysql_mutex_unlock(&LOCK_wsrep_replaying);
@@ -1484,13 +1492,14 @@ static int wsrep_RSU_begin(THD *thd, char *db_, char *table_)
wsrep_replaying--;
mysql_mutex_unlock(&LOCK_wsrep_replaying);
- ret = wsrep->resync(wsrep);
- if (ret != WSREP_OK)
+ if (!wsrep_desync)
{
- WSREP_WARN("resync failed %d for schema: %s, query: %s",
- ret,
- (thd->db ? thd->db : "(null)"),
- thd->query());
+ ret = wsrep->resync(wsrep);
+ if (ret != WSREP_OK)
+ {
+ WSREP_WARN("resync failed %d for schema: %s, query: %s",
+ ret, (thd->db ? thd->db : "(null)"), thd->query());
+ }
}
my_error(ER_LOCK_DEADLOCK, MYF(0));
return(1);
@@ -1527,14 +1536,18 @@ static void wsrep_RSU_end(THD *thd)
(thd->db ? thd->db : "(null)"),
thd->query());
}
- ret = wsrep->resync(wsrep);
- if (ret != WSREP_OK)
+ if (!wsrep_desync)
{
- WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
- (thd->db ? thd->db : "(null)"),
- thd->query());
- return;
+ ret = wsrep->resync(wsrep);
+ if (ret != WSREP_OK)
+ {
+ WSREP_WARN("resync failed %d for schema: %s, query: %s", ret,
+ (thd->db ? thd->db : "(null)"), thd->query());
+ return;
+ }
}
+ else
+ WSREP_DEBUG("RSU resync skipped: %d", wsrep_desync);
thd->variables.wsrep_on = 1;
}
@@ -2183,9 +2196,9 @@ int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len)
&(thd->lex->definer->host),
saved_mode))
{
- WSREP_WARN("SP create string failed: schema: %s, query: %s",
- (thd->db ? thd->db : "(null)"), thd->query());
- return 1;
+ WSREP_WARN("SP create string failed: schema: %s, query: %s",
+ (thd->db ? thd->db : "(null)"), thd->query());
+ return 1;
}
return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len);
@@ -2366,9 +2379,9 @@ int wsrep_thd_retry_counter(THD *thd)
}
-extern "C" bool wsrep_thd_skip_append_keys(THD *thd)
+extern "C" bool wsrep_thd_ignore_table(THD *thd)
{
- return thd->wsrep_skip_append_keys;
+ return thd->wsrep_ignore_table;
}
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index a22eb1a0b64..e91ed2302a2 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -160,6 +160,7 @@ extern void wsrep_kill_mysql(THD *thd);
/* new defines */
extern void wsrep_stop_replication(THD *thd);
extern bool wsrep_start_replication();
+extern bool wsrep_must_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
extern bool wsrep_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
extern int wsrep_check_opts();
extern void wsrep_prepend_PATH (const char* path);
@@ -327,6 +328,7 @@ int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len);
#define wsrep_prepend_PATH(X)
#define wsrep_before_SE() (0)
#define wsrep_init_startup(X)
+#define wsrep_must_sync_wait(...) (0)
#define wsrep_sync_wait(...) (0)
#define wsrep_to_isolation_begin(...) (0)
#define wsrep_register_hton(...) do { } while(0)
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 04926228aa4..03364ccd01e 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) Olivier Bertrand 2004 - 2015
+/* Copyright (C) Olivier Bertrand 2004 - 2016
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
@@ -169,7 +169,7 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
- char version[]= "Version 1.04.0005 December 11, 2015";
+ char version[]= "Version 1.04.0005 January 24, 2016";
#if defined(__WIN__)
char compver[]= "Version 1.04.0005 " __DATE__ " " __TIME__;
char slash= '\\';
@@ -340,14 +340,21 @@ static MYSQL_THDVAR_ENUM(
#endif // XMSG || NEWMSG
/***********************************************************************/
+/* The CONNECT handlerton object. */
+/***********************************************************************/
+handlerton *connect_hton= NULL;
+
+/***********************************************************************/
/* Function to export session variable values to other source files. */
/***********************************************************************/
-extern "C" int GetTraceValue(void) {return THDVAR(current_thd, xtrace);}
+extern "C" int GetTraceValue(void)
+ {return connect_hton ? THDVAR(current_thd, xtrace) : 0;}
bool ExactInfo(void) {return THDVAR(current_thd, exact_info);}
USETEMP UseTemp(void) {return (USETEMP)THDVAR(current_thd, use_tempfile);}
int GetConvSize(void) {return THDVAR(current_thd, conv_size);}
TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);}
-uint GetJsonGrpSize(void) {return THDVAR(current_thd, json_grp_size);}
+uint GetJsonGrpSize(void)
+ {return connect_hton ? THDVAR(current_thd, json_grp_size) : 10;}
uint GetWorkSize(void) {return THDVAR(current_thd, work_size);}
void SetWorkSize(uint)
{
@@ -442,11 +449,6 @@ static int check_msg_path (MYSQL_THD thd, struct st_mysql_sys_var *var,
} // end of check_msg_path
#endif // 0
-/***********************************************************************/
-/* The CONNECT handlerton object. */
-/***********************************************************************/
-handlerton *connect_hton;
-
/**
CREATE TABLE option list (table options)
@@ -687,6 +689,7 @@ static int connect_done_func(void *)
delete pc;
} // endfor pc
+ connect_hton= NULL;
DBUG_RETURN(error);
} // end of connect_done_func
@@ -4922,11 +4925,11 @@ static bool add_field(String *sql, const char *field_name, int typ, int len,
error|= sql->append("` ");
error|= sql->append(type);
- if (len && typ != TYPE_DATE) {
+ if (len && typ != TYPE_DATE && (typ != TYPE_DOUBLE || dec >= 0)) {
error|= sql->append('(');
error|= sql->append_ulonglong(len);
- if (!strcmp(type, "DOUBLE")) {
+ if (typ == TYPE_DOUBLE) {
error|= sql->append(',');
// dec must be < len and < 31
error|= sql->append_ulonglong(MY_MIN(dec, (MY_MIN(len, 31) - 1)));
@@ -5512,6 +5515,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
dec= crp->Prec;
flg= crp->Flag;
v= crp->Var;
+ tm= (crp->Kdata->IsNullable()) ? 0 : NOT_NULL_FLAG;
if (!len && typ == TYPE_STRING)
len= 256; // STRBLK's have 0 length
@@ -5519,9 +5523,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
// Now add the field
#if defined(NEW_WAY)
rc= add_fields(g, thd, &alter_info, cnm, typ, len, dec,
- NOT_NULL_FLAG, "", flg, dbf, v);
+ tm, "", flg, dbf, v);
#else // !NEW_WAY
- if (add_field(&sql, cnm, typ, len, dec, NULL, NOT_NULL_FLAG,
+ if (add_field(&sql, cnm, typ, len, dec, NULL, tm,
NULL, NULL, NULL, NULL, flg, dbf, v))
rc= HA_ERR_OUT_OF_MEM;
#endif // !NEW_WAY
@@ -5578,7 +5582,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
len= crp->Kdata->GetIntValue(i);
break;
case FLD_SCALE:
- dec= crp->Kdata->GetIntValue(i);
+ dec = (!crp->Kdata->IsNull(i)) ? crp->Kdata->GetIntValue(i) : -1;
break;
case FLD_NULL:
if (crp->Kdata->GetIntValue(i))
@@ -5671,14 +5675,14 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
dec= 0;
} // endswitch typ
- } // endif ttp
+ } else
#endif // ODBC_SUPPORT
-
// Make the arguments as required by add_fields
- if (typ == TYPE_DATE)
+ if (typ == TYPE_DOUBLE)
+ prec= len;
+
+ if (typ == TYPE_DATE)
prec= 0;
- else if (typ == TYPE_DOUBLE)
- prec= len;
// Now add the field
#if defined(NEW_WAY)
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index 215562af46e..25c77cea534 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -31,6 +31,8 @@ uint GetJsonGrpSize(void);
static int IsJson(UDF_ARGS *args, uint i);
static PSZ MakePSZ(PGLOBAL g, UDF_ARGS *args, int i);
+static uint JsonGrpSize = 10;
+
/* ----------------------------------- JSNX ------------------------------------ */
/*********************************************************************************/
@@ -1040,6 +1042,14 @@ static void SetChanged(PBSON bsp)
} /* end of SetChanged */
/*********************************************************************************/
+/* Replaces GetJsonGrpSize not usable when CONNECT is not installed. */
+/*********************************************************************************/
+static uint GetJsonGroupSize(void)
+{
+ return (JsonGrpSize) ? JsonGrpSize : GetJsonGrpSize();
+} // end of GetJsonGroupSize
+
+/*********************************************************************************/
/* Program for SubSet re-initialization of the memory pool. */
/*********************************************************************************/
static my_bool JsonSubSet(PGLOBAL g)
@@ -2394,11 +2404,50 @@ void json_object_list_deinit(UDF_INIT* initid)
} // end of json_object_list_deinit
/*********************************************************************************/
+/* Set the value of JsonGrpSize. */
+/*********************************************************************************/
+my_bool jsonset_grp_size_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+{
+ if (args->arg_count != 1 || args->arg_type[0] != INT_RESULT) {
+ strcpy(message, "This function must have 1 integer argument");
+ return true;
+ } else
+ return false;
+
+} // end of jsonset_grp_size_init
+
+long long jsonset_grp_size(UDF_INIT *initid, UDF_ARGS *args, char *, char *)
+{
+ long long n = *(long long*)args->args[0];
+
+ JsonGrpSize = (uint)n;
+ return (long long)GetJsonGroupSize();
+} // end of jsonset_grp_size
+
+/*********************************************************************************/
+/* Get the value of JsonGrpSize. */
+/*********************************************************************************/
+my_bool jsonget_grp_size_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+{
+ if (args->arg_count != 0) {
+ strcpy(message, "This function must have no arguments");
+ return true;
+ } else
+ return false;
+
+} // end of jsonget_grp_size_init
+
+long long jsonget_grp_size(UDF_INIT *initid, UDF_ARGS *args, char *, char *)
+{
+ return (long long)GetJsonGroupSize();
+} // end of jsonget_grp_size
+
+/*********************************************************************************/
/* Make a Json array from values coming from rows. */
/*********************************************************************************/
my_bool json_array_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
- unsigned long reslen, memlen, n = GetJsonGrpSize();
+ unsigned long reslen, memlen, n = GetJsonGroupSize();
if (args->arg_count != 1) {
strcpy(message, "This function can only accept 1 argument");
@@ -2458,7 +2507,7 @@ void json_array_grp_clear(UDF_INIT *initid, char*, char*)
PlugSubSet(g, g->Sarea, g->Sarea_Size);
g->Activityp = (PACTIVITY)new(g) JARRAY;
- g->N = GetJsonGrpSize();
+ g->N = GetJsonGroupSize();
} // end of json_array_grp_clear
void json_array_grp_deinit(UDF_INIT* initid)
@@ -2471,7 +2520,7 @@ void json_array_grp_deinit(UDF_INIT* initid)
/*********************************************************************************/
my_bool json_object_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
- unsigned long reslen, memlen, n = GetJsonGrpSize();
+ unsigned long reslen, memlen, n = GetJsonGroupSize();
if (args->arg_count != 2) {
strcpy(message, "This function requires 2 arguments (key, value)");
@@ -2529,7 +2578,7 @@ void json_object_grp_clear(UDF_INIT *initid, char*, char*)
PlugSubSet(g, g->Sarea, g->Sarea_Size);
g->Activityp = (PACTIVITY)new(g) JOBJECT;
- g->N = GetJsonGrpSize();
+ g->N = GetJsonGroupSize();
} // end of json_object_grp_clear
void json_object_grp_deinit(UDF_INIT* initid)
diff --git a/storage/connect/jsonudf.h b/storage/connect/jsonudf.h
index ecbbb778214..b7e9b8ecabb 100644
--- a/storage/connect/jsonudf.h
+++ b/storage/connect/jsonudf.h
@@ -77,6 +77,12 @@ extern "C" {
DllExport char *json_object_list(UDF_EXEC_ARGS);
DllExport void json_object_list_deinit(UDF_INIT*);
+ DllExport my_bool jsonset_grp_size_init(UDF_INIT*, UDF_ARGS*, char*);
+ DllExport long long jsonset_grp_size(UDF_INIT*, UDF_ARGS*, char*, char*);
+
+ DllExport my_bool jsonget_grp_size_init(UDF_INIT*, UDF_ARGS*, char*);
+ DllExport long long jsonget_grp_size(UDF_INIT*, UDF_ARGS*, char*, char*);
+
DllExport my_bool json_array_grp_init(UDF_INIT*, UDF_ARGS*, char*);
DllExport void json_array_grp_add(UDF_INIT *, UDF_ARGS *, char *, char *);
DllExport char *json_array_grp(UDF_EXEC_ARGS);
diff --git a/storage/connect/mysql-test/connect/r/json_udf.result b/storage/connect/mysql-test/connect/r/json_udf.result
index 5089022c5ea..1e83834cb8f 100644
--- a/storage/connect/mysql-test/connect/r/json_udf.result
+++ b/storage/connect/mysql-test/connect/r/json_udf.result
@@ -217,7 +217,9 @@ DEPARTMENT Json_Array_Grp(NAME)
2452 ["BIGHEAD","ORELLY","BIGHORN","SMITH","CHERRY"]
Warnings:
Warning 1105 Result truncated to json_grp_size values
-SET connect_json_grp_size=30;
+SELECT JsonSet_Grp_Size(30);
+JsonSet_Grp_Size(30)
+30
SELECT Json_Object(title, Json_Array_Grp(name) `json_names`) from t3 GROUP BY title;
Json_Object(title, Json_Array_Grp(name) `json_names`)
{"title":"ADMINISTRATOR","names":["GOOSEPEN","FUNNIGUY","SHRINKY"]}
diff --git a/storage/connect/mysql-test/connect/r/odbc.result b/storage/connect/mysql-test/connect/r/odbc.result
index 8e1951f0b68..4ca7e2095df 100644
--- a/storage/connect/mysql-test/connect/r/odbc.result
+++ b/storage/connect/mysql-test/connect/r/odbc.result
@@ -5,7 +5,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Name` varchar(256) NOT NULL,
- `Description` varchar(256) NOT NULL
+ `Description` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources'
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Drivers;
@@ -13,35 +13,35 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Description` char(128) NOT NULL,
- `Attributes` varchar(256) NOT NULL
+ `Attributes` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Drivers'
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Tables CONNECTION='Not important';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `Table_Cat` char(128) NOT NULL,
- `Table_Schema` char(128) NOT NULL,
+ `Table_Cat` char(128) DEFAULT NULL,
+ `Table_Schema` char(128) DEFAULT NULL,
`Table_Name` char(128) NOT NULL,
`Table_Type` char(16) NOT NULL,
- `Remark` char(255) NOT NULL
+ `Remark` char(255) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Not important' `TABLE_TYPE`='ODBC' `CATFUNC`='Tables'
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Columns CONNECTION='Not important';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `Table_Cat` char(128) NOT NULL,
- `Table_Schema` char(128) NOT NULL,
+ `Table_Cat` char(128) DEFAULT NULL,
+ `Table_Schema` char(128) DEFAULT NULL,
`Table_Name` char(128) NOT NULL,
`Column_Name` char(128) NOT NULL,
`Data_Type` smallint(6) NOT NULL,
`Type_Name` char(30) NOT NULL,
`Column_Size` int(10) NOT NULL,
`Buffer_Length` int(10) NOT NULL,
- `Decimal_Digits` smallint(6) NOT NULL,
- `Radix` smallint(6) NOT NULL,
+ `Decimal_Digits` smallint(6) DEFAULT NULL,
+ `Radix` smallint(6) DEFAULT NULL,
`Nullable` smallint(6) NOT NULL,
- `Remarks` char(255) NOT NULL
+ `Remarks` char(255) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Not important' `TABLE_TYPE`='ODBC' `CATFUNC`='Columns'
DROP TABLE t1;
diff --git a/storage/connect/mysql-test/connect/r/odbc_oracle.result b/storage/connect/mysql-test/connect/r/odbc_oracle.result
index 96d8e53b8e5..8dc7dc07bb1 100644
--- a/storage/connect/mysql-test/connect/r/odbc_oracle.result
+++ b/storage/connect/mysql-test/connect/r/odbc_oracle.result
@@ -1,7 +1,7 @@
Table Create Table
t1 CREATE TABLE `t1` (
`Name` varchar(256) NOT NULL,
- `Description` varchar(256) NOT NULL
+ `Description` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources'
SET NAMES utf8;
#
@@ -14,9 +14,9 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr'
CATFUNC=Tables;
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- MTR T1 TABLE
- MTR T2 TABLE
- MTR V1 VIEW
+NULL MTR T1 TABLE NULL
+NULL MTR T2 TABLE NULL
+NULL MTR V1 VIEW NULL
DROP TABLE t1;
# All tables in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT
@@ -24,9 +24,9 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr'
CATFUNC=Tables TABNAME='%.%';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- MTR T1 TABLE
- MTR T2 TABLE
- MTR V1 VIEW
+NULL MTR T1 TABLE NULL
+NULL MTR T2 TABLE NULL
+NULL MTR V1 VIEW NULL
DROP TABLE t1;
# All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT
@@ -34,7 +34,7 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr'
CATFUNC=Tables TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- MTR T1 TABLE
+NULL MTR T1 TABLE NULL
DROP TABLE t1;
# All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT
@@ -42,7 +42,7 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr'
CATFUNC=Tables TABNAME='T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- MTR T1 TABLE
+NULL MTR T1 TABLE NULL
DROP TABLE t1;
# Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT
@@ -50,7 +50,7 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr'
CATFUNC=Tables TABNAME='MTR.T1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- MTR T1 TABLE
+NULL MTR T1 TABLE NULL
DROP TABLE t1;
# All tables in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT
@@ -58,9 +58,9 @@ TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr'
CATFUNC=Tables TABNAME='MTR.%';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- MTR T1 TABLE
- MTR T2 TABLE
- MTR V1 VIEW
+NULL MTR T1 TABLE NULL
+NULL MTR T2 TABLE NULL
+NULL MTR V1 VIEW NULL
DROP TABLE t1;
#
# Checking CATFUNC=Columns
@@ -73,10 +73,10 @@ CATFUNC=Columns;
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
MTR T1 A 3 DECIMAL 38 40 0 10 1
- MTR T1 B 6 NUMBER 38 40 0 0 1
- MTR T2 A 12 VARCHAR2 64 64 0 0 1
+ MTR T1 B 6 NUMBER 38 40 NULL NULL 1
+ MTR T2 A 12 VARCHAR2 64 64 NULL NULL 1
MTR V1 A 3 DECIMAL 38 40 0 10 1
- MTR V1 B 6 NUMBER 38 40 0 0 1
+ MTR V1 B 6 NUMBER 38 40 NULL NULL 1
DROP TABLE t1;
# All columns in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT
@@ -85,17 +85,17 @@ CATFUNC=Columns TABNAME='%.%';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
MTR T1 A 3 DECIMAL 38 40 0 10 1
- MTR T1 B 6 NUMBER 38 40 0 0 1
- MTR T2 A 12 VARCHAR2 64 64 0 0 1
+ MTR T1 B 6 NUMBER 38 40 NULL NULL 1
+ MTR T2 A 12 VARCHAR2 64 64 NULL NULL 1
MTR V1 A 3 DECIMAL 38 40 0 10 1
- MTR V1 B 6 NUMBER 38 40 0 0 1
+ MTR V1 B 6 NUMBER 38 40 NULL NULL 1
DROP TABLE t1;
# All tables "T1" in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
MTR T1 A 3 DECIMAL 38 40 0 10 1
- MTR T1 B 6 NUMBER 38 40 0 0 1
+ MTR T1 B 6 NUMBER 38 40 NULL NULL 1
DROP TABLE t1;
# Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT
@@ -104,7 +104,7 @@ CATFUNC=Columns TABNAME='MTR.T1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
MTR T1 A 3 DECIMAL 38 40 0 10 1
- MTR T1 B 6 NUMBER 38 40 0 0 1
+ MTR T1 B 6 NUMBER 38 40 NULL NULL 1
DROP TABLE t1;
# All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT
@@ -113,7 +113,7 @@ CATFUNC=Columns TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
MTR T1 A 3 DECIMAL 38 40 0 10 1
- MTR T1 B 6 NUMBER 38 40 0 0 1
+ MTR T1 B 6 NUMBER 38 40 NULL NULL 1
DROP TABLE t1;
#
# Checking tables
@@ -127,32 +127,32 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`A` decimal(40,0) DEFAULT NULL,
- `B` double(40,0) DEFAULT NULL
+ `B` double DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='T1'
SELECT * FROM t1 ORDER BY A;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`A` decimal(40,0) DEFAULT NULL,
- `B` double(40,0) DEFAULT NULL
+ `B` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
DROP TABLE t2;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
DROP VIEW v1;
DROP TABLE t1;
# Table "T1" in the schema "MTR"
@@ -163,13 +163,13 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`A` decimal(40,0) DEFAULT NULL,
- `B` double(40,0) DEFAULT NULL
+ `B` double DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.T1'
SELECT * FROM t1;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
DROP TABLE t1;
# View "V1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT
@@ -179,32 +179,32 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`A` decimal(40,0) DEFAULT NULL,
- `B` double(40,0) DEFAULT NULL
+ `B` double DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.V1'
SELECT * FROM t1;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`A` decimal(40,0) DEFAULT NULL,
- `B` double(40,0) DEFAULT NULL
+ `B` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
DROP TABLE t2;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
A B
10 1000000000
20 1000000000000
-30 1000000000000000
+30 1e15
DROP VIEW v1;
DROP TABLE t1;
# Table "T2" in the schema "MTR"
diff --git a/storage/connect/mysql-test/connect/r/odbc_postgresql.result b/storage/connect/mysql-test/connect/r/odbc_postgresql.result
index 68ce03cb382..3426d23e29c 100644
--- a/storage/connect/mysql-test/connect/r/odbc_postgresql.result
+++ b/storage/connect/mysql-test/connect/r/odbc_postgresql.result
@@ -1,7 +1,7 @@
Table Create Table
t1 CREATE TABLE `t1` (
`Name` varchar(256) NOT NULL,
- `Description` varchar(256) NOT NULL
+ `Description` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources'
SET NAMES utf8;
#
@@ -99,9 +99,9 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
mtr public t1 a 4 int4 10 4 0 10 0
mtr public t2 a 4 int4 10 4 0 10 0
mtr public v1 a 4 int4 10 4 0 10 1
-mtr schema1 t1 a 1 bpchar 10 60 0 0 0
-mtr schema1 t2 a 1 bpchar 10 60 0 0 0
-mtr schema1 v1 a 1 bpchar 10 60 0 0 1
+mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1
DROP TABLE t1;
# All columns in the schemas "public" and "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.%';
@@ -110,16 +110,16 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
mtr public t1 a 4 int4 10 4 0 10 0
mtr public t2 a 4 int4 10 4 0 10 0
mtr public v1 a 4 int4 10 4 0 10 1
-mtr schema1 t1 a 1 bpchar 10 60 0 0 0
-mtr schema1 t2 a 1 bpchar 10 60 0 0 0
-mtr schema1 v1 a 1 bpchar 10 60 0 0 1
+mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1
DROP TABLE t1;
# All tables "t1" in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr public t1 a 4 int4 10 4 0 10 0
-mtr schema1 t1 a 1 bpchar 10 60 0 0 0
+mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
DROP TABLE t1;
# Table "t1" in the schema "public"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.public.t1';
@@ -131,14 +131,14 @@ DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.schema1.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
-mtr schema1 t1 a 1 bpchar 10 60 0 0 0
+mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
DROP TABLE t1;
# All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='xxx.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr public t1 a 4 int4 10 4 0 10 0
-mtr schema1 t1 a 1 bpchar 10 60 0 0 0
+mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
DROP TABLE t1;
#
# Checking tables
diff --git a/storage/connect/mysql-test/connect/r/odbc_sqlite3.result b/storage/connect/mysql-test/connect/r/odbc_sqlite3.result
index 24de417792d..bce69227073 100644
--- a/storage/connect/mysql-test/connect/r/odbc_sqlite3.result
+++ b/storage/connect/mysql-test/connect/r/odbc_sqlite3.result
@@ -1,7 +1,7 @@
Table Create Table
t1 CREATE TABLE `t1` (
`Description` char(128) NOT NULL,
- `Attributes` varchar(256) NOT NULL
+ `Attributes` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Drivers'
SET NAMES utf8;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=MTR_SUITE_DIR/std_data/test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;;
@@ -44,2420 +44,2420 @@ DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABNAME='t1' TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=MTR_SUITE_DIR/std_data/test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
SELECT * FROM t1;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
- t1 a 12 varchar(64) 64 64 10 0 1
+ t1 a 12 varchar(64) 64 64 10 0 1 NULL
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABNAME='t1' TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=MTR_SUITE_DIR/std_data/test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
SELECT * FROM t1;
Table_Cat Table_Schema Table_Name Table_Type Remark
- t1 TABLE
+NULL NULL t1 TABLE NULL
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=MTR_SUITE_DIR/std_data/test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
SELECT * FROM t1 ORDER BY Table_name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
- t000 a 4 INT 9 10 10 0 1
- t000 b 4 INT 9 10 10 0 1
- t000 c 4 INT 9 10 10 0 1
- t000 d 4 INT 9 10 10 0 1
- t000 e 4 INT 9 10 10 0 1
- t001 a 4 INT 9 10 10 0 1
- t001 b 4 INT 9 10 10 0 1
- t001 c 4 INT 9 10 10 0 1
- t001 d 4 INT 9 10 10 0 1
- t001 e 4 INT 9 10 10 0 1
- t002 a 4 INT 9 10 10 0 1
- t002 b 4 INT 9 10 10 0 1
- t002 c 4 INT 9 10 10 0 1
- t002 d 4 INT 9 10 10 0 1
- t002 e 4 INT 9 10 10 0 1
- t003 a 4 INT 9 10 10 0 1
- t003 b 4 INT 9 10 10 0 1
- t003 c 4 INT 9 10 10 0 1
- t003 d 4 INT 9 10 10 0 1
- t003 e 4 INT 9 10 10 0 1
- t004 a 4 INT 9 10 10 0 1
- t004 b 4 INT 9 10 10 0 1
- t004 c 4 INT 9 10 10 0 1
- t004 d 4 INT 9 10 10 0 1
- t004 e 4 INT 9 10 10 0 1
- t005 a 4 INT 9 10 10 0 1
- t005 b 4 INT 9 10 10 0 1
- t005 c 4 INT 9 10 10 0 1
- t005 d 4 INT 9 10 10 0 1
- t005 e 4 INT 9 10 10 0 1
- t006 a 4 INT 9 10 10 0 1
- t006 b 4 INT 9 10 10 0 1
- t006 c 4 INT 9 10 10 0 1
- t006 d 4 INT 9 10 10 0 1
- t006 e 4 INT 9 10 10 0 1
- t007 a 4 INT 9 10 10 0 1
- t007 b 4 INT 9 10 10 0 1
- t007 c 4 INT 9 10 10 0 1
- t007 d 4 INT 9 10 10 0 1
- t007 e 4 INT 9 10 10 0 1
- t008 a 4 INT 9 10 10 0 1
- t008 b 4 INT 9 10 10 0 1
- t008 c 4 INT 9 10 10 0 1
- t008 d 4 INT 9 10 10 0 1
- t008 e 4 INT 9 10 10 0 1
- t009 a 4 INT 9 10 10 0 1
- t009 b 4 INT 9 10 10 0 1
- t009 c 4 INT 9 10 10 0 1
- t009 d 4 INT 9 10 10 0 1
- t009 e 4 INT 9 10 10 0 1
- t010 a 4 INT 9 10 10 0 1
- t010 b 4 INT 9 10 10 0 1
- t010 c 4 INT 9 10 10 0 1
- t010 d 4 INT 9 10 10 0 1
- t010 e 4 INT 9 10 10 0 1
- t011 a 4 INT 9 10 10 0 1
- t011 b 4 INT 9 10 10 0 1
- t011 c 4 INT 9 10 10 0 1
- t011 d 4 INT 9 10 10 0 1
- t011 e 4 INT 9 10 10 0 1
- t012 a 4 INT 9 10 10 0 1
- t012 b 4 INT 9 10 10 0 1
- t012 c 4 INT 9 10 10 0 1
- t012 d 4 INT 9 10 10 0 1
- t012 e 4 INT 9 10 10 0 1
- t013 a 4 INT 9 10 10 0 1
- t013 b 4 INT 9 10 10 0 1
- t013 c 4 INT 9 10 10 0 1
- t013 d 4 INT 9 10 10 0 1
- t013 e 4 INT 9 10 10 0 1
- t014 a 4 INT 9 10 10 0 1
- t014 b 4 INT 9 10 10 0 1
- t014 c 4 INT 9 10 10 0 1
- t014 d 4 INT 9 10 10 0 1
- t014 e 4 INT 9 10 10 0 1
- t015 a 4 INT 9 10 10 0 1
- t015 b 4 INT 9 10 10 0 1
- t015 c 4 INT 9 10 10 0 1
- t015 d 4 INT 9 10 10 0 1
- t015 e 4 INT 9 10 10 0 1
- t016 a 4 INT 9 10 10 0 1
- t016 b 4 INT 9 10 10 0 1
- t016 c 4 INT 9 10 10 0 1
- t016 d 4 INT 9 10 10 0 1
- t016 e 4 INT 9 10 10 0 1
- t017 a 4 INT 9 10 10 0 1
- t017 b 4 INT 9 10 10 0 1
- t017 c 4 INT 9 10 10 0 1
- t017 d 4 INT 9 10 10 0 1
- t017 e 4 INT 9 10 10 0 1
- t018 a 4 INT 9 10 10 0 1
- t018 b 4 INT 9 10 10 0 1
- t018 c 4 INT 9 10 10 0 1
- t018 d 4 INT 9 10 10 0 1
- t018 e 4 INT 9 10 10 0 1
- t019 a 4 INT 9 10 10 0 1
- t019 b 4 INT 9 10 10 0 1
- t019 c 4 INT 9 10 10 0 1
- t019 d 4 INT 9 10 10 0 1
- t019 e 4 INT 9 10 10 0 1
- t020 a 4 INT 9 10 10 0 1
- t020 b 4 INT 9 10 10 0 1
- t020 c 4 INT 9 10 10 0 1
- t020 d 4 INT 9 10 10 0 1
- t020 e 4 INT 9 10 10 0 1
- t021 a 4 INT 9 10 10 0 1
- t021 b 4 INT 9 10 10 0 1
- t021 c 4 INT 9 10 10 0 1
- t021 d 4 INT 9 10 10 0 1
- t021 e 4 INT 9 10 10 0 1
- t022 a 4 INT 9 10 10 0 1
- t022 b 4 INT 9 10 10 0 1
- t022 c 4 INT 9 10 10 0 1
- t022 d 4 INT 9 10 10 0 1
- t022 e 4 INT 9 10 10 0 1
- t023 a 4 INT 9 10 10 0 1
- t023 b 4 INT 9 10 10 0 1
- t023 c 4 INT 9 10 10 0 1
- t023 d 4 INT 9 10 10 0 1
- t023 e 4 INT 9 10 10 0 1
- t024 a 4 INT 9 10 10 0 1
- t024 b 4 INT 9 10 10 0 1
- t024 c 4 INT 9 10 10 0 1
- t024 d 4 INT 9 10 10 0 1
- t024 e 4 INT 9 10 10 0 1
- t025 a 4 INT 9 10 10 0 1
- t025 b 4 INT 9 10 10 0 1
- t025 c 4 INT 9 10 10 0 1
- t025 d 4 INT 9 10 10 0 1
- t025 e 4 INT 9 10 10 0 1
- t026 a 4 INT 9 10 10 0 1
- t026 b 4 INT 9 10 10 0 1
- t026 c 4 INT 9 10 10 0 1
- t026 d 4 INT 9 10 10 0 1
- t026 e 4 INT 9 10 10 0 1
- t027 a 4 INT 9 10 10 0 1
- t027 b 4 INT 9 10 10 0 1
- t027 c 4 INT 9 10 10 0 1
- t027 d 4 INT 9 10 10 0 1
- t027 e 4 INT 9 10 10 0 1
- t028 a 4 INT 9 10 10 0 1
- t028 b 4 INT 9 10 10 0 1
- t028 c 4 INT 9 10 10 0 1
- t028 d 4 INT 9 10 10 0 1
- t028 e 4 INT 9 10 10 0 1
- t029 a 4 INT 9 10 10 0 1
- t029 b 4 INT 9 10 10 0 1
- t029 c 4 INT 9 10 10 0 1
- t029 d 4 INT 9 10 10 0 1
- t029 e 4 INT 9 10 10 0 1
- t030 a 4 INT 9 10 10 0 1
- t030 b 4 INT 9 10 10 0 1
- t030 c 4 INT 9 10 10 0 1
- t030 d 4 INT 9 10 10 0 1
- t030 e 4 INT 9 10 10 0 1
- t031 a 4 INT 9 10 10 0 1
- t031 b 4 INT 9 10 10 0 1
- t031 c 4 INT 9 10 10 0 1
- t031 d 4 INT 9 10 10 0 1
- t031 e 4 INT 9 10 10 0 1
- t032 a 4 INT 9 10 10 0 1
- t032 b 4 INT 9 10 10 0 1
- t032 c 4 INT 9 10 10 0 1
- t032 d 4 INT 9 10 10 0 1
- t032 e 4 INT 9 10 10 0 1
- t033 a 4 INT 9 10 10 0 1
- t033 b 4 INT 9 10 10 0 1
- t033 c 4 INT 9 10 10 0 1
- t033 d 4 INT 9 10 10 0 1
- t033 e 4 INT 9 10 10 0 1
- t034 a 4 INT 9 10 10 0 1
- t034 b 4 INT 9 10 10 0 1
- t034 c 4 INT 9 10 10 0 1
- t034 d 4 INT 9 10 10 0 1
- t034 e 4 INT 9 10 10 0 1
- t035 a 4 INT 9 10 10 0 1
- t035 b 4 INT 9 10 10 0 1
- t035 c 4 INT 9 10 10 0 1
- t035 d 4 INT 9 10 10 0 1
- t035 e 4 INT 9 10 10 0 1
- t036 a 4 INT 9 10 10 0 1
- t036 b 4 INT 9 10 10 0 1
- t036 c 4 INT 9 10 10 0 1
- t036 d 4 INT 9 10 10 0 1
- t036 e 4 INT 9 10 10 0 1
- t037 a 4 INT 9 10 10 0 1
- t037 b 4 INT 9 10 10 0 1
- t037 c 4 INT 9 10 10 0 1
- t037 d 4 INT 9 10 10 0 1
- t037 e 4 INT 9 10 10 0 1
- t038 a 4 INT 9 10 10 0 1
- t038 b 4 INT 9 10 10 0 1
- t038 c 4 INT 9 10 10 0 1
- t038 d 4 INT 9 10 10 0 1
- t038 e 4 INT 9 10 10 0 1
- t039 a 4 INT 9 10 10 0 1
- t039 b 4 INT 9 10 10 0 1
- t039 c 4 INT 9 10 10 0 1
- t039 d 4 INT 9 10 10 0 1
- t039 e 4 INT 9 10 10 0 1
- t040 a 4 INT 9 10 10 0 1
- t040 b 4 INT 9 10 10 0 1
- t040 c 4 INT 9 10 10 0 1
- t040 d 4 INT 9 10 10 0 1
- t040 e 4 INT 9 10 10 0 1
- t041 a 4 INT 9 10 10 0 1
- t041 b 4 INT 9 10 10 0 1
- t041 c 4 INT 9 10 10 0 1
- t041 d 4 INT 9 10 10 0 1
- t041 e 4 INT 9 10 10 0 1
- t042 a 4 INT 9 10 10 0 1
- t042 b 4 INT 9 10 10 0 1
- t042 c 4 INT 9 10 10 0 1
- t042 d 4 INT 9 10 10 0 1
- t042 e 4 INT 9 10 10 0 1
- t043 a 4 INT 9 10 10 0 1
- t043 b 4 INT 9 10 10 0 1
- t043 c 4 INT 9 10 10 0 1
- t043 d 4 INT 9 10 10 0 1
- t043 e 4 INT 9 10 10 0 1
- t044 a 4 INT 9 10 10 0 1
- t044 b 4 INT 9 10 10 0 1
- t044 c 4 INT 9 10 10 0 1
- t044 d 4 INT 9 10 10 0 1
- t044 e 4 INT 9 10 10 0 1
- t045 a 4 INT 9 10 10 0 1
- t045 b 4 INT 9 10 10 0 1
- t045 c 4 INT 9 10 10 0 1
- t045 d 4 INT 9 10 10 0 1
- t045 e 4 INT 9 10 10 0 1
- t046 a 4 INT 9 10 10 0 1
- t046 b 4 INT 9 10 10 0 1
- t046 c 4 INT 9 10 10 0 1
- t046 d 4 INT 9 10 10 0 1
- t046 e 4 INT 9 10 10 0 1
- t047 a 4 INT 9 10 10 0 1
- t047 b 4 INT 9 10 10 0 1
- t047 c 4 INT 9 10 10 0 1
- t047 d 4 INT 9 10 10 0 1
- t047 e 4 INT 9 10 10 0 1
- t048 a 4 INT 9 10 10 0 1
- t048 b 4 INT 9 10 10 0 1
- t048 c 4 INT 9 10 10 0 1
- t048 d 4 INT 9 10 10 0 1
- t048 e 4 INT 9 10 10 0 1
- t049 a 4 INT 9 10 10 0 1
- t049 b 4 INT 9 10 10 0 1
- t049 c 4 INT 9 10 10 0 1
- t049 d 4 INT 9 10 10 0 1
- t049 e 4 INT 9 10 10 0 1
- t050 a 4 INT 9 10 10 0 1
- t050 b 4 INT 9 10 10 0 1
- t050 c 4 INT 9 10 10 0 1
- t050 d 4 INT 9 10 10 0 1
- t050 e 4 INT 9 10 10 0 1
- t051 a 4 INT 9 10 10 0 1
- t051 b 4 INT 9 10 10 0 1
- t051 c 4 INT 9 10 10 0 1
- t051 d 4 INT 9 10 10 0 1
- t051 e 4 INT 9 10 10 0 1
- t052 a 4 INT 9 10 10 0 1
- t052 b 4 INT 9 10 10 0 1
- t052 c 4 INT 9 10 10 0 1
- t052 d 4 INT 9 10 10 0 1
- t052 e 4 INT 9 10 10 0 1
- t053 a 4 INT 9 10 10 0 1
- t053 b 4 INT 9 10 10 0 1
- t053 c 4 INT 9 10 10 0 1
- t053 d 4 INT 9 10 10 0 1
- t053 e 4 INT 9 10 10 0 1
- t054 a 4 INT 9 10 10 0 1
- t054 b 4 INT 9 10 10 0 1
- t054 c 4 INT 9 10 10 0 1
- t054 d 4 INT 9 10 10 0 1
- t054 e 4 INT 9 10 10 0 1
- t055 a 4 INT 9 10 10 0 1
- t055 b 4 INT 9 10 10 0 1
- t055 c 4 INT 9 10 10 0 1
- t055 d 4 INT 9 10 10 0 1
- t055 e 4 INT 9 10 10 0 1
- t056 a 4 INT 9 10 10 0 1
- t056 b 4 INT 9 10 10 0 1
- t056 c 4 INT 9 10 10 0 1
- t056 d 4 INT 9 10 10 0 1
- t056 e 4 INT 9 10 10 0 1
- t057 a 4 INT 9 10 10 0 1
- t057 b 4 INT 9 10 10 0 1
- t057 c 4 INT 9 10 10 0 1
- t057 d 4 INT 9 10 10 0 1
- t057 e 4 INT 9 10 10 0 1
- t058 a 4 INT 9 10 10 0 1
- t058 b 4 INT 9 10 10 0 1
- t058 c 4 INT 9 10 10 0 1
- t058 d 4 INT 9 10 10 0 1
- t058 e 4 INT 9 10 10 0 1
- t059 a 4 INT 9 10 10 0 1
- t059 b 4 INT 9 10 10 0 1
- t059 c 4 INT 9 10 10 0 1
- t059 d 4 INT 9 10 10 0 1
- t059 e 4 INT 9 10 10 0 1
- t060 a 4 INT 9 10 10 0 1
- t060 b 4 INT 9 10 10 0 1
- t060 c 4 INT 9 10 10 0 1
- t060 d 4 INT 9 10 10 0 1
- t060 e 4 INT 9 10 10 0 1
- t061 a 4 INT 9 10 10 0 1
- t061 b 4 INT 9 10 10 0 1
- t061 c 4 INT 9 10 10 0 1
- t061 d 4 INT 9 10 10 0 1
- t061 e 4 INT 9 10 10 0 1
- t062 a 4 INT 9 10 10 0 1
- t062 b 4 INT 9 10 10 0 1
- t062 c 4 INT 9 10 10 0 1
- t062 d 4 INT 9 10 10 0 1
- t062 e 4 INT 9 10 10 0 1
- t063 a 4 INT 9 10 10 0 1
- t063 b 4 INT 9 10 10 0 1
- t063 c 4 INT 9 10 10 0 1
- t063 d 4 INT 9 10 10 0 1
- t063 e 4 INT 9 10 10 0 1
- t064 a 4 INT 9 10 10 0 1
- t064 b 4 INT 9 10 10 0 1
- t064 c 4 INT 9 10 10 0 1
- t064 d 4 INT 9 10 10 0 1
- t064 e 4 INT 9 10 10 0 1
- t065 a 4 INT 9 10 10 0 1
- t065 b 4 INT 9 10 10 0 1
- t065 c 4 INT 9 10 10 0 1
- t065 d 4 INT 9 10 10 0 1
- t065 e 4 INT 9 10 10 0 1
- t066 a 4 INT 9 10 10 0 1
- t066 b 4 INT 9 10 10 0 1
- t066 c 4 INT 9 10 10 0 1
- t066 d 4 INT 9 10 10 0 1
- t066 e 4 INT 9 10 10 0 1
- t067 a 4 INT 9 10 10 0 1
- t067 b 4 INT 9 10 10 0 1
- t067 c 4 INT 9 10 10 0 1
- t067 d 4 INT 9 10 10 0 1
- t067 e 4 INT 9 10 10 0 1
- t068 a 4 INT 9 10 10 0 1
- t068 b 4 INT 9 10 10 0 1
- t068 c 4 INT 9 10 10 0 1
- t068 d 4 INT 9 10 10 0 1
- t068 e 4 INT 9 10 10 0 1
- t069 a 4 INT 9 10 10 0 1
- t069 b 4 INT 9 10 10 0 1
- t069 c 4 INT 9 10 10 0 1
- t069 d 4 INT 9 10 10 0 1
- t069 e 4 INT 9 10 10 0 1
- t070 a 4 INT 9 10 10 0 1
- t070 b 4 INT 9 10 10 0 1
- t070 c 4 INT 9 10 10 0 1
- t070 d 4 INT 9 10 10 0 1
- t070 e 4 INT 9 10 10 0 1
- t071 a 4 INT 9 10 10 0 1
- t071 b 4 INT 9 10 10 0 1
- t071 c 4 INT 9 10 10 0 1
- t071 d 4 INT 9 10 10 0 1
- t071 e 4 INT 9 10 10 0 1
- t072 a 4 INT 9 10 10 0 1
- t072 b 4 INT 9 10 10 0 1
- t072 c 4 INT 9 10 10 0 1
- t072 d 4 INT 9 10 10 0 1
- t072 e 4 INT 9 10 10 0 1
- t073 a 4 INT 9 10 10 0 1
- t073 b 4 INT 9 10 10 0 1
- t073 c 4 INT 9 10 10 0 1
- t073 d 4 INT 9 10 10 0 1
- t073 e 4 INT 9 10 10 0 1
- t074 a 4 INT 9 10 10 0 1
- t074 b 4 INT 9 10 10 0 1
- t074 c 4 INT 9 10 10 0 1
- t074 d 4 INT 9 10 10 0 1
- t074 e 4 INT 9 10 10 0 1
- t075 a 4 INT 9 10 10 0 1
- t075 b 4 INT 9 10 10 0 1
- t075 c 4 INT 9 10 10 0 1
- t075 d 4 INT 9 10 10 0 1
- t075 e 4 INT 9 10 10 0 1
- t076 a 4 INT 9 10 10 0 1
- t076 b 4 INT 9 10 10 0 1
- t076 c 4 INT 9 10 10 0 1
- t076 d 4 INT 9 10 10 0 1
- t076 e 4 INT 9 10 10 0 1
- t077 a 4 INT 9 10 10 0 1
- t077 b 4 INT 9 10 10 0 1
- t077 c 4 INT 9 10 10 0 1
- t077 d 4 INT 9 10 10 0 1
- t077 e 4 INT 9 10 10 0 1
- t078 a 4 INT 9 10 10 0 1
- t078 b 4 INT 9 10 10 0 1
- t078 c 4 INT 9 10 10 0 1
- t078 d 4 INT 9 10 10 0 1
- t078 e 4 INT 9 10 10 0 1
- t079 a 4 INT 9 10 10 0 1
- t079 b 4 INT 9 10 10 0 1
- t079 c 4 INT 9 10 10 0 1
- t079 d 4 INT 9 10 10 0 1
- t079 e 4 INT 9 10 10 0 1
- t080 a 4 INT 9 10 10 0 1
- t080 b 4 INT 9 10 10 0 1
- t080 c 4 INT 9 10 10 0 1
- t080 d 4 INT 9 10 10 0 1
- t080 e 4 INT 9 10 10 0 1
- t081 a 4 INT 9 10 10 0 1
- t081 b 4 INT 9 10 10 0 1
- t081 c 4 INT 9 10 10 0 1
- t081 d 4 INT 9 10 10 0 1
- t081 e 4 INT 9 10 10 0 1
- t082 a 4 INT 9 10 10 0 1
- t082 b 4 INT 9 10 10 0 1
- t082 c 4 INT 9 10 10 0 1
- t082 d 4 INT 9 10 10 0 1
- t082 e 4 INT 9 10 10 0 1
- t083 a 4 INT 9 10 10 0 1
- t083 b 4 INT 9 10 10 0 1
- t083 c 4 INT 9 10 10 0 1
- t083 d 4 INT 9 10 10 0 1
- t083 e 4 INT 9 10 10 0 1
- t084 a 4 INT 9 10 10 0 1
- t084 b 4 INT 9 10 10 0 1
- t084 c 4 INT 9 10 10 0 1
- t084 d 4 INT 9 10 10 0 1
- t084 e 4 INT 9 10 10 0 1
- t085 a 4 INT 9 10 10 0 1
- t085 b 4 INT 9 10 10 0 1
- t085 c 4 INT 9 10 10 0 1
- t085 d 4 INT 9 10 10 0 1
- t085 e 4 INT 9 10 10 0 1
- t086 a 4 INT 9 10 10 0 1
- t086 b 4 INT 9 10 10 0 1
- t086 c 4 INT 9 10 10 0 1
- t086 d 4 INT 9 10 10 0 1
- t086 e 4 INT 9 10 10 0 1
- t087 a 4 INT 9 10 10 0 1
- t087 b 4 INT 9 10 10 0 1
- t087 c 4 INT 9 10 10 0 1
- t087 d 4 INT 9 10 10 0 1
- t087 e 4 INT 9 10 10 0 1
- t088 a 4 INT 9 10 10 0 1
- t088 b 4 INT 9 10 10 0 1
- t088 c 4 INT 9 10 10 0 1
- t088 d 4 INT 9 10 10 0 1
- t088 e 4 INT 9 10 10 0 1
- t089 a 4 INT 9 10 10 0 1
- t089 b 4 INT 9 10 10 0 1
- t089 c 4 INT 9 10 10 0 1
- t089 d 4 INT 9 10 10 0 1
- t089 e 4 INT 9 10 10 0 1
- t090 a 4 INT 9 10 10 0 1
- t090 b 4 INT 9 10 10 0 1
- t090 c 4 INT 9 10 10 0 1
- t090 d 4 INT 9 10 10 0 1
- t090 e 4 INT 9 10 10 0 1
- t091 a 4 INT 9 10 10 0 1
- t091 b 4 INT 9 10 10 0 1
- t091 c 4 INT 9 10 10 0 1
- t091 d 4 INT 9 10 10 0 1
- t091 e 4 INT 9 10 10 0 1
- t092 a 4 INT 9 10 10 0 1
- t092 b 4 INT 9 10 10 0 1
- t092 c 4 INT 9 10 10 0 1
- t092 d 4 INT 9 10 10 0 1
- t092 e 4 INT 9 10 10 0 1
- t093 a 4 INT 9 10 10 0 1
- t093 b 4 INT 9 10 10 0 1
- t093 c 4 INT 9 10 10 0 1
- t093 d 4 INT 9 10 10 0 1
- t093 e 4 INT 9 10 10 0 1
- t094 a 4 INT 9 10 10 0 1
- t094 b 4 INT 9 10 10 0 1
- t094 c 4 INT 9 10 10 0 1
- t094 d 4 INT 9 10 10 0 1
- t094 e 4 INT 9 10 10 0 1
- t095 a 4 INT 9 10 10 0 1
- t095 b 4 INT 9 10 10 0 1
- t095 c 4 INT 9 10 10 0 1
- t095 d 4 INT 9 10 10 0 1
- t095 e 4 INT 9 10 10 0 1
- t096 a 4 INT 9 10 10 0 1
- t096 b 4 INT 9 10 10 0 1
- t096 c 4 INT 9 10 10 0 1
- t096 d 4 INT 9 10 10 0 1
- t096 e 4 INT 9 10 10 0 1
- t097 a 4 INT 9 10 10 0 1
- t097 b 4 INT 9 10 10 0 1
- t097 c 4 INT 9 10 10 0 1
- t097 d 4 INT 9 10 10 0 1
- t097 e 4 INT 9 10 10 0 1
- t098 a 4 INT 9 10 10 0 1
- t098 b 4 INT 9 10 10 0 1
- t098 c 4 INT 9 10 10 0 1
- t098 d 4 INT 9 10 10 0 1
- t098 e 4 INT 9 10 10 0 1
- t099 a 4 INT 9 10 10 0 1
- t099 b 4 INT 9 10 10 0 1
- t099 c 4 INT 9 10 10 0 1
- t099 d 4 INT 9 10 10 0 1
- t099 e 4 INT 9 10 10 0 1
- t1 a 12 varchar(64) 64 64 10 0 1
- t100 a 4 INT 9 10 10 0 1
- t100 b 4 INT 9 10 10 0 1
- t100 c 4 INT 9 10 10 0 1
- t100 d 4 INT 9 10 10 0 1
- t100 e 4 INT 9 10 10 0 1
- t101 a 4 INT 9 10 10 0 1
- t101 b 4 INT 9 10 10 0 1
- t101 c 4 INT 9 10 10 0 1
- t101 d 4 INT 9 10 10 0 1
- t101 e 4 INT 9 10 10 0 1
- t102 a 4 INT 9 10 10 0 1
- t102 b 4 INT 9 10 10 0 1
- t102 c 4 INT 9 10 10 0 1
- t102 d 4 INT 9 10 10 0 1
- t102 e 4 INT 9 10 10 0 1
- t103 a 4 INT 9 10 10 0 1
- t103 b 4 INT 9 10 10 0 1
- t103 c 4 INT 9 10 10 0 1
- t103 d 4 INT 9 10 10 0 1
- t103 e 4 INT 9 10 10 0 1
- t104 a 4 INT 9 10 10 0 1
- t104 b 4 INT 9 10 10 0 1
- t104 c 4 INT 9 10 10 0 1
- t104 d 4 INT 9 10 10 0 1
- t104 e 4 INT 9 10 10 0 1
- t105 a 4 INT 9 10 10 0 1
- t105 b 4 INT 9 10 10 0 1
- t105 c 4 INT 9 10 10 0 1
- t105 d 4 INT 9 10 10 0 1
- t105 e 4 INT 9 10 10 0 1
- t106 a 4 INT 9 10 10 0 1
- t106 b 4 INT 9 10 10 0 1
- t106 c 4 INT 9 10 10 0 1
- t106 d 4 INT 9 10 10 0 1
- t106 e 4 INT 9 10 10 0 1
- t107 a 4 INT 9 10 10 0 1
- t107 b 4 INT 9 10 10 0 1
- t107 c 4 INT 9 10 10 0 1
- t107 d 4 INT 9 10 10 0 1
- t107 e 4 INT 9 10 10 0 1
- t108 a 4 INT 9 10 10 0 1
- t108 b 4 INT 9 10 10 0 1
- t108 c 4 INT 9 10 10 0 1
- t108 d 4 INT 9 10 10 0 1
- t108 e 4 INT 9 10 10 0 1
- t109 a 4 INT 9 10 10 0 1
- t109 b 4 INT 9 10 10 0 1
- t109 c 4 INT 9 10 10 0 1
- t109 d 4 INT 9 10 10 0 1
- t109 e 4 INT 9 10 10 0 1
- t110 a 4 INT 9 10 10 0 1
- t110 b 4 INT 9 10 10 0 1
- t110 c 4 INT 9 10 10 0 1
- t110 d 4 INT 9 10 10 0 1
- t110 e 4 INT 9 10 10 0 1
- t111 a 4 INT 9 10 10 0 1
- t111 b 4 INT 9 10 10 0 1
- t111 c 4 INT 9 10 10 0 1
- t111 d 4 INT 9 10 10 0 1
- t111 e 4 INT 9 10 10 0 1
- t112 a 4 INT 9 10 10 0 1
- t112 b 4 INT 9 10 10 0 1
- t112 c 4 INT 9 10 10 0 1
- t112 d 4 INT 9 10 10 0 1
- t112 e 4 INT 9 10 10 0 1
- t113 a 4 INT 9 10 10 0 1
- t113 b 4 INT 9 10 10 0 1
- t113 c 4 INT 9 10 10 0 1
- t113 d 4 INT 9 10 10 0 1
- t113 e 4 INT 9 10 10 0 1
- t114 a 4 INT 9 10 10 0 1
- t114 b 4 INT 9 10 10 0 1
- t114 c 4 INT 9 10 10 0 1
- t114 d 4 INT 9 10 10 0 1
- t114 e 4 INT 9 10 10 0 1
- t115 a 4 INT 9 10 10 0 1
- t115 b 4 INT 9 10 10 0 1
- t115 c 4 INT 9 10 10 0 1
- t115 d 4 INT 9 10 10 0 1
- t115 e 4 INT 9 10 10 0 1
- t116 a 4 INT 9 10 10 0 1
- t116 b 4 INT 9 10 10 0 1
- t116 c 4 INT 9 10 10 0 1
- t116 d 4 INT 9 10 10 0 1
- t116 e 4 INT 9 10 10 0 1
- t117 a 4 INT 9 10 10 0 1
- t117 b 4 INT 9 10 10 0 1
- t117 c 4 INT 9 10 10 0 1
- t117 d 4 INT 9 10 10 0 1
- t117 e 4 INT 9 10 10 0 1
- t118 a 4 INT 9 10 10 0 1
- t118 b 4 INT 9 10 10 0 1
- t118 c 4 INT 9 10 10 0 1
- t118 d 4 INT 9 10 10 0 1
- t118 e 4 INT 9 10 10 0 1
- t119 a 4 INT 9 10 10 0 1
- t119 b 4 INT 9 10 10 0 1
- t119 c 4 INT 9 10 10 0 1
- t119 d 4 INT 9 10 10 0 1
- t119 e 4 INT 9 10 10 0 1
- t120 a 4 INT 9 10 10 0 1
- t120 b 4 INT 9 10 10 0 1
- t120 c 4 INT 9 10 10 0 1
- t120 d 4 INT 9 10 10 0 1
- t120 e 4 INT 9 10 10 0 1
- t121 a 4 INT 9 10 10 0 1
- t121 b 4 INT 9 10 10 0 1
- t121 c 4 INT 9 10 10 0 1
- t121 d 4 INT 9 10 10 0 1
- t121 e 4 INT 9 10 10 0 1
- t122 a 4 INT 9 10 10 0 1
- t122 b 4 INT 9 10 10 0 1
- t122 c 4 INT 9 10 10 0 1
- t122 d 4 INT 9 10 10 0 1
- t122 e 4 INT 9 10 10 0 1
- t123 a 4 INT 9 10 10 0 1
- t123 b 4 INT 9 10 10 0 1
- t123 c 4 INT 9 10 10 0 1
- t123 d 4 INT 9 10 10 0 1
- t123 e 4 INT 9 10 10 0 1
- t124 a 4 INT 9 10 10 0 1
- t124 b 4 INT 9 10 10 0 1
- t124 c 4 INT 9 10 10 0 1
- t124 d 4 INT 9 10 10 0 1
- t124 e 4 INT 9 10 10 0 1
- t125 a 4 INT 9 10 10 0 1
- t125 b 4 INT 9 10 10 0 1
- t125 c 4 INT 9 10 10 0 1
- t125 d 4 INT 9 10 10 0 1
- t125 e 4 INT 9 10 10 0 1
- t126 a 4 INT 9 10 10 0 1
- t126 b 4 INT 9 10 10 0 1
- t126 c 4 INT 9 10 10 0 1
- t126 d 4 INT 9 10 10 0 1
- t126 e 4 INT 9 10 10 0 1
- t127 a 4 INT 9 10 10 0 1
- t127 b 4 INT 9 10 10 0 1
- t127 c 4 INT 9 10 10 0 1
- t127 d 4 INT 9 10 10 0 1
- t127 e 4 INT 9 10 10 0 1
- t128 a 4 INT 9 10 10 0 1
- t128 b 4 INT 9 10 10 0 1
- t128 c 4 INT 9 10 10 0 1
- t128 d 4 INT 9 10 10 0 1
- t128 e 4 INT 9 10 10 0 1
- t129 a 4 INT 9 10 10 0 1
- t129 b 4 INT 9 10 10 0 1
- t129 c 4 INT 9 10 10 0 1
- t129 d 4 INT 9 10 10 0 1
- t129 e 4 INT 9 10 10 0 1
- t130 a 4 INT 9 10 10 0 1
- t130 b 4 INT 9 10 10 0 1
- t130 c 4 INT 9 10 10 0 1
- t130 d 4 INT 9 10 10 0 1
- t130 e 4 INT 9 10 10 0 1
- t131 a 4 INT 9 10 10 0 1
- t131 b 4 INT 9 10 10 0 1
- t131 c 4 INT 9 10 10 0 1
- t131 d 4 INT 9 10 10 0 1
- t131 e 4 INT 9 10 10 0 1
- t132 a 4 INT 9 10 10 0 1
- t132 b 4 INT 9 10 10 0 1
- t132 c 4 INT 9 10 10 0 1
- t132 d 4 INT 9 10 10 0 1
- t132 e 4 INT 9 10 10 0 1
- t133 a 4 INT 9 10 10 0 1
- t133 b 4 INT 9 10 10 0 1
- t133 c 4 INT 9 10 10 0 1
- t133 d 4 INT 9 10 10 0 1
- t133 e 4 INT 9 10 10 0 1
- t134 a 4 INT 9 10 10 0 1
- t134 b 4 INT 9 10 10 0 1
- t134 c 4 INT 9 10 10 0 1
- t134 d 4 INT 9 10 10 0 1
- t134 e 4 INT 9 10 10 0 1
- t135 a 4 INT 9 10 10 0 1
- t135 b 4 INT 9 10 10 0 1
- t135 c 4 INT 9 10 10 0 1
- t135 d 4 INT 9 10 10 0 1
- t135 e 4 INT 9 10 10 0 1
- t136 a 4 INT 9 10 10 0 1
- t136 b 4 INT 9 10 10 0 1
- t136 c 4 INT 9 10 10 0 1
- t136 d 4 INT 9 10 10 0 1
- t136 e 4 INT 9 10 10 0 1
- t137 a 4 INT 9 10 10 0 1
- t137 b 4 INT 9 10 10 0 1
- t137 c 4 INT 9 10 10 0 1
- t137 d 4 INT 9 10 10 0 1
- t137 e 4 INT 9 10 10 0 1
- t138 a 4 INT 9 10 10 0 1
- t138 b 4 INT 9 10 10 0 1
- t138 c 4 INT 9 10 10 0 1
- t138 d 4 INT 9 10 10 0 1
- t138 e 4 INT 9 10 10 0 1
- t139 a 4 INT 9 10 10 0 1
- t139 b 4 INT 9 10 10 0 1
- t139 c 4 INT 9 10 10 0 1
- t139 d 4 INT 9 10 10 0 1
- t139 e 4 INT 9 10 10 0 1
- t140 a 4 INT 9 10 10 0 1
- t140 b 4 INT 9 10 10 0 1
- t140 c 4 INT 9 10 10 0 1
- t140 d 4 INT 9 10 10 0 1
- t140 e 4 INT 9 10 10 0 1
- t141 a 4 INT 9 10 10 0 1
- t141 b 4 INT 9 10 10 0 1
- t141 c 4 INT 9 10 10 0 1
- t141 d 4 INT 9 10 10 0 1
- t141 e 4 INT 9 10 10 0 1
- t142 a 4 INT 9 10 10 0 1
- t142 b 4 INT 9 10 10 0 1
- t142 c 4 INT 9 10 10 0 1
- t142 d 4 INT 9 10 10 0 1
- t142 e 4 INT 9 10 10 0 1
- t143 a 4 INT 9 10 10 0 1
- t143 b 4 INT 9 10 10 0 1
- t143 c 4 INT 9 10 10 0 1
- t143 d 4 INT 9 10 10 0 1
- t143 e 4 INT 9 10 10 0 1
- t144 a 4 INT 9 10 10 0 1
- t144 b 4 INT 9 10 10 0 1
- t144 c 4 INT 9 10 10 0 1
- t144 d 4 INT 9 10 10 0 1
- t144 e 4 INT 9 10 10 0 1
- t145 a 4 INT 9 10 10 0 1
- t145 b 4 INT 9 10 10 0 1
- t145 c 4 INT 9 10 10 0 1
- t145 d 4 INT 9 10 10 0 1
- t145 e 4 INT 9 10 10 0 1
- t146 a 4 INT 9 10 10 0 1
- t146 b 4 INT 9 10 10 0 1
- t146 c 4 INT 9 10 10 0 1
- t146 d 4 INT 9 10 10 0 1
- t146 e 4 INT 9 10 10 0 1
- t147 a 4 INT 9 10 10 0 1
- t147 b 4 INT 9 10 10 0 1
- t147 c 4 INT 9 10 10 0 1
- t147 d 4 INT 9 10 10 0 1
- t147 e 4 INT 9 10 10 0 1
- t148 a 4 INT 9 10 10 0 1
- t148 b 4 INT 9 10 10 0 1
- t148 c 4 INT 9 10 10 0 1
- t148 d 4 INT 9 10 10 0 1
- t148 e 4 INT 9 10 10 0 1
- t149 a 4 INT 9 10 10 0 1
- t149 b 4 INT 9 10 10 0 1
- t149 c 4 INT 9 10 10 0 1
- t149 d 4 INT 9 10 10 0 1
- t149 e 4 INT 9 10 10 0 1
- t150 a 4 INT 9 10 10 0 1
- t150 b 4 INT 9 10 10 0 1
- t150 c 4 INT 9 10 10 0 1
- t150 d 4 INT 9 10 10 0 1
- t150 e 4 INT 9 10 10 0 1
- t151 a 4 INT 9 10 10 0 1
- t151 b 4 INT 9 10 10 0 1
- t151 c 4 INT 9 10 10 0 1
- t151 d 4 INT 9 10 10 0 1
- t151 e 4 INT 9 10 10 0 1
- t152 a 4 INT 9 10 10 0 1
- t152 b 4 INT 9 10 10 0 1
- t152 c 4 INT 9 10 10 0 1
- t152 d 4 INT 9 10 10 0 1
- t152 e 4 INT 9 10 10 0 1
- t153 a 4 INT 9 10 10 0 1
- t153 b 4 INT 9 10 10 0 1
- t153 c 4 INT 9 10 10 0 1
- t153 d 4 INT 9 10 10 0 1
- t153 e 4 INT 9 10 10 0 1
- t154 a 4 INT 9 10 10 0 1
- t154 b 4 INT 9 10 10 0 1
- t154 c 4 INT 9 10 10 0 1
- t154 d 4 INT 9 10 10 0 1
- t154 e 4 INT 9 10 10 0 1
- t155 a 4 INT 9 10 10 0 1
- t155 b 4 INT 9 10 10 0 1
- t155 c 4 INT 9 10 10 0 1
- t155 d 4 INT 9 10 10 0 1
- t155 e 4 INT 9 10 10 0 1
- t156 a 4 INT 9 10 10 0 1
- t156 b 4 INT 9 10 10 0 1
- t156 c 4 INT 9 10 10 0 1
- t156 d 4 INT 9 10 10 0 1
- t156 e 4 INT 9 10 10 0 1
- t157 a 4 INT 9 10 10 0 1
- t157 b 4 INT 9 10 10 0 1
- t157 c 4 INT 9 10 10 0 1
- t157 d 4 INT 9 10 10 0 1
- t157 e 4 INT 9 10 10 0 1
- t158 a 4 INT 9 10 10 0 1
- t158 b 4 INT 9 10 10 0 1
- t158 c 4 INT 9 10 10 0 1
- t158 d 4 INT 9 10 10 0 1
- t158 e 4 INT 9 10 10 0 1
- t159 a 4 INT 9 10 10 0 1
- t159 b 4 INT 9 10 10 0 1
- t159 c 4 INT 9 10 10 0 1
- t159 d 4 INT 9 10 10 0 1
- t159 e 4 INT 9 10 10 0 1
- t160 a 4 INT 9 10 10 0 1
- t160 b 4 INT 9 10 10 0 1
- t160 c 4 INT 9 10 10 0 1
- t160 d 4 INT 9 10 10 0 1
- t160 e 4 INT 9 10 10 0 1
- t161 a 4 INT 9 10 10 0 1
- t161 b 4 INT 9 10 10 0 1
- t161 c 4 INT 9 10 10 0 1
- t161 d 4 INT 9 10 10 0 1
- t161 e 4 INT 9 10 10 0 1
- t162 a 4 INT 9 10 10 0 1
- t162 b 4 INT 9 10 10 0 1
- t162 c 4 INT 9 10 10 0 1
- t162 d 4 INT 9 10 10 0 1
- t162 e 4 INT 9 10 10 0 1
- t163 a 4 INT 9 10 10 0 1
- t163 b 4 INT 9 10 10 0 1
- t163 c 4 INT 9 10 10 0 1
- t163 d 4 INT 9 10 10 0 1
- t163 e 4 INT 9 10 10 0 1
- t164 a 4 INT 9 10 10 0 1
- t164 b 4 INT 9 10 10 0 1
- t164 c 4 INT 9 10 10 0 1
- t164 d 4 INT 9 10 10 0 1
- t164 e 4 INT 9 10 10 0 1
- t165 a 4 INT 9 10 10 0 1
- t165 b 4 INT 9 10 10 0 1
- t165 c 4 INT 9 10 10 0 1
- t165 d 4 INT 9 10 10 0 1
- t165 e 4 INT 9 10 10 0 1
- t166 a 4 INT 9 10 10 0 1
- t166 b 4 INT 9 10 10 0 1
- t166 c 4 INT 9 10 10 0 1
- t166 d 4 INT 9 10 10 0 1
- t166 e 4 INT 9 10 10 0 1
- t167 a 4 INT 9 10 10 0 1
- t167 b 4 INT 9 10 10 0 1
- t167 c 4 INT 9 10 10 0 1
- t167 d 4 INT 9 10 10 0 1
- t167 e 4 INT 9 10 10 0 1
- t168 a 4 INT 9 10 10 0 1
- t168 b 4 INT 9 10 10 0 1
- t168 c 4 INT 9 10 10 0 1
- t168 d 4 INT 9 10 10 0 1
- t168 e 4 INT 9 10 10 0 1
- t169 a 4 INT 9 10 10 0 1
- t169 b 4 INT 9 10 10 0 1
- t169 c 4 INT 9 10 10 0 1
- t169 d 4 INT 9 10 10 0 1
- t169 e 4 INT 9 10 10 0 1
- t170 a 4 INT 9 10 10 0 1
- t170 b 4 INT 9 10 10 0 1
- t170 c 4 INT 9 10 10 0 1
- t170 d 4 INT 9 10 10 0 1
- t170 e 4 INT 9 10 10 0 1
- t171 a 4 INT 9 10 10 0 1
- t171 b 4 INT 9 10 10 0 1
- t171 c 4 INT 9 10 10 0 1
- t171 d 4 INT 9 10 10 0 1
- t171 e 4 INT 9 10 10 0 1
- t172 a 4 INT 9 10 10 0 1
- t172 b 4 INT 9 10 10 0 1
- t172 c 4 INT 9 10 10 0 1
- t172 d 4 INT 9 10 10 0 1
- t172 e 4 INT 9 10 10 0 1
- t173 a 4 INT 9 10 10 0 1
- t173 b 4 INT 9 10 10 0 1
- t173 c 4 INT 9 10 10 0 1
- t173 d 4 INT 9 10 10 0 1
- t173 e 4 INT 9 10 10 0 1
- t174 a 4 INT 9 10 10 0 1
- t174 b 4 INT 9 10 10 0 1
- t174 c 4 INT 9 10 10 0 1
- t174 d 4 INT 9 10 10 0 1
- t174 e 4 INT 9 10 10 0 1
- t175 a 4 INT 9 10 10 0 1
- t175 b 4 INT 9 10 10 0 1
- t175 c 4 INT 9 10 10 0 1
- t175 d 4 INT 9 10 10 0 1
- t175 e 4 INT 9 10 10 0 1
- t176 a 4 INT 9 10 10 0 1
- t176 b 4 INT 9 10 10 0 1
- t176 c 4 INT 9 10 10 0 1
- t176 d 4 INT 9 10 10 0 1
- t176 e 4 INT 9 10 10 0 1
- t177 a 4 INT 9 10 10 0 1
- t177 b 4 INT 9 10 10 0 1
- t177 c 4 INT 9 10 10 0 1
- t177 d 4 INT 9 10 10 0 1
- t177 e 4 INT 9 10 10 0 1
- t178 a 4 INT 9 10 10 0 1
- t178 b 4 INT 9 10 10 0 1
- t178 c 4 INT 9 10 10 0 1
- t178 d 4 INT 9 10 10 0 1
- t178 e 4 INT 9 10 10 0 1
- t179 a 4 INT 9 10 10 0 1
- t179 b 4 INT 9 10 10 0 1
- t179 c 4 INT 9 10 10 0 1
- t179 d 4 INT 9 10 10 0 1
- t179 e 4 INT 9 10 10 0 1
- t180 a 4 INT 9 10 10 0 1
- t180 b 4 INT 9 10 10 0 1
- t180 c 4 INT 9 10 10 0 1
- t180 d 4 INT 9 10 10 0 1
- t180 e 4 INT 9 10 10 0 1
- t181 a 4 INT 9 10 10 0 1
- t181 b 4 INT 9 10 10 0 1
- t181 c 4 INT 9 10 10 0 1
- t181 d 4 INT 9 10 10 0 1
- t181 e 4 INT 9 10 10 0 1
- t182 a 4 INT 9 10 10 0 1
- t182 b 4 INT 9 10 10 0 1
- t182 c 4 INT 9 10 10 0 1
- t182 d 4 INT 9 10 10 0 1
- t182 e 4 INT 9 10 10 0 1
- t183 a 4 INT 9 10 10 0 1
- t183 b 4 INT 9 10 10 0 1
- t183 c 4 INT 9 10 10 0 1
- t183 d 4 INT 9 10 10 0 1
- t183 e 4 INT 9 10 10 0 1
- t184 a 4 INT 9 10 10 0 1
- t184 b 4 INT 9 10 10 0 1
- t184 c 4 INT 9 10 10 0 1
- t184 d 4 INT 9 10 10 0 1
- t184 e 4 INT 9 10 10 0 1
- t185 a 4 INT 9 10 10 0 1
- t185 b 4 INT 9 10 10 0 1
- t185 c 4 INT 9 10 10 0 1
- t185 d 4 INT 9 10 10 0 1
- t185 e 4 INT 9 10 10 0 1
- t186 a 4 INT 9 10 10 0 1
- t186 b 4 INT 9 10 10 0 1
- t186 c 4 INT 9 10 10 0 1
- t186 d 4 INT 9 10 10 0 1
- t186 e 4 INT 9 10 10 0 1
- t187 a 4 INT 9 10 10 0 1
- t187 b 4 INT 9 10 10 0 1
- t187 c 4 INT 9 10 10 0 1
- t187 d 4 INT 9 10 10 0 1
- t187 e 4 INT 9 10 10 0 1
- t188 a 4 INT 9 10 10 0 1
- t188 b 4 INT 9 10 10 0 1
- t188 c 4 INT 9 10 10 0 1
- t188 d 4 INT 9 10 10 0 1
- t188 e 4 INT 9 10 10 0 1
- t189 a 4 INT 9 10 10 0 1
- t189 b 4 INT 9 10 10 0 1
- t189 c 4 INT 9 10 10 0 1
- t189 d 4 INT 9 10 10 0 1
- t189 e 4 INT 9 10 10 0 1
- t190 a 4 INT 9 10 10 0 1
- t190 b 4 INT 9 10 10 0 1
- t190 c 4 INT 9 10 10 0 1
- t190 d 4 INT 9 10 10 0 1
- t190 e 4 INT 9 10 10 0 1
- t191 a 4 INT 9 10 10 0 1
- t191 b 4 INT 9 10 10 0 1
- t191 c 4 INT 9 10 10 0 1
- t191 d 4 INT 9 10 10 0 1
- t191 e 4 INT 9 10 10 0 1
- t192 a 4 INT 9 10 10 0 1
- t192 b 4 INT 9 10 10 0 1
- t192 c 4 INT 9 10 10 0 1
- t192 d 4 INT 9 10 10 0 1
- t192 e 4 INT 9 10 10 0 1
- t193 a 4 INT 9 10 10 0 1
- t193 b 4 INT 9 10 10 0 1
- t193 c 4 INT 9 10 10 0 1
- t193 d 4 INT 9 10 10 0 1
- t193 e 4 INT 9 10 10 0 1
- t194 a 4 INT 9 10 10 0 1
- t194 b 4 INT 9 10 10 0 1
- t194 c 4 INT 9 10 10 0 1
- t194 d 4 INT 9 10 10 0 1
- t194 e 4 INT 9 10 10 0 1
- t195 a 4 INT 9 10 10 0 1
- t195 b 4 INT 9 10 10 0 1
- t195 c 4 INT 9 10 10 0 1
- t195 d 4 INT 9 10 10 0 1
- t195 e 4 INT 9 10 10 0 1
- t196 a 4 INT 9 10 10 0 1
- t196 b 4 INT 9 10 10 0 1
- t196 c 4 INT 9 10 10 0 1
- t196 d 4 INT 9 10 10 0 1
- t196 e 4 INT 9 10 10 0 1
- t197 a 4 INT 9 10 10 0 1
- t197 b 4 INT 9 10 10 0 1
- t197 c 4 INT 9 10 10 0 1
- t197 d 4 INT 9 10 10 0 1
- t197 e 4 INT 9 10 10 0 1
- t198 a 4 INT 9 10 10 0 1
- t198 b 4 INT 9 10 10 0 1
- t198 c 4 INT 9 10 10 0 1
- t198 d 4 INT 9 10 10 0 1
- t198 e 4 INT 9 10 10 0 1
- t199 a 4 INT 9 10 10 0 1
- t199 b 4 INT 9 10 10 0 1
- t199 c 4 INT 9 10 10 0 1
- t199 d 4 INT 9 10 10 0 1
- t199 e 4 INT 9 10 10 0 1
- t200 a 4 INT 9 10 10 0 1
- t200 b 4 INT 9 10 10 0 1
- t200 c 4 INT 9 10 10 0 1
- t200 d 4 INT 9 10 10 0 1
- t200 e 4 INT 9 10 10 0 1
- t201 a 4 INT 9 10 10 0 1
- t201 b 4 INT 9 10 10 0 1
- t201 c 4 INT 9 10 10 0 1
- t201 d 4 INT 9 10 10 0 1
- t201 e 4 INT 9 10 10 0 1
- t202 a 4 INT 9 10 10 0 1
- t202 b 4 INT 9 10 10 0 1
- t202 c 4 INT 9 10 10 0 1
- t202 d 4 INT 9 10 10 0 1
- t202 e 4 INT 9 10 10 0 1
- t203 a 4 INT 9 10 10 0 1
- t203 b 4 INT 9 10 10 0 1
- t203 c 4 INT 9 10 10 0 1
- t203 d 4 INT 9 10 10 0 1
- t203 e 4 INT 9 10 10 0 1
- t204 a 4 INT 9 10 10 0 1
- t204 b 4 INT 9 10 10 0 1
- t204 c 4 INT 9 10 10 0 1
- t204 d 4 INT 9 10 10 0 1
- t204 e 4 INT 9 10 10 0 1
- t205 a 4 INT 9 10 10 0 1
- t205 b 4 INT 9 10 10 0 1
- t205 c 4 INT 9 10 10 0 1
- t205 d 4 INT 9 10 10 0 1
- t205 e 4 INT 9 10 10 0 1
- t206 a 4 INT 9 10 10 0 1
- t206 b 4 INT 9 10 10 0 1
- t206 c 4 INT 9 10 10 0 1
- t206 d 4 INT 9 10 10 0 1
- t206 e 4 INT 9 10 10 0 1
- t207 a 4 INT 9 10 10 0 1
- t207 b 4 INT 9 10 10 0 1
- t207 c 4 INT 9 10 10 0 1
- t207 d 4 INT 9 10 10 0 1
- t207 e 4 INT 9 10 10 0 1
- t208 a 4 INT 9 10 10 0 1
- t208 b 4 INT 9 10 10 0 1
- t208 c 4 INT 9 10 10 0 1
- t208 d 4 INT 9 10 10 0 1
- t208 e 4 INT 9 10 10 0 1
- t209 a 4 INT 9 10 10 0 1
- t209 b 4 INT 9 10 10 0 1
- t209 c 4 INT 9 10 10 0 1
- t209 d 4 INT 9 10 10 0 1
- t209 e 4 INT 9 10 10 0 1
- t210 a 4 INT 9 10 10 0 1
- t210 b 4 INT 9 10 10 0 1
- t210 c 4 INT 9 10 10 0 1
- t210 d 4 INT 9 10 10 0 1
- t210 e 4 INT 9 10 10 0 1
- t211 a 4 INT 9 10 10 0 1
- t211 b 4 INT 9 10 10 0 1
- t211 c 4 INT 9 10 10 0 1
- t211 d 4 INT 9 10 10 0 1
- t211 e 4 INT 9 10 10 0 1
- t212 a 4 INT 9 10 10 0 1
- t212 b 4 INT 9 10 10 0 1
- t212 c 4 INT 9 10 10 0 1
- t212 d 4 INT 9 10 10 0 1
- t212 e 4 INT 9 10 10 0 1
- t213 a 4 INT 9 10 10 0 1
- t213 b 4 INT 9 10 10 0 1
- t213 c 4 INT 9 10 10 0 1
- t213 d 4 INT 9 10 10 0 1
- t213 e 4 INT 9 10 10 0 1
- t214 a 4 INT 9 10 10 0 1
- t214 b 4 INT 9 10 10 0 1
- t214 c 4 INT 9 10 10 0 1
- t214 d 4 INT 9 10 10 0 1
- t214 e 4 INT 9 10 10 0 1
- t215 a 4 INT 9 10 10 0 1
- t215 b 4 INT 9 10 10 0 1
- t215 c 4 INT 9 10 10 0 1
- t215 d 4 INT 9 10 10 0 1
- t215 e 4 INT 9 10 10 0 1
- t216 a 4 INT 9 10 10 0 1
- t216 b 4 INT 9 10 10 0 1
- t216 c 4 INT 9 10 10 0 1
- t216 d 4 INT 9 10 10 0 1
- t216 e 4 INT 9 10 10 0 1
- t217 a 4 INT 9 10 10 0 1
- t217 b 4 INT 9 10 10 0 1
- t217 c 4 INT 9 10 10 0 1
- t217 d 4 INT 9 10 10 0 1
- t217 e 4 INT 9 10 10 0 1
- t218 a 4 INT 9 10 10 0 1
- t218 b 4 INT 9 10 10 0 1
- t218 c 4 INT 9 10 10 0 1
- t218 d 4 INT 9 10 10 0 1
- t218 e 4 INT 9 10 10 0 1
- t219 a 4 INT 9 10 10 0 1
- t219 b 4 INT 9 10 10 0 1
- t219 c 4 INT 9 10 10 0 1
- t219 d 4 INT 9 10 10 0 1
- t219 e 4 INT 9 10 10 0 1
- t220 a 4 INT 9 10 10 0 1
- t220 b 4 INT 9 10 10 0 1
- t220 c 4 INT 9 10 10 0 1
- t220 d 4 INT 9 10 10 0 1
- t220 e 4 INT 9 10 10 0 1
- t221 a 4 INT 9 10 10 0 1
- t221 b 4 INT 9 10 10 0 1
- t221 c 4 INT 9 10 10 0 1
- t221 d 4 INT 9 10 10 0 1
- t221 e 4 INT 9 10 10 0 1
- t222 a 4 INT 9 10 10 0 1
- t222 b 4 INT 9 10 10 0 1
- t222 c 4 INT 9 10 10 0 1
- t222 d 4 INT 9 10 10 0 1
- t222 e 4 INT 9 10 10 0 1
- t223 a 4 INT 9 10 10 0 1
- t223 b 4 INT 9 10 10 0 1
- t223 c 4 INT 9 10 10 0 1
- t223 d 4 INT 9 10 10 0 1
- t223 e 4 INT 9 10 10 0 1
- t224 a 4 INT 9 10 10 0 1
- t224 b 4 INT 9 10 10 0 1
- t224 c 4 INT 9 10 10 0 1
- t224 d 4 INT 9 10 10 0 1
- t224 e 4 INT 9 10 10 0 1
- t225 a 4 INT 9 10 10 0 1
- t225 b 4 INT 9 10 10 0 1
- t225 c 4 INT 9 10 10 0 1
- t225 d 4 INT 9 10 10 0 1
- t225 e 4 INT 9 10 10 0 1
- t226 a 4 INT 9 10 10 0 1
- t226 b 4 INT 9 10 10 0 1
- t226 c 4 INT 9 10 10 0 1
- t226 d 4 INT 9 10 10 0 1
- t226 e 4 INT 9 10 10 0 1
- t227 a 4 INT 9 10 10 0 1
- t227 b 4 INT 9 10 10 0 1
- t227 c 4 INT 9 10 10 0 1
- t227 d 4 INT 9 10 10 0 1
- t227 e 4 INT 9 10 10 0 1
- t228 a 4 INT 9 10 10 0 1
- t228 b 4 INT 9 10 10 0 1
- t228 c 4 INT 9 10 10 0 1
- t228 d 4 INT 9 10 10 0 1
- t228 e 4 INT 9 10 10 0 1
- t229 a 4 INT 9 10 10 0 1
- t229 b 4 INT 9 10 10 0 1
- t229 c 4 INT 9 10 10 0 1
- t229 d 4 INT 9 10 10 0 1
- t229 e 4 INT 9 10 10 0 1
- t230 a 4 INT 9 10 10 0 1
- t230 b 4 INT 9 10 10 0 1
- t230 c 4 INT 9 10 10 0 1
- t230 d 4 INT 9 10 10 0 1
- t230 e 4 INT 9 10 10 0 1
- t231 a 4 INT 9 10 10 0 1
- t231 b 4 INT 9 10 10 0 1
- t231 c 4 INT 9 10 10 0 1
- t231 d 4 INT 9 10 10 0 1
- t231 e 4 INT 9 10 10 0 1
- t232 a 4 INT 9 10 10 0 1
- t232 b 4 INT 9 10 10 0 1
- t232 c 4 INT 9 10 10 0 1
- t232 d 4 INT 9 10 10 0 1
- t232 e 4 INT 9 10 10 0 1
- t233 a 4 INT 9 10 10 0 1
- t233 b 4 INT 9 10 10 0 1
- t233 c 4 INT 9 10 10 0 1
- t233 d 4 INT 9 10 10 0 1
- t233 e 4 INT 9 10 10 0 1
- t234 a 4 INT 9 10 10 0 1
- t234 b 4 INT 9 10 10 0 1
- t234 c 4 INT 9 10 10 0 1
- t234 d 4 INT 9 10 10 0 1
- t234 e 4 INT 9 10 10 0 1
- t235 a 4 INT 9 10 10 0 1
- t235 b 4 INT 9 10 10 0 1
- t235 c 4 INT 9 10 10 0 1
- t235 d 4 INT 9 10 10 0 1
- t235 e 4 INT 9 10 10 0 1
- t236 a 4 INT 9 10 10 0 1
- t236 b 4 INT 9 10 10 0 1
- t236 c 4 INT 9 10 10 0 1
- t236 d 4 INT 9 10 10 0 1
- t236 e 4 INT 9 10 10 0 1
- t237 a 4 INT 9 10 10 0 1
- t237 b 4 INT 9 10 10 0 1
- t237 c 4 INT 9 10 10 0 1
- t237 d 4 INT 9 10 10 0 1
- t237 e 4 INT 9 10 10 0 1
- t238 a 4 INT 9 10 10 0 1
- t238 b 4 INT 9 10 10 0 1
- t238 c 4 INT 9 10 10 0 1
- t238 d 4 INT 9 10 10 0 1
- t238 e 4 INT 9 10 10 0 1
- t239 a 4 INT 9 10 10 0 1
- t239 b 4 INT 9 10 10 0 1
- t239 c 4 INT 9 10 10 0 1
- t239 d 4 INT 9 10 10 0 1
- t239 e 4 INT 9 10 10 0 1
- t240 a 4 INT 9 10 10 0 1
- t240 b 4 INT 9 10 10 0 1
- t240 c 4 INT 9 10 10 0 1
- t240 d 4 INT 9 10 10 0 1
- t240 e 4 INT 9 10 10 0 1
- t241 a 4 INT 9 10 10 0 1
- t241 b 4 INT 9 10 10 0 1
- t241 c 4 INT 9 10 10 0 1
- t241 d 4 INT 9 10 10 0 1
- t241 e 4 INT 9 10 10 0 1
- t242 a 4 INT 9 10 10 0 1
- t242 b 4 INT 9 10 10 0 1
- t242 c 4 INT 9 10 10 0 1
- t242 d 4 INT 9 10 10 0 1
- t242 e 4 INT 9 10 10 0 1
- t243 a 4 INT 9 10 10 0 1
- t243 b 4 INT 9 10 10 0 1
- t243 c 4 INT 9 10 10 0 1
- t243 d 4 INT 9 10 10 0 1
- t243 e 4 INT 9 10 10 0 1
- t244 a 4 INT 9 10 10 0 1
- t244 b 4 INT 9 10 10 0 1
- t244 c 4 INT 9 10 10 0 1
- t244 d 4 INT 9 10 10 0 1
- t244 e 4 INT 9 10 10 0 1
- t245 a 4 INT 9 10 10 0 1
- t245 b 4 INT 9 10 10 0 1
- t245 c 4 INT 9 10 10 0 1
- t245 d 4 INT 9 10 10 0 1
- t245 e 4 INT 9 10 10 0 1
- t246 a 4 INT 9 10 10 0 1
- t246 b 4 INT 9 10 10 0 1
- t246 c 4 INT 9 10 10 0 1
- t246 d 4 INT 9 10 10 0 1
- t246 e 4 INT 9 10 10 0 1
- t247 a 4 INT 9 10 10 0 1
- t247 b 4 INT 9 10 10 0 1
- t247 c 4 INT 9 10 10 0 1
- t247 d 4 INT 9 10 10 0 1
- t247 e 4 INT 9 10 10 0 1
- t248 a 4 INT 9 10 10 0 1
- t248 b 4 INT 9 10 10 0 1
- t248 c 4 INT 9 10 10 0 1
- t248 d 4 INT 9 10 10 0 1
- t248 e 4 INT 9 10 10 0 1
- t249 a 4 INT 9 10 10 0 1
- t249 b 4 INT 9 10 10 0 1
- t249 c 4 INT 9 10 10 0 1
- t249 d 4 INT 9 10 10 0 1
- t249 e 4 INT 9 10 10 0 1
- t250 a 4 INT 9 10 10 0 1
- t250 b 4 INT 9 10 10 0 1
- t250 c 4 INT 9 10 10 0 1
- t250 d 4 INT 9 10 10 0 1
- t250 e 4 INT 9 10 10 0 1
- t251 a 4 INT 9 10 10 0 1
- t251 b 4 INT 9 10 10 0 1
- t251 c 4 INT 9 10 10 0 1
- t251 d 4 INT 9 10 10 0 1
- t251 e 4 INT 9 10 10 0 1
- t252 a 4 INT 9 10 10 0 1
- t252 b 4 INT 9 10 10 0 1
- t252 c 4 INT 9 10 10 0 1
- t252 d 4 INT 9 10 10 0 1
- t252 e 4 INT 9 10 10 0 1
- t253 a 4 INT 9 10 10 0 1
- t253 b 4 INT 9 10 10 0 1
- t253 c 4 INT 9 10 10 0 1
- t253 d 4 INT 9 10 10 0 1
- t253 e 4 INT 9 10 10 0 1
- t254 a 4 INT 9 10 10 0 1
- t254 b 4 INT 9 10 10 0 1
- t254 c 4 INT 9 10 10 0 1
- t254 d 4 INT 9 10 10 0 1
- t254 e 4 INT 9 10 10 0 1
- t255 a 4 INT 9 10 10 0 1
- t255 b 4 INT 9 10 10 0 1
- t255 c 4 INT 9 10 10 0 1
- t255 d 4 INT 9 10 10 0 1
- t255 e 4 INT 9 10 10 0 1
- t256 a 4 INT 9 10 10 0 1
- t256 b 4 INT 9 10 10 0 1
- t256 c 4 INT 9 10 10 0 1
- t256 d 4 INT 9 10 10 0 1
- t256 e 4 INT 9 10 10 0 1
- t257 a 4 INT 9 10 10 0 1
- t257 b 4 INT 9 10 10 0 1
- t257 c 4 INT 9 10 10 0 1
- t257 d 4 INT 9 10 10 0 1
- t257 e 4 INT 9 10 10 0 1
- t258 a 4 INT 9 10 10 0 1
- t258 b 4 INT 9 10 10 0 1
- t258 c 4 INT 9 10 10 0 1
- t258 d 4 INT 9 10 10 0 1
- t258 e 4 INT 9 10 10 0 1
- t259 a 4 INT 9 10 10 0 1
- t259 b 4 INT 9 10 10 0 1
- t259 c 4 INT 9 10 10 0 1
- t259 d 4 INT 9 10 10 0 1
- t259 e 4 INT 9 10 10 0 1
- t260 a 4 INT 9 10 10 0 1
- t260 b 4 INT 9 10 10 0 1
- t260 c 4 INT 9 10 10 0 1
- t260 d 4 INT 9 10 10 0 1
- t260 e 4 INT 9 10 10 0 1
- t261 a 4 INT 9 10 10 0 1
- t261 b 4 INT 9 10 10 0 1
- t261 c 4 INT 9 10 10 0 1
- t261 d 4 INT 9 10 10 0 1
- t261 e 4 INT 9 10 10 0 1
- t262 a 4 INT 9 10 10 0 1
- t262 b 4 INT 9 10 10 0 1
- t262 c 4 INT 9 10 10 0 1
- t262 d 4 INT 9 10 10 0 1
- t262 e 4 INT 9 10 10 0 1
- t263 a 4 INT 9 10 10 0 1
- t263 b 4 INT 9 10 10 0 1
- t263 c 4 INT 9 10 10 0 1
- t263 d 4 INT 9 10 10 0 1
- t263 e 4 INT 9 10 10 0 1
- t264 a 4 INT 9 10 10 0 1
- t264 b 4 INT 9 10 10 0 1
- t264 c 4 INT 9 10 10 0 1
- t264 d 4 INT 9 10 10 0 1
- t264 e 4 INT 9 10 10 0 1
- t265 a 4 INT 9 10 10 0 1
- t265 b 4 INT 9 10 10 0 1
- t265 c 4 INT 9 10 10 0 1
- t265 d 4 INT 9 10 10 0 1
- t265 e 4 INT 9 10 10 0 1
- t266 a 4 INT 9 10 10 0 1
- t266 b 4 INT 9 10 10 0 1
- t266 c 4 INT 9 10 10 0 1
- t266 d 4 INT 9 10 10 0 1
- t266 e 4 INT 9 10 10 0 1
- t267 a 4 INT 9 10 10 0 1
- t267 b 4 INT 9 10 10 0 1
- t267 c 4 INT 9 10 10 0 1
- t267 d 4 INT 9 10 10 0 1
- t267 e 4 INT 9 10 10 0 1
- t268 a 4 INT 9 10 10 0 1
- t268 b 4 INT 9 10 10 0 1
- t268 c 4 INT 9 10 10 0 1
- t268 d 4 INT 9 10 10 0 1
- t268 e 4 INT 9 10 10 0 1
- t269 a 4 INT 9 10 10 0 1
- t269 b 4 INT 9 10 10 0 1
- t269 c 4 INT 9 10 10 0 1
- t269 d 4 INT 9 10 10 0 1
- t269 e 4 INT 9 10 10 0 1
- t270 a 4 INT 9 10 10 0 1
- t270 b 4 INT 9 10 10 0 1
- t270 c 4 INT 9 10 10 0 1
- t270 d 4 INT 9 10 10 0 1
- t270 e 4 INT 9 10 10 0 1
- t271 a 4 INT 9 10 10 0 1
- t271 b 4 INT 9 10 10 0 1
- t271 c 4 INT 9 10 10 0 1
- t271 d 4 INT 9 10 10 0 1
- t271 e 4 INT 9 10 10 0 1
- t272 a 4 INT 9 10 10 0 1
- t272 b 4 INT 9 10 10 0 1
- t272 c 4 INT 9 10 10 0 1
- t272 d 4 INT 9 10 10 0 1
- t272 e 4 INT 9 10 10 0 1
- t273 a 4 INT 9 10 10 0 1
- t273 b 4 INT 9 10 10 0 1
- t273 c 4 INT 9 10 10 0 1
- t273 d 4 INT 9 10 10 0 1
- t273 e 4 INT 9 10 10 0 1
- t274 a 4 INT 9 10 10 0 1
- t274 b 4 INT 9 10 10 0 1
- t274 c 4 INT 9 10 10 0 1
- t274 d 4 INT 9 10 10 0 1
- t274 e 4 INT 9 10 10 0 1
- t275 a 4 INT 9 10 10 0 1
- t275 b 4 INT 9 10 10 0 1
- t275 c 4 INT 9 10 10 0 1
- t275 d 4 INT 9 10 10 0 1
- t275 e 4 INT 9 10 10 0 1
- t276 a 4 INT 9 10 10 0 1
- t276 b 4 INT 9 10 10 0 1
- t276 c 4 INT 9 10 10 0 1
- t276 d 4 INT 9 10 10 0 1
- t276 e 4 INT 9 10 10 0 1
- t277 a 4 INT 9 10 10 0 1
- t277 b 4 INT 9 10 10 0 1
- t277 c 4 INT 9 10 10 0 1
- t277 d 4 INT 9 10 10 0 1
- t277 e 4 INT 9 10 10 0 1
- t278 a 4 INT 9 10 10 0 1
- t278 b 4 INT 9 10 10 0 1
- t278 c 4 INT 9 10 10 0 1
- t278 d 4 INT 9 10 10 0 1
- t278 e 4 INT 9 10 10 0 1
- t279 a 4 INT 9 10 10 0 1
- t279 b 4 INT 9 10 10 0 1
- t279 c 4 INT 9 10 10 0 1
- t279 d 4 INT 9 10 10 0 1
- t279 e 4 INT 9 10 10 0 1
- t280 a 4 INT 9 10 10 0 1
- t280 b 4 INT 9 10 10 0 1
- t280 c 4 INT 9 10 10 0 1
- t280 d 4 INT 9 10 10 0 1
- t280 e 4 INT 9 10 10 0 1
- t281 a 4 INT 9 10 10 0 1
- t281 b 4 INT 9 10 10 0 1
- t281 c 4 INT 9 10 10 0 1
- t281 d 4 INT 9 10 10 0 1
- t281 e 4 INT 9 10 10 0 1
- t282 a 4 INT 9 10 10 0 1
- t282 b 4 INT 9 10 10 0 1
- t282 c 4 INT 9 10 10 0 1
- t282 d 4 INT 9 10 10 0 1
- t282 e 4 INT 9 10 10 0 1
- t283 a 4 INT 9 10 10 0 1
- t283 b 4 INT 9 10 10 0 1
- t283 c 4 INT 9 10 10 0 1
- t283 d 4 INT 9 10 10 0 1
- t283 e 4 INT 9 10 10 0 1
- t284 a 4 INT 9 10 10 0 1
- t284 b 4 INT 9 10 10 0 1
- t284 c 4 INT 9 10 10 0 1
- t284 d 4 INT 9 10 10 0 1
- t284 e 4 INT 9 10 10 0 1
- t285 a 4 INT 9 10 10 0 1
- t285 b 4 INT 9 10 10 0 1
- t285 c 4 INT 9 10 10 0 1
- t285 d 4 INT 9 10 10 0 1
- t285 e 4 INT 9 10 10 0 1
- t286 a 4 INT 9 10 10 0 1
- t286 b 4 INT 9 10 10 0 1
- t286 c 4 INT 9 10 10 0 1
- t286 d 4 INT 9 10 10 0 1
- t286 e 4 INT 9 10 10 0 1
- t287 a 4 INT 9 10 10 0 1
- t287 b 4 INT 9 10 10 0 1
- t287 c 4 INT 9 10 10 0 1
- t287 d 4 INT 9 10 10 0 1
- t287 e 4 INT 9 10 10 0 1
- t288 a 4 INT 9 10 10 0 1
- t288 b 4 INT 9 10 10 0 1
- t288 c 4 INT 9 10 10 0 1
- t288 d 4 INT 9 10 10 0 1
- t288 e 4 INT 9 10 10 0 1
- t289 a 4 INT 9 10 10 0 1
- t289 b 4 INT 9 10 10 0 1
- t289 c 4 INT 9 10 10 0 1
- t289 d 4 INT 9 10 10 0 1
- t289 e 4 INT 9 10 10 0 1
- t290 a 4 INT 9 10 10 0 1
- t290 b 4 INT 9 10 10 0 1
- t290 c 4 INT 9 10 10 0 1
- t290 d 4 INT 9 10 10 0 1
- t290 e 4 INT 9 10 10 0 1
- t291 a 4 INT 9 10 10 0 1
- t291 b 4 INT 9 10 10 0 1
- t291 c 4 INT 9 10 10 0 1
- t291 d 4 INT 9 10 10 0 1
- t291 e 4 INT 9 10 10 0 1
- t292 a 4 INT 9 10 10 0 1
- t292 b 4 INT 9 10 10 0 1
- t292 c 4 INT 9 10 10 0 1
- t292 d 4 INT 9 10 10 0 1
- t292 e 4 INT 9 10 10 0 1
- t293 a 4 INT 9 10 10 0 1
- t293 b 4 INT 9 10 10 0 1
- t293 c 4 INT 9 10 10 0 1
- t293 d 4 INT 9 10 10 0 1
- t293 e 4 INT 9 10 10 0 1
- t294 a 4 INT 9 10 10 0 1
- t294 b 4 INT 9 10 10 0 1
- t294 c 4 INT 9 10 10 0 1
- t294 d 4 INT 9 10 10 0 1
- t294 e 4 INT 9 10 10 0 1
- t295 a 4 INT 9 10 10 0 1
- t295 b 4 INT 9 10 10 0 1
- t295 c 4 INT 9 10 10 0 1
- t295 d 4 INT 9 10 10 0 1
- t295 e 4 INT 9 10 10 0 1
- t296 a 4 INT 9 10 10 0 1
- t296 b 4 INT 9 10 10 0 1
- t296 c 4 INT 9 10 10 0 1
- t296 d 4 INT 9 10 10 0 1
- t296 e 4 INT 9 10 10 0 1
- t297 a 4 INT 9 10 10 0 1
- t297 b 4 INT 9 10 10 0 1
- t297 c 4 INT 9 10 10 0 1
- t297 d 4 INT 9 10 10 0 1
- t297 e 4 INT 9 10 10 0 1
- t298 a 4 INT 9 10 10 0 1
- t298 b 4 INT 9 10 10 0 1
- t298 c 4 INT 9 10 10 0 1
- t298 d 4 INT 9 10 10 0 1
- t298 e 4 INT 9 10 10 0 1
- t299 a 4 INT 9 10 10 0 1
- t299 b 4 INT 9 10 10 0 1
- t299 c 4 INT 9 10 10 0 1
- t299 d 4 INT 9 10 10 0 1
- t299 e 4 INT 9 10 10 0 1
- t300 a 4 INT 9 10 10 0 1
- t300 b 4 INT 9 10 10 0 1
- t300 c 4 INT 9 10 10 0 1
- t300 d 4 INT 9 10 10 0 1
- t300 e 4 INT 9 10 10 0 1
- t301 a 4 INT 9 10 10 0 1
- t301 b 4 INT 9 10 10 0 1
- t301 c 4 INT 9 10 10 0 1
- t301 d 4 INT 9 10 10 0 1
- t301 e 4 INT 9 10 10 0 1
- t302 a 4 INT 9 10 10 0 1
- t302 b 4 INT 9 10 10 0 1
- t302 c 4 INT 9 10 10 0 1
- t302 d 4 INT 9 10 10 0 1
- t302 e 4 INT 9 10 10 0 1
- t303 a 4 INT 9 10 10 0 1
- t303 b 4 INT 9 10 10 0 1
- t303 c 4 INT 9 10 10 0 1
- t303 d 4 INT 9 10 10 0 1
- t303 e 4 INT 9 10 10 0 1
- t304 a 4 INT 9 10 10 0 1
- t304 b 4 INT 9 10 10 0 1
- t304 c 4 INT 9 10 10 0 1
- t304 d 4 INT 9 10 10 0 1
- t304 e 4 INT 9 10 10 0 1
- t305 a 4 INT 9 10 10 0 1
- t305 b 4 INT 9 10 10 0 1
- t305 c 4 INT 9 10 10 0 1
- t305 d 4 INT 9 10 10 0 1
- t305 e 4 INT 9 10 10 0 1
- t306 a 4 INT 9 10 10 0 1
- t306 b 4 INT 9 10 10 0 1
- t306 c 4 INT 9 10 10 0 1
- t306 d 4 INT 9 10 10 0 1
- t306 e 4 INT 9 10 10 0 1
- t307 a 4 INT 9 10 10 0 1
- t307 b 4 INT 9 10 10 0 1
- t307 c 4 INT 9 10 10 0 1
- t307 d 4 INT 9 10 10 0 1
- t307 e 4 INT 9 10 10 0 1
- t308 a 4 INT 9 10 10 0 1
- t308 b 4 INT 9 10 10 0 1
- t308 c 4 INT 9 10 10 0 1
- t308 d 4 INT 9 10 10 0 1
- t308 e 4 INT 9 10 10 0 1
- t309 a 4 INT 9 10 10 0 1
- t309 b 4 INT 9 10 10 0 1
- t309 c 4 INT 9 10 10 0 1
- t309 d 4 INT 9 10 10 0 1
- t309 e 4 INT 9 10 10 0 1
- t310 a 4 INT 9 10 10 0 1
- t310 b 4 INT 9 10 10 0 1
- t310 c 4 INT 9 10 10 0 1
- t310 d 4 INT 9 10 10 0 1
- t310 e 4 INT 9 10 10 0 1
- t311 a 4 INT 9 10 10 0 1
- t311 b 4 INT 9 10 10 0 1
- t311 c 4 INT 9 10 10 0 1
- t311 d 4 INT 9 10 10 0 1
- t311 e 4 INT 9 10 10 0 1
- t312 a 4 INT 9 10 10 0 1
- t312 b 4 INT 9 10 10 0 1
- t312 c 4 INT 9 10 10 0 1
- t312 d 4 INT 9 10 10 0 1
- t312 e 4 INT 9 10 10 0 1
- t313 a 4 INT 9 10 10 0 1
- t313 b 4 INT 9 10 10 0 1
- t313 c 4 INT 9 10 10 0 1
- t313 d 4 INT 9 10 10 0 1
- t313 e 4 INT 9 10 10 0 1
- t314 a 4 INT 9 10 10 0 1
- t314 b 4 INT 9 10 10 0 1
- t314 c 4 INT 9 10 10 0 1
- t314 d 4 INT 9 10 10 0 1
- t314 e 4 INT 9 10 10 0 1
- t315 a 4 INT 9 10 10 0 1
- t315 b 4 INT 9 10 10 0 1
- t315 c 4 INT 9 10 10 0 1
- t315 d 4 INT 9 10 10 0 1
- t315 e 4 INT 9 10 10 0 1
- t316 a 4 INT 9 10 10 0 1
- t316 b 4 INT 9 10 10 0 1
- t316 c 4 INT 9 10 10 0 1
- t316 d 4 INT 9 10 10 0 1
- t316 e 4 INT 9 10 10 0 1
- t317 a 4 INT 9 10 10 0 1
- t317 b 4 INT 9 10 10 0 1
- t317 c 4 INT 9 10 10 0 1
- t317 d 4 INT 9 10 10 0 1
- t317 e 4 INT 9 10 10 0 1
- t318 a 4 INT 9 10 10 0 1
- t318 b 4 INT 9 10 10 0 1
- t318 c 4 INT 9 10 10 0 1
- t318 d 4 INT 9 10 10 0 1
- t318 e 4 INT 9 10 10 0 1
- t319 a 4 INT 9 10 10 0 1
- t319 b 4 INT 9 10 10 0 1
- t319 c 4 INT 9 10 10 0 1
- t319 d 4 INT 9 10 10 0 1
- t319 e 4 INT 9 10 10 0 1
- t320 a 4 INT 9 10 10 0 1
- t320 b 4 INT 9 10 10 0 1
- t320 c 4 INT 9 10 10 0 1
- t320 d 4 INT 9 10 10 0 1
- t320 e 4 INT 9 10 10 0 1
- t321 a 4 INT 9 10 10 0 1
- t321 b 4 INT 9 10 10 0 1
- t321 c 4 INT 9 10 10 0 1
- t321 d 4 INT 9 10 10 0 1
- t321 e 4 INT 9 10 10 0 1
- t322 a 4 INT 9 10 10 0 1
- t322 b 4 INT 9 10 10 0 1
- t322 c 4 INT 9 10 10 0 1
- t322 d 4 INT 9 10 10 0 1
- t322 e 4 INT 9 10 10 0 1
- t323 a 4 INT 9 10 10 0 1
- t323 b 4 INT 9 10 10 0 1
- t323 c 4 INT 9 10 10 0 1
- t323 d 4 INT 9 10 10 0 1
- t323 e 4 INT 9 10 10 0 1
- t324 a 4 INT 9 10 10 0 1
- t324 b 4 INT 9 10 10 0 1
- t324 c 4 INT 9 10 10 0 1
- t324 d 4 INT 9 10 10 0 1
- t324 e 4 INT 9 10 10 0 1
- t325 a 4 INT 9 10 10 0 1
- t325 b 4 INT 9 10 10 0 1
- t325 c 4 INT 9 10 10 0 1
- t325 d 4 INT 9 10 10 0 1
- t325 e 4 INT 9 10 10 0 1
- t326 a 4 INT 9 10 10 0 1
- t326 b 4 INT 9 10 10 0 1
- t326 c 4 INT 9 10 10 0 1
- t326 d 4 INT 9 10 10 0 1
- t326 e 4 INT 9 10 10 0 1
- t327 a 4 INT 9 10 10 0 1
- t327 b 4 INT 9 10 10 0 1
- t327 c 4 INT 9 10 10 0 1
- t327 d 4 INT 9 10 10 0 1
- t327 e 4 INT 9 10 10 0 1
- t328 a 4 INT 9 10 10 0 1
- t328 b 4 INT 9 10 10 0 1
- t328 c 4 INT 9 10 10 0 1
- t328 d 4 INT 9 10 10 0 1
- t328 e 4 INT 9 10 10 0 1
- t329 a 4 INT 9 10 10 0 1
- t329 b 4 INT 9 10 10 0 1
- t329 c 4 INT 9 10 10 0 1
- t329 d 4 INT 9 10 10 0 1
- t329 e 4 INT 9 10 10 0 1
- t330 a 4 INT 9 10 10 0 1
- t330 b 4 INT 9 10 10 0 1
- t330 c 4 INT 9 10 10 0 1
- t330 d 4 INT 9 10 10 0 1
- t330 e 4 INT 9 10 10 0 1
- t331 a 4 INT 9 10 10 0 1
- t331 b 4 INT 9 10 10 0 1
- t331 c 4 INT 9 10 10 0 1
- t331 d 4 INT 9 10 10 0 1
- t331 e 4 INT 9 10 10 0 1
- t332 a 4 INT 9 10 10 0 1
- t332 b 4 INT 9 10 10 0 1
- t332 c 4 INT 9 10 10 0 1
- t332 d 4 INT 9 10 10 0 1
- t332 e 4 INT 9 10 10 0 1
- t333 a 4 INT 9 10 10 0 1
- t333 b 4 INT 9 10 10 0 1
- t333 c 4 INT 9 10 10 0 1
- t333 d 4 INT 9 10 10 0 1
- t333 e 4 INT 9 10 10 0 1
- t334 a 4 INT 9 10 10 0 1
- t334 b 4 INT 9 10 10 0 1
- t334 c 4 INT 9 10 10 0 1
- t334 d 4 INT 9 10 10 0 1
- t334 e 4 INT 9 10 10 0 1
- t335 a 4 INT 9 10 10 0 1
- t335 b 4 INT 9 10 10 0 1
- t335 c 4 INT 9 10 10 0 1
- t335 d 4 INT 9 10 10 0 1
- t335 e 4 INT 9 10 10 0 1
- t336 a 4 INT 9 10 10 0 1
- t336 b 4 INT 9 10 10 0 1
- t336 c 4 INT 9 10 10 0 1
- t336 d 4 INT 9 10 10 0 1
- t336 e 4 INT 9 10 10 0 1
- t337 a 4 INT 9 10 10 0 1
- t337 b 4 INT 9 10 10 0 1
- t337 c 4 INT 9 10 10 0 1
- t337 d 4 INT 9 10 10 0 1
- t337 e 4 INT 9 10 10 0 1
- t338 a 4 INT 9 10 10 0 1
- t338 b 4 INT 9 10 10 0 1
- t338 c 4 INT 9 10 10 0 1
- t338 d 4 INT 9 10 10 0 1
- t338 e 4 INT 9 10 10 0 1
- t339 a 4 INT 9 10 10 0 1
- t339 b 4 INT 9 10 10 0 1
- t339 c 4 INT 9 10 10 0 1
- t339 d 4 INT 9 10 10 0 1
- t339 e 4 INT 9 10 10 0 1
- t340 a 4 INT 9 10 10 0 1
- t340 b 4 INT 9 10 10 0 1
- t340 c 4 INT 9 10 10 0 1
- t340 d 4 INT 9 10 10 0 1
- t340 e 4 INT 9 10 10 0 1
- t341 a 4 INT 9 10 10 0 1
- t341 b 4 INT 9 10 10 0 1
- t341 c 4 INT 9 10 10 0 1
- t341 d 4 INT 9 10 10 0 1
- t341 e 4 INT 9 10 10 0 1
- t342 a 4 INT 9 10 10 0 1
- t342 b 4 INT 9 10 10 0 1
- t342 c 4 INT 9 10 10 0 1
- t342 d 4 INT 9 10 10 0 1
- t342 e 4 INT 9 10 10 0 1
- t343 a 4 INT 9 10 10 0 1
- t343 b 4 INT 9 10 10 0 1
- t343 c 4 INT 9 10 10 0 1
- t343 d 4 INT 9 10 10 0 1
- t343 e 4 INT 9 10 10 0 1
- t344 a 4 INT 9 10 10 0 1
- t344 b 4 INT 9 10 10 0 1
- t344 c 4 INT 9 10 10 0 1
- t344 d 4 INT 9 10 10 0 1
- t344 e 4 INT 9 10 10 0 1
- t345 a 4 INT 9 10 10 0 1
- t345 b 4 INT 9 10 10 0 1
- t345 c 4 INT 9 10 10 0 1
- t345 d 4 INT 9 10 10 0 1
- t345 e 4 INT 9 10 10 0 1
- t346 a 4 INT 9 10 10 0 1
- t346 b 4 INT 9 10 10 0 1
- t346 c 4 INT 9 10 10 0 1
- t346 d 4 INT 9 10 10 0 1
- t346 e 4 INT 9 10 10 0 1
- t347 a 4 INT 9 10 10 0 1
- t347 b 4 INT 9 10 10 0 1
- t347 c 4 INT 9 10 10 0 1
- t347 d 4 INT 9 10 10 0 1
- t347 e 4 INT 9 10 10 0 1
- t348 a 4 INT 9 10 10 0 1
- t348 b 4 INT 9 10 10 0 1
- t348 c 4 INT 9 10 10 0 1
- t348 d 4 INT 9 10 10 0 1
- t348 e 4 INT 9 10 10 0 1
- t349 a 4 INT 9 10 10 0 1
- t349 b 4 INT 9 10 10 0 1
- t349 c 4 INT 9 10 10 0 1
- t349 d 4 INT 9 10 10 0 1
- t349 e 4 INT 9 10 10 0 1
- t350 a 4 INT 9 10 10 0 1
- t350 b 4 INT 9 10 10 0 1
- t350 c 4 INT 9 10 10 0 1
- t350 d 4 INT 9 10 10 0 1
- t350 e 4 INT 9 10 10 0 1
- t351 a 4 INT 9 10 10 0 1
- t351 b 4 INT 9 10 10 0 1
- t351 c 4 INT 9 10 10 0 1
- t351 d 4 INT 9 10 10 0 1
- t351 e 4 INT 9 10 10 0 1
- t352 a 4 INT 9 10 10 0 1
- t352 b 4 INT 9 10 10 0 1
- t352 c 4 INT 9 10 10 0 1
- t352 d 4 INT 9 10 10 0 1
- t352 e 4 INT 9 10 10 0 1
- t353 a 4 INT 9 10 10 0 1
- t353 b 4 INT 9 10 10 0 1
- t353 c 4 INT 9 10 10 0 1
- t353 d 4 INT 9 10 10 0 1
- t353 e 4 INT 9 10 10 0 1
- t354 a 4 INT 9 10 10 0 1
- t354 b 4 INT 9 10 10 0 1
- t354 c 4 INT 9 10 10 0 1
- t354 d 4 INT 9 10 10 0 1
- t354 e 4 INT 9 10 10 0 1
- t355 a 4 INT 9 10 10 0 1
- t355 b 4 INT 9 10 10 0 1
- t355 c 4 INT 9 10 10 0 1
- t355 d 4 INT 9 10 10 0 1
- t355 e 4 INT 9 10 10 0 1
- t356 a 4 INT 9 10 10 0 1
- t356 b 4 INT 9 10 10 0 1
- t356 c 4 INT 9 10 10 0 1
- t356 d 4 INT 9 10 10 0 1
- t356 e 4 INT 9 10 10 0 1
- t357 a 4 INT 9 10 10 0 1
- t357 b 4 INT 9 10 10 0 1
- t357 c 4 INT 9 10 10 0 1
- t357 d 4 INT 9 10 10 0 1
- t357 e 4 INT 9 10 10 0 1
- t358 a 4 INT 9 10 10 0 1
- t358 b 4 INT 9 10 10 0 1
- t358 c 4 INT 9 10 10 0 1
- t358 d 4 INT 9 10 10 0 1
- t358 e 4 INT 9 10 10 0 1
- t359 a 4 INT 9 10 10 0 1
- t359 b 4 INT 9 10 10 0 1
- t359 c 4 INT 9 10 10 0 1
- t359 d 4 INT 9 10 10 0 1
- t359 e 4 INT 9 10 10 0 1
- t360 a 4 INT 9 10 10 0 1
- t360 b 4 INT 9 10 10 0 1
- t360 c 4 INT 9 10 10 0 1
- t360 d 4 INT 9 10 10 0 1
- t360 e 4 INT 9 10 10 0 1
- t361 a 4 INT 9 10 10 0 1
- t361 b 4 INT 9 10 10 0 1
- t361 c 4 INT 9 10 10 0 1
- t361 d 4 INT 9 10 10 0 1
- t361 e 4 INT 9 10 10 0 1
- t362 a 4 INT 9 10 10 0 1
- t362 b 4 INT 9 10 10 0 1
- t362 c 4 INT 9 10 10 0 1
- t362 d 4 INT 9 10 10 0 1
- t362 e 4 INT 9 10 10 0 1
- t363 a 4 INT 9 10 10 0 1
- t363 b 4 INT 9 10 10 0 1
- t363 c 4 INT 9 10 10 0 1
- t363 d 4 INT 9 10 10 0 1
- t363 e 4 INT 9 10 10 0 1
- t364 a 4 INT 9 10 10 0 1
- t364 b 4 INT 9 10 10 0 1
- t364 c 4 INT 9 10 10 0 1
- t364 d 4 INT 9 10 10 0 1
- t364 e 4 INT 9 10 10 0 1
- t365 a 4 INT 9 10 10 0 1
- t365 b 4 INT 9 10 10 0 1
- t365 c 4 INT 9 10 10 0 1
- t365 d 4 INT 9 10 10 0 1
- t365 e 4 INT 9 10 10 0 1
- t366 a 4 INT 9 10 10 0 1
- t366 b 4 INT 9 10 10 0 1
- t366 c 4 INT 9 10 10 0 1
- t366 d 4 INT 9 10 10 0 1
- t366 e 4 INT 9 10 10 0 1
- t367 a 4 INT 9 10 10 0 1
- t367 b 4 INT 9 10 10 0 1
- t367 c 4 INT 9 10 10 0 1
- t367 d 4 INT 9 10 10 0 1
- t367 e 4 INT 9 10 10 0 1
- t368 a 4 INT 9 10 10 0 1
- t368 b 4 INT 9 10 10 0 1
- t368 c 4 INT 9 10 10 0 1
- t368 d 4 INT 9 10 10 0 1
- t368 e 4 INT 9 10 10 0 1
- t369 a 4 INT 9 10 10 0 1
- t369 b 4 INT 9 10 10 0 1
- t369 c 4 INT 9 10 10 0 1
- t369 d 4 INT 9 10 10 0 1
- t369 e 4 INT 9 10 10 0 1
- t370 a 4 INT 9 10 10 0 1
- t370 b 4 INT 9 10 10 0 1
- t370 c 4 INT 9 10 10 0 1
- t370 d 4 INT 9 10 10 0 1
- t370 e 4 INT 9 10 10 0 1
- t371 a 4 INT 9 10 10 0 1
- t371 b 4 INT 9 10 10 0 1
- t371 c 4 INT 9 10 10 0 1
- t371 d 4 INT 9 10 10 0 1
- t371 e 4 INT 9 10 10 0 1
- t372 a 4 INT 9 10 10 0 1
- t372 b 4 INT 9 10 10 0 1
- t372 c 4 INT 9 10 10 0 1
- t372 d 4 INT 9 10 10 0 1
- t372 e 4 INT 9 10 10 0 1
- t373 a 4 INT 9 10 10 0 1
- t373 b 4 INT 9 10 10 0 1
- t373 c 4 INT 9 10 10 0 1
- t373 d 4 INT 9 10 10 0 1
- t373 e 4 INT 9 10 10 0 1
- t374 a 4 INT 9 10 10 0 1
- t374 b 4 INT 9 10 10 0 1
- t374 c 4 INT 9 10 10 0 1
- t374 d 4 INT 9 10 10 0 1
- t374 e 4 INT 9 10 10 0 1
- t375 a 4 INT 9 10 10 0 1
- t375 b 4 INT 9 10 10 0 1
- t375 c 4 INT 9 10 10 0 1
- t375 d 4 INT 9 10 10 0 1
- t375 e 4 INT 9 10 10 0 1
- t376 a 4 INT 9 10 10 0 1
- t376 b 4 INT 9 10 10 0 1
- t376 c 4 INT 9 10 10 0 1
- t376 d 4 INT 9 10 10 0 1
- t376 e 4 INT 9 10 10 0 1
- t377 a 4 INT 9 10 10 0 1
- t377 b 4 INT 9 10 10 0 1
- t377 c 4 INT 9 10 10 0 1
- t377 d 4 INT 9 10 10 0 1
- t377 e 4 INT 9 10 10 0 1
- t378 a 4 INT 9 10 10 0 1
- t378 b 4 INT 9 10 10 0 1
- t378 c 4 INT 9 10 10 0 1
- t378 d 4 INT 9 10 10 0 1
- t378 e 4 INT 9 10 10 0 1
- t379 a 4 INT 9 10 10 0 1
- t379 b 4 INT 9 10 10 0 1
- t379 c 4 INT 9 10 10 0 1
- t379 d 4 INT 9 10 10 0 1
- t379 e 4 INT 9 10 10 0 1
- t380 a 4 INT 9 10 10 0 1
- t380 b 4 INT 9 10 10 0 1
- t380 c 4 INT 9 10 10 0 1
- t380 d 4 INT 9 10 10 0 1
- t380 e 4 INT 9 10 10 0 1
- t381 a 4 INT 9 10 10 0 1
- t381 b 4 INT 9 10 10 0 1
- t381 c 4 INT 9 10 10 0 1
- t381 d 4 INT 9 10 10 0 1
- t381 e 4 INT 9 10 10 0 1
- t382 a 4 INT 9 10 10 0 1
- t382 b 4 INT 9 10 10 0 1
- t382 c 4 INT 9 10 10 0 1
- t382 d 4 INT 9 10 10 0 1
- t382 e 4 INT 9 10 10 0 1
- t383 a 4 INT 9 10 10 0 1
- t383 b 4 INT 9 10 10 0 1
- t383 c 4 INT 9 10 10 0 1
- t383 d 4 INT 9 10 10 0 1
- t383 e 4 INT 9 10 10 0 1
- t384 a 4 INT 9 10 10 0 1
- t384 b 4 INT 9 10 10 0 1
- t384 c 4 INT 9 10 10 0 1
- t384 d 4 INT 9 10 10 0 1
- t384 e 4 INT 9 10 10 0 1
- t385 a 4 INT 9 10 10 0 1
- t385 b 4 INT 9 10 10 0 1
- t385 c 4 INT 9 10 10 0 1
- t385 d 4 INT 9 10 10 0 1
- t385 e 4 INT 9 10 10 0 1
- t386 a 4 INT 9 10 10 0 1
- t386 b 4 INT 9 10 10 0 1
- t386 c 4 INT 9 10 10 0 1
- t386 d 4 INT 9 10 10 0 1
- t386 e 4 INT 9 10 10 0 1
- t387 a 4 INT 9 10 10 0 1
- t387 b 4 INT 9 10 10 0 1
- t387 c 4 INT 9 10 10 0 1
- t387 d 4 INT 9 10 10 0 1
- t387 e 4 INT 9 10 10 0 1
- t388 a 4 INT 9 10 10 0 1
- t388 b 4 INT 9 10 10 0 1
- t388 c 4 INT 9 10 10 0 1
- t388 d 4 INT 9 10 10 0 1
- t388 e 4 INT 9 10 10 0 1
- t389 a 4 INT 9 10 10 0 1
- t389 b 4 INT 9 10 10 0 1
- t389 c 4 INT 9 10 10 0 1
- t389 d 4 INT 9 10 10 0 1
- t389 e 4 INT 9 10 10 0 1
- t390 a 4 INT 9 10 10 0 1
- t390 b 4 INT 9 10 10 0 1
- t390 c 4 INT 9 10 10 0 1
- t390 d 4 INT 9 10 10 0 1
- t390 e 4 INT 9 10 10 0 1
- t391 a 4 INT 9 10 10 0 1
- t391 b 4 INT 9 10 10 0 1
- t391 c 4 INT 9 10 10 0 1
- t391 d 4 INT 9 10 10 0 1
- t391 e 4 INT 9 10 10 0 1
- t392 a 4 INT 9 10 10 0 1
- t392 b 4 INT 9 10 10 0 1
- t392 c 4 INT 9 10 10 0 1
- t392 d 4 INT 9 10 10 0 1
- t392 e 4 INT 9 10 10 0 1
- t393 a 4 INT 9 10 10 0 1
- t393 b 4 INT 9 10 10 0 1
- t393 c 4 INT 9 10 10 0 1
- t393 d 4 INT 9 10 10 0 1
- t393 e 4 INT 9 10 10 0 1
- t394 a 4 INT 9 10 10 0 1
- t394 b 4 INT 9 10 10 0 1
- t394 c 4 INT 9 10 10 0 1
- t394 d 4 INT 9 10 10 0 1
- t394 e 4 INT 9 10 10 0 1
- t395 a 4 INT 9 10 10 0 1
- t395 b 4 INT 9 10 10 0 1
- t395 c 4 INT 9 10 10 0 1
- t395 d 4 INT 9 10 10 0 1
- t395 e 4 INT 9 10 10 0 1
- t396 a 4 INT 9 10 10 0 1
- t396 b 4 INT 9 10 10 0 1
- t396 c 4 INT 9 10 10 0 1
- t396 d 4 INT 9 10 10 0 1
- t396 e 4 INT 9 10 10 0 1
- t397 a 4 INT 9 10 10 0 1
- t397 b 4 INT 9 10 10 0 1
- t397 c 4 INT 9 10 10 0 1
- t397 d 4 INT 9 10 10 0 1
- t397 e 4 INT 9 10 10 0 1
- t398 a 4 INT 9 10 10 0 1
- t398 b 4 INT 9 10 10 0 1
- t398 c 4 INT 9 10 10 0 1
- t398 d 4 INT 9 10 10 0 1
- t398 e 4 INT 9 10 10 0 1
- t399 a 4 INT 9 10 10 0 1
- t399 b 4 INT 9 10 10 0 1
- t399 c 4 INT 9 10 10 0 1
- t399 d 4 INT 9 10 10 0 1
- t399 e 4 INT 9 10 10 0 1
+ t000 a 4 INT 9 10 10 0 1 NULL
+ t000 b 4 INT 9 10 10 0 1 NULL
+ t000 c 4 INT 9 10 10 0 1 NULL
+ t000 d 4 INT 9 10 10 0 1 NULL
+ t000 e 4 INT 9 10 10 0 1 NULL
+ t001 a 4 INT 9 10 10 0 1 NULL
+ t001 b 4 INT 9 10 10 0 1 NULL
+ t001 c 4 INT 9 10 10 0 1 NULL
+ t001 d 4 INT 9 10 10 0 1 NULL
+ t001 e 4 INT 9 10 10 0 1 NULL
+ t002 a 4 INT 9 10 10 0 1 NULL
+ t002 b 4 INT 9 10 10 0 1 NULL
+ t002 c 4 INT 9 10 10 0 1 NULL
+ t002 d 4 INT 9 10 10 0 1 NULL
+ t002 e 4 INT 9 10 10 0 1 NULL
+ t003 a 4 INT 9 10 10 0 1 NULL
+ t003 b 4 INT 9 10 10 0 1 NULL
+ t003 c 4 INT 9 10 10 0 1 NULL
+ t003 d 4 INT 9 10 10 0 1 NULL
+ t003 e 4 INT 9 10 10 0 1 NULL
+ t004 a 4 INT 9 10 10 0 1 NULL
+ t004 b 4 INT 9 10 10 0 1 NULL
+ t004 c 4 INT 9 10 10 0 1 NULL
+ t004 d 4 INT 9 10 10 0 1 NULL
+ t004 e 4 INT 9 10 10 0 1 NULL
+ t005 a 4 INT 9 10 10 0 1 NULL
+ t005 b 4 INT 9 10 10 0 1 NULL
+ t005 c 4 INT 9 10 10 0 1 NULL
+ t005 d 4 INT 9 10 10 0 1 NULL
+ t005 e 4 INT 9 10 10 0 1 NULL
+ t006 a 4 INT 9 10 10 0 1 NULL
+ t006 b 4 INT 9 10 10 0 1 NULL
+ t006 c 4 INT 9 10 10 0 1 NULL
+ t006 d 4 INT 9 10 10 0 1 NULL
+ t006 e 4 INT 9 10 10 0 1 NULL
+ t007 a 4 INT 9 10 10 0 1 NULL
+ t007 b 4 INT 9 10 10 0 1 NULL
+ t007 c 4 INT 9 10 10 0 1 NULL
+ t007 d 4 INT 9 10 10 0 1 NULL
+ t007 e 4 INT 9 10 10 0 1 NULL
+ t008 a 4 INT 9 10 10 0 1 NULL
+ t008 b 4 INT 9 10 10 0 1 NULL
+ t008 c 4 INT 9 10 10 0 1 NULL
+ t008 d 4 INT 9 10 10 0 1 NULL
+ t008 e 4 INT 9 10 10 0 1 NULL
+ t009 a 4 INT 9 10 10 0 1 NULL
+ t009 b 4 INT 9 10 10 0 1 NULL
+ t009 c 4 INT 9 10 10 0 1 NULL
+ t009 d 4 INT 9 10 10 0 1 NULL
+ t009 e 4 INT 9 10 10 0 1 NULL
+ t010 a 4 INT 9 10 10 0 1 NULL
+ t010 b 4 INT 9 10 10 0 1 NULL
+ t010 c 4 INT 9 10 10 0 1 NULL
+ t010 d 4 INT 9 10 10 0 1 NULL
+ t010 e 4 INT 9 10 10 0 1 NULL
+ t011 a 4 INT 9 10 10 0 1 NULL
+ t011 b 4 INT 9 10 10 0 1 NULL
+ t011 c 4 INT 9 10 10 0 1 NULL
+ t011 d 4 INT 9 10 10 0 1 NULL
+ t011 e 4 INT 9 10 10 0 1 NULL
+ t012 a 4 INT 9 10 10 0 1 NULL
+ t012 b 4 INT 9 10 10 0 1 NULL
+ t012 c 4 INT 9 10 10 0 1 NULL
+ t012 d 4 INT 9 10 10 0 1 NULL
+ t012 e 4 INT 9 10 10 0 1 NULL
+ t013 a 4 INT 9 10 10 0 1 NULL
+ t013 b 4 INT 9 10 10 0 1 NULL
+ t013 c 4 INT 9 10 10 0 1 NULL
+ t013 d 4 INT 9 10 10 0 1 NULL
+ t013 e 4 INT 9 10 10 0 1 NULL
+ t014 a 4 INT 9 10 10 0 1 NULL
+ t014 b 4 INT 9 10 10 0 1 NULL
+ t014 c 4 INT 9 10 10 0 1 NULL
+ t014 d 4 INT 9 10 10 0 1 NULL
+ t014 e 4 INT 9 10 10 0 1 NULL
+ t015 a 4 INT 9 10 10 0 1 NULL
+ t015 b 4 INT 9 10 10 0 1 NULL
+ t015 c 4 INT 9 10 10 0 1 NULL
+ t015 d 4 INT 9 10 10 0 1 NULL
+ t015 e 4 INT 9 10 10 0 1 NULL
+ t016 a 4 INT 9 10 10 0 1 NULL
+ t016 b 4 INT 9 10 10 0 1 NULL
+ t016 c 4 INT 9 10 10 0 1 NULL
+ t016 d 4 INT 9 10 10 0 1 NULL
+ t016 e 4 INT 9 10 10 0 1 NULL
+ t017 a 4 INT 9 10 10 0 1 NULL
+ t017 b 4 INT 9 10 10 0 1 NULL
+ t017 c 4 INT 9 10 10 0 1 NULL
+ t017 d 4 INT 9 10 10 0 1 NULL
+ t017 e 4 INT 9 10 10 0 1 NULL
+ t018 a 4 INT 9 10 10 0 1 NULL
+ t018 b 4 INT 9 10 10 0 1 NULL
+ t018 c 4 INT 9 10 10 0 1 NULL
+ t018 d 4 INT 9 10 10 0 1 NULL
+ t018 e 4 INT 9 10 10 0 1 NULL
+ t019 a 4 INT 9 10 10 0 1 NULL
+ t019 b 4 INT 9 10 10 0 1 NULL
+ t019 c 4 INT 9 10 10 0 1 NULL
+ t019 d 4 INT 9 10 10 0 1 NULL
+ t019 e 4 INT 9 10 10 0 1 NULL
+ t020 a 4 INT 9 10 10 0 1 NULL
+ t020 b 4 INT 9 10 10 0 1 NULL
+ t020 c 4 INT 9 10 10 0 1 NULL
+ t020 d 4 INT 9 10 10 0 1 NULL
+ t020 e 4 INT 9 10 10 0 1 NULL
+ t021 a 4 INT 9 10 10 0 1 NULL
+ t021 b 4 INT 9 10 10 0 1 NULL
+ t021 c 4 INT 9 10 10 0 1 NULL
+ t021 d 4 INT 9 10 10 0 1 NULL
+ t021 e 4 INT 9 10 10 0 1 NULL
+ t022 a 4 INT 9 10 10 0 1 NULL
+ t022 b 4 INT 9 10 10 0 1 NULL
+ t022 c 4 INT 9 10 10 0 1 NULL
+ t022 d 4 INT 9 10 10 0 1 NULL
+ t022 e 4 INT 9 10 10 0 1 NULL
+ t023 a 4 INT 9 10 10 0 1 NULL
+ t023 b 4 INT 9 10 10 0 1 NULL
+ t023 c 4 INT 9 10 10 0 1 NULL
+ t023 d 4 INT 9 10 10 0 1 NULL
+ t023 e 4 INT 9 10 10 0 1 NULL
+ t024 a 4 INT 9 10 10 0 1 NULL
+ t024 b 4 INT 9 10 10 0 1 NULL
+ t024 c 4 INT 9 10 10 0 1 NULL
+ t024 d 4 INT 9 10 10 0 1 NULL
+ t024 e 4 INT 9 10 10 0 1 NULL
+ t025 a 4 INT 9 10 10 0 1 NULL
+ t025 b 4 INT 9 10 10 0 1 NULL
+ t025 c 4 INT 9 10 10 0 1 NULL
+ t025 d 4 INT 9 10 10 0 1 NULL
+ t025 e 4 INT 9 10 10 0 1 NULL
+ t026 a 4 INT 9 10 10 0 1 NULL
+ t026 b 4 INT 9 10 10 0 1 NULL
+ t026 c 4 INT 9 10 10 0 1 NULL
+ t026 d 4 INT 9 10 10 0 1 NULL
+ t026 e 4 INT 9 10 10 0 1 NULL
+ t027 a 4 INT 9 10 10 0 1 NULL
+ t027 b 4 INT 9 10 10 0 1 NULL
+ t027 c 4 INT 9 10 10 0 1 NULL
+ t027 d 4 INT 9 10 10 0 1 NULL
+ t027 e 4 INT 9 10 10 0 1 NULL
+ t028 a 4 INT 9 10 10 0 1 NULL
+ t028 b 4 INT 9 10 10 0 1 NULL
+ t028 c 4 INT 9 10 10 0 1 NULL
+ t028 d 4 INT 9 10 10 0 1 NULL
+ t028 e 4 INT 9 10 10 0 1 NULL
+ t029 a 4 INT 9 10 10 0 1 NULL
+ t029 b 4 INT 9 10 10 0 1 NULL
+ t029 c 4 INT 9 10 10 0 1 NULL
+ t029 d 4 INT 9 10 10 0 1 NULL
+ t029 e 4 INT 9 10 10 0 1 NULL
+ t030 a 4 INT 9 10 10 0 1 NULL
+ t030 b 4 INT 9 10 10 0 1 NULL
+ t030 c 4 INT 9 10 10 0 1 NULL
+ t030 d 4 INT 9 10 10 0 1 NULL
+ t030 e 4 INT 9 10 10 0 1 NULL
+ t031 a 4 INT 9 10 10 0 1 NULL
+ t031 b 4 INT 9 10 10 0 1 NULL
+ t031 c 4 INT 9 10 10 0 1 NULL
+ t031 d 4 INT 9 10 10 0 1 NULL
+ t031 e 4 INT 9 10 10 0 1 NULL
+ t032 a 4 INT 9 10 10 0 1 NULL
+ t032 b 4 INT 9 10 10 0 1 NULL
+ t032 c 4 INT 9 10 10 0 1 NULL
+ t032 d 4 INT 9 10 10 0 1 NULL
+ t032 e 4 INT 9 10 10 0 1 NULL
+ t033 a 4 INT 9 10 10 0 1 NULL
+ t033 b 4 INT 9 10 10 0 1 NULL
+ t033 c 4 INT 9 10 10 0 1 NULL
+ t033 d 4 INT 9 10 10 0 1 NULL
+ t033 e 4 INT 9 10 10 0 1 NULL
+ t034 a 4 INT 9 10 10 0 1 NULL
+ t034 b 4 INT 9 10 10 0 1 NULL
+ t034 c 4 INT 9 10 10 0 1 NULL
+ t034 d 4 INT 9 10 10 0 1 NULL
+ t034 e 4 INT 9 10 10 0 1 NULL
+ t035 a 4 INT 9 10 10 0 1 NULL
+ t035 b 4 INT 9 10 10 0 1 NULL
+ t035 c 4 INT 9 10 10 0 1 NULL
+ t035 d 4 INT 9 10 10 0 1 NULL
+ t035 e 4 INT 9 10 10 0 1 NULL
+ t036 a 4 INT 9 10 10 0 1 NULL
+ t036 b 4 INT 9 10 10 0 1 NULL
+ t036 c 4 INT 9 10 10 0 1 NULL
+ t036 d 4 INT 9 10 10 0 1 NULL
+ t036 e 4 INT 9 10 10 0 1 NULL
+ t037 a 4 INT 9 10 10 0 1 NULL
+ t037 b 4 INT 9 10 10 0 1 NULL
+ t037 c 4 INT 9 10 10 0 1 NULL
+ t037 d 4 INT 9 10 10 0 1 NULL
+ t037 e 4 INT 9 10 10 0 1 NULL
+ t038 a 4 INT 9 10 10 0 1 NULL
+ t038 b 4 INT 9 10 10 0 1 NULL
+ t038 c 4 INT 9 10 10 0 1 NULL
+ t038 d 4 INT 9 10 10 0 1 NULL
+ t038 e 4 INT 9 10 10 0 1 NULL
+ t039 a 4 INT 9 10 10 0 1 NULL
+ t039 b 4 INT 9 10 10 0 1 NULL
+ t039 c 4 INT 9 10 10 0 1 NULL
+ t039 d 4 INT 9 10 10 0 1 NULL
+ t039 e 4 INT 9 10 10 0 1 NULL
+ t040 a 4 INT 9 10 10 0 1 NULL
+ t040 b 4 INT 9 10 10 0 1 NULL
+ t040 c 4 INT 9 10 10 0 1 NULL
+ t040 d 4 INT 9 10 10 0 1 NULL
+ t040 e 4 INT 9 10 10 0 1 NULL
+ t041 a 4 INT 9 10 10 0 1 NULL
+ t041 b 4 INT 9 10 10 0 1 NULL
+ t041 c 4 INT 9 10 10 0 1 NULL
+ t041 d 4 INT 9 10 10 0 1 NULL
+ t041 e 4 INT 9 10 10 0 1 NULL
+ t042 a 4 INT 9 10 10 0 1 NULL
+ t042 b 4 INT 9 10 10 0 1 NULL
+ t042 c 4 INT 9 10 10 0 1 NULL
+ t042 d 4 INT 9 10 10 0 1 NULL
+ t042 e 4 INT 9 10 10 0 1 NULL
+ t043 a 4 INT 9 10 10 0 1 NULL
+ t043 b 4 INT 9 10 10 0 1 NULL
+ t043 c 4 INT 9 10 10 0 1 NULL
+ t043 d 4 INT 9 10 10 0 1 NULL
+ t043 e 4 INT 9 10 10 0 1 NULL
+ t044 a 4 INT 9 10 10 0 1 NULL
+ t044 b 4 INT 9 10 10 0 1 NULL
+ t044 c 4 INT 9 10 10 0 1 NULL
+ t044 d 4 INT 9 10 10 0 1 NULL
+ t044 e 4 INT 9 10 10 0 1 NULL
+ t045 a 4 INT 9 10 10 0 1 NULL
+ t045 b 4 INT 9 10 10 0 1 NULL
+ t045 c 4 INT 9 10 10 0 1 NULL
+ t045 d 4 INT 9 10 10 0 1 NULL
+ t045 e 4 INT 9 10 10 0 1 NULL
+ t046 a 4 INT 9 10 10 0 1 NULL
+ t046 b 4 INT 9 10 10 0 1 NULL
+ t046 c 4 INT 9 10 10 0 1 NULL
+ t046 d 4 INT 9 10 10 0 1 NULL
+ t046 e 4 INT 9 10 10 0 1 NULL
+ t047 a 4 INT 9 10 10 0 1 NULL
+ t047 b 4 INT 9 10 10 0 1 NULL
+ t047 c 4 INT 9 10 10 0 1 NULL
+ t047 d 4 INT 9 10 10 0 1 NULL
+ t047 e 4 INT 9 10 10 0 1 NULL
+ t048 a 4 INT 9 10 10 0 1 NULL
+ t048 b 4 INT 9 10 10 0 1 NULL
+ t048 c 4 INT 9 10 10 0 1 NULL
+ t048 d 4 INT 9 10 10 0 1 NULL
+ t048 e 4 INT 9 10 10 0 1 NULL
+ t049 a 4 INT 9 10 10 0 1 NULL
+ t049 b 4 INT 9 10 10 0 1 NULL
+ t049 c 4 INT 9 10 10 0 1 NULL
+ t049 d 4 INT 9 10 10 0 1 NULL
+ t049 e 4 INT 9 10 10 0 1 NULL
+ t050 a 4 INT 9 10 10 0 1 NULL
+ t050 b 4 INT 9 10 10 0 1 NULL
+ t050 c 4 INT 9 10 10 0 1 NULL
+ t050 d 4 INT 9 10 10 0 1 NULL
+ t050 e 4 INT 9 10 10 0 1 NULL
+ t051 a 4 INT 9 10 10 0 1 NULL
+ t051 b 4 INT 9 10 10 0 1 NULL
+ t051 c 4 INT 9 10 10 0 1 NULL
+ t051 d 4 INT 9 10 10 0 1 NULL
+ t051 e 4 INT 9 10 10 0 1 NULL
+ t052 a 4 INT 9 10 10 0 1 NULL
+ t052 b 4 INT 9 10 10 0 1 NULL
+ t052 c 4 INT 9 10 10 0 1 NULL
+ t052 d 4 INT 9 10 10 0 1 NULL
+ t052 e 4 INT 9 10 10 0 1 NULL
+ t053 a 4 INT 9 10 10 0 1 NULL
+ t053 b 4 INT 9 10 10 0 1 NULL
+ t053 c 4 INT 9 10 10 0 1 NULL
+ t053 d 4 INT 9 10 10 0 1 NULL
+ t053 e 4 INT 9 10 10 0 1 NULL
+ t054 a 4 INT 9 10 10 0 1 NULL
+ t054 b 4 INT 9 10 10 0 1 NULL
+ t054 c 4 INT 9 10 10 0 1 NULL
+ t054 d 4 INT 9 10 10 0 1 NULL
+ t054 e 4 INT 9 10 10 0 1 NULL
+ t055 a 4 INT 9 10 10 0 1 NULL
+ t055 b 4 INT 9 10 10 0 1 NULL
+ t055 c 4 INT 9 10 10 0 1 NULL
+ t055 d 4 INT 9 10 10 0 1 NULL
+ t055 e 4 INT 9 10 10 0 1 NULL
+ t056 a 4 INT 9 10 10 0 1 NULL
+ t056 b 4 INT 9 10 10 0 1 NULL
+ t056 c 4 INT 9 10 10 0 1 NULL
+ t056 d 4 INT 9 10 10 0 1 NULL
+ t056 e 4 INT 9 10 10 0 1 NULL
+ t057 a 4 INT 9 10 10 0 1 NULL
+ t057 b 4 INT 9 10 10 0 1 NULL
+ t057 c 4 INT 9 10 10 0 1 NULL
+ t057 d 4 INT 9 10 10 0 1 NULL
+ t057 e 4 INT 9 10 10 0 1 NULL
+ t058 a 4 INT 9 10 10 0 1 NULL
+ t058 b 4 INT 9 10 10 0 1 NULL
+ t058 c 4 INT 9 10 10 0 1 NULL
+ t058 d 4 INT 9 10 10 0 1 NULL
+ t058 e 4 INT 9 10 10 0 1 NULL
+ t059 a 4 INT 9 10 10 0 1 NULL
+ t059 b 4 INT 9 10 10 0 1 NULL
+ t059 c 4 INT 9 10 10 0 1 NULL
+ t059 d 4 INT 9 10 10 0 1 NULL
+ t059 e 4 INT 9 10 10 0 1 NULL
+ t060 a 4 INT 9 10 10 0 1 NULL
+ t060 b 4 INT 9 10 10 0 1 NULL
+ t060 c 4 INT 9 10 10 0 1 NULL
+ t060 d 4 INT 9 10 10 0 1 NULL
+ t060 e 4 INT 9 10 10 0 1 NULL
+ t061 a 4 INT 9 10 10 0 1 NULL
+ t061 b 4 INT 9 10 10 0 1 NULL
+ t061 c 4 INT 9 10 10 0 1 NULL
+ t061 d 4 INT 9 10 10 0 1 NULL
+ t061 e 4 INT 9 10 10 0 1 NULL
+ t062 a 4 INT 9 10 10 0 1 NULL
+ t062 b 4 INT 9 10 10 0 1 NULL
+ t062 c 4 INT 9 10 10 0 1 NULL
+ t062 d 4 INT 9 10 10 0 1 NULL
+ t062 e 4 INT 9 10 10 0 1 NULL
+ t063 a 4 INT 9 10 10 0 1 NULL
+ t063 b 4 INT 9 10 10 0 1 NULL
+ t063 c 4 INT 9 10 10 0 1 NULL
+ t063 d 4 INT 9 10 10 0 1 NULL
+ t063 e 4 INT 9 10 10 0 1 NULL
+ t064 a 4 INT 9 10 10 0 1 NULL
+ t064 b 4 INT 9 10 10 0 1 NULL
+ t064 c 4 INT 9 10 10 0 1 NULL
+ t064 d 4 INT 9 10 10 0 1 NULL
+ t064 e 4 INT 9 10 10 0 1 NULL
+ t065 a 4 INT 9 10 10 0 1 NULL
+ t065 b 4 INT 9 10 10 0 1 NULL
+ t065 c 4 INT 9 10 10 0 1 NULL
+ t065 d 4 INT 9 10 10 0 1 NULL
+ t065 e 4 INT 9 10 10 0 1 NULL
+ t066 a 4 INT 9 10 10 0 1 NULL
+ t066 b 4 INT 9 10 10 0 1 NULL
+ t066 c 4 INT 9 10 10 0 1 NULL
+ t066 d 4 INT 9 10 10 0 1 NULL
+ t066 e 4 INT 9 10 10 0 1 NULL
+ t067 a 4 INT 9 10 10 0 1 NULL
+ t067 b 4 INT 9 10 10 0 1 NULL
+ t067 c 4 INT 9 10 10 0 1 NULL
+ t067 d 4 INT 9 10 10 0 1 NULL
+ t067 e 4 INT 9 10 10 0 1 NULL
+ t068 a 4 INT 9 10 10 0 1 NULL
+ t068 b 4 INT 9 10 10 0 1 NULL
+ t068 c 4 INT 9 10 10 0 1 NULL
+ t068 d 4 INT 9 10 10 0 1 NULL
+ t068 e 4 INT 9 10 10 0 1 NULL
+ t069 a 4 INT 9 10 10 0 1 NULL
+ t069 b 4 INT 9 10 10 0 1 NULL
+ t069 c 4 INT 9 10 10 0 1 NULL
+ t069 d 4 INT 9 10 10 0 1 NULL
+ t069 e 4 INT 9 10 10 0 1 NULL
+ t070 a 4 INT 9 10 10 0 1 NULL
+ t070 b 4 INT 9 10 10 0 1 NULL
+ t070 c 4 INT 9 10 10 0 1 NULL
+ t070 d 4 INT 9 10 10 0 1 NULL
+ t070 e 4 INT 9 10 10 0 1 NULL
+ t071 a 4 INT 9 10 10 0 1 NULL
+ t071 b 4 INT 9 10 10 0 1 NULL
+ t071 c 4 INT 9 10 10 0 1 NULL
+ t071 d 4 INT 9 10 10 0 1 NULL
+ t071 e 4 INT 9 10 10 0 1 NULL
+ t072 a 4 INT 9 10 10 0 1 NULL
+ t072 b 4 INT 9 10 10 0 1 NULL
+ t072 c 4 INT 9 10 10 0 1 NULL
+ t072 d 4 INT 9 10 10 0 1 NULL
+ t072 e 4 INT 9 10 10 0 1 NULL
+ t073 a 4 INT 9 10 10 0 1 NULL
+ t073 b 4 INT 9 10 10 0 1 NULL
+ t073 c 4 INT 9 10 10 0 1 NULL
+ t073 d 4 INT 9 10 10 0 1 NULL
+ t073 e 4 INT 9 10 10 0 1 NULL
+ t074 a 4 INT 9 10 10 0 1 NULL
+ t074 b 4 INT 9 10 10 0 1 NULL
+ t074 c 4 INT 9 10 10 0 1 NULL
+ t074 d 4 INT 9 10 10 0 1 NULL
+ t074 e 4 INT 9 10 10 0 1 NULL
+ t075 a 4 INT 9 10 10 0 1 NULL
+ t075 b 4 INT 9 10 10 0 1 NULL
+ t075 c 4 INT 9 10 10 0 1 NULL
+ t075 d 4 INT 9 10 10 0 1 NULL
+ t075 e 4 INT 9 10 10 0 1 NULL
+ t076 a 4 INT 9 10 10 0 1 NULL
+ t076 b 4 INT 9 10 10 0 1 NULL
+ t076 c 4 INT 9 10 10 0 1 NULL
+ t076 d 4 INT 9 10 10 0 1 NULL
+ t076 e 4 INT 9 10 10 0 1 NULL
+ t077 a 4 INT 9 10 10 0 1 NULL
+ t077 b 4 INT 9 10 10 0 1 NULL
+ t077 c 4 INT 9 10 10 0 1 NULL
+ t077 d 4 INT 9 10 10 0 1 NULL
+ t077 e 4 INT 9 10 10 0 1 NULL
+ t078 a 4 INT 9 10 10 0 1 NULL
+ t078 b 4 INT 9 10 10 0 1 NULL
+ t078 c 4 INT 9 10 10 0 1 NULL
+ t078 d 4 INT 9 10 10 0 1 NULL
+ t078 e 4 INT 9 10 10 0 1 NULL
+ t079 a 4 INT 9 10 10 0 1 NULL
+ t079 b 4 INT 9 10 10 0 1 NULL
+ t079 c 4 INT 9 10 10 0 1 NULL
+ t079 d 4 INT 9 10 10 0 1 NULL
+ t079 e 4 INT 9 10 10 0 1 NULL
+ t080 a 4 INT 9 10 10 0 1 NULL
+ t080 b 4 INT 9 10 10 0 1 NULL
+ t080 c 4 INT 9 10 10 0 1 NULL
+ t080 d 4 INT 9 10 10 0 1 NULL
+ t080 e 4 INT 9 10 10 0 1 NULL
+ t081 a 4 INT 9 10 10 0 1 NULL
+ t081 b 4 INT 9 10 10 0 1 NULL
+ t081 c 4 INT 9 10 10 0 1 NULL
+ t081 d 4 INT 9 10 10 0 1 NULL
+ t081 e 4 INT 9 10 10 0 1 NULL
+ t082 a 4 INT 9 10 10 0 1 NULL
+ t082 b 4 INT 9 10 10 0 1 NULL
+ t082 c 4 INT 9 10 10 0 1 NULL
+ t082 d 4 INT 9 10 10 0 1 NULL
+ t082 e 4 INT 9 10 10 0 1 NULL
+ t083 a 4 INT 9 10 10 0 1 NULL
+ t083 b 4 INT 9 10 10 0 1 NULL
+ t083 c 4 INT 9 10 10 0 1 NULL
+ t083 d 4 INT 9 10 10 0 1 NULL
+ t083 e 4 INT 9 10 10 0 1 NULL
+ t084 a 4 INT 9 10 10 0 1 NULL
+ t084 b 4 INT 9 10 10 0 1 NULL
+ t084 c 4 INT 9 10 10 0 1 NULL
+ t084 d 4 INT 9 10 10 0 1 NULL
+ t084 e 4 INT 9 10 10 0 1 NULL
+ t085 a 4 INT 9 10 10 0 1 NULL
+ t085 b 4 INT 9 10 10 0 1 NULL
+ t085 c 4 INT 9 10 10 0 1 NULL
+ t085 d 4 INT 9 10 10 0 1 NULL
+ t085 e 4 INT 9 10 10 0 1 NULL
+ t086 a 4 INT 9 10 10 0 1 NULL
+ t086 b 4 INT 9 10 10 0 1 NULL
+ t086 c 4 INT 9 10 10 0 1 NULL
+ t086 d 4 INT 9 10 10 0 1 NULL
+ t086 e 4 INT 9 10 10 0 1 NULL
+ t087 a 4 INT 9 10 10 0 1 NULL
+ t087 b 4 INT 9 10 10 0 1 NULL
+ t087 c 4 INT 9 10 10 0 1 NULL
+ t087 d 4 INT 9 10 10 0 1 NULL
+ t087 e 4 INT 9 10 10 0 1 NULL
+ t088 a 4 INT 9 10 10 0 1 NULL
+ t088 b 4 INT 9 10 10 0 1 NULL
+ t088 c 4 INT 9 10 10 0 1 NULL
+ t088 d 4 INT 9 10 10 0 1 NULL
+ t088 e 4 INT 9 10 10 0 1 NULL
+ t089 a 4 INT 9 10 10 0 1 NULL
+ t089 b 4 INT 9 10 10 0 1 NULL
+ t089 c 4 INT 9 10 10 0 1 NULL
+ t089 d 4 INT 9 10 10 0 1 NULL
+ t089 e 4 INT 9 10 10 0 1 NULL
+ t090 a 4 INT 9 10 10 0 1 NULL
+ t090 b 4 INT 9 10 10 0 1 NULL
+ t090 c 4 INT 9 10 10 0 1 NULL
+ t090 d 4 INT 9 10 10 0 1 NULL
+ t090 e 4 INT 9 10 10 0 1 NULL
+ t091 a 4 INT 9 10 10 0 1 NULL
+ t091 b 4 INT 9 10 10 0 1 NULL
+ t091 c 4 INT 9 10 10 0 1 NULL
+ t091 d 4 INT 9 10 10 0 1 NULL
+ t091 e 4 INT 9 10 10 0 1 NULL
+ t092 a 4 INT 9 10 10 0 1 NULL
+ t092 b 4 INT 9 10 10 0 1 NULL
+ t092 c 4 INT 9 10 10 0 1 NULL
+ t092 d 4 INT 9 10 10 0 1 NULL
+ t092 e 4 INT 9 10 10 0 1 NULL
+ t093 a 4 INT 9 10 10 0 1 NULL
+ t093 b 4 INT 9 10 10 0 1 NULL
+ t093 c 4 INT 9 10 10 0 1 NULL
+ t093 d 4 INT 9 10 10 0 1 NULL
+ t093 e 4 INT 9 10 10 0 1 NULL
+ t094 a 4 INT 9 10 10 0 1 NULL
+ t094 b 4 INT 9 10 10 0 1 NULL
+ t094 c 4 INT 9 10 10 0 1 NULL
+ t094 d 4 INT 9 10 10 0 1 NULL
+ t094 e 4 INT 9 10 10 0 1 NULL
+ t095 a 4 INT 9 10 10 0 1 NULL
+ t095 b 4 INT 9 10 10 0 1 NULL
+ t095 c 4 INT 9 10 10 0 1 NULL
+ t095 d 4 INT 9 10 10 0 1 NULL
+ t095 e 4 INT 9 10 10 0 1 NULL
+ t096 a 4 INT 9 10 10 0 1 NULL
+ t096 b 4 INT 9 10 10 0 1 NULL
+ t096 c 4 INT 9 10 10 0 1 NULL
+ t096 d 4 INT 9 10 10 0 1 NULL
+ t096 e 4 INT 9 10 10 0 1 NULL
+ t097 a 4 INT 9 10 10 0 1 NULL
+ t097 b 4 INT 9 10 10 0 1 NULL
+ t097 c 4 INT 9 10 10 0 1 NULL
+ t097 d 4 INT 9 10 10 0 1 NULL
+ t097 e 4 INT 9 10 10 0 1 NULL
+ t098 a 4 INT 9 10 10 0 1 NULL
+ t098 b 4 INT 9 10 10 0 1 NULL
+ t098 c 4 INT 9 10 10 0 1 NULL
+ t098 d 4 INT 9 10 10 0 1 NULL
+ t098 e 4 INT 9 10 10 0 1 NULL
+ t099 a 4 INT 9 10 10 0 1 NULL
+ t099 b 4 INT 9 10 10 0 1 NULL
+ t099 c 4 INT 9 10 10 0 1 NULL
+ t099 d 4 INT 9 10 10 0 1 NULL
+ t099 e 4 INT 9 10 10 0 1 NULL
+ t1 a 12 varchar(64) 64 64 10 0 1 NULL
+ t100 a 4 INT 9 10 10 0 1 NULL
+ t100 b 4 INT 9 10 10 0 1 NULL
+ t100 c 4 INT 9 10 10 0 1 NULL
+ t100 d 4 INT 9 10 10 0 1 NULL
+ t100 e 4 INT 9 10 10 0 1 NULL
+ t101 a 4 INT 9 10 10 0 1 NULL
+ t101 b 4 INT 9 10 10 0 1 NULL
+ t101 c 4 INT 9 10 10 0 1 NULL
+ t101 d 4 INT 9 10 10 0 1 NULL
+ t101 e 4 INT 9 10 10 0 1 NULL
+ t102 a 4 INT 9 10 10 0 1 NULL
+ t102 b 4 INT 9 10 10 0 1 NULL
+ t102 c 4 INT 9 10 10 0 1 NULL
+ t102 d 4 INT 9 10 10 0 1 NULL
+ t102 e 4 INT 9 10 10 0 1 NULL
+ t103 a 4 INT 9 10 10 0 1 NULL
+ t103 b 4 INT 9 10 10 0 1 NULL
+ t103 c 4 INT 9 10 10 0 1 NULL
+ t103 d 4 INT 9 10 10 0 1 NULL
+ t103 e 4 INT 9 10 10 0 1 NULL
+ t104 a 4 INT 9 10 10 0 1 NULL
+ t104 b 4 INT 9 10 10 0 1 NULL
+ t104 c 4 INT 9 10 10 0 1 NULL
+ t104 d 4 INT 9 10 10 0 1 NULL
+ t104 e 4 INT 9 10 10 0 1 NULL
+ t105 a 4 INT 9 10 10 0 1 NULL
+ t105 b 4 INT 9 10 10 0 1 NULL
+ t105 c 4 INT 9 10 10 0 1 NULL
+ t105 d 4 INT 9 10 10 0 1 NULL
+ t105 e 4 INT 9 10 10 0 1 NULL
+ t106 a 4 INT 9 10 10 0 1 NULL
+ t106 b 4 INT 9 10 10 0 1 NULL
+ t106 c 4 INT 9 10 10 0 1 NULL
+ t106 d 4 INT 9 10 10 0 1 NULL
+ t106 e 4 INT 9 10 10 0 1 NULL
+ t107 a 4 INT 9 10 10 0 1 NULL
+ t107 b 4 INT 9 10 10 0 1 NULL
+ t107 c 4 INT 9 10 10 0 1 NULL
+ t107 d 4 INT 9 10 10 0 1 NULL
+ t107 e 4 INT 9 10 10 0 1 NULL
+ t108 a 4 INT 9 10 10 0 1 NULL
+ t108 b 4 INT 9 10 10 0 1 NULL
+ t108 c 4 INT 9 10 10 0 1 NULL
+ t108 d 4 INT 9 10 10 0 1 NULL
+ t108 e 4 INT 9 10 10 0 1 NULL
+ t109 a 4 INT 9 10 10 0 1 NULL
+ t109 b 4 INT 9 10 10 0 1 NULL
+ t109 c 4 INT 9 10 10 0 1 NULL
+ t109 d 4 INT 9 10 10 0 1 NULL
+ t109 e 4 INT 9 10 10 0 1 NULL
+ t110 a 4 INT 9 10 10 0 1 NULL
+ t110 b 4 INT 9 10 10 0 1 NULL
+ t110 c 4 INT 9 10 10 0 1 NULL
+ t110 d 4 INT 9 10 10 0 1 NULL
+ t110 e 4 INT 9 10 10 0 1 NULL
+ t111 a 4 INT 9 10 10 0 1 NULL
+ t111 b 4 INT 9 10 10 0 1 NULL
+ t111 c 4 INT 9 10 10 0 1 NULL
+ t111 d 4 INT 9 10 10 0 1 NULL
+ t111 e 4 INT 9 10 10 0 1 NULL
+ t112 a 4 INT 9 10 10 0 1 NULL
+ t112 b 4 INT 9 10 10 0 1 NULL
+ t112 c 4 INT 9 10 10 0 1 NULL
+ t112 d 4 INT 9 10 10 0 1 NULL
+ t112 e 4 INT 9 10 10 0 1 NULL
+ t113 a 4 INT 9 10 10 0 1 NULL
+ t113 b 4 INT 9 10 10 0 1 NULL
+ t113 c 4 INT 9 10 10 0 1 NULL
+ t113 d 4 INT 9 10 10 0 1 NULL
+ t113 e 4 INT 9 10 10 0 1 NULL
+ t114 a 4 INT 9 10 10 0 1 NULL
+ t114 b 4 INT 9 10 10 0 1 NULL
+ t114 c 4 INT 9 10 10 0 1 NULL
+ t114 d 4 INT 9 10 10 0 1 NULL
+ t114 e 4 INT 9 10 10 0 1 NULL
+ t115 a 4 INT 9 10 10 0 1 NULL
+ t115 b 4 INT 9 10 10 0 1 NULL
+ t115 c 4 INT 9 10 10 0 1 NULL
+ t115 d 4 INT 9 10 10 0 1 NULL
+ t115 e 4 INT 9 10 10 0 1 NULL
+ t116 a 4 INT 9 10 10 0 1 NULL
+ t116 b 4 INT 9 10 10 0 1 NULL
+ t116 c 4 INT 9 10 10 0 1 NULL
+ t116 d 4 INT 9 10 10 0 1 NULL
+ t116 e 4 INT 9 10 10 0 1 NULL
+ t117 a 4 INT 9 10 10 0 1 NULL
+ t117 b 4 INT 9 10 10 0 1 NULL
+ t117 c 4 INT 9 10 10 0 1 NULL
+ t117 d 4 INT 9 10 10 0 1 NULL
+ t117 e 4 INT 9 10 10 0 1 NULL
+ t118 a 4 INT 9 10 10 0 1 NULL
+ t118 b 4 INT 9 10 10 0 1 NULL
+ t118 c 4 INT 9 10 10 0 1 NULL
+ t118 d 4 INT 9 10 10 0 1 NULL
+ t118 e 4 INT 9 10 10 0 1 NULL
+ t119 a 4 INT 9 10 10 0 1 NULL
+ t119 b 4 INT 9 10 10 0 1 NULL
+ t119 c 4 INT 9 10 10 0 1 NULL
+ t119 d 4 INT 9 10 10 0 1 NULL
+ t119 e 4 INT 9 10 10 0 1 NULL
+ t120 a 4 INT 9 10 10 0 1 NULL
+ t120 b 4 INT 9 10 10 0 1 NULL
+ t120 c 4 INT 9 10 10 0 1 NULL
+ t120 d 4 INT 9 10 10 0 1 NULL
+ t120 e 4 INT 9 10 10 0 1 NULL
+ t121 a 4 INT 9 10 10 0 1 NULL
+ t121 b 4 INT 9 10 10 0 1 NULL
+ t121 c 4 INT 9 10 10 0 1 NULL
+ t121 d 4 INT 9 10 10 0 1 NULL
+ t121 e 4 INT 9 10 10 0 1 NULL
+ t122 a 4 INT 9 10 10 0 1 NULL
+ t122 b 4 INT 9 10 10 0 1 NULL
+ t122 c 4 INT 9 10 10 0 1 NULL
+ t122 d 4 INT 9 10 10 0 1 NULL
+ t122 e 4 INT 9 10 10 0 1 NULL
+ t123 a 4 INT 9 10 10 0 1 NULL
+ t123 b 4 INT 9 10 10 0 1 NULL
+ t123 c 4 INT 9 10 10 0 1 NULL
+ t123 d 4 INT 9 10 10 0 1 NULL
+ t123 e 4 INT 9 10 10 0 1 NULL
+ t124 a 4 INT 9 10 10 0 1 NULL
+ t124 b 4 INT 9 10 10 0 1 NULL
+ t124 c 4 INT 9 10 10 0 1 NULL
+ t124 d 4 INT 9 10 10 0 1 NULL
+ t124 e 4 INT 9 10 10 0 1 NULL
+ t125 a 4 INT 9 10 10 0 1 NULL
+ t125 b 4 INT 9 10 10 0 1 NULL
+ t125 c 4 INT 9 10 10 0 1 NULL
+ t125 d 4 INT 9 10 10 0 1 NULL
+ t125 e 4 INT 9 10 10 0 1 NULL
+ t126 a 4 INT 9 10 10 0 1 NULL
+ t126 b 4 INT 9 10 10 0 1 NULL
+ t126 c 4 INT 9 10 10 0 1 NULL
+ t126 d 4 INT 9 10 10 0 1 NULL
+ t126 e 4 INT 9 10 10 0 1 NULL
+ t127 a 4 INT 9 10 10 0 1 NULL
+ t127 b 4 INT 9 10 10 0 1 NULL
+ t127 c 4 INT 9 10 10 0 1 NULL
+ t127 d 4 INT 9 10 10 0 1 NULL
+ t127 e 4 INT 9 10 10 0 1 NULL
+ t128 a 4 INT 9 10 10 0 1 NULL
+ t128 b 4 INT 9 10 10 0 1 NULL
+ t128 c 4 INT 9 10 10 0 1 NULL
+ t128 d 4 INT 9 10 10 0 1 NULL
+ t128 e 4 INT 9 10 10 0 1 NULL
+ t129 a 4 INT 9 10 10 0 1 NULL
+ t129 b 4 INT 9 10 10 0 1 NULL
+ t129 c 4 INT 9 10 10 0 1 NULL
+ t129 d 4 INT 9 10 10 0 1 NULL
+ t129 e 4 INT 9 10 10 0 1 NULL
+ t130 a 4 INT 9 10 10 0 1 NULL
+ t130 b 4 INT 9 10 10 0 1 NULL
+ t130 c 4 INT 9 10 10 0 1 NULL
+ t130 d 4 INT 9 10 10 0 1 NULL
+ t130 e 4 INT 9 10 10 0 1 NULL
+ t131 a 4 INT 9 10 10 0 1 NULL
+ t131 b 4 INT 9 10 10 0 1 NULL
+ t131 c 4 INT 9 10 10 0 1 NULL
+ t131 d 4 INT 9 10 10 0 1 NULL
+ t131 e 4 INT 9 10 10 0 1 NULL
+ t132 a 4 INT 9 10 10 0 1 NULL
+ t132 b 4 INT 9 10 10 0 1 NULL
+ t132 c 4 INT 9 10 10 0 1 NULL
+ t132 d 4 INT 9 10 10 0 1 NULL
+ t132 e 4 INT 9 10 10 0 1 NULL
+ t133 a 4 INT 9 10 10 0 1 NULL
+ t133 b 4 INT 9 10 10 0 1 NULL
+ t133 c 4 INT 9 10 10 0 1 NULL
+ t133 d 4 INT 9 10 10 0 1 NULL
+ t133 e 4 INT 9 10 10 0 1 NULL
+ t134 a 4 INT 9 10 10 0 1 NULL
+ t134 b 4 INT 9 10 10 0 1 NULL
+ t134 c 4 INT 9 10 10 0 1 NULL
+ t134 d 4 INT 9 10 10 0 1 NULL
+ t134 e 4 INT 9 10 10 0 1 NULL
+ t135 a 4 INT 9 10 10 0 1 NULL
+ t135 b 4 INT 9 10 10 0 1 NULL
+ t135 c 4 INT 9 10 10 0 1 NULL
+ t135 d 4 INT 9 10 10 0 1 NULL
+ t135 e 4 INT 9 10 10 0 1 NULL
+ t136 a 4 INT 9 10 10 0 1 NULL
+ t136 b 4 INT 9 10 10 0 1 NULL
+ t136 c 4 INT 9 10 10 0 1 NULL
+ t136 d 4 INT 9 10 10 0 1 NULL
+ t136 e 4 INT 9 10 10 0 1 NULL
+ t137 a 4 INT 9 10 10 0 1 NULL
+ t137 b 4 INT 9 10 10 0 1 NULL
+ t137 c 4 INT 9 10 10 0 1 NULL
+ t137 d 4 INT 9 10 10 0 1 NULL
+ t137 e 4 INT 9 10 10 0 1 NULL
+ t138 a 4 INT 9 10 10 0 1 NULL
+ t138 b 4 INT 9 10 10 0 1 NULL
+ t138 c 4 INT 9 10 10 0 1 NULL
+ t138 d 4 INT 9 10 10 0 1 NULL
+ t138 e 4 INT 9 10 10 0 1 NULL
+ t139 a 4 INT 9 10 10 0 1 NULL
+ t139 b 4 INT 9 10 10 0 1 NULL
+ t139 c 4 INT 9 10 10 0 1 NULL
+ t139 d 4 INT 9 10 10 0 1 NULL
+ t139 e 4 INT 9 10 10 0 1 NULL
+ t140 a 4 INT 9 10 10 0 1 NULL
+ t140 b 4 INT 9 10 10 0 1 NULL
+ t140 c 4 INT 9 10 10 0 1 NULL
+ t140 d 4 INT 9 10 10 0 1 NULL
+ t140 e 4 INT 9 10 10 0 1 NULL
+ t141 a 4 INT 9 10 10 0 1 NULL
+ t141 b 4 INT 9 10 10 0 1 NULL
+ t141 c 4 INT 9 10 10 0 1 NULL
+ t141 d 4 INT 9 10 10 0 1 NULL
+ t141 e 4 INT 9 10 10 0 1 NULL
+ t142 a 4 INT 9 10 10 0 1 NULL
+ t142 b 4 INT 9 10 10 0 1 NULL
+ t142 c 4 INT 9 10 10 0 1 NULL
+ t142 d 4 INT 9 10 10 0 1 NULL
+ t142 e 4 INT 9 10 10 0 1 NULL
+ t143 a 4 INT 9 10 10 0 1 NULL
+ t143 b 4 INT 9 10 10 0 1 NULL
+ t143 c 4 INT 9 10 10 0 1 NULL
+ t143 d 4 INT 9 10 10 0 1 NULL
+ t143 e 4 INT 9 10 10 0 1 NULL
+ t144 a 4 INT 9 10 10 0 1 NULL
+ t144 b 4 INT 9 10 10 0 1 NULL
+ t144 c 4 INT 9 10 10 0 1 NULL
+ t144 d 4 INT 9 10 10 0 1 NULL
+ t144 e 4 INT 9 10 10 0 1 NULL
+ t145 a 4 INT 9 10 10 0 1 NULL
+ t145 b 4 INT 9 10 10 0 1 NULL
+ t145 c 4 INT 9 10 10 0 1 NULL
+ t145 d 4 INT 9 10 10 0 1 NULL
+ t145 e 4 INT 9 10 10 0 1 NULL
+ t146 a 4 INT 9 10 10 0 1 NULL
+ t146 b 4 INT 9 10 10 0 1 NULL
+ t146 c 4 INT 9 10 10 0 1 NULL
+ t146 d 4 INT 9 10 10 0 1 NULL
+ t146 e 4 INT 9 10 10 0 1 NULL
+ t147 a 4 INT 9 10 10 0 1 NULL
+ t147 b 4 INT 9 10 10 0 1 NULL
+ t147 c 4 INT 9 10 10 0 1 NULL
+ t147 d 4 INT 9 10 10 0 1 NULL
+ t147 e 4 INT 9 10 10 0 1 NULL
+ t148 a 4 INT 9 10 10 0 1 NULL
+ t148 b 4 INT 9 10 10 0 1 NULL
+ t148 c 4 INT 9 10 10 0 1 NULL
+ t148 d 4 INT 9 10 10 0 1 NULL
+ t148 e 4 INT 9 10 10 0 1 NULL
+ t149 a 4 INT 9 10 10 0 1 NULL
+ t149 b 4 INT 9 10 10 0 1 NULL
+ t149 c 4 INT 9 10 10 0 1 NULL
+ t149 d 4 INT 9 10 10 0 1 NULL
+ t149 e 4 INT 9 10 10 0 1 NULL
+ t150 a 4 INT 9 10 10 0 1 NULL
+ t150 b 4 INT 9 10 10 0 1 NULL
+ t150 c 4 INT 9 10 10 0 1 NULL
+ t150 d 4 INT 9 10 10 0 1 NULL
+ t150 e 4 INT 9 10 10 0 1 NULL
+ t151 a 4 INT 9 10 10 0 1 NULL
+ t151 b 4 INT 9 10 10 0 1 NULL
+ t151 c 4 INT 9 10 10 0 1 NULL
+ t151 d 4 INT 9 10 10 0 1 NULL
+ t151 e 4 INT 9 10 10 0 1 NULL
+ t152 a 4 INT 9 10 10 0 1 NULL
+ t152 b 4 INT 9 10 10 0 1 NULL
+ t152 c 4 INT 9 10 10 0 1 NULL
+ t152 d 4 INT 9 10 10 0 1 NULL
+ t152 e 4 INT 9 10 10 0 1 NULL
+ t153 a 4 INT 9 10 10 0 1 NULL
+ t153 b 4 INT 9 10 10 0 1 NULL
+ t153 c 4 INT 9 10 10 0 1 NULL
+ t153 d 4 INT 9 10 10 0 1 NULL
+ t153 e 4 INT 9 10 10 0 1 NULL
+ t154 a 4 INT 9 10 10 0 1 NULL
+ t154 b 4 INT 9 10 10 0 1 NULL
+ t154 c 4 INT 9 10 10 0 1 NULL
+ t154 d 4 INT 9 10 10 0 1 NULL
+ t154 e 4 INT 9 10 10 0 1 NULL
+ t155 a 4 INT 9 10 10 0 1 NULL
+ t155 b 4 INT 9 10 10 0 1 NULL
+ t155 c 4 INT 9 10 10 0 1 NULL
+ t155 d 4 INT 9 10 10 0 1 NULL
+ t155 e 4 INT 9 10 10 0 1 NULL
+ t156 a 4 INT 9 10 10 0 1 NULL
+ t156 b 4 INT 9 10 10 0 1 NULL
+ t156 c 4 INT 9 10 10 0 1 NULL
+ t156 d 4 INT 9 10 10 0 1 NULL
+ t156 e 4 INT 9 10 10 0 1 NULL
+ t157 a 4 INT 9 10 10 0 1 NULL
+ t157 b 4 INT 9 10 10 0 1 NULL
+ t157 c 4 INT 9 10 10 0 1 NULL
+ t157 d 4 INT 9 10 10 0 1 NULL
+ t157 e 4 INT 9 10 10 0 1 NULL
+ t158 a 4 INT 9 10 10 0 1 NULL
+ t158 b 4 INT 9 10 10 0 1 NULL
+ t158 c 4 INT 9 10 10 0 1 NULL
+ t158 d 4 INT 9 10 10 0 1 NULL
+ t158 e 4 INT 9 10 10 0 1 NULL
+ t159 a 4 INT 9 10 10 0 1 NULL
+ t159 b 4 INT 9 10 10 0 1 NULL
+ t159 c 4 INT 9 10 10 0 1 NULL
+ t159 d 4 INT 9 10 10 0 1 NULL
+ t159 e 4 INT 9 10 10 0 1 NULL
+ t160 a 4 INT 9 10 10 0 1 NULL
+ t160 b 4 INT 9 10 10 0 1 NULL
+ t160 c 4 INT 9 10 10 0 1 NULL
+ t160 d 4 INT 9 10 10 0 1 NULL
+ t160 e 4 INT 9 10 10 0 1 NULL
+ t161 a 4 INT 9 10 10 0 1 NULL
+ t161 b 4 INT 9 10 10 0 1 NULL
+ t161 c 4 INT 9 10 10 0 1 NULL
+ t161 d 4 INT 9 10 10 0 1 NULL
+ t161 e 4 INT 9 10 10 0 1 NULL
+ t162 a 4 INT 9 10 10 0 1 NULL
+ t162 b 4 INT 9 10 10 0 1 NULL
+ t162 c 4 INT 9 10 10 0 1 NULL
+ t162 d 4 INT 9 10 10 0 1 NULL
+ t162 e 4 INT 9 10 10 0 1 NULL
+ t163 a 4 INT 9 10 10 0 1 NULL
+ t163 b 4 INT 9 10 10 0 1 NULL
+ t163 c 4 INT 9 10 10 0 1 NULL
+ t163 d 4 INT 9 10 10 0 1 NULL
+ t163 e 4 INT 9 10 10 0 1 NULL
+ t164 a 4 INT 9 10 10 0 1 NULL
+ t164 b 4 INT 9 10 10 0 1 NULL
+ t164 c 4 INT 9 10 10 0 1 NULL
+ t164 d 4 INT 9 10 10 0 1 NULL
+ t164 e 4 INT 9 10 10 0 1 NULL
+ t165 a 4 INT 9 10 10 0 1 NULL
+ t165 b 4 INT 9 10 10 0 1 NULL
+ t165 c 4 INT 9 10 10 0 1 NULL
+ t165 d 4 INT 9 10 10 0 1 NULL
+ t165 e 4 INT 9 10 10 0 1 NULL
+ t166 a 4 INT 9 10 10 0 1 NULL
+ t166 b 4 INT 9 10 10 0 1 NULL
+ t166 c 4 INT 9 10 10 0 1 NULL
+ t166 d 4 INT 9 10 10 0 1 NULL
+ t166 e 4 INT 9 10 10 0 1 NULL
+ t167 a 4 INT 9 10 10 0 1 NULL
+ t167 b 4 INT 9 10 10 0 1 NULL
+ t167 c 4 INT 9 10 10 0 1 NULL
+ t167 d 4 INT 9 10 10 0 1 NULL
+ t167 e 4 INT 9 10 10 0 1 NULL
+ t168 a 4 INT 9 10 10 0 1 NULL
+ t168 b 4 INT 9 10 10 0 1 NULL
+ t168 c 4 INT 9 10 10 0 1 NULL
+ t168 d 4 INT 9 10 10 0 1 NULL
+ t168 e 4 INT 9 10 10 0 1 NULL
+ t169 a 4 INT 9 10 10 0 1 NULL
+ t169 b 4 INT 9 10 10 0 1 NULL
+ t169 c 4 INT 9 10 10 0 1 NULL
+ t169 d 4 INT 9 10 10 0 1 NULL
+ t169 e 4 INT 9 10 10 0 1 NULL
+ t170 a 4 INT 9 10 10 0 1 NULL
+ t170 b 4 INT 9 10 10 0 1 NULL
+ t170 c 4 INT 9 10 10 0 1 NULL
+ t170 d 4 INT 9 10 10 0 1 NULL
+ t170 e 4 INT 9 10 10 0 1 NULL
+ t171 a 4 INT 9 10 10 0 1 NULL
+ t171 b 4 INT 9 10 10 0 1 NULL
+ t171 c 4 INT 9 10 10 0 1 NULL
+ t171 d 4 INT 9 10 10 0 1 NULL
+ t171 e 4 INT 9 10 10 0 1 NULL
+ t172 a 4 INT 9 10 10 0 1 NULL
+ t172 b 4 INT 9 10 10 0 1 NULL
+ t172 c 4 INT 9 10 10 0 1 NULL
+ t172 d 4 INT 9 10 10 0 1 NULL
+ t172 e 4 INT 9 10 10 0 1 NULL
+ t173 a 4 INT 9 10 10 0 1 NULL
+ t173 b 4 INT 9 10 10 0 1 NULL
+ t173 c 4 INT 9 10 10 0 1 NULL
+ t173 d 4 INT 9 10 10 0 1 NULL
+ t173 e 4 INT 9 10 10 0 1 NULL
+ t174 a 4 INT 9 10 10 0 1 NULL
+ t174 b 4 INT 9 10 10 0 1 NULL
+ t174 c 4 INT 9 10 10 0 1 NULL
+ t174 d 4 INT 9 10 10 0 1 NULL
+ t174 e 4 INT 9 10 10 0 1 NULL
+ t175 a 4 INT 9 10 10 0 1 NULL
+ t175 b 4 INT 9 10 10 0 1 NULL
+ t175 c 4 INT 9 10 10 0 1 NULL
+ t175 d 4 INT 9 10 10 0 1 NULL
+ t175 e 4 INT 9 10 10 0 1 NULL
+ t176 a 4 INT 9 10 10 0 1 NULL
+ t176 b 4 INT 9 10 10 0 1 NULL
+ t176 c 4 INT 9 10 10 0 1 NULL
+ t176 d 4 INT 9 10 10 0 1 NULL
+ t176 e 4 INT 9 10 10 0 1 NULL
+ t177 a 4 INT 9 10 10 0 1 NULL
+ t177 b 4 INT 9 10 10 0 1 NULL
+ t177 c 4 INT 9 10 10 0 1 NULL
+ t177 d 4 INT 9 10 10 0 1 NULL
+ t177 e 4 INT 9 10 10 0 1 NULL
+ t178 a 4 INT 9 10 10 0 1 NULL
+ t178 b 4 INT 9 10 10 0 1 NULL
+ t178 c 4 INT 9 10 10 0 1 NULL
+ t178 d 4 INT 9 10 10 0 1 NULL
+ t178 e 4 INT 9 10 10 0 1 NULL
+ t179 a 4 INT 9 10 10 0 1 NULL
+ t179 b 4 INT 9 10 10 0 1 NULL
+ t179 c 4 INT 9 10 10 0 1 NULL
+ t179 d 4 INT 9 10 10 0 1 NULL
+ t179 e 4 INT 9 10 10 0 1 NULL
+ t180 a 4 INT 9 10 10 0 1 NULL
+ t180 b 4 INT 9 10 10 0 1 NULL
+ t180 c 4 INT 9 10 10 0 1 NULL
+ t180 d 4 INT 9 10 10 0 1 NULL
+ t180 e 4 INT 9 10 10 0 1 NULL
+ t181 a 4 INT 9 10 10 0 1 NULL
+ t181 b 4 INT 9 10 10 0 1 NULL
+ t181 c 4 INT 9 10 10 0 1 NULL
+ t181 d 4 INT 9 10 10 0 1 NULL
+ t181 e 4 INT 9 10 10 0 1 NULL
+ t182 a 4 INT 9 10 10 0 1 NULL
+ t182 b 4 INT 9 10 10 0 1 NULL
+ t182 c 4 INT 9 10 10 0 1 NULL
+ t182 d 4 INT 9 10 10 0 1 NULL
+ t182 e 4 INT 9 10 10 0 1 NULL
+ t183 a 4 INT 9 10 10 0 1 NULL
+ t183 b 4 INT 9 10 10 0 1 NULL
+ t183 c 4 INT 9 10 10 0 1 NULL
+ t183 d 4 INT 9 10 10 0 1 NULL
+ t183 e 4 INT 9 10 10 0 1 NULL
+ t184 a 4 INT 9 10 10 0 1 NULL
+ t184 b 4 INT 9 10 10 0 1 NULL
+ t184 c 4 INT 9 10 10 0 1 NULL
+ t184 d 4 INT 9 10 10 0 1 NULL
+ t184 e 4 INT 9 10 10 0 1 NULL
+ t185 a 4 INT 9 10 10 0 1 NULL
+ t185 b 4 INT 9 10 10 0 1 NULL
+ t185 c 4 INT 9 10 10 0 1 NULL
+ t185 d 4 INT 9 10 10 0 1 NULL
+ t185 e 4 INT 9 10 10 0 1 NULL
+ t186 a 4 INT 9 10 10 0 1 NULL
+ t186 b 4 INT 9 10 10 0 1 NULL
+ t186 c 4 INT 9 10 10 0 1 NULL
+ t186 d 4 INT 9 10 10 0 1 NULL
+ t186 e 4 INT 9 10 10 0 1 NULL
+ t187 a 4 INT 9 10 10 0 1 NULL
+ t187 b 4 INT 9 10 10 0 1 NULL
+ t187 c 4 INT 9 10 10 0 1 NULL
+ t187 d 4 INT 9 10 10 0 1 NULL
+ t187 e 4 INT 9 10 10 0 1 NULL
+ t188 a 4 INT 9 10 10 0 1 NULL
+ t188 b 4 INT 9 10 10 0 1 NULL
+ t188 c 4 INT 9 10 10 0 1 NULL
+ t188 d 4 INT 9 10 10 0 1 NULL
+ t188 e 4 INT 9 10 10 0 1 NULL
+ t189 a 4 INT 9 10 10 0 1 NULL
+ t189 b 4 INT 9 10 10 0 1 NULL
+ t189 c 4 INT 9 10 10 0 1 NULL
+ t189 d 4 INT 9 10 10 0 1 NULL
+ t189 e 4 INT 9 10 10 0 1 NULL
+ t190 a 4 INT 9 10 10 0 1 NULL
+ t190 b 4 INT 9 10 10 0 1 NULL
+ t190 c 4 INT 9 10 10 0 1 NULL
+ t190 d 4 INT 9 10 10 0 1 NULL
+ t190 e 4 INT 9 10 10 0 1 NULL
+ t191 a 4 INT 9 10 10 0 1 NULL
+ t191 b 4 INT 9 10 10 0 1 NULL
+ t191 c 4 INT 9 10 10 0 1 NULL
+ t191 d 4 INT 9 10 10 0 1 NULL
+ t191 e 4 INT 9 10 10 0 1 NULL
+ t192 a 4 INT 9 10 10 0 1 NULL
+ t192 b 4 INT 9 10 10 0 1 NULL
+ t192 c 4 INT 9 10 10 0 1 NULL
+ t192 d 4 INT 9 10 10 0 1 NULL
+ t192 e 4 INT 9 10 10 0 1 NULL
+ t193 a 4 INT 9 10 10 0 1 NULL
+ t193 b 4 INT 9 10 10 0 1 NULL
+ t193 c 4 INT 9 10 10 0 1 NULL
+ t193 d 4 INT 9 10 10 0 1 NULL
+ t193 e 4 INT 9 10 10 0 1 NULL
+ t194 a 4 INT 9 10 10 0 1 NULL
+ t194 b 4 INT 9 10 10 0 1 NULL
+ t194 c 4 INT 9 10 10 0 1 NULL
+ t194 d 4 INT 9 10 10 0 1 NULL
+ t194 e 4 INT 9 10 10 0 1 NULL
+ t195 a 4 INT 9 10 10 0 1 NULL
+ t195 b 4 INT 9 10 10 0 1 NULL
+ t195 c 4 INT 9 10 10 0 1 NULL
+ t195 d 4 INT 9 10 10 0 1 NULL
+ t195 e 4 INT 9 10 10 0 1 NULL
+ t196 a 4 INT 9 10 10 0 1 NULL
+ t196 b 4 INT 9 10 10 0 1 NULL
+ t196 c 4 INT 9 10 10 0 1 NULL
+ t196 d 4 INT 9 10 10 0 1 NULL
+ t196 e 4 INT 9 10 10 0 1 NULL
+ t197 a 4 INT 9 10 10 0 1 NULL
+ t197 b 4 INT 9 10 10 0 1 NULL
+ t197 c 4 INT 9 10 10 0 1 NULL
+ t197 d 4 INT 9 10 10 0 1 NULL
+ t197 e 4 INT 9 10 10 0 1 NULL
+ t198 a 4 INT 9 10 10 0 1 NULL
+ t198 b 4 INT 9 10 10 0 1 NULL
+ t198 c 4 INT 9 10 10 0 1 NULL
+ t198 d 4 INT 9 10 10 0 1 NULL
+ t198 e 4 INT 9 10 10 0 1 NULL
+ t199 a 4 INT 9 10 10 0 1 NULL
+ t199 b 4 INT 9 10 10 0 1 NULL
+ t199 c 4 INT 9 10 10 0 1 NULL
+ t199 d 4 INT 9 10 10 0 1 NULL
+ t199 e 4 INT 9 10 10 0 1 NULL
+ t200 a 4 INT 9 10 10 0 1 NULL
+ t200 b 4 INT 9 10 10 0 1 NULL
+ t200 c 4 INT 9 10 10 0 1 NULL
+ t200 d 4 INT 9 10 10 0 1 NULL
+ t200 e 4 INT 9 10 10 0 1 NULL
+ t201 a 4 INT 9 10 10 0 1 NULL
+ t201 b 4 INT 9 10 10 0 1 NULL
+ t201 c 4 INT 9 10 10 0 1 NULL
+ t201 d 4 INT 9 10 10 0 1 NULL
+ t201 e 4 INT 9 10 10 0 1 NULL
+ t202 a 4 INT 9 10 10 0 1 NULL
+ t202 b 4 INT 9 10 10 0 1 NULL
+ t202 c 4 INT 9 10 10 0 1 NULL
+ t202 d 4 INT 9 10 10 0 1 NULL
+ t202 e 4 INT 9 10 10 0 1 NULL
+ t203 a 4 INT 9 10 10 0 1 NULL
+ t203 b 4 INT 9 10 10 0 1 NULL
+ t203 c 4 INT 9 10 10 0 1 NULL
+ t203 d 4 INT 9 10 10 0 1 NULL
+ t203 e 4 INT 9 10 10 0 1 NULL
+ t204 a 4 INT 9 10 10 0 1 NULL
+ t204 b 4 INT 9 10 10 0 1 NULL
+ t204 c 4 INT 9 10 10 0 1 NULL
+ t204 d 4 INT 9 10 10 0 1 NULL
+ t204 e 4 INT 9 10 10 0 1 NULL
+ t205 a 4 INT 9 10 10 0 1 NULL
+ t205 b 4 INT 9 10 10 0 1 NULL
+ t205 c 4 INT 9 10 10 0 1 NULL
+ t205 d 4 INT 9 10 10 0 1 NULL
+ t205 e 4 INT 9 10 10 0 1 NULL
+ t206 a 4 INT 9 10 10 0 1 NULL
+ t206 b 4 INT 9 10 10 0 1 NULL
+ t206 c 4 INT 9 10 10 0 1 NULL
+ t206 d 4 INT 9 10 10 0 1 NULL
+ t206 e 4 INT 9 10 10 0 1 NULL
+ t207 a 4 INT 9 10 10 0 1 NULL
+ t207 b 4 INT 9 10 10 0 1 NULL
+ t207 c 4 INT 9 10 10 0 1 NULL
+ t207 d 4 INT 9 10 10 0 1 NULL
+ t207 e 4 INT 9 10 10 0 1 NULL
+ t208 a 4 INT 9 10 10 0 1 NULL
+ t208 b 4 INT 9 10 10 0 1 NULL
+ t208 c 4 INT 9 10 10 0 1 NULL
+ t208 d 4 INT 9 10 10 0 1 NULL
+ t208 e 4 INT 9 10 10 0 1 NULL
+ t209 a 4 INT 9 10 10 0 1 NULL
+ t209 b 4 INT 9 10 10 0 1 NULL
+ t209 c 4 INT 9 10 10 0 1 NULL
+ t209 d 4 INT 9 10 10 0 1 NULL
+ t209 e 4 INT 9 10 10 0 1 NULL
+ t210 a 4 INT 9 10 10 0 1 NULL
+ t210 b 4 INT 9 10 10 0 1 NULL
+ t210 c 4 INT 9 10 10 0 1 NULL
+ t210 d 4 INT 9 10 10 0 1 NULL
+ t210 e 4 INT 9 10 10 0 1 NULL
+ t211 a 4 INT 9 10 10 0 1 NULL
+ t211 b 4 INT 9 10 10 0 1 NULL
+ t211 c 4 INT 9 10 10 0 1 NULL
+ t211 d 4 INT 9 10 10 0 1 NULL
+ t211 e 4 INT 9 10 10 0 1 NULL
+ t212 a 4 INT 9 10 10 0 1 NULL
+ t212 b 4 INT 9 10 10 0 1 NULL
+ t212 c 4 INT 9 10 10 0 1 NULL
+ t212 d 4 INT 9 10 10 0 1 NULL
+ t212 e 4 INT 9 10 10 0 1 NULL
+ t213 a 4 INT 9 10 10 0 1 NULL
+ t213 b 4 INT 9 10 10 0 1 NULL
+ t213 c 4 INT 9 10 10 0 1 NULL
+ t213 d 4 INT 9 10 10 0 1 NULL
+ t213 e 4 INT 9 10 10 0 1 NULL
+ t214 a 4 INT 9 10 10 0 1 NULL
+ t214 b 4 INT 9 10 10 0 1 NULL
+ t214 c 4 INT 9 10 10 0 1 NULL
+ t214 d 4 INT 9 10 10 0 1 NULL
+ t214 e 4 INT 9 10 10 0 1 NULL
+ t215 a 4 INT 9 10 10 0 1 NULL
+ t215 b 4 INT 9 10 10 0 1 NULL
+ t215 c 4 INT 9 10 10 0 1 NULL
+ t215 d 4 INT 9 10 10 0 1 NULL
+ t215 e 4 INT 9 10 10 0 1 NULL
+ t216 a 4 INT 9 10 10 0 1 NULL
+ t216 b 4 INT 9 10 10 0 1 NULL
+ t216 c 4 INT 9 10 10 0 1 NULL
+ t216 d 4 INT 9 10 10 0 1 NULL
+ t216 e 4 INT 9 10 10 0 1 NULL
+ t217 a 4 INT 9 10 10 0 1 NULL
+ t217 b 4 INT 9 10 10 0 1 NULL
+ t217 c 4 INT 9 10 10 0 1 NULL
+ t217 d 4 INT 9 10 10 0 1 NULL
+ t217 e 4 INT 9 10 10 0 1 NULL
+ t218 a 4 INT 9 10 10 0 1 NULL
+ t218 b 4 INT 9 10 10 0 1 NULL
+ t218 c 4 INT 9 10 10 0 1 NULL
+ t218 d 4 INT 9 10 10 0 1 NULL
+ t218 e 4 INT 9 10 10 0 1 NULL
+ t219 a 4 INT 9 10 10 0 1 NULL
+ t219 b 4 INT 9 10 10 0 1 NULL
+ t219 c 4 INT 9 10 10 0 1 NULL
+ t219 d 4 INT 9 10 10 0 1 NULL
+ t219 e 4 INT 9 10 10 0 1 NULL
+ t220 a 4 INT 9 10 10 0 1 NULL
+ t220 b 4 INT 9 10 10 0 1 NULL
+ t220 c 4 INT 9 10 10 0 1 NULL
+ t220 d 4 INT 9 10 10 0 1 NULL
+ t220 e 4 INT 9 10 10 0 1 NULL
+ t221 a 4 INT 9 10 10 0 1 NULL
+ t221 b 4 INT 9 10 10 0 1 NULL
+ t221 c 4 INT 9 10 10 0 1 NULL
+ t221 d 4 INT 9 10 10 0 1 NULL
+ t221 e 4 INT 9 10 10 0 1 NULL
+ t222 a 4 INT 9 10 10 0 1 NULL
+ t222 b 4 INT 9 10 10 0 1 NULL
+ t222 c 4 INT 9 10 10 0 1 NULL
+ t222 d 4 INT 9 10 10 0 1 NULL
+ t222 e 4 INT 9 10 10 0 1 NULL
+ t223 a 4 INT 9 10 10 0 1 NULL
+ t223 b 4 INT 9 10 10 0 1 NULL
+ t223 c 4 INT 9 10 10 0 1 NULL
+ t223 d 4 INT 9 10 10 0 1 NULL
+ t223 e 4 INT 9 10 10 0 1 NULL
+ t224 a 4 INT 9 10 10 0 1 NULL
+ t224 b 4 INT 9 10 10 0 1 NULL
+ t224 c 4 INT 9 10 10 0 1 NULL
+ t224 d 4 INT 9 10 10 0 1 NULL
+ t224 e 4 INT 9 10 10 0 1 NULL
+ t225 a 4 INT 9 10 10 0 1 NULL
+ t225 b 4 INT 9 10 10 0 1 NULL
+ t225 c 4 INT 9 10 10 0 1 NULL
+ t225 d 4 INT 9 10 10 0 1 NULL
+ t225 e 4 INT 9 10 10 0 1 NULL
+ t226 a 4 INT 9 10 10 0 1 NULL
+ t226 b 4 INT 9 10 10 0 1 NULL
+ t226 c 4 INT 9 10 10 0 1 NULL
+ t226 d 4 INT 9 10 10 0 1 NULL
+ t226 e 4 INT 9 10 10 0 1 NULL
+ t227 a 4 INT 9 10 10 0 1 NULL
+ t227 b 4 INT 9 10 10 0 1 NULL
+ t227 c 4 INT 9 10 10 0 1 NULL
+ t227 d 4 INT 9 10 10 0 1 NULL
+ t227 e 4 INT 9 10 10 0 1 NULL
+ t228 a 4 INT 9 10 10 0 1 NULL
+ t228 b 4 INT 9 10 10 0 1 NULL
+ t228 c 4 INT 9 10 10 0 1 NULL
+ t228 d 4 INT 9 10 10 0 1 NULL
+ t228 e 4 INT 9 10 10 0 1 NULL
+ t229 a 4 INT 9 10 10 0 1 NULL
+ t229 b 4 INT 9 10 10 0 1 NULL
+ t229 c 4 INT 9 10 10 0 1 NULL
+ t229 d 4 INT 9 10 10 0 1 NULL
+ t229 e 4 INT 9 10 10 0 1 NULL
+ t230 a 4 INT 9 10 10 0 1 NULL
+ t230 b 4 INT 9 10 10 0 1 NULL
+ t230 c 4 INT 9 10 10 0 1 NULL
+ t230 d 4 INT 9 10 10 0 1 NULL
+ t230 e 4 INT 9 10 10 0 1 NULL
+ t231 a 4 INT 9 10 10 0 1 NULL
+ t231 b 4 INT 9 10 10 0 1 NULL
+ t231 c 4 INT 9 10 10 0 1 NULL
+ t231 d 4 INT 9 10 10 0 1 NULL
+ t231 e 4 INT 9 10 10 0 1 NULL
+ t232 a 4 INT 9 10 10 0 1 NULL
+ t232 b 4 INT 9 10 10 0 1 NULL
+ t232 c 4 INT 9 10 10 0 1 NULL
+ t232 d 4 INT 9 10 10 0 1 NULL
+ t232 e 4 INT 9 10 10 0 1 NULL
+ t233 a 4 INT 9 10 10 0 1 NULL
+ t233 b 4 INT 9 10 10 0 1 NULL
+ t233 c 4 INT 9 10 10 0 1 NULL
+ t233 d 4 INT 9 10 10 0 1 NULL
+ t233 e 4 INT 9 10 10 0 1 NULL
+ t234 a 4 INT 9 10 10 0 1 NULL
+ t234 b 4 INT 9 10 10 0 1 NULL
+ t234 c 4 INT 9 10 10 0 1 NULL
+ t234 d 4 INT 9 10 10 0 1 NULL
+ t234 e 4 INT 9 10 10 0 1 NULL
+ t235 a 4 INT 9 10 10 0 1 NULL
+ t235 b 4 INT 9 10 10 0 1 NULL
+ t235 c 4 INT 9 10 10 0 1 NULL
+ t235 d 4 INT 9 10 10 0 1 NULL
+ t235 e 4 INT 9 10 10 0 1 NULL
+ t236 a 4 INT 9 10 10 0 1 NULL
+ t236 b 4 INT 9 10 10 0 1 NULL
+ t236 c 4 INT 9 10 10 0 1 NULL
+ t236 d 4 INT 9 10 10 0 1 NULL
+ t236 e 4 INT 9 10 10 0 1 NULL
+ t237 a 4 INT 9 10 10 0 1 NULL
+ t237 b 4 INT 9 10 10 0 1 NULL
+ t237 c 4 INT 9 10 10 0 1 NULL
+ t237 d 4 INT 9 10 10 0 1 NULL
+ t237 e 4 INT 9 10 10 0 1 NULL
+ t238 a 4 INT 9 10 10 0 1 NULL
+ t238 b 4 INT 9 10 10 0 1 NULL
+ t238 c 4 INT 9 10 10 0 1 NULL
+ t238 d 4 INT 9 10 10 0 1 NULL
+ t238 e 4 INT 9 10 10 0 1 NULL
+ t239 a 4 INT 9 10 10 0 1 NULL
+ t239 b 4 INT 9 10 10 0 1 NULL
+ t239 c 4 INT 9 10 10 0 1 NULL
+ t239 d 4 INT 9 10 10 0 1 NULL
+ t239 e 4 INT 9 10 10 0 1 NULL
+ t240 a 4 INT 9 10 10 0 1 NULL
+ t240 b 4 INT 9 10 10 0 1 NULL
+ t240 c 4 INT 9 10 10 0 1 NULL
+ t240 d 4 INT 9 10 10 0 1 NULL
+ t240 e 4 INT 9 10 10 0 1 NULL
+ t241 a 4 INT 9 10 10 0 1 NULL
+ t241 b 4 INT 9 10 10 0 1 NULL
+ t241 c 4 INT 9 10 10 0 1 NULL
+ t241 d 4 INT 9 10 10 0 1 NULL
+ t241 e 4 INT 9 10 10 0 1 NULL
+ t242 a 4 INT 9 10 10 0 1 NULL
+ t242 b 4 INT 9 10 10 0 1 NULL
+ t242 c 4 INT 9 10 10 0 1 NULL
+ t242 d 4 INT 9 10 10 0 1 NULL
+ t242 e 4 INT 9 10 10 0 1 NULL
+ t243 a 4 INT 9 10 10 0 1 NULL
+ t243 b 4 INT 9 10 10 0 1 NULL
+ t243 c 4 INT 9 10 10 0 1 NULL
+ t243 d 4 INT 9 10 10 0 1 NULL
+ t243 e 4 INT 9 10 10 0 1 NULL
+ t244 a 4 INT 9 10 10 0 1 NULL
+ t244 b 4 INT 9 10 10 0 1 NULL
+ t244 c 4 INT 9 10 10 0 1 NULL
+ t244 d 4 INT 9 10 10 0 1 NULL
+ t244 e 4 INT 9 10 10 0 1 NULL
+ t245 a 4 INT 9 10 10 0 1 NULL
+ t245 b 4 INT 9 10 10 0 1 NULL
+ t245 c 4 INT 9 10 10 0 1 NULL
+ t245 d 4 INT 9 10 10 0 1 NULL
+ t245 e 4 INT 9 10 10 0 1 NULL
+ t246 a 4 INT 9 10 10 0 1 NULL
+ t246 b 4 INT 9 10 10 0 1 NULL
+ t246 c 4 INT 9 10 10 0 1 NULL
+ t246 d 4 INT 9 10 10 0 1 NULL
+ t246 e 4 INT 9 10 10 0 1 NULL
+ t247 a 4 INT 9 10 10 0 1 NULL
+ t247 b 4 INT 9 10 10 0 1 NULL
+ t247 c 4 INT 9 10 10 0 1 NULL
+ t247 d 4 INT 9 10 10 0 1 NULL
+ t247 e 4 INT 9 10 10 0 1 NULL
+ t248 a 4 INT 9 10 10 0 1 NULL
+ t248 b 4 INT 9 10 10 0 1 NULL
+ t248 c 4 INT 9 10 10 0 1 NULL
+ t248 d 4 INT 9 10 10 0 1 NULL
+ t248 e 4 INT 9 10 10 0 1 NULL
+ t249 a 4 INT 9 10 10 0 1 NULL
+ t249 b 4 INT 9 10 10 0 1 NULL
+ t249 c 4 INT 9 10 10 0 1 NULL
+ t249 d 4 INT 9 10 10 0 1 NULL
+ t249 e 4 INT 9 10 10 0 1 NULL
+ t250 a 4 INT 9 10 10 0 1 NULL
+ t250 b 4 INT 9 10 10 0 1 NULL
+ t250 c 4 INT 9 10 10 0 1 NULL
+ t250 d 4 INT 9 10 10 0 1 NULL
+ t250 e 4 INT 9 10 10 0 1 NULL
+ t251 a 4 INT 9 10 10 0 1 NULL
+ t251 b 4 INT 9 10 10 0 1 NULL
+ t251 c 4 INT 9 10 10 0 1 NULL
+ t251 d 4 INT 9 10 10 0 1 NULL
+ t251 e 4 INT 9 10 10 0 1 NULL
+ t252 a 4 INT 9 10 10 0 1 NULL
+ t252 b 4 INT 9 10 10 0 1 NULL
+ t252 c 4 INT 9 10 10 0 1 NULL
+ t252 d 4 INT 9 10 10 0 1 NULL
+ t252 e 4 INT 9 10 10 0 1 NULL
+ t253 a 4 INT 9 10 10 0 1 NULL
+ t253 b 4 INT 9 10 10 0 1 NULL
+ t253 c 4 INT 9 10 10 0 1 NULL
+ t253 d 4 INT 9 10 10 0 1 NULL
+ t253 e 4 INT 9 10 10 0 1 NULL
+ t254 a 4 INT 9 10 10 0 1 NULL
+ t254 b 4 INT 9 10 10 0 1 NULL
+ t254 c 4 INT 9 10 10 0 1 NULL
+ t254 d 4 INT 9 10 10 0 1 NULL
+ t254 e 4 INT 9 10 10 0 1 NULL
+ t255 a 4 INT 9 10 10 0 1 NULL
+ t255 b 4 INT 9 10 10 0 1 NULL
+ t255 c 4 INT 9 10 10 0 1 NULL
+ t255 d 4 INT 9 10 10 0 1 NULL
+ t255 e 4 INT 9 10 10 0 1 NULL
+ t256 a 4 INT 9 10 10 0 1 NULL
+ t256 b 4 INT 9 10 10 0 1 NULL
+ t256 c 4 INT 9 10 10 0 1 NULL
+ t256 d 4 INT 9 10 10 0 1 NULL
+ t256 e 4 INT 9 10 10 0 1 NULL
+ t257 a 4 INT 9 10 10 0 1 NULL
+ t257 b 4 INT 9 10 10 0 1 NULL
+ t257 c 4 INT 9 10 10 0 1 NULL
+ t257 d 4 INT 9 10 10 0 1 NULL
+ t257 e 4 INT 9 10 10 0 1 NULL
+ t258 a 4 INT 9 10 10 0 1 NULL
+ t258 b 4 INT 9 10 10 0 1 NULL
+ t258 c 4 INT 9 10 10 0 1 NULL
+ t258 d 4 INT 9 10 10 0 1 NULL
+ t258 e 4 INT 9 10 10 0 1 NULL
+ t259 a 4 INT 9 10 10 0 1 NULL
+ t259 b 4 INT 9 10 10 0 1 NULL
+ t259 c 4 INT 9 10 10 0 1 NULL
+ t259 d 4 INT 9 10 10 0 1 NULL
+ t259 e 4 INT 9 10 10 0 1 NULL
+ t260 a 4 INT 9 10 10 0 1 NULL
+ t260 b 4 INT 9 10 10 0 1 NULL
+ t260 c 4 INT 9 10 10 0 1 NULL
+ t260 d 4 INT 9 10 10 0 1 NULL
+ t260 e 4 INT 9 10 10 0 1 NULL
+ t261 a 4 INT 9 10 10 0 1 NULL
+ t261 b 4 INT 9 10 10 0 1 NULL
+ t261 c 4 INT 9 10 10 0 1 NULL
+ t261 d 4 INT 9 10 10 0 1 NULL
+ t261 e 4 INT 9 10 10 0 1 NULL
+ t262 a 4 INT 9 10 10 0 1 NULL
+ t262 b 4 INT 9 10 10 0 1 NULL
+ t262 c 4 INT 9 10 10 0 1 NULL
+ t262 d 4 INT 9 10 10 0 1 NULL
+ t262 e 4 INT 9 10 10 0 1 NULL
+ t263 a 4 INT 9 10 10 0 1 NULL
+ t263 b 4 INT 9 10 10 0 1 NULL
+ t263 c 4 INT 9 10 10 0 1 NULL
+ t263 d 4 INT 9 10 10 0 1 NULL
+ t263 e 4 INT 9 10 10 0 1 NULL
+ t264 a 4 INT 9 10 10 0 1 NULL
+ t264 b 4 INT 9 10 10 0 1 NULL
+ t264 c 4 INT 9 10 10 0 1 NULL
+ t264 d 4 INT 9 10 10 0 1 NULL
+ t264 e 4 INT 9 10 10 0 1 NULL
+ t265 a 4 INT 9 10 10 0 1 NULL
+ t265 b 4 INT 9 10 10 0 1 NULL
+ t265 c 4 INT 9 10 10 0 1 NULL
+ t265 d 4 INT 9 10 10 0 1 NULL
+ t265 e 4 INT 9 10 10 0 1 NULL
+ t266 a 4 INT 9 10 10 0 1 NULL
+ t266 b 4 INT 9 10 10 0 1 NULL
+ t266 c 4 INT 9 10 10 0 1 NULL
+ t266 d 4 INT 9 10 10 0 1 NULL
+ t266 e 4 INT 9 10 10 0 1 NULL
+ t267 a 4 INT 9 10 10 0 1 NULL
+ t267 b 4 INT 9 10 10 0 1 NULL
+ t267 c 4 INT 9 10 10 0 1 NULL
+ t267 d 4 INT 9 10 10 0 1 NULL
+ t267 e 4 INT 9 10 10 0 1 NULL
+ t268 a 4 INT 9 10 10 0 1 NULL
+ t268 b 4 INT 9 10 10 0 1 NULL
+ t268 c 4 INT 9 10 10 0 1 NULL
+ t268 d 4 INT 9 10 10 0 1 NULL
+ t268 e 4 INT 9 10 10 0 1 NULL
+ t269 a 4 INT 9 10 10 0 1 NULL
+ t269 b 4 INT 9 10 10 0 1 NULL
+ t269 c 4 INT 9 10 10 0 1 NULL
+ t269 d 4 INT 9 10 10 0 1 NULL
+ t269 e 4 INT 9 10 10 0 1 NULL
+ t270 a 4 INT 9 10 10 0 1 NULL
+ t270 b 4 INT 9 10 10 0 1 NULL
+ t270 c 4 INT 9 10 10 0 1 NULL
+ t270 d 4 INT 9 10 10 0 1 NULL
+ t270 e 4 INT 9 10 10 0 1 NULL
+ t271 a 4 INT 9 10 10 0 1 NULL
+ t271 b 4 INT 9 10 10 0 1 NULL
+ t271 c 4 INT 9 10 10 0 1 NULL
+ t271 d 4 INT 9 10 10 0 1 NULL
+ t271 e 4 INT 9 10 10 0 1 NULL
+ t272 a 4 INT 9 10 10 0 1 NULL
+ t272 b 4 INT 9 10 10 0 1 NULL
+ t272 c 4 INT 9 10 10 0 1 NULL
+ t272 d 4 INT 9 10 10 0 1 NULL
+ t272 e 4 INT 9 10 10 0 1 NULL
+ t273 a 4 INT 9 10 10 0 1 NULL
+ t273 b 4 INT 9 10 10 0 1 NULL
+ t273 c 4 INT 9 10 10 0 1 NULL
+ t273 d 4 INT 9 10 10 0 1 NULL
+ t273 e 4 INT 9 10 10 0 1 NULL
+ t274 a 4 INT 9 10 10 0 1 NULL
+ t274 b 4 INT 9 10 10 0 1 NULL
+ t274 c 4 INT 9 10 10 0 1 NULL
+ t274 d 4 INT 9 10 10 0 1 NULL
+ t274 e 4 INT 9 10 10 0 1 NULL
+ t275 a 4 INT 9 10 10 0 1 NULL
+ t275 b 4 INT 9 10 10 0 1 NULL
+ t275 c 4 INT 9 10 10 0 1 NULL
+ t275 d 4 INT 9 10 10 0 1 NULL
+ t275 e 4 INT 9 10 10 0 1 NULL
+ t276 a 4 INT 9 10 10 0 1 NULL
+ t276 b 4 INT 9 10 10 0 1 NULL
+ t276 c 4 INT 9 10 10 0 1 NULL
+ t276 d 4 INT 9 10 10 0 1 NULL
+ t276 e 4 INT 9 10 10 0 1 NULL
+ t277 a 4 INT 9 10 10 0 1 NULL
+ t277 b 4 INT 9 10 10 0 1 NULL
+ t277 c 4 INT 9 10 10 0 1 NULL
+ t277 d 4 INT 9 10 10 0 1 NULL
+ t277 e 4 INT 9 10 10 0 1 NULL
+ t278 a 4 INT 9 10 10 0 1 NULL
+ t278 b 4 INT 9 10 10 0 1 NULL
+ t278 c 4 INT 9 10 10 0 1 NULL
+ t278 d 4 INT 9 10 10 0 1 NULL
+ t278 e 4 INT 9 10 10 0 1 NULL
+ t279 a 4 INT 9 10 10 0 1 NULL
+ t279 b 4 INT 9 10 10 0 1 NULL
+ t279 c 4 INT 9 10 10 0 1 NULL
+ t279 d 4 INT 9 10 10 0 1 NULL
+ t279 e 4 INT 9 10 10 0 1 NULL
+ t280 a 4 INT 9 10 10 0 1 NULL
+ t280 b 4 INT 9 10 10 0 1 NULL
+ t280 c 4 INT 9 10 10 0 1 NULL
+ t280 d 4 INT 9 10 10 0 1 NULL
+ t280 e 4 INT 9 10 10 0 1 NULL
+ t281 a 4 INT 9 10 10 0 1 NULL
+ t281 b 4 INT 9 10 10 0 1 NULL
+ t281 c 4 INT 9 10 10 0 1 NULL
+ t281 d 4 INT 9 10 10 0 1 NULL
+ t281 e 4 INT 9 10 10 0 1 NULL
+ t282 a 4 INT 9 10 10 0 1 NULL
+ t282 b 4 INT 9 10 10 0 1 NULL
+ t282 c 4 INT 9 10 10 0 1 NULL
+ t282 d 4 INT 9 10 10 0 1 NULL
+ t282 e 4 INT 9 10 10 0 1 NULL
+ t283 a 4 INT 9 10 10 0 1 NULL
+ t283 b 4 INT 9 10 10 0 1 NULL
+ t283 c 4 INT 9 10 10 0 1 NULL
+ t283 d 4 INT 9 10 10 0 1 NULL
+ t283 e 4 INT 9 10 10 0 1 NULL
+ t284 a 4 INT 9 10 10 0 1 NULL
+ t284 b 4 INT 9 10 10 0 1 NULL
+ t284 c 4 INT 9 10 10 0 1 NULL
+ t284 d 4 INT 9 10 10 0 1 NULL
+ t284 e 4 INT 9 10 10 0 1 NULL
+ t285 a 4 INT 9 10 10 0 1 NULL
+ t285 b 4 INT 9 10 10 0 1 NULL
+ t285 c 4 INT 9 10 10 0 1 NULL
+ t285 d 4 INT 9 10 10 0 1 NULL
+ t285 e 4 INT 9 10 10 0 1 NULL
+ t286 a 4 INT 9 10 10 0 1 NULL
+ t286 b 4 INT 9 10 10 0 1 NULL
+ t286 c 4 INT 9 10 10 0 1 NULL
+ t286 d 4 INT 9 10 10 0 1 NULL
+ t286 e 4 INT 9 10 10 0 1 NULL
+ t287 a 4 INT 9 10 10 0 1 NULL
+ t287 b 4 INT 9 10 10 0 1 NULL
+ t287 c 4 INT 9 10 10 0 1 NULL
+ t287 d 4 INT 9 10 10 0 1 NULL
+ t287 e 4 INT 9 10 10 0 1 NULL
+ t288 a 4 INT 9 10 10 0 1 NULL
+ t288 b 4 INT 9 10 10 0 1 NULL
+ t288 c 4 INT 9 10 10 0 1 NULL
+ t288 d 4 INT 9 10 10 0 1 NULL
+ t288 e 4 INT 9 10 10 0 1 NULL
+ t289 a 4 INT 9 10 10 0 1 NULL
+ t289 b 4 INT 9 10 10 0 1 NULL
+ t289 c 4 INT 9 10 10 0 1 NULL
+ t289 d 4 INT 9 10 10 0 1 NULL
+ t289 e 4 INT 9 10 10 0 1 NULL
+ t290 a 4 INT 9 10 10 0 1 NULL
+ t290 b 4 INT 9 10 10 0 1 NULL
+ t290 c 4 INT 9 10 10 0 1 NULL
+ t290 d 4 INT 9 10 10 0 1 NULL
+ t290 e 4 INT 9 10 10 0 1 NULL
+ t291 a 4 INT 9 10 10 0 1 NULL
+ t291 b 4 INT 9 10 10 0 1 NULL
+ t291 c 4 INT 9 10 10 0 1 NULL
+ t291 d 4 INT 9 10 10 0 1 NULL
+ t291 e 4 INT 9 10 10 0 1 NULL
+ t292 a 4 INT 9 10 10 0 1 NULL
+ t292 b 4 INT 9 10 10 0 1 NULL
+ t292 c 4 INT 9 10 10 0 1 NULL
+ t292 d 4 INT 9 10 10 0 1 NULL
+ t292 e 4 INT 9 10 10 0 1 NULL
+ t293 a 4 INT 9 10 10 0 1 NULL
+ t293 b 4 INT 9 10 10 0 1 NULL
+ t293 c 4 INT 9 10 10 0 1 NULL
+ t293 d 4 INT 9 10 10 0 1 NULL
+ t293 e 4 INT 9 10 10 0 1 NULL
+ t294 a 4 INT 9 10 10 0 1 NULL
+ t294 b 4 INT 9 10 10 0 1 NULL
+ t294 c 4 INT 9 10 10 0 1 NULL
+ t294 d 4 INT 9 10 10 0 1 NULL
+ t294 e 4 INT 9 10 10 0 1 NULL
+ t295 a 4 INT 9 10 10 0 1 NULL
+ t295 b 4 INT 9 10 10 0 1 NULL
+ t295 c 4 INT 9 10 10 0 1 NULL
+ t295 d 4 INT 9 10 10 0 1 NULL
+ t295 e 4 INT 9 10 10 0 1 NULL
+ t296 a 4 INT 9 10 10 0 1 NULL
+ t296 b 4 INT 9 10 10 0 1 NULL
+ t296 c 4 INT 9 10 10 0 1 NULL
+ t296 d 4 INT 9 10 10 0 1 NULL
+ t296 e 4 INT 9 10 10 0 1 NULL
+ t297 a 4 INT 9 10 10 0 1 NULL
+ t297 b 4 INT 9 10 10 0 1 NULL
+ t297 c 4 INT 9 10 10 0 1 NULL
+ t297 d 4 INT 9 10 10 0 1 NULL
+ t297 e 4 INT 9 10 10 0 1 NULL
+ t298 a 4 INT 9 10 10 0 1 NULL
+ t298 b 4 INT 9 10 10 0 1 NULL
+ t298 c 4 INT 9 10 10 0 1 NULL
+ t298 d 4 INT 9 10 10 0 1 NULL
+ t298 e 4 INT 9 10 10 0 1 NULL
+ t299 a 4 INT 9 10 10 0 1 NULL
+ t299 b 4 INT 9 10 10 0 1 NULL
+ t299 c 4 INT 9 10 10 0 1 NULL
+ t299 d 4 INT 9 10 10 0 1 NULL
+ t299 e 4 INT 9 10 10 0 1 NULL
+ t300 a 4 INT 9 10 10 0 1 NULL
+ t300 b 4 INT 9 10 10 0 1 NULL
+ t300 c 4 INT 9 10 10 0 1 NULL
+ t300 d 4 INT 9 10 10 0 1 NULL
+ t300 e 4 INT 9 10 10 0 1 NULL
+ t301 a 4 INT 9 10 10 0 1 NULL
+ t301 b 4 INT 9 10 10 0 1 NULL
+ t301 c 4 INT 9 10 10 0 1 NULL
+ t301 d 4 INT 9 10 10 0 1 NULL
+ t301 e 4 INT 9 10 10 0 1 NULL
+ t302 a 4 INT 9 10 10 0 1 NULL
+ t302 b 4 INT 9 10 10 0 1 NULL
+ t302 c 4 INT 9 10 10 0 1 NULL
+ t302 d 4 INT 9 10 10 0 1 NULL
+ t302 e 4 INT 9 10 10 0 1 NULL
+ t303 a 4 INT 9 10 10 0 1 NULL
+ t303 b 4 INT 9 10 10 0 1 NULL
+ t303 c 4 INT 9 10 10 0 1 NULL
+ t303 d 4 INT 9 10 10 0 1 NULL
+ t303 e 4 INT 9 10 10 0 1 NULL
+ t304 a 4 INT 9 10 10 0 1 NULL
+ t304 b 4 INT 9 10 10 0 1 NULL
+ t304 c 4 INT 9 10 10 0 1 NULL
+ t304 d 4 INT 9 10 10 0 1 NULL
+ t304 e 4 INT 9 10 10 0 1 NULL
+ t305 a 4 INT 9 10 10 0 1 NULL
+ t305 b 4 INT 9 10 10 0 1 NULL
+ t305 c 4 INT 9 10 10 0 1 NULL
+ t305 d 4 INT 9 10 10 0 1 NULL
+ t305 e 4 INT 9 10 10 0 1 NULL
+ t306 a 4 INT 9 10 10 0 1 NULL
+ t306 b 4 INT 9 10 10 0 1 NULL
+ t306 c 4 INT 9 10 10 0 1 NULL
+ t306 d 4 INT 9 10 10 0 1 NULL
+ t306 e 4 INT 9 10 10 0 1 NULL
+ t307 a 4 INT 9 10 10 0 1 NULL
+ t307 b 4 INT 9 10 10 0 1 NULL
+ t307 c 4 INT 9 10 10 0 1 NULL
+ t307 d 4 INT 9 10 10 0 1 NULL
+ t307 e 4 INT 9 10 10 0 1 NULL
+ t308 a 4 INT 9 10 10 0 1 NULL
+ t308 b 4 INT 9 10 10 0 1 NULL
+ t308 c 4 INT 9 10 10 0 1 NULL
+ t308 d 4 INT 9 10 10 0 1 NULL
+ t308 e 4 INT 9 10 10 0 1 NULL
+ t309 a 4 INT 9 10 10 0 1 NULL
+ t309 b 4 INT 9 10 10 0 1 NULL
+ t309 c 4 INT 9 10 10 0 1 NULL
+ t309 d 4 INT 9 10 10 0 1 NULL
+ t309 e 4 INT 9 10 10 0 1 NULL
+ t310 a 4 INT 9 10 10 0 1 NULL
+ t310 b 4 INT 9 10 10 0 1 NULL
+ t310 c 4 INT 9 10 10 0 1 NULL
+ t310 d 4 INT 9 10 10 0 1 NULL
+ t310 e 4 INT 9 10 10 0 1 NULL
+ t311 a 4 INT 9 10 10 0 1 NULL
+ t311 b 4 INT 9 10 10 0 1 NULL
+ t311 c 4 INT 9 10 10 0 1 NULL
+ t311 d 4 INT 9 10 10 0 1 NULL
+ t311 e 4 INT 9 10 10 0 1 NULL
+ t312 a 4 INT 9 10 10 0 1 NULL
+ t312 b 4 INT 9 10 10 0 1 NULL
+ t312 c 4 INT 9 10 10 0 1 NULL
+ t312 d 4 INT 9 10 10 0 1 NULL
+ t312 e 4 INT 9 10 10 0 1 NULL
+ t313 a 4 INT 9 10 10 0 1 NULL
+ t313 b 4 INT 9 10 10 0 1 NULL
+ t313 c 4 INT 9 10 10 0 1 NULL
+ t313 d 4 INT 9 10 10 0 1 NULL
+ t313 e 4 INT 9 10 10 0 1 NULL
+ t314 a 4 INT 9 10 10 0 1 NULL
+ t314 b 4 INT 9 10 10 0 1 NULL
+ t314 c 4 INT 9 10 10 0 1 NULL
+ t314 d 4 INT 9 10 10 0 1 NULL
+ t314 e 4 INT 9 10 10 0 1 NULL
+ t315 a 4 INT 9 10 10 0 1 NULL
+ t315 b 4 INT 9 10 10 0 1 NULL
+ t315 c 4 INT 9 10 10 0 1 NULL
+ t315 d 4 INT 9 10 10 0 1 NULL
+ t315 e 4 INT 9 10 10 0 1 NULL
+ t316 a 4 INT 9 10 10 0 1 NULL
+ t316 b 4 INT 9 10 10 0 1 NULL
+ t316 c 4 INT 9 10 10 0 1 NULL
+ t316 d 4 INT 9 10 10 0 1 NULL
+ t316 e 4 INT 9 10 10 0 1 NULL
+ t317 a 4 INT 9 10 10 0 1 NULL
+ t317 b 4 INT 9 10 10 0 1 NULL
+ t317 c 4 INT 9 10 10 0 1 NULL
+ t317 d 4 INT 9 10 10 0 1 NULL
+ t317 e 4 INT 9 10 10 0 1 NULL
+ t318 a 4 INT 9 10 10 0 1 NULL
+ t318 b 4 INT 9 10 10 0 1 NULL
+ t318 c 4 INT 9 10 10 0 1 NULL
+ t318 d 4 INT 9 10 10 0 1 NULL
+ t318 e 4 INT 9 10 10 0 1 NULL
+ t319 a 4 INT 9 10 10 0 1 NULL
+ t319 b 4 INT 9 10 10 0 1 NULL
+ t319 c 4 INT 9 10 10 0 1 NULL
+ t319 d 4 INT 9 10 10 0 1 NULL
+ t319 e 4 INT 9 10 10 0 1 NULL
+ t320 a 4 INT 9 10 10 0 1 NULL
+ t320 b 4 INT 9 10 10 0 1 NULL
+ t320 c 4 INT 9 10 10 0 1 NULL
+ t320 d 4 INT 9 10 10 0 1 NULL
+ t320 e 4 INT 9 10 10 0 1 NULL
+ t321 a 4 INT 9 10 10 0 1 NULL
+ t321 b 4 INT 9 10 10 0 1 NULL
+ t321 c 4 INT 9 10 10 0 1 NULL
+ t321 d 4 INT 9 10 10 0 1 NULL
+ t321 e 4 INT 9 10 10 0 1 NULL
+ t322 a 4 INT 9 10 10 0 1 NULL
+ t322 b 4 INT 9 10 10 0 1 NULL
+ t322 c 4 INT 9 10 10 0 1 NULL
+ t322 d 4 INT 9 10 10 0 1 NULL
+ t322 e 4 INT 9 10 10 0 1 NULL
+ t323 a 4 INT 9 10 10 0 1 NULL
+ t323 b 4 INT 9 10 10 0 1 NULL
+ t323 c 4 INT 9 10 10 0 1 NULL
+ t323 d 4 INT 9 10 10 0 1 NULL
+ t323 e 4 INT 9 10 10 0 1 NULL
+ t324 a 4 INT 9 10 10 0 1 NULL
+ t324 b 4 INT 9 10 10 0 1 NULL
+ t324 c 4 INT 9 10 10 0 1 NULL
+ t324 d 4 INT 9 10 10 0 1 NULL
+ t324 e 4 INT 9 10 10 0 1 NULL
+ t325 a 4 INT 9 10 10 0 1 NULL
+ t325 b 4 INT 9 10 10 0 1 NULL
+ t325 c 4 INT 9 10 10 0 1 NULL
+ t325 d 4 INT 9 10 10 0 1 NULL
+ t325 e 4 INT 9 10 10 0 1 NULL
+ t326 a 4 INT 9 10 10 0 1 NULL
+ t326 b 4 INT 9 10 10 0 1 NULL
+ t326 c 4 INT 9 10 10 0 1 NULL
+ t326 d 4 INT 9 10 10 0 1 NULL
+ t326 e 4 INT 9 10 10 0 1 NULL
+ t327 a 4 INT 9 10 10 0 1 NULL
+ t327 b 4 INT 9 10 10 0 1 NULL
+ t327 c 4 INT 9 10 10 0 1 NULL
+ t327 d 4 INT 9 10 10 0 1 NULL
+ t327 e 4 INT 9 10 10 0 1 NULL
+ t328 a 4 INT 9 10 10 0 1 NULL
+ t328 b 4 INT 9 10 10 0 1 NULL
+ t328 c 4 INT 9 10 10 0 1 NULL
+ t328 d 4 INT 9 10 10 0 1 NULL
+ t328 e 4 INT 9 10 10 0 1 NULL
+ t329 a 4 INT 9 10 10 0 1 NULL
+ t329 b 4 INT 9 10 10 0 1 NULL
+ t329 c 4 INT 9 10 10 0 1 NULL
+ t329 d 4 INT 9 10 10 0 1 NULL
+ t329 e 4 INT 9 10 10 0 1 NULL
+ t330 a 4 INT 9 10 10 0 1 NULL
+ t330 b 4 INT 9 10 10 0 1 NULL
+ t330 c 4 INT 9 10 10 0 1 NULL
+ t330 d 4 INT 9 10 10 0 1 NULL
+ t330 e 4 INT 9 10 10 0 1 NULL
+ t331 a 4 INT 9 10 10 0 1 NULL
+ t331 b 4 INT 9 10 10 0 1 NULL
+ t331 c 4 INT 9 10 10 0 1 NULL
+ t331 d 4 INT 9 10 10 0 1 NULL
+ t331 e 4 INT 9 10 10 0 1 NULL
+ t332 a 4 INT 9 10 10 0 1 NULL
+ t332 b 4 INT 9 10 10 0 1 NULL
+ t332 c 4 INT 9 10 10 0 1 NULL
+ t332 d 4 INT 9 10 10 0 1 NULL
+ t332 e 4 INT 9 10 10 0 1 NULL
+ t333 a 4 INT 9 10 10 0 1 NULL
+ t333 b 4 INT 9 10 10 0 1 NULL
+ t333 c 4 INT 9 10 10 0 1 NULL
+ t333 d 4 INT 9 10 10 0 1 NULL
+ t333 e 4 INT 9 10 10 0 1 NULL
+ t334 a 4 INT 9 10 10 0 1 NULL
+ t334 b 4 INT 9 10 10 0 1 NULL
+ t334 c 4 INT 9 10 10 0 1 NULL
+ t334 d 4 INT 9 10 10 0 1 NULL
+ t334 e 4 INT 9 10 10 0 1 NULL
+ t335 a 4 INT 9 10 10 0 1 NULL
+ t335 b 4 INT 9 10 10 0 1 NULL
+ t335 c 4 INT 9 10 10 0 1 NULL
+ t335 d 4 INT 9 10 10 0 1 NULL
+ t335 e 4 INT 9 10 10 0 1 NULL
+ t336 a 4 INT 9 10 10 0 1 NULL
+ t336 b 4 INT 9 10 10 0 1 NULL
+ t336 c 4 INT 9 10 10 0 1 NULL
+ t336 d 4 INT 9 10 10 0 1 NULL
+ t336 e 4 INT 9 10 10 0 1 NULL
+ t337 a 4 INT 9 10 10 0 1 NULL
+ t337 b 4 INT 9 10 10 0 1 NULL
+ t337 c 4 INT 9 10 10 0 1 NULL
+ t337 d 4 INT 9 10 10 0 1 NULL
+ t337 e 4 INT 9 10 10 0 1 NULL
+ t338 a 4 INT 9 10 10 0 1 NULL
+ t338 b 4 INT 9 10 10 0 1 NULL
+ t338 c 4 INT 9 10 10 0 1 NULL
+ t338 d 4 INT 9 10 10 0 1 NULL
+ t338 e 4 INT 9 10 10 0 1 NULL
+ t339 a 4 INT 9 10 10 0 1 NULL
+ t339 b 4 INT 9 10 10 0 1 NULL
+ t339 c 4 INT 9 10 10 0 1 NULL
+ t339 d 4 INT 9 10 10 0 1 NULL
+ t339 e 4 INT 9 10 10 0 1 NULL
+ t340 a 4 INT 9 10 10 0 1 NULL
+ t340 b 4 INT 9 10 10 0 1 NULL
+ t340 c 4 INT 9 10 10 0 1 NULL
+ t340 d 4 INT 9 10 10 0 1 NULL
+ t340 e 4 INT 9 10 10 0 1 NULL
+ t341 a 4 INT 9 10 10 0 1 NULL
+ t341 b 4 INT 9 10 10 0 1 NULL
+ t341 c 4 INT 9 10 10 0 1 NULL
+ t341 d 4 INT 9 10 10 0 1 NULL
+ t341 e 4 INT 9 10 10 0 1 NULL
+ t342 a 4 INT 9 10 10 0 1 NULL
+ t342 b 4 INT 9 10 10 0 1 NULL
+ t342 c 4 INT 9 10 10 0 1 NULL
+ t342 d 4 INT 9 10 10 0 1 NULL
+ t342 e 4 INT 9 10 10 0 1 NULL
+ t343 a 4 INT 9 10 10 0 1 NULL
+ t343 b 4 INT 9 10 10 0 1 NULL
+ t343 c 4 INT 9 10 10 0 1 NULL
+ t343 d 4 INT 9 10 10 0 1 NULL
+ t343 e 4 INT 9 10 10 0 1 NULL
+ t344 a 4 INT 9 10 10 0 1 NULL
+ t344 b 4 INT 9 10 10 0 1 NULL
+ t344 c 4 INT 9 10 10 0 1 NULL
+ t344 d 4 INT 9 10 10 0 1 NULL
+ t344 e 4 INT 9 10 10 0 1 NULL
+ t345 a 4 INT 9 10 10 0 1 NULL
+ t345 b 4 INT 9 10 10 0 1 NULL
+ t345 c 4 INT 9 10 10 0 1 NULL
+ t345 d 4 INT 9 10 10 0 1 NULL
+ t345 e 4 INT 9 10 10 0 1 NULL
+ t346 a 4 INT 9 10 10 0 1 NULL
+ t346 b 4 INT 9 10 10 0 1 NULL
+ t346 c 4 INT 9 10 10 0 1 NULL
+ t346 d 4 INT 9 10 10 0 1 NULL
+ t346 e 4 INT 9 10 10 0 1 NULL
+ t347 a 4 INT 9 10 10 0 1 NULL
+ t347 b 4 INT 9 10 10 0 1 NULL
+ t347 c 4 INT 9 10 10 0 1 NULL
+ t347 d 4 INT 9 10 10 0 1 NULL
+ t347 e 4 INT 9 10 10 0 1 NULL
+ t348 a 4 INT 9 10 10 0 1 NULL
+ t348 b 4 INT 9 10 10 0 1 NULL
+ t348 c 4 INT 9 10 10 0 1 NULL
+ t348 d 4 INT 9 10 10 0 1 NULL
+ t348 e 4 INT 9 10 10 0 1 NULL
+ t349 a 4 INT 9 10 10 0 1 NULL
+ t349 b 4 INT 9 10 10 0 1 NULL
+ t349 c 4 INT 9 10 10 0 1 NULL
+ t349 d 4 INT 9 10 10 0 1 NULL
+ t349 e 4 INT 9 10 10 0 1 NULL
+ t350 a 4 INT 9 10 10 0 1 NULL
+ t350 b 4 INT 9 10 10 0 1 NULL
+ t350 c 4 INT 9 10 10 0 1 NULL
+ t350 d 4 INT 9 10 10 0 1 NULL
+ t350 e 4 INT 9 10 10 0 1 NULL
+ t351 a 4 INT 9 10 10 0 1 NULL
+ t351 b 4 INT 9 10 10 0 1 NULL
+ t351 c 4 INT 9 10 10 0 1 NULL
+ t351 d 4 INT 9 10 10 0 1 NULL
+ t351 e 4 INT 9 10 10 0 1 NULL
+ t352 a 4 INT 9 10 10 0 1 NULL
+ t352 b 4 INT 9 10 10 0 1 NULL
+ t352 c 4 INT 9 10 10 0 1 NULL
+ t352 d 4 INT 9 10 10 0 1 NULL
+ t352 e 4 INT 9 10 10 0 1 NULL
+ t353 a 4 INT 9 10 10 0 1 NULL
+ t353 b 4 INT 9 10 10 0 1 NULL
+ t353 c 4 INT 9 10 10 0 1 NULL
+ t353 d 4 INT 9 10 10 0 1 NULL
+ t353 e 4 INT 9 10 10 0 1 NULL
+ t354 a 4 INT 9 10 10 0 1 NULL
+ t354 b 4 INT 9 10 10 0 1 NULL
+ t354 c 4 INT 9 10 10 0 1 NULL
+ t354 d 4 INT 9 10 10 0 1 NULL
+ t354 e 4 INT 9 10 10 0 1 NULL
+ t355 a 4 INT 9 10 10 0 1 NULL
+ t355 b 4 INT 9 10 10 0 1 NULL
+ t355 c 4 INT 9 10 10 0 1 NULL
+ t355 d 4 INT 9 10 10 0 1 NULL
+ t355 e 4 INT 9 10 10 0 1 NULL
+ t356 a 4 INT 9 10 10 0 1 NULL
+ t356 b 4 INT 9 10 10 0 1 NULL
+ t356 c 4 INT 9 10 10 0 1 NULL
+ t356 d 4 INT 9 10 10 0 1 NULL
+ t356 e 4 INT 9 10 10 0 1 NULL
+ t357 a 4 INT 9 10 10 0 1 NULL
+ t357 b 4 INT 9 10 10 0 1 NULL
+ t357 c 4 INT 9 10 10 0 1 NULL
+ t357 d 4 INT 9 10 10 0 1 NULL
+ t357 e 4 INT 9 10 10 0 1 NULL
+ t358 a 4 INT 9 10 10 0 1 NULL
+ t358 b 4 INT 9 10 10 0 1 NULL
+ t358 c 4 INT 9 10 10 0 1 NULL
+ t358 d 4 INT 9 10 10 0 1 NULL
+ t358 e 4 INT 9 10 10 0 1 NULL
+ t359 a 4 INT 9 10 10 0 1 NULL
+ t359 b 4 INT 9 10 10 0 1 NULL
+ t359 c 4 INT 9 10 10 0 1 NULL
+ t359 d 4 INT 9 10 10 0 1 NULL
+ t359 e 4 INT 9 10 10 0 1 NULL
+ t360 a 4 INT 9 10 10 0 1 NULL
+ t360 b 4 INT 9 10 10 0 1 NULL
+ t360 c 4 INT 9 10 10 0 1 NULL
+ t360 d 4 INT 9 10 10 0 1 NULL
+ t360 e 4 INT 9 10 10 0 1 NULL
+ t361 a 4 INT 9 10 10 0 1 NULL
+ t361 b 4 INT 9 10 10 0 1 NULL
+ t361 c 4 INT 9 10 10 0 1 NULL
+ t361 d 4 INT 9 10 10 0 1 NULL
+ t361 e 4 INT 9 10 10 0 1 NULL
+ t362 a 4 INT 9 10 10 0 1 NULL
+ t362 b 4 INT 9 10 10 0 1 NULL
+ t362 c 4 INT 9 10 10 0 1 NULL
+ t362 d 4 INT 9 10 10 0 1 NULL
+ t362 e 4 INT 9 10 10 0 1 NULL
+ t363 a 4 INT 9 10 10 0 1 NULL
+ t363 b 4 INT 9 10 10 0 1 NULL
+ t363 c 4 INT 9 10 10 0 1 NULL
+ t363 d 4 INT 9 10 10 0 1 NULL
+ t363 e 4 INT 9 10 10 0 1 NULL
+ t364 a 4 INT 9 10 10 0 1 NULL
+ t364 b 4 INT 9 10 10 0 1 NULL
+ t364 c 4 INT 9 10 10 0 1 NULL
+ t364 d 4 INT 9 10 10 0 1 NULL
+ t364 e 4 INT 9 10 10 0 1 NULL
+ t365 a 4 INT 9 10 10 0 1 NULL
+ t365 b 4 INT 9 10 10 0 1 NULL
+ t365 c 4 INT 9 10 10 0 1 NULL
+ t365 d 4 INT 9 10 10 0 1 NULL
+ t365 e 4 INT 9 10 10 0 1 NULL
+ t366 a 4 INT 9 10 10 0 1 NULL
+ t366 b 4 INT 9 10 10 0 1 NULL
+ t366 c 4 INT 9 10 10 0 1 NULL
+ t366 d 4 INT 9 10 10 0 1 NULL
+ t366 e 4 INT 9 10 10 0 1 NULL
+ t367 a 4 INT 9 10 10 0 1 NULL
+ t367 b 4 INT 9 10 10 0 1 NULL
+ t367 c 4 INT 9 10 10 0 1 NULL
+ t367 d 4 INT 9 10 10 0 1 NULL
+ t367 e 4 INT 9 10 10 0 1 NULL
+ t368 a 4 INT 9 10 10 0 1 NULL
+ t368 b 4 INT 9 10 10 0 1 NULL
+ t368 c 4 INT 9 10 10 0 1 NULL
+ t368 d 4 INT 9 10 10 0 1 NULL
+ t368 e 4 INT 9 10 10 0 1 NULL
+ t369 a 4 INT 9 10 10 0 1 NULL
+ t369 b 4 INT 9 10 10 0 1 NULL
+ t369 c 4 INT 9 10 10 0 1 NULL
+ t369 d 4 INT 9 10 10 0 1 NULL
+ t369 e 4 INT 9 10 10 0 1 NULL
+ t370 a 4 INT 9 10 10 0 1 NULL
+ t370 b 4 INT 9 10 10 0 1 NULL
+ t370 c 4 INT 9 10 10 0 1 NULL
+ t370 d 4 INT 9 10 10 0 1 NULL
+ t370 e 4 INT 9 10 10 0 1 NULL
+ t371 a 4 INT 9 10 10 0 1 NULL
+ t371 b 4 INT 9 10 10 0 1 NULL
+ t371 c 4 INT 9 10 10 0 1 NULL
+ t371 d 4 INT 9 10 10 0 1 NULL
+ t371 e 4 INT 9 10 10 0 1 NULL
+ t372 a 4 INT 9 10 10 0 1 NULL
+ t372 b 4 INT 9 10 10 0 1 NULL
+ t372 c 4 INT 9 10 10 0 1 NULL
+ t372 d 4 INT 9 10 10 0 1 NULL
+ t372 e 4 INT 9 10 10 0 1 NULL
+ t373 a 4 INT 9 10 10 0 1 NULL
+ t373 b 4 INT 9 10 10 0 1 NULL
+ t373 c 4 INT 9 10 10 0 1 NULL
+ t373 d 4 INT 9 10 10 0 1 NULL
+ t373 e 4 INT 9 10 10 0 1 NULL
+ t374 a 4 INT 9 10 10 0 1 NULL
+ t374 b 4 INT 9 10 10 0 1 NULL
+ t374 c 4 INT 9 10 10 0 1 NULL
+ t374 d 4 INT 9 10 10 0 1 NULL
+ t374 e 4 INT 9 10 10 0 1 NULL
+ t375 a 4 INT 9 10 10 0 1 NULL
+ t375 b 4 INT 9 10 10 0 1 NULL
+ t375 c 4 INT 9 10 10 0 1 NULL
+ t375 d 4 INT 9 10 10 0 1 NULL
+ t375 e 4 INT 9 10 10 0 1 NULL
+ t376 a 4 INT 9 10 10 0 1 NULL
+ t376 b 4 INT 9 10 10 0 1 NULL
+ t376 c 4 INT 9 10 10 0 1 NULL
+ t376 d 4 INT 9 10 10 0 1 NULL
+ t376 e 4 INT 9 10 10 0 1 NULL
+ t377 a 4 INT 9 10 10 0 1 NULL
+ t377 b 4 INT 9 10 10 0 1 NULL
+ t377 c 4 INT 9 10 10 0 1 NULL
+ t377 d 4 INT 9 10 10 0 1 NULL
+ t377 e 4 INT 9 10 10 0 1 NULL
+ t378 a 4 INT 9 10 10 0 1 NULL
+ t378 b 4 INT 9 10 10 0 1 NULL
+ t378 c 4 INT 9 10 10 0 1 NULL
+ t378 d 4 INT 9 10 10 0 1 NULL
+ t378 e 4 INT 9 10 10 0 1 NULL
+ t379 a 4 INT 9 10 10 0 1 NULL
+ t379 b 4 INT 9 10 10 0 1 NULL
+ t379 c 4 INT 9 10 10 0 1 NULL
+ t379 d 4 INT 9 10 10 0 1 NULL
+ t379 e 4 INT 9 10 10 0 1 NULL
+ t380 a 4 INT 9 10 10 0 1 NULL
+ t380 b 4 INT 9 10 10 0 1 NULL
+ t380 c 4 INT 9 10 10 0 1 NULL
+ t380 d 4 INT 9 10 10 0 1 NULL
+ t380 e 4 INT 9 10 10 0 1 NULL
+ t381 a 4 INT 9 10 10 0 1 NULL
+ t381 b 4 INT 9 10 10 0 1 NULL
+ t381 c 4 INT 9 10 10 0 1 NULL
+ t381 d 4 INT 9 10 10 0 1 NULL
+ t381 e 4 INT 9 10 10 0 1 NULL
+ t382 a 4 INT 9 10 10 0 1 NULL
+ t382 b 4 INT 9 10 10 0 1 NULL
+ t382 c 4 INT 9 10 10 0 1 NULL
+ t382 d 4 INT 9 10 10 0 1 NULL
+ t382 e 4 INT 9 10 10 0 1 NULL
+ t383 a 4 INT 9 10 10 0 1 NULL
+ t383 b 4 INT 9 10 10 0 1 NULL
+ t383 c 4 INT 9 10 10 0 1 NULL
+ t383 d 4 INT 9 10 10 0 1 NULL
+ t383 e 4 INT 9 10 10 0 1 NULL
+ t384 a 4 INT 9 10 10 0 1 NULL
+ t384 b 4 INT 9 10 10 0 1 NULL
+ t384 c 4 INT 9 10 10 0 1 NULL
+ t384 d 4 INT 9 10 10 0 1 NULL
+ t384 e 4 INT 9 10 10 0 1 NULL
+ t385 a 4 INT 9 10 10 0 1 NULL
+ t385 b 4 INT 9 10 10 0 1 NULL
+ t385 c 4 INT 9 10 10 0 1 NULL
+ t385 d 4 INT 9 10 10 0 1 NULL
+ t385 e 4 INT 9 10 10 0 1 NULL
+ t386 a 4 INT 9 10 10 0 1 NULL
+ t386 b 4 INT 9 10 10 0 1 NULL
+ t386 c 4 INT 9 10 10 0 1 NULL
+ t386 d 4 INT 9 10 10 0 1 NULL
+ t386 e 4 INT 9 10 10 0 1 NULL
+ t387 a 4 INT 9 10 10 0 1 NULL
+ t387 b 4 INT 9 10 10 0 1 NULL
+ t387 c 4 INT 9 10 10 0 1 NULL
+ t387 d 4 INT 9 10 10 0 1 NULL
+ t387 e 4 INT 9 10 10 0 1 NULL
+ t388 a 4 INT 9 10 10 0 1 NULL
+ t388 b 4 INT 9 10 10 0 1 NULL
+ t388 c 4 INT 9 10 10 0 1 NULL
+ t388 d 4 INT 9 10 10 0 1 NULL
+ t388 e 4 INT 9 10 10 0 1 NULL
+ t389 a 4 INT 9 10 10 0 1 NULL
+ t389 b 4 INT 9 10 10 0 1 NULL
+ t389 c 4 INT 9 10 10 0 1 NULL
+ t389 d 4 INT 9 10 10 0 1 NULL
+ t389 e 4 INT 9 10 10 0 1 NULL
+ t390 a 4 INT 9 10 10 0 1 NULL
+ t390 b 4 INT 9 10 10 0 1 NULL
+ t390 c 4 INT 9 10 10 0 1 NULL
+ t390 d 4 INT 9 10 10 0 1 NULL
+ t390 e 4 INT 9 10 10 0 1 NULL
+ t391 a 4 INT 9 10 10 0 1 NULL
+ t391 b 4 INT 9 10 10 0 1 NULL
+ t391 c 4 INT 9 10 10 0 1 NULL
+ t391 d 4 INT 9 10 10 0 1 NULL
+ t391 e 4 INT 9 10 10 0 1 NULL
+ t392 a 4 INT 9 10 10 0 1 NULL
+ t392 b 4 INT 9 10 10 0 1 NULL
+ t392 c 4 INT 9 10 10 0 1 NULL
+ t392 d 4 INT 9 10 10 0 1 NULL
+ t392 e 4 INT 9 10 10 0 1 NULL
+ t393 a 4 INT 9 10 10 0 1 NULL
+ t393 b 4 INT 9 10 10 0 1 NULL
+ t393 c 4 INT 9 10 10 0 1 NULL
+ t393 d 4 INT 9 10 10 0 1 NULL
+ t393 e 4 INT 9 10 10 0 1 NULL
+ t394 a 4 INT 9 10 10 0 1 NULL
+ t394 b 4 INT 9 10 10 0 1 NULL
+ t394 c 4 INT 9 10 10 0 1 NULL
+ t394 d 4 INT 9 10 10 0 1 NULL
+ t394 e 4 INT 9 10 10 0 1 NULL
+ t395 a 4 INT 9 10 10 0 1 NULL
+ t395 b 4 INT 9 10 10 0 1 NULL
+ t395 c 4 INT 9 10 10 0 1 NULL
+ t395 d 4 INT 9 10 10 0 1 NULL
+ t395 e 4 INT 9 10 10 0 1 NULL
+ t396 a 4 INT 9 10 10 0 1 NULL
+ t396 b 4 INT 9 10 10 0 1 NULL
+ t396 c 4 INT 9 10 10 0 1 NULL
+ t396 d 4 INT 9 10 10 0 1 NULL
+ t396 e 4 INT 9 10 10 0 1 NULL
+ t397 a 4 INT 9 10 10 0 1 NULL
+ t397 b 4 INT 9 10 10 0 1 NULL
+ t397 c 4 INT 9 10 10 0 1 NULL
+ t397 d 4 INT 9 10 10 0 1 NULL
+ t397 e 4 INT 9 10 10 0 1 NULL
+ t398 a 4 INT 9 10 10 0 1 NULL
+ t398 b 4 INT 9 10 10 0 1 NULL
+ t398 c 4 INT 9 10 10 0 1 NULL
+ t398 d 4 INT 9 10 10 0 1 NULL
+ t398 e 4 INT 9 10 10 0 1 NULL
+ t399 a 4 INT 9 10 10 0 1 NULL
+ t399 b 4 INT 9 10 10 0 1 NULL
+ t399 c 4 INT 9 10 10 0 1 NULL
+ t399 d 4 INT 9 10 10 0 1 NULL
+ t399 e 4 INT 9 10 10 0 1 NULL
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=MTR_SUITE_DIR/std_data/test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
SELECT * FROM t1 ORDER BY Table_name;
Table_Cat Table_Schema Table_Name Table_Type Remark
- t000 TABLE
- t001 TABLE
- t002 TABLE
- t003 TABLE
- t004 TABLE
- t005 TABLE
- t006 TABLE
- t007 TABLE
- t008 TABLE
- t009 TABLE
- t010 TABLE
- t011 TABLE
- t012 TABLE
- t013 TABLE
- t014 TABLE
- t015 TABLE
- t016 TABLE
- t017 TABLE
- t018 TABLE
- t019 TABLE
- t020 TABLE
- t021 TABLE
- t022 TABLE
- t023 TABLE
- t024 TABLE
- t025 TABLE
- t026 TABLE
- t027 TABLE
- t028 TABLE
- t029 TABLE
- t030 TABLE
- t031 TABLE
- t032 TABLE
- t033 TABLE
- t034 TABLE
- t035 TABLE
- t036 TABLE
- t037 TABLE
- t038 TABLE
- t039 TABLE
- t040 TABLE
- t041 TABLE
- t042 TABLE
- t043 TABLE
- t044 TABLE
- t045 TABLE
- t046 TABLE
- t047 TABLE
- t048 TABLE
- t049 TABLE
- t050 TABLE
- t051 TABLE
- t052 TABLE
- t053 TABLE
- t054 TABLE
- t055 TABLE
- t056 TABLE
- t057 TABLE
- t058 TABLE
- t059 TABLE
- t060 TABLE
- t061 TABLE
- t062 TABLE
- t063 TABLE
- t064 TABLE
- t065 TABLE
- t066 TABLE
- t067 TABLE
- t068 TABLE
- t069 TABLE
- t070 TABLE
- t071 TABLE
- t072 TABLE
- t073 TABLE
- t074 TABLE
- t075 TABLE
- t076 TABLE
- t077 TABLE
- t078 TABLE
- t079 TABLE
- t080 TABLE
- t081 TABLE
- t082 TABLE
- t083 TABLE
- t084 TABLE
- t085 TABLE
- t086 TABLE
- t087 TABLE
- t088 TABLE
- t089 TABLE
- t090 TABLE
- t091 TABLE
- t092 TABLE
- t093 TABLE
- t094 TABLE
- t095 TABLE
- t096 TABLE
- t097 TABLE
- t098 TABLE
- t099 TABLE
- t1 TABLE
- t100 TABLE
- t101 TABLE
- t102 TABLE
- t103 TABLE
- t104 TABLE
- t105 TABLE
- t106 TABLE
- t107 TABLE
- t108 TABLE
- t109 TABLE
- t110 TABLE
- t111 TABLE
- t112 TABLE
- t113 TABLE
- t114 TABLE
- t115 TABLE
- t116 TABLE
- t117 TABLE
- t118 TABLE
- t119 TABLE
- t120 TABLE
- t121 TABLE
- t122 TABLE
- t123 TABLE
- t124 TABLE
- t125 TABLE
- t126 TABLE
- t127 TABLE
- t128 TABLE
- t129 TABLE
- t130 TABLE
- t131 TABLE
- t132 TABLE
- t133 TABLE
- t134 TABLE
- t135 TABLE
- t136 TABLE
- t137 TABLE
- t138 TABLE
- t139 TABLE
- t140 TABLE
- t141 TABLE
- t142 TABLE
- t143 TABLE
- t144 TABLE
- t145 TABLE
- t146 TABLE
- t147 TABLE
- t148 TABLE
- t149 TABLE
- t150 TABLE
- t151 TABLE
- t152 TABLE
- t153 TABLE
- t154 TABLE
- t155 TABLE
- t156 TABLE
- t157 TABLE
- t158 TABLE
- t159 TABLE
- t160 TABLE
- t161 TABLE
- t162 TABLE
- t163 TABLE
- t164 TABLE
- t165 TABLE
- t166 TABLE
- t167 TABLE
- t168 TABLE
- t169 TABLE
- t170 TABLE
- t171 TABLE
- t172 TABLE
- t173 TABLE
- t174 TABLE
- t175 TABLE
- t176 TABLE
- t177 TABLE
- t178 TABLE
- t179 TABLE
- t180 TABLE
- t181 TABLE
- t182 TABLE
- t183 TABLE
- t184 TABLE
- t185 TABLE
- t186 TABLE
- t187 TABLE
- t188 TABLE
- t189 TABLE
- t190 TABLE
- t191 TABLE
- t192 TABLE
- t193 TABLE
- t194 TABLE
- t195 TABLE
- t196 TABLE
- t197 TABLE
- t198 TABLE
- t199 TABLE
- t200 TABLE
- t201 TABLE
- t202 TABLE
- t203 TABLE
- t204 TABLE
- t205 TABLE
- t206 TABLE
- t207 TABLE
- t208 TABLE
- t209 TABLE
- t210 TABLE
- t211 TABLE
- t212 TABLE
- t213 TABLE
- t214 TABLE
- t215 TABLE
- t216 TABLE
- t217 TABLE
- t218 TABLE
- t219 TABLE
- t220 TABLE
- t221 TABLE
- t222 TABLE
- t223 TABLE
- t224 TABLE
- t225 TABLE
- t226 TABLE
- t227 TABLE
- t228 TABLE
- t229 TABLE
- t230 TABLE
- t231 TABLE
- t232 TABLE
- t233 TABLE
- t234 TABLE
- t235 TABLE
- t236 TABLE
- t237 TABLE
- t238 TABLE
- t239 TABLE
- t240 TABLE
- t241 TABLE
- t242 TABLE
- t243 TABLE
- t244 TABLE
- t245 TABLE
- t246 TABLE
- t247 TABLE
- t248 TABLE
- t249 TABLE
- t250 TABLE
- t251 TABLE
- t252 TABLE
- t253 TABLE
- t254 TABLE
- t255 TABLE
- t256 TABLE
- t257 TABLE
- t258 TABLE
- t259 TABLE
- t260 TABLE
- t261 TABLE
- t262 TABLE
- t263 TABLE
- t264 TABLE
- t265 TABLE
- t266 TABLE
- t267 TABLE
- t268 TABLE
- t269 TABLE
- t270 TABLE
- t271 TABLE
- t272 TABLE
- t273 TABLE
- t274 TABLE
- t275 TABLE
- t276 TABLE
- t277 TABLE
- t278 TABLE
- t279 TABLE
- t280 TABLE
- t281 TABLE
- t282 TABLE
- t283 TABLE
- t284 TABLE
- t285 TABLE
- t286 TABLE
- t287 TABLE
- t288 TABLE
- t289 TABLE
- t290 TABLE
- t291 TABLE
- t292 TABLE
- t293 TABLE
- t294 TABLE
- t295 TABLE
- t296 TABLE
- t297 TABLE
- t298 TABLE
- t299 TABLE
- t300 TABLE
- t301 TABLE
- t302 TABLE
- t303 TABLE
- t304 TABLE
- t305 TABLE
- t306 TABLE
- t307 TABLE
- t308 TABLE
- t309 TABLE
- t310 TABLE
- t311 TABLE
- t312 TABLE
- t313 TABLE
- t314 TABLE
- t315 TABLE
- t316 TABLE
- t317 TABLE
- t318 TABLE
- t319 TABLE
- t320 TABLE
- t321 TABLE
- t322 TABLE
- t323 TABLE
- t324 TABLE
- t325 TABLE
- t326 TABLE
- t327 TABLE
- t328 TABLE
- t329 TABLE
- t330 TABLE
- t331 TABLE
- t332 TABLE
- t333 TABLE
- t334 TABLE
- t335 TABLE
- t336 TABLE
- t337 TABLE
- t338 TABLE
- t339 TABLE
- t340 TABLE
- t341 TABLE
- t342 TABLE
- t343 TABLE
- t344 TABLE
- t345 TABLE
- t346 TABLE
- t347 TABLE
- t348 TABLE
- t349 TABLE
- t350 TABLE
- t351 TABLE
- t352 TABLE
- t353 TABLE
- t354 TABLE
- t355 TABLE
- t356 TABLE
- t357 TABLE
- t358 TABLE
- t359 TABLE
- t360 TABLE
- t361 TABLE
- t362 TABLE
- t363 TABLE
- t364 TABLE
- t365 TABLE
- t366 TABLE
- t367 TABLE
- t368 TABLE
- t369 TABLE
- t370 TABLE
- t371 TABLE
- t372 TABLE
- t373 TABLE
- t374 TABLE
- t375 TABLE
- t376 TABLE
- t377 TABLE
- t378 TABLE
- t379 TABLE
- t380 TABLE
- t381 TABLE
- t382 TABLE
- t383 TABLE
- t384 TABLE
- t385 TABLE
- t386 TABLE
- t387 TABLE
- t388 TABLE
- t389 TABLE
- t390 TABLE
- t391 TABLE
- t392 TABLE
- t393 TABLE
- t394 TABLE
- t395 TABLE
- t396 TABLE
- t397 TABLE
- t398 TABLE
- t399 TABLE
+NULL NULL t000 TABLE NULL
+NULL NULL t001 TABLE NULL
+NULL NULL t002 TABLE NULL
+NULL NULL t003 TABLE NULL
+NULL NULL t004 TABLE NULL
+NULL NULL t005 TABLE NULL
+NULL NULL t006 TABLE NULL
+NULL NULL t007 TABLE NULL
+NULL NULL t008 TABLE NULL
+NULL NULL t009 TABLE NULL
+NULL NULL t010 TABLE NULL
+NULL NULL t011 TABLE NULL
+NULL NULL t012 TABLE NULL
+NULL NULL t013 TABLE NULL
+NULL NULL t014 TABLE NULL
+NULL NULL t015 TABLE NULL
+NULL NULL t016 TABLE NULL
+NULL NULL t017 TABLE NULL
+NULL NULL t018 TABLE NULL
+NULL NULL t019 TABLE NULL
+NULL NULL t020 TABLE NULL
+NULL NULL t021 TABLE NULL
+NULL NULL t022 TABLE NULL
+NULL NULL t023 TABLE NULL
+NULL NULL t024 TABLE NULL
+NULL NULL t025 TABLE NULL
+NULL NULL t026 TABLE NULL
+NULL NULL t027 TABLE NULL
+NULL NULL t028 TABLE NULL
+NULL NULL t029 TABLE NULL
+NULL NULL t030 TABLE NULL
+NULL NULL t031 TABLE NULL
+NULL NULL t032 TABLE NULL
+NULL NULL t033 TABLE NULL
+NULL NULL t034 TABLE NULL
+NULL NULL t035 TABLE NULL
+NULL NULL t036 TABLE NULL
+NULL NULL t037 TABLE NULL
+NULL NULL t038 TABLE NULL
+NULL NULL t039 TABLE NULL
+NULL NULL t040 TABLE NULL
+NULL NULL t041 TABLE NULL
+NULL NULL t042 TABLE NULL
+NULL NULL t043 TABLE NULL
+NULL NULL t044 TABLE NULL
+NULL NULL t045 TABLE NULL
+NULL NULL t046 TABLE NULL
+NULL NULL t047 TABLE NULL
+NULL NULL t048 TABLE NULL
+NULL NULL t049 TABLE NULL
+NULL NULL t050 TABLE NULL
+NULL NULL t051 TABLE NULL
+NULL NULL t052 TABLE NULL
+NULL NULL t053 TABLE NULL
+NULL NULL t054 TABLE NULL
+NULL NULL t055 TABLE NULL
+NULL NULL t056 TABLE NULL
+NULL NULL t057 TABLE NULL
+NULL NULL t058 TABLE NULL
+NULL NULL t059 TABLE NULL
+NULL NULL t060 TABLE NULL
+NULL NULL t061 TABLE NULL
+NULL NULL t062 TABLE NULL
+NULL NULL t063 TABLE NULL
+NULL NULL t064 TABLE NULL
+NULL NULL t065 TABLE NULL
+NULL NULL t066 TABLE NULL
+NULL NULL t067 TABLE NULL
+NULL NULL t068 TABLE NULL
+NULL NULL t069 TABLE NULL
+NULL NULL t070 TABLE NULL
+NULL NULL t071 TABLE NULL
+NULL NULL t072 TABLE NULL
+NULL NULL t073 TABLE NULL
+NULL NULL t074 TABLE NULL
+NULL NULL t075 TABLE NULL
+NULL NULL t076 TABLE NULL
+NULL NULL t077 TABLE NULL
+NULL NULL t078 TABLE NULL
+NULL NULL t079 TABLE NULL
+NULL NULL t080 TABLE NULL
+NULL NULL t081 TABLE NULL
+NULL NULL t082 TABLE NULL
+NULL NULL t083 TABLE NULL
+NULL NULL t084 TABLE NULL
+NULL NULL t085 TABLE NULL
+NULL NULL t086 TABLE NULL
+NULL NULL t087 TABLE NULL
+NULL NULL t088 TABLE NULL
+NULL NULL t089 TABLE NULL
+NULL NULL t090 TABLE NULL
+NULL NULL t091 TABLE NULL
+NULL NULL t092 TABLE NULL
+NULL NULL t093 TABLE NULL
+NULL NULL t094 TABLE NULL
+NULL NULL t095 TABLE NULL
+NULL NULL t096 TABLE NULL
+NULL NULL t097 TABLE NULL
+NULL NULL t098 TABLE NULL
+NULL NULL t099 TABLE NULL
+NULL NULL t1 TABLE NULL
+NULL NULL t100 TABLE NULL
+NULL NULL t101 TABLE NULL
+NULL NULL t102 TABLE NULL
+NULL NULL t103 TABLE NULL
+NULL NULL t104 TABLE NULL
+NULL NULL t105 TABLE NULL
+NULL NULL t106 TABLE NULL
+NULL NULL t107 TABLE NULL
+NULL NULL t108 TABLE NULL
+NULL NULL t109 TABLE NULL
+NULL NULL t110 TABLE NULL
+NULL NULL t111 TABLE NULL
+NULL NULL t112 TABLE NULL
+NULL NULL t113 TABLE NULL
+NULL NULL t114 TABLE NULL
+NULL NULL t115 TABLE NULL
+NULL NULL t116 TABLE NULL
+NULL NULL t117 TABLE NULL
+NULL NULL t118 TABLE NULL
+NULL NULL t119 TABLE NULL
+NULL NULL t120 TABLE NULL
+NULL NULL t121 TABLE NULL
+NULL NULL t122 TABLE NULL
+NULL NULL t123 TABLE NULL
+NULL NULL t124 TABLE NULL
+NULL NULL t125 TABLE NULL
+NULL NULL t126 TABLE NULL
+NULL NULL t127 TABLE NULL
+NULL NULL t128 TABLE NULL
+NULL NULL t129 TABLE NULL
+NULL NULL t130 TABLE NULL
+NULL NULL t131 TABLE NULL
+NULL NULL t132 TABLE NULL
+NULL NULL t133 TABLE NULL
+NULL NULL t134 TABLE NULL
+NULL NULL t135 TABLE NULL
+NULL NULL t136 TABLE NULL
+NULL NULL t137 TABLE NULL
+NULL NULL t138 TABLE NULL
+NULL NULL t139 TABLE NULL
+NULL NULL t140 TABLE NULL
+NULL NULL t141 TABLE NULL
+NULL NULL t142 TABLE NULL
+NULL NULL t143 TABLE NULL
+NULL NULL t144 TABLE NULL
+NULL NULL t145 TABLE NULL
+NULL NULL t146 TABLE NULL
+NULL NULL t147 TABLE NULL
+NULL NULL t148 TABLE NULL
+NULL NULL t149 TABLE NULL
+NULL NULL t150 TABLE NULL
+NULL NULL t151 TABLE NULL
+NULL NULL t152 TABLE NULL
+NULL NULL t153 TABLE NULL
+NULL NULL t154 TABLE NULL
+NULL NULL t155 TABLE NULL
+NULL NULL t156 TABLE NULL
+NULL NULL t157 TABLE NULL
+NULL NULL t158 TABLE NULL
+NULL NULL t159 TABLE NULL
+NULL NULL t160 TABLE NULL
+NULL NULL t161 TABLE NULL
+NULL NULL t162 TABLE NULL
+NULL NULL t163 TABLE NULL
+NULL NULL t164 TABLE NULL
+NULL NULL t165 TABLE NULL
+NULL NULL t166 TABLE NULL
+NULL NULL t167 TABLE NULL
+NULL NULL t168 TABLE NULL
+NULL NULL t169 TABLE NULL
+NULL NULL t170 TABLE NULL
+NULL NULL t171 TABLE NULL
+NULL NULL t172 TABLE NULL
+NULL NULL t173 TABLE NULL
+NULL NULL t174 TABLE NULL
+NULL NULL t175 TABLE NULL
+NULL NULL t176 TABLE NULL
+NULL NULL t177 TABLE NULL
+NULL NULL t178 TABLE NULL
+NULL NULL t179 TABLE NULL
+NULL NULL t180 TABLE NULL
+NULL NULL t181 TABLE NULL
+NULL NULL t182 TABLE NULL
+NULL NULL t183 TABLE NULL
+NULL NULL t184 TABLE NULL
+NULL NULL t185 TABLE NULL
+NULL NULL t186 TABLE NULL
+NULL NULL t187 TABLE NULL
+NULL NULL t188 TABLE NULL
+NULL NULL t189 TABLE NULL
+NULL NULL t190 TABLE NULL
+NULL NULL t191 TABLE NULL
+NULL NULL t192 TABLE NULL
+NULL NULL t193 TABLE NULL
+NULL NULL t194 TABLE NULL
+NULL NULL t195 TABLE NULL
+NULL NULL t196 TABLE NULL
+NULL NULL t197 TABLE NULL
+NULL NULL t198 TABLE NULL
+NULL NULL t199 TABLE NULL
+NULL NULL t200 TABLE NULL
+NULL NULL t201 TABLE NULL
+NULL NULL t202 TABLE NULL
+NULL NULL t203 TABLE NULL
+NULL NULL t204 TABLE NULL
+NULL NULL t205 TABLE NULL
+NULL NULL t206 TABLE NULL
+NULL NULL t207 TABLE NULL
+NULL NULL t208 TABLE NULL
+NULL NULL t209 TABLE NULL
+NULL NULL t210 TABLE NULL
+NULL NULL t211 TABLE NULL
+NULL NULL t212 TABLE NULL
+NULL NULL t213 TABLE NULL
+NULL NULL t214 TABLE NULL
+NULL NULL t215 TABLE NULL
+NULL NULL t216 TABLE NULL
+NULL NULL t217 TABLE NULL
+NULL NULL t218 TABLE NULL
+NULL NULL t219 TABLE NULL
+NULL NULL t220 TABLE NULL
+NULL NULL t221 TABLE NULL
+NULL NULL t222 TABLE NULL
+NULL NULL t223 TABLE NULL
+NULL NULL t224 TABLE NULL
+NULL NULL t225 TABLE NULL
+NULL NULL t226 TABLE NULL
+NULL NULL t227 TABLE NULL
+NULL NULL t228 TABLE NULL
+NULL NULL t229 TABLE NULL
+NULL NULL t230 TABLE NULL
+NULL NULL t231 TABLE NULL
+NULL NULL t232 TABLE NULL
+NULL NULL t233 TABLE NULL
+NULL NULL t234 TABLE NULL
+NULL NULL t235 TABLE NULL
+NULL NULL t236 TABLE NULL
+NULL NULL t237 TABLE NULL
+NULL NULL t238 TABLE NULL
+NULL NULL t239 TABLE NULL
+NULL NULL t240 TABLE NULL
+NULL NULL t241 TABLE NULL
+NULL NULL t242 TABLE NULL
+NULL NULL t243 TABLE NULL
+NULL NULL t244 TABLE NULL
+NULL NULL t245 TABLE NULL
+NULL NULL t246 TABLE NULL
+NULL NULL t247 TABLE NULL
+NULL NULL t248 TABLE NULL
+NULL NULL t249 TABLE NULL
+NULL NULL t250 TABLE NULL
+NULL NULL t251 TABLE NULL
+NULL NULL t252 TABLE NULL
+NULL NULL t253 TABLE NULL
+NULL NULL t254 TABLE NULL
+NULL NULL t255 TABLE NULL
+NULL NULL t256 TABLE NULL
+NULL NULL t257 TABLE NULL
+NULL NULL t258 TABLE NULL
+NULL NULL t259 TABLE NULL
+NULL NULL t260 TABLE NULL
+NULL NULL t261 TABLE NULL
+NULL NULL t262 TABLE NULL
+NULL NULL t263 TABLE NULL
+NULL NULL t264 TABLE NULL
+NULL NULL t265 TABLE NULL
+NULL NULL t266 TABLE NULL
+NULL NULL t267 TABLE NULL
+NULL NULL t268 TABLE NULL
+NULL NULL t269 TABLE NULL
+NULL NULL t270 TABLE NULL
+NULL NULL t271 TABLE NULL
+NULL NULL t272 TABLE NULL
+NULL NULL t273 TABLE NULL
+NULL NULL t274 TABLE NULL
+NULL NULL t275 TABLE NULL
+NULL NULL t276 TABLE NULL
+NULL NULL t277 TABLE NULL
+NULL NULL t278 TABLE NULL
+NULL NULL t279 TABLE NULL
+NULL NULL t280 TABLE NULL
+NULL NULL t281 TABLE NULL
+NULL NULL t282 TABLE NULL
+NULL NULL t283 TABLE NULL
+NULL NULL t284 TABLE NULL
+NULL NULL t285 TABLE NULL
+NULL NULL t286 TABLE NULL
+NULL NULL t287 TABLE NULL
+NULL NULL t288 TABLE NULL
+NULL NULL t289 TABLE NULL
+NULL NULL t290 TABLE NULL
+NULL NULL t291 TABLE NULL
+NULL NULL t292 TABLE NULL
+NULL NULL t293 TABLE NULL
+NULL NULL t294 TABLE NULL
+NULL NULL t295 TABLE NULL
+NULL NULL t296 TABLE NULL
+NULL NULL t297 TABLE NULL
+NULL NULL t298 TABLE NULL
+NULL NULL t299 TABLE NULL
+NULL NULL t300 TABLE NULL
+NULL NULL t301 TABLE NULL
+NULL NULL t302 TABLE NULL
+NULL NULL t303 TABLE NULL
+NULL NULL t304 TABLE NULL
+NULL NULL t305 TABLE NULL
+NULL NULL t306 TABLE NULL
+NULL NULL t307 TABLE NULL
+NULL NULL t308 TABLE NULL
+NULL NULL t309 TABLE NULL
+NULL NULL t310 TABLE NULL
+NULL NULL t311 TABLE NULL
+NULL NULL t312 TABLE NULL
+NULL NULL t313 TABLE NULL
+NULL NULL t314 TABLE NULL
+NULL NULL t315 TABLE NULL
+NULL NULL t316 TABLE NULL
+NULL NULL t317 TABLE NULL
+NULL NULL t318 TABLE NULL
+NULL NULL t319 TABLE NULL
+NULL NULL t320 TABLE NULL
+NULL NULL t321 TABLE NULL
+NULL NULL t322 TABLE NULL
+NULL NULL t323 TABLE NULL
+NULL NULL t324 TABLE NULL
+NULL NULL t325 TABLE NULL
+NULL NULL t326 TABLE NULL
+NULL NULL t327 TABLE NULL
+NULL NULL t328 TABLE NULL
+NULL NULL t329 TABLE NULL
+NULL NULL t330 TABLE NULL
+NULL NULL t331 TABLE NULL
+NULL NULL t332 TABLE NULL
+NULL NULL t333 TABLE NULL
+NULL NULL t334 TABLE NULL
+NULL NULL t335 TABLE NULL
+NULL NULL t336 TABLE NULL
+NULL NULL t337 TABLE NULL
+NULL NULL t338 TABLE NULL
+NULL NULL t339 TABLE NULL
+NULL NULL t340 TABLE NULL
+NULL NULL t341 TABLE NULL
+NULL NULL t342 TABLE NULL
+NULL NULL t343 TABLE NULL
+NULL NULL t344 TABLE NULL
+NULL NULL t345 TABLE NULL
+NULL NULL t346 TABLE NULL
+NULL NULL t347 TABLE NULL
+NULL NULL t348 TABLE NULL
+NULL NULL t349 TABLE NULL
+NULL NULL t350 TABLE NULL
+NULL NULL t351 TABLE NULL
+NULL NULL t352 TABLE NULL
+NULL NULL t353 TABLE NULL
+NULL NULL t354 TABLE NULL
+NULL NULL t355 TABLE NULL
+NULL NULL t356 TABLE NULL
+NULL NULL t357 TABLE NULL
+NULL NULL t358 TABLE NULL
+NULL NULL t359 TABLE NULL
+NULL NULL t360 TABLE NULL
+NULL NULL t361 TABLE NULL
+NULL NULL t362 TABLE NULL
+NULL NULL t363 TABLE NULL
+NULL NULL t364 TABLE NULL
+NULL NULL t365 TABLE NULL
+NULL NULL t366 TABLE NULL
+NULL NULL t367 TABLE NULL
+NULL NULL t368 TABLE NULL
+NULL NULL t369 TABLE NULL
+NULL NULL t370 TABLE NULL
+NULL NULL t371 TABLE NULL
+NULL NULL t372 TABLE NULL
+NULL NULL t373 TABLE NULL
+NULL NULL t374 TABLE NULL
+NULL NULL t375 TABLE NULL
+NULL NULL t376 TABLE NULL
+NULL NULL t377 TABLE NULL
+NULL NULL t378 TABLE NULL
+NULL NULL t379 TABLE NULL
+NULL NULL t380 TABLE NULL
+NULL NULL t381 TABLE NULL
+NULL NULL t382 TABLE NULL
+NULL NULL t383 TABLE NULL
+NULL NULL t384 TABLE NULL
+NULL NULL t385 TABLE NULL
+NULL NULL t386 TABLE NULL
+NULL NULL t387 TABLE NULL
+NULL NULL t388 TABLE NULL
+NULL NULL t389 TABLE NULL
+NULL NULL t390 TABLE NULL
+NULL NULL t391 TABLE NULL
+NULL NULL t392 TABLE NULL
+NULL NULL t393 TABLE NULL
+NULL NULL t394 TABLE NULL
+NULL NULL t395 TABLE NULL
+NULL NULL t396 TABLE NULL
+NULL NULL t397 TABLE NULL
+NULL NULL t398 TABLE NULL
+NULL NULL t399 TABLE NULL
DROP TABLE t1;
diff --git a/storage/connect/mysql-test/connect/r/odbc_sqlite3_grant.result b/storage/connect/mysql-test/connect/r/odbc_sqlite3_grant.result
index 06b4239bd69..f9045e73862 100644
--- a/storage/connect/mysql-test/connect/r/odbc_sqlite3_grant.result
+++ b/storage/connect/mysql-test/connect/r/odbc_sqlite3_grant.result
@@ -1,7 +1,7 @@
Table Create Table
t1 CREATE TABLE `t1` (
`Description` char(128) NOT NULL,
- `Attributes` varchar(256) NOT NULL
+ `Attributes` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Drivers'
SET NAMES utf8;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
diff --git a/storage/connect/mysql-test/connect/r/odbc_xls.result b/storage/connect/mysql-test/connect/r/odbc_xls.result
index 8c560ef013a..d379cb5b4bb 100644
--- a/storage/connect/mysql-test/connect/r/odbc_xls.result
+++ b/storage/connect/mysql-test/connect/r/odbc_xls.result
@@ -1,7 +1,7 @@
Table Create Table
t1 CREATE TABLE `t1` (
`Name` varchar(256) NOT NULL,
- `Description` varchar(256) NOT NULL
+ `Description` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources'
CREATE TABLE contact (Nom VARCHAR(128), Fonction VARCHAR(128), Company VARCHAR(128), Repertoire VARCHAR(30)) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineXLS;DBQ=DATADIR/test/contacts.xls';;
SELECT Nom, Fonction FROM contact WHERE Repertoire='ascii';
@@ -16,11 +16,11 @@ DROP TABLE contact;
CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Tables TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineXLS;DBQ=DATADIR/test/contacts.xls' CHARSET=utf8 DATA_CHARSET=latin1;;
SELECT * FROM t1 WHERE Table_name='CONTACT';
Table_Cat Table_Schema Table_Name Table_Type Remark
-DATADIR/test/contacts CONTACT TABLE
+DATADIR/test/contacts NULL CONTACT TABLE NULL
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT CATFUNC=Columns TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineXLS;DBQ=DATADIR/test/contacts.xls' CHARSET=utf8 DATA_CHARSET=latin1;;
SELECT * FROM t1 WHERE Table_name='CONTACT' AND Column_name IN ('Nom','Fonction');
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
-DATADIR/test/contacts CONTACT Nom 12 VARCHAR 255 510 0 0 1
-DATADIR/test/contacts CONTACT Fonction 12 VARCHAR 255 510 0 0 1
+DATADIR/test/contacts NULL CONTACT Nom 12 VARCHAR 255 510 NULL NULL 1 NULL
+DATADIR/test/contacts NULL CONTACT Fonction 12 VARCHAR 255 510 NULL NULL 1 NULL
DROP TABLE t1;
diff --git a/storage/connect/mysql-test/connect/t/json_udf.inc b/storage/connect/mysql-test/connect/t/json_udf.inc
index f17d59832f3..2ade7ad02fe 100644
--- a/storage/connect/mysql-test/connect/t/json_udf.inc
+++ b/storage/connect/mysql-test/connect/t/json_udf.inc
@@ -20,6 +20,8 @@ if (!$HA_CONNECT_SO) {
--eval CREATE FUNCTION json_object_delete RETURNS STRING SONAME '$HA_CONNECT_SO';
--eval CREATE FUNCTION json_object_list RETURNS STRING SONAME '$HA_CONNECT_SO';
--eval CREATE FUNCTION jsonvalue RETURNS STRING SONAME '$HA_CONNECT_SO';
+--eval CREATE FUNCTION jsonset_grp_size RETURNS INTEGER SONAME '$HA_CONNECT_SO';
+--eval CREATE FUNCTION jsonget_grp_size RETURNS INTEGER SONAME '$HA_CONNECT_SO';
--eval CREATE AGGREGATE FUNCTION json_array_grp RETURNS STRING SONAME '$HA_CONNECT_SO';
--eval CREATE AGGREGATE FUNCTION json_object_grp RETURNS STRING SONAME '$HA_CONNECT_SO';
--eval CREATE FUNCTION jsonget_string RETURNS STRING SONAME '$HA_CONNECT_SO';
diff --git a/storage/connect/mysql-test/connect/t/json_udf.test b/storage/connect/mysql-test/connect/t/json_udf.test
index cfd1fdae258..d11e2fd7cf6 100644
--- a/storage/connect/mysql-test/connect/t/json_udf.test
+++ b/storage/connect/mysql-test/connect/t/json_udf.test
@@ -108,7 +108,8 @@ CREATE TABLE t3 (
SELECT Json_Object(SERIALNO, NAME, TITLE, SALARY) FROM t3 WHERE NAME = 'MERCHANT';
SELECT DEPARTMENT, Json_Array_Grp(NAME) FROM t3 GROUP BY DEPARTMENT;
-SET connect_json_grp_size=30;
+#SET connect_json_grp_size=30; Deprecated
+SELECT JsonSet_Grp_Size(30);
SELECT Json_Object(title, Json_Array_Grp(name) `json_names`) from t3 GROUP BY title;
SELECT Json_Array(DEPARTMENT, Json_Array_Grp(NAME)) FROM t3 GROUP BY DEPARTMENT;
SELECT Json_Object(DEPARTMENT, Json_Array_Grp(NAME) json_NAMES) FROM t3 GROUP BY DEPARTMENT;
diff --git a/storage/connect/mysql-test/connect/t/json_udf2.inc b/storage/connect/mysql-test/connect/t/json_udf2.inc
index f62b178b003..4c74e2c11f2 100644
--- a/storage/connect/mysql-test/connect/t/json_udf2.inc
+++ b/storage/connect/mysql-test/connect/t/json_udf2.inc
@@ -11,6 +11,8 @@ DROP FUNCTION json_object_add;
DROP FUNCTION json_object_delete;
DROP FUNCTION json_object_list;
DROP FUNCTION jsonvalue;
+DROP FUNCTION jsonset_grp_size;
+DROP FUNCTION jsonget_grp_size;
DROP FUNCTION json_array_grp;
DROP FUNCTION json_object_grp;
DROP FUNCTION jsonget_string;
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index 1ccdf231970..cb21a8bda15 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -1,7 +1,7 @@
/************ Odbconn C++ Functions Source Code File (.CPP) ************/
/* Name: ODBCONN.CPP Version 2.2 */
/* */
-/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */
+/* (C) Copyright to the author Olivier BERTRAND 1998-2016 */
/* */
/* This file contains the ODBC connection classes functions. */
/***********************************************************************/
@@ -314,8 +314,10 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table,
FLD_TYPE, FLD_TYPENAME, FLD_PREC, FLD_LENGTH,
FLD_SCALE, FLD_RADIX, FLD_NULL, FLD_REM};
unsigned int length[] = {0, 0, 0, 0, 6, 0, 10, 10, 6, 6, 6, 0};
- int n, ncol = 12;
- PQRYRES qrp;
+ bool b[] = {true,true,false,false,false,false,false,false,true,true,false,true};
+ int i, n, ncol = 12;
+ PCOLRES crp;
+ PQRYRES qrp;
CATPARM *cap;
ODBConn *ocp = NULL;
@@ -363,6 +365,10 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table,
qrp = PlgAllocResult(g, ncol, maxres, IDS_COLUMNS,
buftyp, fldtyp, length, false, true);
+ for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next)
+ if (b[i])
+ crp->Kdata->SetNullable(true);
+
if (info || !qrp) // Info table
return qrp;
@@ -495,8 +501,10 @@ PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info)
int buftyp[] = {TYPE_STRING, TYPE_STRING};
XFLD fldtyp[] = {FLD_NAME, FLD_REM};
unsigned int length[] = {128, 256};
- int ncol = 2;
- PQRYRES qrp;
+ bool b[] = {false, true};
+ int i, ncol = 2;
+ PCOLRES crp;
+ PQRYRES qrp;
ODBConn *ocp = NULL;
/************************************************************************/
@@ -520,7 +528,11 @@ PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info)
qrp = PlgAllocResult(g, ncol, maxres, IDS_DRIVER,
buftyp, fldtyp, length, false, true);
- /************************************************************************/
+ for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next)
+ if (b[i])
+ crp->Kdata->SetNullable(true);
+
+ /************************************************************************/
/* Now get the results into blocks. */
/************************************************************************/
if (!info && qrp && ocp->GetDrivers(qrp))
@@ -542,8 +554,10 @@ PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info)
int buftyp[] = {TYPE_STRING, TYPE_STRING};
XFLD fldtyp[] = {FLD_NAME, FLD_REM};
unsigned int length[] = {0, 256};
- int n = 0, ncol = 2;
- PQRYRES qrp;
+ bool b[] = {false, true};
+ int i, n = 0, ncol = 2;
+ PCOLRES crp;
+ PQRYRES qrp;
ODBConn *ocp = NULL;
/************************************************************************/
@@ -571,7 +585,11 @@ PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info)
qrp = PlgAllocResult(g, ncol, maxres, IDS_DSRC,
buftyp, fldtyp, length, false, true);
- /************************************************************************/
+ for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next)
+ if (b[i])
+ crp->Kdata->SetNullable(true);
+
+ /************************************************************************/
/* Now get the results into blocks. */
/************************************************************************/
if (!info && qrp && ocp->GetDataSources(qrp))
@@ -595,8 +613,10 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
XFLD fldtyp[] = {FLD_CAT, FLD_SCHEM, FLD_NAME,
FLD_TYPE, FLD_REM};
unsigned int length[] = {0, 0, 0, 16, 0};
- int n, ncol = 5;
- PQRYRES qrp;
+ bool b[] ={ true, true, false, false, true };
+ int i, n, ncol = 5;
+ PCOLRES crp;
+ PQRYRES qrp;
CATPARM *cap;
ODBConn *ocp = NULL;
@@ -638,7 +658,11 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
qrp = PlgAllocResult(g, ncol, maxres, IDS_TABLES, buftyp,
fldtyp, length, false, true);
- if (info || !qrp)
+ for (i = 0, crp = qrp->Colresp; crp; i++, crp = crp->Next)
+ if (b[i])
+ crp->Kdata->SetNullable(true);
+
+ if (info || !qrp)
return qrp;
if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp)))
@@ -2249,7 +2273,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
rc = SQLTables(hstmt, name.ptr(2), name.length(2),
name.ptr(1), name.length(1),
name.ptr(0), name.length(0),
- cap->Pat, SQL_NTS);
+ cap->Pat, cap->Pat ? SQL_NTS : 0);
break;
case CAT_COL:
// rc = SQLSetStmtAttr(hstmt, SQL_ATTR_METADATA_ID,
@@ -2258,7 +2282,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
rc = SQLColumns(hstmt, name.ptr(2), name.length(2),
name.ptr(1), name.length(1),
name.ptr(0), name.length(0),
- cap->Pat, SQL_NTS);
+ cap->Pat, cap->Pat ? SQL_NTS : 0);
break;
case CAT_KEY:
fnc = "SQLPrimaryKeys";
diff --git a/storage/connect/table.cpp b/storage/connect/table.cpp
index 933e072c1bb..c21bb1660ea 100644
--- a/storage/connect/table.cpp
+++ b/storage/connect/table.cpp
@@ -1,7 +1,7 @@
/************** Table C++ Functions Source Code File (.CPP) ************/
/* Name: TABLE.CPP Version 2.7 */
/* */
-/* (C) Copyright to the author Olivier BERTRAND 1999-2015 */
+/* (C) Copyright to the author Olivier BERTRAND 1999-2016 */
/* */
/* This file contains the TBX, TDB and OPJOIN classes functions. */
/***********************************************************************/
@@ -518,7 +518,8 @@ bool TDBCAT::InitCol(PGLOBAL g)
sprintf(g->Message, "Invalid flag %d for column %s",
colp->Flag, colp->Name);
return true;
- } // endif Crp
+ } else if (crp->Fld == FLD_SCALE || crp->Fld == FLD_RADIX)
+ colp->Value->SetNullable(true);
} // endfor colp
@@ -586,11 +587,14 @@ CATCOL::CATCOL(PCOLDEF cdp, PTDB tdbp, int n)
/***********************************************************************/
void CATCOL::ReadColumn(PGLOBAL)
{
+ bool b = (!Crp->Kdata || Crp->Kdata->IsNull(Tdbp->N));
+
// Get the value of the Name or Description property
- if (Crp->Kdata)
+ if (!b)
Value->SetValue_pvblk(Crp->Kdata, Tdbp->N);
else
Value->Reset();
+ Value->SetNull(b);
} // end of ReadColumn
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index fd9a049a05a..501a814721d 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -912,19 +912,21 @@ bool TDBODBC::OpenDB(PGLOBAL g)
if ((n = Ocp->GetResultSize(Query->GetStr(), Cnp)) < 0) {
strcpy(g->Message, "Cannot get result size");
return true;
- } // endif n
+ } else if (n) {
+ Ocp->m_Rows = n;
- Ocp->m_Rows = n;
+ if ((Qrp = Ocp->AllocateResult(g)))
+ Memory = 2; // Must be filled
+ else {
+ strcpy(g->Message, "Result set memory allocation failed");
+ return true;
+ } // endif n
- if ((Qrp = Ocp->AllocateResult(g)))
- Memory = 2; // Must be filled
- else {
- strcpy(g->Message, "Result set memory allocation failed");
- return true;
- } // endif n
+ } else // Void result
+ Memory = 0;
- Ocp->m_Rows = 0;
- } else
+ Ocp->m_Rows = 0;
+ } else
return true;
} // endif Memory
diff --git a/storage/connect/valblk.h b/storage/connect/valblk.h
index f6eb7258a77..c3cad79b234 100644
--- a/storage/connect/valblk.h
+++ b/storage/connect/valblk.h
@@ -73,7 +73,8 @@ class VALBLK : public BLOCK {
virtual void SetNull(int n, bool b)
{if (To_Nulls) {To_Nulls[n] = (b) ? '*' : 0;}}
virtual bool IsNull(int n) {return To_Nulls && To_Nulls[n];}
- virtual void SetNullable(bool b);
+ virtual bool IsNullable(void) {return Nullable;}
+ virtual void SetNullable(bool b);
virtual bool IsUnsigned(void) {return Unsigned;}
virtual bool Init(PGLOBAL g, bool check) = 0;
virtual int GetVlen(void) = 0;
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 68d5dd325ff..be5b04787dd 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -777,6 +777,10 @@ btr_root_get(
buf_block_t* root = btr_root_block_get(index, RW_X_LATCH,
mtr);
+ if (root && root->page.encrypted == true) {
+ root = NULL;
+ }
+
return(root ? buf_block_get_frame(root) : NULL);
}
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index f4e7c0d0c6b..bd424b7b598 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -4674,10 +4674,10 @@ corrupt:
ib_push_warning((void *)NULL, DB_DECRYPTION_FAILED,
"Table in tablespace %lu encrypted."
- "However key management plugin or used key_id %lu is not found or"
+ "However key management plugin or used key_id %u is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.",
- bpage->key_version);
+ (ulint)bpage->space, bpage->key_version);
if (bpage->space > TRX_SYS_SPACE) {
if (corrupted) {
@@ -4701,10 +4701,19 @@ corrupt:
}
if (uncompressed && !recv_no_ibuf_operations) {
- ibuf_merge_or_delete_for_page(
- (buf_block_t*) bpage, bpage->space,
- bpage->offset, buf_page_get_zip_size(bpage),
- TRUE);
+ if (bpage && bpage->encrypted) {
+ fprintf(stderr,
+ "InnoDB: Warning: Table in tablespace %lu encrypted."
+ "However key management plugin or used key_id %u is not found or"
+ " used encryption algorithm or method does not match."
+ " Can't continue opening the table.\n",
+ (ulint)bpage->space, bpage->key_version);
+ } else {
+ ibuf_merge_or_delete_for_page(
+ (buf_block_t*) bpage, bpage->space,
+ bpage->offset, buf_page_get_zip_size(bpage),
+ TRUE);
+ }
}
} else {
/* io_type == BUF_IO_WRITE */
@@ -6156,6 +6165,7 @@ buf_page_decrypt_after_read(
bool page_compressed = fil_page_is_compressed(dst_frame);
bool page_compressed_encrypted = fil_page_is_compressed_encrypted(dst_frame);
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+ bool success = true;
/* If page is encrypted read post-encryption checksum */
if (!page_compressed_encrypted && key_version != 0) {
@@ -6214,16 +6224,21 @@ buf_page_decrypt_after_read(
}
/* decrypt using crypt_buf to dst_frame */
- fil_space_decrypt(bpage->space,
- slot->crypt_buf,
- size,
- dst_frame);
+ byte* res = fil_space_decrypt(bpage->space,
+ slot->crypt_buf,
+ size,
+ dst_frame);
+
+ if (!res) {
+ bpage->encrypted = true;
+ success = false;
+ }
#ifdef UNIV_DEBUG
fil_page_type_validate(dst_frame);
#endif
}
- if (page_compressed_encrypted) {
+ if (page_compressed_encrypted && success) {
if (!slot) {
slot = buf_pool_reserve_tmp_slot(buf_pool, page_compressed);
}
@@ -6236,11 +6251,11 @@ buf_page_decrypt_after_read(
dst_frame,
size,
&bpage->write_size);
- }
#ifdef UNIV_DEBUG
- fil_page_type_validate(dst_frame);
+ fil_page_type_validate(dst_frame);
#endif
+ }
/* Mark this slot as free */
if (slot) {
@@ -6250,5 +6265,5 @@ buf_page_decrypt_after_read(
bpage->key_version = key_version;
- return (TRUE);
+ return (success);
}
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index 9748b35e93b..6f3aca0e1fb 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2011, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2015, 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
@@ -163,6 +163,25 @@ buf_load_status(
va_end(ap);
}
+/** Returns the directory path where the buffer pool dump file will be created.
+@return directory path */
+static
+const char*
+get_buf_dump_dir()
+{
+ const char* dump_dir;
+
+ /* The dump file should be created in the default data directory if
+ innodb_data_home_dir is set as an empty string. */
+ if (strcmp(srv_data_home, "") == 0) {
+ dump_dir = fil_path_to_mysql_datadir;
+ } else {
+ dump_dir = srv_data_home;
+ }
+
+ return(dump_dir);
+}
+
/*****************************************************************//**
Perform a buffer pool dump into the file specified by
innodb_buffer_pool_filename. If any errors occur then the value of
@@ -186,7 +205,7 @@ buf_dump(
int ret;
ut_snprintf(full_filename, sizeof(full_filename),
- "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR,
+ "%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
srv_buf_dump_filename);
ut_snprintf(tmp_filename, sizeof(tmp_filename),
@@ -471,7 +490,7 @@ buf_load()
buf_load_abort_flag = FALSE;
ut_snprintf(full_filename, sizeof(full_filename),
- "%s%c%s", srv_data_home, SRV_PATH_SEPARATOR,
+ "%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
srv_buf_dump_filename);
buf_load_status(STATUS_NOTICE,
diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc
index 1a1dd29a202..573357b54ee 100644
--- a/storage/innobase/dict/dict0boot.cc
+++ b/storage/innobase/dict/dict0boot.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
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
@@ -450,27 +451,29 @@ dict_boot(void)
/* Initialize the insert buffer table and index for each tablespace */
- ibuf_init_at_db_start();
-
dberr_t err = DB_SUCCESS;
- if (srv_read_only_mode && !ibuf_is_empty()) {
+ err = ibuf_init_at_db_start();
- ib_logf(IB_LOG_LEVEL_ERROR,
- "Change buffer must be empty when --innodb-read-only "
- "is set!");
+ if (err == DB_SUCCESS) {
+ if (srv_read_only_mode && !ibuf_is_empty()) {
- err = DB_ERROR;
- } else {
- /* Load definitions of other indexes on system tables */
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "Change buffer must be empty when --innodb-read-only "
+ "is set!");
- dict_load_sys_table(dict_sys->sys_tables);
- dict_load_sys_table(dict_sys->sys_columns);
- dict_load_sys_table(dict_sys->sys_indexes);
- dict_load_sys_table(dict_sys->sys_fields);
- }
+ err = DB_ERROR;
+ } else {
+ /* Load definitions of other indexes on system tables */
- mutex_exit(&(dict_sys->mutex));
+ dict_load_sys_table(dict_sys->sys_tables);
+ dict_load_sys_table(dict_sys->sys_columns);
+ dict_load_sys_table(dict_sys->sys_indexes);
+ dict_load_sys_table(dict_sys->sys_fields);
+ }
+
+ mutex_exit(&(dict_sys->mutex));
+ }
return(err);
}
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 2b728353d99..c51deb0a048 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1116,7 +1116,7 @@ dict_init(void)
&dict_operation_lock, SYNC_DICT_OPERATION);
if (!srv_read_only_mode) {
- dict_foreign_err_file = os_file_create_tmpfile();
+ dict_foreign_err_file = os_file_create_tmpfile(NULL);
ut_a(dict_foreign_err_file);
mutex_create(dict_foreign_err_mutex_key,
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index 12ead09d829..5c283f693d5 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2009, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2009, 2015, 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
@@ -1488,7 +1488,6 @@ on the leaf page.
when comparing records
@param[out] n_diff number of distinct records
@param[out] n_external_pages number of external pages
-@param[in,out] mtr mini-transaction
@return number of distinct records on the leaf page */
static
void
@@ -1496,8 +1495,7 @@ dict_stats_analyze_index_below_cur(
const btr_cur_t* cur,
ulint n_prefix,
ib_uint64_t* n_diff,
- ib_uint64_t* n_external_pages,
- mtr_t* mtr)
+ ib_uint64_t* n_external_pages)
{
dict_index_t* index;
ulint space;
@@ -1511,6 +1509,7 @@ dict_stats_analyze_index_below_cur(
ulint* offsets2;
ulint* offsets_rec;
ulint size;
+ mtr_t mtr;
index = btr_cur_get_index(cur);
@@ -1549,12 +1548,14 @@ dict_stats_analyze_index_below_cur(
function without analyzing any leaf pages */
*n_external_pages = 0;
+ mtr_start(&mtr);
+
/* descend to the leaf level on the B-tree */
for (;;) {
block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH,
NULL /* no guessed block */,
- BUF_GET, __FILE__, __LINE__, mtr);
+ BUF_GET, __FILE__, __LINE__, &mtr);
page = buf_block_get_frame(block);
@@ -1576,6 +1577,8 @@ dict_stats_analyze_index_below_cur(
ut_a(*n_diff > 0);
if (*n_diff == 1) {
+ mtr_commit(&mtr);
+
/* page has all keys equal and the end of the page
was reached by dict_stats_scan_page(), no need to
descend to the leaf level */
@@ -1600,7 +1603,7 @@ dict_stats_analyze_index_below_cur(
}
/* make sure we got a leaf page as a result from the above loop */
- ut_ad(btr_page_get_level(page, mtr) == 0);
+ ut_ad(btr_page_get_level(page, &mtr) == 0);
/* scan the leaf page and find the number of distinct keys,
when looking only at the first n_prefix columns; also estimate
@@ -1617,6 +1620,7 @@ dict_stats_analyze_index_below_cur(
__func__, page_no, n_diff);
#endif
+ mtr_commit(&mtr);
mem_heap_free(heap);
}
@@ -1826,8 +1830,7 @@ dict_stats_analyze_index_for_n_prefix(
dict_stats_analyze_index_below_cur(btr_pcur_get_btr_cur(&pcur),
n_prefix,
&n_diff_on_leaf_page,
- &n_external_pages,
- mtr);
+ &n_external_pages);
/* We adjust n_diff_on_leaf_page here to avoid counting
one record twice - once as the last on some page and once
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 3d9d6a18122..03020896542 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -799,6 +799,7 @@ fil_space_decrypt(
byte* src_frame) /*!< in/out: page buffer */
{
dberr_t err = DB_SUCCESS;
+ byte* res = NULL;
bool encrypted = fil_space_decrypt(
fil_space_get_crypt_data(space),
@@ -807,13 +808,17 @@ fil_space_decrypt(
src_frame,
&err);
- if (encrypted) {
- /* Copy the decrypted page back to page buffer, not
- really any other options. */
- memcpy(src_frame, tmp_frame, page_size);
+ if (err == DB_SUCCESS) {
+ if (encrypted) {
+ /* Copy the decrypted page back to page buffer, not
+ really any other options. */
+ memcpy(src_frame, tmp_frame, page_size);
+ }
+
+ res = src_frame;
}
- return src_frame;
+ return res;
}
/******************************************************************
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index e096b8bf6d6..2a0aa4daf12 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -580,7 +580,7 @@ fts_zip_read_word(
#ifdef UNIV_DEBUG
ulint i;
#endif
- byte len = 0;
+ short len = 0;
void* null = NULL;
byte* ptr = word->f_str;
int flush = Z_NO_FLUSH;
@@ -590,7 +590,7 @@ fts_zip_read_word(
return(NULL);
}
- zip->zp->next_out = &len;
+ zip->zp->next_out = reinterpret_cast<byte*>(&len);
zip->zp->avail_out = sizeof(len);
while (zip->status == Z_OK && zip->zp->avail_out > 0) {
@@ -688,11 +688,12 @@ fts_fetch_index_words(
fts_zip_t* zip = static_cast<fts_zip_t*>(user_arg);
que_node_t* exp = sel_node->select_list;
dfield_t* dfield = que_node_get_val(exp);
- byte len = (byte) dfield_get_len(dfield);
+ short len = static_cast<short>(dfield_get_len(dfield));
void* data = dfield_get_data(dfield);
/* Skip the duplicate words. */
- if (zip->word.f_len == len && !memcmp(zip->word.f_str, data, len)) {
+ if (zip->word.f_len == static_cast<ulint>(len)
+ && !memcmp(zip->word.f_str, data, len)) {
return(TRUE);
}
@@ -706,7 +707,7 @@ fts_fetch_index_words(
ut_a(zip->zp->next_in == NULL);
/* The string is prefixed by len. */
- zip->zp->next_in = &len;
+ zip->zp->next_in = reinterpret_cast<byte*>(&len);
zip->zp->avail_in = sizeof(len);
/* Compress the word, create output blocks as necessary. */
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 3c8287a7be4..32999341691 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4,7 +4,7 @@ Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2016, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -33,6 +33,8 @@ this program; if not, write to the Free Software Foundation, Inc.,
*****************************************************************************/
+#define lower_case_file_system lower_case_file_system_server
+#define mysql_unpacked_real_data_home mysql_unpacked_real_data_home_server
#include <sql_table.h> // explain_filename, nz2, EXPLAIN_PARTITIONS_AS_COMMENT,
// EXPLAIN_FILENAME_MAX_EXTRA_LENGTH
@@ -44,6 +46,11 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include <table_cache.h>
#include <my_check_opt.h>
+#undef lower_case_file_system
+#undef mysql_unpacked_real_data_home
+MYSQL_PLUGIN_IMPORT extern my_bool lower_case_file_system;
+MYSQL_PLUGIN_IMPORT extern char mysql_unpacked_real_data_home[];
+
#ifdef _WIN32
#include <io.h>
#endif
@@ -553,6 +560,67 @@ ib_cb_t innodb_api_cb[] = {
(ib_cb_t) ib_trx_read_only
};
+/**
+ Test a file path whether it is same as mysql data directory path.
+
+ @param path null terminated character string
+
+ @return
+ @retval TRUE The path is different from mysql data directory.
+ @retval FALSE The path is same as mysql data directory.
+*/
+static bool is_mysql_datadir_path(const char *path)
+{
+ if (path == NULL)
+ return false;
+
+ char mysql_data_dir[FN_REFLEN], path_dir[FN_REFLEN];
+ convert_dirname(path_dir, path, NullS);
+ convert_dirname(mysql_data_dir, mysql_unpacked_real_data_home, NullS);
+ size_t mysql_data_home_len= dirname_length(mysql_data_dir);
+ size_t path_len = dirname_length(path_dir);
+
+ if (path_len < mysql_data_home_len)
+ return true;
+
+ if (!lower_case_file_system)
+ return(memcmp(mysql_data_dir, path_dir, mysql_data_home_len));
+
+ return(files_charset_info->coll->strnncoll(files_charset_info,
+ (uchar *) path_dir, path_len,
+ (uchar *) mysql_data_dir,
+ mysql_data_home_len,
+ TRUE));
+
+}
+
+
+static int mysql_tmpfile_path(const char *path, const char *prefix)
+{
+ DBUG_ASSERT(path != NULL);
+ DBUG_ASSERT((strlen(path) + strlen(prefix)) <= FN_REFLEN);
+
+ char filename[FN_REFLEN];
+ File fd = create_temp_file(filename, path, prefix,
+#ifdef __WIN__
+ O_BINARY | O_TRUNC | O_SEQUENTIAL |
+ O_SHORT_LIVED |
+#endif /* __WIN__ */
+ O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY,
+ MYF(MY_WME));
+ if (fd >= 0) {
+#ifndef __WIN__
+ /*
+ This can be removed once the following bug is fixed:
+ Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option
+ (file not removed) (Unix)
+ */
+ unlink(filename);
+#endif /* !__WIN__ */
+ }
+
+ return fd;
+}
static void innodb_remember_check_sysvar_funcs();
mysql_var_check_func check_sysvar_enum;
@@ -588,7 +656,6 @@ ha_create_table_option innodb_table_option_list[]=
HA_TOPTION_END
};
-
/*************************************************************//**
Check whether valid argument given to innodb_ft_*_stopword_table.
This function is registered as a callback with MySQL.
@@ -604,6 +671,108 @@ innodb_stopword_table_validate(
for update function */
struct st_mysql_value* value); /*!< in: incoming string */
+/** Validate passed-in "value" is a valid directory name.
+This function is registered as a callback with MySQL.
+@param[in,out] thd thread handle
+@param[in] var pointer to system variable
+@param[out] save immediate result for update
+@param[in] value incoming string
+@return 0 for valid name */
+static
+int
+innodb_tmpdir_validate(
+ THD* thd,
+ struct st_mysql_sys_var* var,
+ void* save,
+ struct st_mysql_value* value)
+{
+
+ char* alter_tmp_dir;
+ char* innodb_tmp_dir;
+ char buff[OS_FILE_MAX_PATH];
+ int len = sizeof(buff);
+ char tmp_abs_path[FN_REFLEN + 2];
+
+ ut_ad(save != NULL);
+ ut_ad(value != NULL);
+
+ if (check_global_access(thd, FILE_ACL)) {
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WRONG_ARGUMENTS,
+ "InnoDB: FILE Permissions required");
+ *static_cast<const char**>(save) = NULL;
+ return(1);
+ }
+
+ alter_tmp_dir = (char*) value->val_str(value, buff, &len);
+
+ if (!alter_tmp_dir) {
+ *static_cast<const char**>(save) = alter_tmp_dir;
+ return(0);
+ }
+
+ if (strlen(alter_tmp_dir) > FN_REFLEN) {
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WRONG_ARGUMENTS,
+ "Path length should not exceed %d bytes", FN_REFLEN);
+ *static_cast<const char**>(save) = NULL;
+ return(1);
+ }
+
+ my_realpath(tmp_abs_path, alter_tmp_dir, 0);
+ size_t tmp_abs_len = strlen(tmp_abs_path);
+
+ if (my_access(tmp_abs_path, F_OK)) {
+
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WRONG_ARGUMENTS,
+ "InnoDB: Path doesn't exist.");
+ *static_cast<const char**>(save) = NULL;
+ return(1);
+ } else if (my_access(tmp_abs_path, R_OK | W_OK)) {
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WRONG_ARGUMENTS,
+ "InnoDB: Server doesn't have permission in "
+ "the given location.");
+ *static_cast<const char**>(save) = NULL;
+ return(1);
+ }
+
+ MY_STAT stat_info_dir;
+
+ if (my_stat(tmp_abs_path, &stat_info_dir, MYF(0))) {
+ if ((stat_info_dir.st_mode & S_IFDIR) != S_IFDIR) {
+
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WRONG_ARGUMENTS,
+ "Given path is not a directory. ");
+ *static_cast<const char**>(save) = NULL;
+ return(1);
+ }
+ }
+
+ if (!is_mysql_datadir_path(tmp_abs_path)) {
+
+ push_warning_printf(
+ thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WRONG_ARGUMENTS,
+ "InnoDB: Path Location should not be same as "
+ "mysql data directory location.");
+ *static_cast<const char**>(save) = NULL;
+ return(1);
+ }
+
+ innodb_tmp_dir = static_cast<char*>(
+ thd_memdup(thd, tmp_abs_path, tmp_abs_len + 1));
+ *static_cast<const char**>(save) = innodb_tmp_dir;
+ return(0);
+}
+
/** "GEN_CLUST_INDEX" is the name reserved for InnoDB default
system clustered index when there is no primary key. */
const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX";
@@ -688,6 +857,11 @@ static MYSQL_THDVAR_STR(ft_user_stopword_table,
"User supplied stopword table name, effective in the session level.",
innodb_stopword_table_validate, NULL, NULL);
+static MYSQL_THDVAR_STR(tmpdir,
+ PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC,
+ "Directory for temporary non-tablespace files.",
+ innodb_tmpdir_validate, NULL, NULL);
+
static SHOW_VAR innodb_status_variables[]= {
{"buffer_pool_dump_status",
(char*) &export_vars.innodb_buffer_pool_dump_status, SHOW_CHAR},
@@ -763,12 +937,6 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_os_log_pending_writes, SHOW_LONG},
{"os_log_written",
(char*) &export_vars.innodb_os_log_written, SHOW_LONGLONG},
- {"os_merge_buffers_written",
- (char*) &export_vars.innodb_merge_buffers_written, SHOW_LONGLONG},
- {"os_merge_buffers_read",
- (char*) &export_vars.innodb_merge_buffers_read, SHOW_LONGLONG},
- {"os_merge_buffers_merged",
- (char*) &export_vars.innodb_merge_buffers_merged, SHOW_LONGLONG},
{"page_size",
(char*) &export_vars.innodb_page_size, SHOW_LONG},
{"pages_created",
@@ -1273,7 +1441,6 @@ Normalizes a table name string. A normalized name consists of the
database name catenated to '/' and table name. An example:
test/mytable. On Windows normalization puts both the database name and the
table name always to lower case if "set_lower_case" is set to TRUE. */
-static
void
normalize_table_name_low(
/*=====================*/
@@ -1543,6 +1710,26 @@ thd_supports_xa(
return(THDVAR(thd, support_xa));
}
+/** Get the value of innodb_tmpdir.
+@param[in] thd thread handle, or NULL to query
+ the global innodb_tmpdir.
+@retval NULL if innodb_tmpdir="" */
+UNIV_INTERN
+const char*
+thd_innodb_tmpdir(
+ THD* thd)
+{
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(false));
+#endif /* UNIV_SYNC_DEBUG */
+
+ const char* tmp_dir = THDVAR(thd, tmpdir);
+ if (tmp_dir != NULL && *tmp_dir == '\0') {
+ tmp_dir = NULL;
+ }
+
+ return(tmp_dir);
+}
/******************************************************************//**
Returns the lock wait timeout for the current connection.
@return the lock wait timeout, in seconds */
@@ -2082,13 +2269,14 @@ innobase_get_lower_case_table_names(void)
return(lower_case_table_names);
}
-/*********************************************************************//**
-Creates a temporary file.
+/** Create a temporary file in the location specified by the parameter
+path. If the path is null, then it will be created in tmpdir.
+@param[in] path location for creating temporary file
@return temporary file descriptor, or < 0 on error */
UNIV_INTERN
int
-innobase_mysql_tmpfile(void)
-/*========================*/
+innobase_mysql_tmpfile(
+ const char* path)
{
#ifdef WITH_INNODB_DISALLOW_WRITES
os_event_wait(srv_allow_writes_event);
@@ -2101,7 +2289,11 @@ innobase_mysql_tmpfile(void)
return(-1);
);
- fd = mysql_tmpfile("ib");
+ if (path == NULL) {
+ fd = mysql_tmpfile("ib");
+ } else {
+ fd = mysql_tmpfile_path(path, "ib");
+ }
if (fd >= 0) {
/* Copy the file descriptor, so that the additional resources
@@ -3030,6 +3222,13 @@ ha_innobase::reset_template(void)
ut_ad(prebuilt->magic_n == ROW_PREBUILT_ALLOCATED);
ut_ad(prebuilt->magic_n2 == prebuilt->magic_n);
+ /* Force table to be freed in close_thread_table(). */
+ DBUG_EXECUTE_IF("free_table_in_fts_query",
+ if (prebuilt->in_fts_query) {
+ table->m_needs_reopen = true;
+ }
+ );
+
prebuilt->keep_other_fields_on_keyread = 0;
prebuilt->read_just_key = 0;
prebuilt->in_fts_query = 0;
@@ -4866,7 +5065,6 @@ Normalizes a table name string. A normalized name consists of the
database name catenated to '/' and table name. Example: test/mytable.
On Windows normalization puts both the database name and the
table name always to lower case if "set_lower_case" is set to TRUE. */
-static
void
normalize_table_name_low(
/*=====================*/
@@ -8105,7 +8303,7 @@ report_error:
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
!wsrep_consistency_check(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL))
{
@@ -8627,7 +8825,7 @@ func_exit:
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
DBUG_PRINT("wsrep", ("update row key"));
@@ -8693,7 +8891,7 @@ ha_innobase::delete_row(
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL)) {
DBUG_PRINT("wsrep", ("delete fail"));
@@ -17707,15 +17905,12 @@ innobase_fts_close_ranking(
{
fts_result_t* result;
- ((NEW_FT_INFO*) fts_hdl)->ft_prebuilt->in_fts_query = false;
-
result = ((NEW_FT_INFO*) fts_hdl)->ft_result;
fts_query_free_result(result);
my_free((uchar*) fts_hdl);
-
return;
}
@@ -18144,6 +18339,15 @@ wsrep_innobase_kill_one_trx(
(thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void");
wsrep_thd_LOCK(thd);
+ DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock",
+ {
+ const char act[]=
+ "now "
+ "wait_for signal.wsrep_after_BF_victim_lock";
+ DBUG_ASSERT(!debug_sync_set_action(bf_thd,
+ STRING_WITH_LEN(act)));
+ };);
+
if (wsrep_thd_query_state(thd) == QUERY_EXITING) {
WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id);
@@ -19680,6 +19884,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(sync_array_size),
MYSQL_SYSVAR(compression_failure_threshold_pct),
MYSQL_SYSVAR(compression_pad_pct_max),
+ MYSQL_SYSVAR(simulate_comp_failures),
#ifdef UNIV_DEBUG
MYSQL_SYSVAR(trx_rseg_n_slots_debug),
MYSQL_SYSVAR(limit_optimistic_insert_debug),
@@ -19687,7 +19892,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(fil_make_page_dirty_debug),
MYSQL_SYSVAR(saved_page_number_debug),
#endif /* UNIV_DEBUG */
- MYSQL_SYSVAR(simulate_comp_failures),
+ MYSQL_SYSVAR(tmpdir),
MYSQL_SYSVAR(force_primary_key),
MYSQL_SYSVAR(fatal_semaphore_wait_threshold),
/* Table page compression feature */
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 0087b220d2f..332c5f319fa 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -201,12 +201,14 @@ innobase_fulltext_exist(
/*******************************************************************//**
Determine if ALTER TABLE needs to rebuild the table.
@param ha_alter_info the DDL operation
+@param altered_table MySQL original table
@return whether it is necessary to rebuild the table */
static __attribute__((nonnull, warn_unused_result))
bool
innobase_need_rebuild(
/*==================*/
- const Alter_inplace_info* ha_alter_info)
+ const Alter_inplace_info* ha_alter_info,
+ const TABLE* altered_table)
{
if (ha_alter_info->handler_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
@@ -218,6 +220,34 @@ innobase_need_rebuild(
return(false);
}
+ /* If alter table changes column name and adds a new
+ index, we need to check is this new index created
+ to new column name. This is because column name
+ changes are done normally after creating indexes. */
+ if ((ha_alter_info->handler_flags
+ & Alter_inplace_info::ALTER_COLUMN_NAME) &&
+ ((ha_alter_info->handler_flags
+ & Alter_inplace_info::ADD_INDEX) ||
+ (ha_alter_info->handler_flags
+ & Alter_inplace_info::ADD_FOREIGN_KEY))) {
+ for (ulint i = 0; i < ha_alter_info->key_count; i++) {
+ const KEY* key = &ha_alter_info->key_info_buffer[
+ ha_alter_info->index_add_buffer[i]];
+
+ for (ulint j = 0; j < key->user_defined_key_parts; j++) {
+ const KEY_PART_INFO* key_part = &(key->key_part[j]);
+ const Field* field = altered_table->field[key_part->fieldnr];
+
+ /* Field used on added index is renamed on
+ this same alter table. We need table
+ rebuild. */
+ if (field->flags & FIELD_IS_RENAMED) {
+ return (true);
+ }
+ }
+ }
+ }
+
return(!!(ha_alter_info->handler_flags & INNOBASE_ALTER_REBUILD));
}
@@ -555,7 +585,7 @@ ha_innobase::check_if_supported_inplace_alter(
operation is possible. */
} else if (((ha_alter_info->handler_flags
& Alter_inplace_info::ADD_PK_INDEX)
- || innobase_need_rebuild(ha_alter_info))
+ || innobase_need_rebuild(ha_alter_info, table))
&& (innobase_fulltext_exist(altered_table))) {
/* Refuse to rebuild the table online, if
fulltext indexes are to survive the rebuild. */
@@ -1558,7 +1588,8 @@ innobase_create_index_def(
index_def_t* index, /*!< out: index definition */
mem_heap_t* heap, /*!< in: heap where memory
is allocated */
- const Field** fields) /*!z in: MySQL table fields */
+ const Field** fields) /*!< in: MySQL table fields
+ */
{
const KEY* key = &keys[key_number];
ulint i;
@@ -1853,9 +1884,11 @@ innobase_create_key_defs(
bool& add_fts_doc_id,
/*!< in: whether we need to add new DOC ID
column for FTS index */
- bool& add_fts_doc_idx)
+ bool& add_fts_doc_idx,
/*!< in: whether we need to add new DOC ID
index for FTS index */
+ const TABLE* table)
+ /*!< in: MySQL table that is being altered */
{
index_def_t* indexdef;
index_def_t* indexdefs;
@@ -1905,7 +1938,8 @@ innobase_create_key_defs(
}
const bool rebuild = new_primary || add_fts_doc_id
- || innobase_need_rebuild(ha_alter_info);
+ || innobase_need_rebuild(ha_alter_info, table);
+
/* Reserve one more space if new_primary is true, and we might
need to add the FTS_DOC_ID_INDEX */
indexdef = indexdefs = static_cast<index_def_t*>(
@@ -2738,11 +2772,16 @@ prepare_inplace_alter_table_dict(
ctx->num_to_add_index = ha_alter_info->index_add_count;
+ ut_ad(ctx->prebuilt->trx->mysql_thd != NULL);
+ const char* path = thd_innodb_tmpdir(
+ ctx->prebuilt->trx->mysql_thd);
+
index_defs = innobase_create_key_defs(
ctx->heap, ha_alter_info, altered_table, ctx->num_to_add_index,
num_fts_index,
row_table_got_default_clust_index(ctx->new_table),
- fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx);
+ fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx,
+ old_table);
new_clustered = DICT_CLUSTERED & index_defs[0].ind_type;
@@ -2755,7 +2794,7 @@ prepare_inplace_alter_table_dict(
/* This is not an online operation (LOCK=NONE). */
} else if (ctx->add_autoinc == ULINT_UNDEFINED
&& num_fts_index == 0
- && (!innobase_need_rebuild(ha_alter_info)
+ && (!innobase_need_rebuild(ha_alter_info, old_table)
|| !innobase_fulltext_exist(altered_table))) {
/* InnoDB can perform an online operation (LOCK=NONE). */
} else {
@@ -2772,7 +2811,7 @@ prepare_inplace_alter_table_dict(
is just copied from old table and stored in indexdefs[0] */
DBUG_ASSERT(!add_fts_doc_id || new_clustered);
DBUG_ASSERT(!!new_clustered ==
- (innobase_need_rebuild(ha_alter_info)
+ (innobase_need_rebuild(ha_alter_info, old_table)
|| add_fts_doc_id));
/* Allocate memory for dictionary index definitions */
@@ -3032,7 +3071,7 @@ prepare_inplace_alter_table_dict(
add_cols, ctx->heap);
ctx->add_cols = add_cols;
} else {
- DBUG_ASSERT(!innobase_need_rebuild(ha_alter_info));
+ DBUG_ASSERT(!innobase_need_rebuild(ha_alter_info, old_table));
if (!ctx->new_table->fts
&& innobase_fulltext_exist(altered_table)) {
@@ -3053,7 +3092,7 @@ prepare_inplace_alter_table_dict(
ctx->add_index[a] = row_merge_create_index(
ctx->trx, ctx->new_table,
- &index_defs[a]);
+ &index_defs[a], ctx->col_names);
add_key_nums[a] = index_defs[a].key_number;
@@ -3090,8 +3129,10 @@ prepare_inplace_alter_table_dict(
error = DB_OUT_OF_MEMORY;
goto error_handling;);
rw_lock_x_lock(&ctx->add_index[a]->lock);
+
bool ok = row_log_allocate(ctx->add_index[a],
- NULL, true, NULL, NULL);
+ NULL, true, NULL,
+ NULL, path);
rw_lock_x_unlock(&ctx->add_index[a]->lock);
if (!ok) {
@@ -3117,7 +3158,7 @@ prepare_inplace_alter_table_dict(
clust_index, ctx->new_table,
!(ha_alter_info->handler_flags
& Alter_inplace_info::ADD_PK_INDEX),
- ctx->add_cols, ctx->col_map);
+ ctx->add_cols, ctx->col_map, path);
rw_lock_x_unlock(&clust_index->lock);
if (!ok) {
@@ -3914,7 +3955,7 @@ err_exit:
if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA)
|| (ha_alter_info->handler_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
- && !innobase_need_rebuild(ha_alter_info))) {
+ && !innobase_need_rebuild(ha_alter_info, table))) {
if (heap) {
ha_alter_info->handler_ctx
@@ -4088,7 +4129,7 @@ ok_exit:
if (ha_alter_info->handler_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
- && !innobase_need_rebuild(ha_alter_info)) {
+ && !innobase_need_rebuild(ha_alter_info, table)) {
goto ok_exit;
}
@@ -4110,6 +4151,7 @@ ok_exit:
files and merge sort. */
DBUG_EXECUTE_IF("innodb_OOM_inplace_alter",
error = DB_OUT_OF_MEMORY; goto oom;);
+
error = row_merge_build_indexes(
prebuilt->trx,
prebuilt->table, ctx->new_table,
@@ -4800,9 +4842,11 @@ commit_get_autoinc(
Field* autoinc_field =
old_table->found_next_number_field;
+ KEY* autoinc_key =
+ old_table->key_info + old_table->s->next_number_index;
- dict_index_t* index = dict_table_get_index_on_first_col(
- ctx->old_table, autoinc_field->field_index);
+ dict_index_t* index = dict_table_get_index_on_name(
+ ctx->old_table, autoinc_key->name);
max_autoinc = ha_alter_info->create_info->auto_increment_value;
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index c1e5051dc6f..9e8d8659739 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
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
@@ -383,12 +384,18 @@ ibuf_header_page_get(
buf_block_t* block;
ut_ad(!ibuf_inside(mtr));
+ page_t* page = NULL;
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
- buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
- return(buf_block_get_frame(block));
+ if (!block->page.encrypted) {
+ buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
+
+ page = buf_block_get_frame(block);
+ }
+
+ return page;
}
/******************************************************************//**
@@ -500,9 +507,10 @@ ibuf_size_update(
/******************************************************************//**
Creates the insert buffer data structure at a database startup and initializes
-the data structures for the insert buffer. */
+the data structures for the insert buffer.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void)
/*=======================*/
{
@@ -513,7 +521,7 @@ ibuf_init_at_db_start(void)
dict_index_t* index;
ulint n_used;
page_t* header_page;
- dberr_t error;
+ dberr_t error= DB_SUCCESS;
ibuf = static_cast<ibuf_t*>(mem_zalloc(sizeof(ibuf_t)));
@@ -543,6 +551,10 @@ ibuf_init_at_db_start(void)
header_page = ibuf_header_page_get(&mtr);
+ if (!header_page) {
+ return (DB_DECRYPTION_FAILED);
+ }
+
fseg_n_reserved_pages(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
&n_used, &mtr);
ibuf_enter(&mtr);
@@ -593,6 +605,7 @@ ibuf_init_at_db_start(void)
ut_a(error == DB_SUCCESS);
ibuf->index = dict_table_get_first_index(table);
+ return (error);
}
/*********************************************************************//**
diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h
index cf2e022c006..aa601f28e25 100644
--- a/storage/innobase/include/fil0crypt.h
+++ b/storage/innobase/include/fil0crypt.h
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2015, MariaDB Corporation.
+Copyright (c) 2015, 2016, MariaDB Corporation.
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
@@ -212,6 +212,7 @@ bool
fil_space_check_encryption_read(
/*============================*/
ulint space); /*!< in: tablespace id */
+
/******************************************************************
Decrypt a page
@return true if page is decrypted, false if not. */
@@ -226,7 +227,6 @@ fil_space_decrypt(
dberr_t* err); /*!< in: out: DB_SUCCESS or
error code */
-
/*********************************************************************
Encrypt buffer page
@return encrypted page, or original not encrypted page if encrypt
@@ -253,7 +253,8 @@ fil_space_decrypt(
ulint space, /*!< in: tablespace id */
byte* src_frame, /*!< in: page frame */
ulint page_size, /*!< in: size of data to encrypt */
- byte* dst_frame); /*!< in: where to decrypt to */
+ byte* dst_frame) /*!< in: where to decrypt to */
+ __attribute__((warn_unused_result));
/*********************************************************************
fil_space_verify_crypt_checksum
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index 59abb0863d9..427bfaf2c05 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2006, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 2015, 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
@@ -351,6 +351,15 @@ thd_supports_xa(
THD* thd); /*!< in: thread handle, or NULL to query
the global innodb_supports_xa */
+/** Get status of innodb_tmpdir.
+@param[in] thd thread handle, or NULL to query
+ the global innodb_tmpdir.
+@retval NULL if innodb_tmpdir="" */
+UNIV_INTERN
+const char*
+thd_innodb_tmpdir(
+ THD* thd);
+
/******************************************************************//**
Returns the lock wait timeout for the current connection.
@return the lock wait timeout, in seconds */
@@ -634,6 +643,7 @@ ib_push_warning(
ulint error, /*!< in: error code to push as warning */
const char *format,/*!< in: warning message */
...);
+
/********************************************************************//**
Helper function to push warnings from InnoDB internals to SQL-layer. */
UNIV_INTERN
@@ -643,4 +653,19 @@ ib_push_warning(
ulint error, /*!< in: error code to push as warning */
const char *format,/*!< in: warning message */
...);
+
+/*****************************************************************//**
+Normalizes a table name string. A normalized name consists of the
+database name catenated to '/' and table name. An example:
+test/mytable. On Windows normalization puts both the database name and the
+table name always to lower case if "set_lower_case" is set to TRUE. */
+void
+normalize_table_name_low(
+/*=====================*/
+ char* norm_name, /*!< out: normalized name as a
+ null-terminated string */
+ const char* name, /*!< in: table name string */
+ ibool set_lower_case); /*!< in: TRUE if we want to set
+ name to lower case */
+
#endif /* HA_INNODB_PROTOTYPES_H */
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 9c3b686c998..badafe6befd 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
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
@@ -91,9 +92,10 @@ separately committed mini-transaction, because in crash recovery, the
free bits could momentarily be set too high. */
/******************************************************************//**
-Creates the insert buffer data structure at a database startup. */
+Creates the insert buffer data structure at a database startup.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void);
/*=======================*/
/*********************************************************************//**
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index c630e91e815..c610e1790eb 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -435,14 +435,19 @@ UNIV_INTERN
void
os_io_init_simple(void);
/*===================*/
-/***********************************************************************//**
-Creates a temporary file. This function is like tmpfile(3), but
-the temporary file is created in the MySQL temporary directory.
-@return temporary file handle, or NULL on error */
+
+/** Create a temporary file. This function is like tmpfile(3), but
+the temporary file is created in the given parameter path. If the path
+is null then it will create the file in the mysql server configuration
+parameter (--tmpdir).
+@param[in] path location for creating temporary file
+@return temporary file handle, or NULL on error */
+UNIV_INTERN
FILE*
-os_file_create_tmpfile(void);
-/*========================*/
+os_file_create_tmpfile(
+ const char* path);
+
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************//**
The os_file_opendir() function opens a directory stream corresponding to the
@@ -1271,14 +1276,14 @@ os_file_get_status(
file can be opened in RW mode */
#if !defined(UNIV_HOTBACKUP)
-/*********************************************************************//**
-Creates a temporary file that will be deleted on close.
-This function is defined in ha_innodb.cc.
-@return temporary file descriptor, or < 0 on error */
+/** Create a temporary file in the location specified by the parameter
+path. If the path is null, then it will be created in tmpdir.
+@param[in] path location for creating temporary file
+@return temporary file descriptor, or < 0 on error */
UNIV_INTERN
int
-innobase_mysql_tmpfile(void);
-/*========================*/
+innobase_mysql_tmpfile(
+ const char* path);
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h
index f105838eece..e127504c484 100644
--- a/storage/innobase/include/row0log.h
+++ b/storage/innobase/include/row0log.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2015, 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
@@ -55,8 +55,9 @@ row_log_allocate(
const dtuple_t* add_cols,
/*!< in: default values of
added columns, or NULL */
- const ulint* col_map)/*!< in: mapping of old column
+ const ulint* col_map,/*!< in: mapping of old column
numbers to new ones, or NULL if !table */
+ const char* path) /*!< in: where to create temporary file */
__attribute__((nonnull(1), warn_unused_result));
/******************************************************//**
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index 196543f25e1..53164b5197f 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 2005, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, MariaDB Corporation.
+Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2015, 2016, MariaDB Corporation.
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
@@ -187,14 +187,14 @@ void
row_merge_drop_temp_indexes(void);
/*=============================*/
-/*********************************************************************//**
-Creates temporary merge files, and if UNIV_PFS_IO defined, register
-the file descriptor with Performance Schema.
+/** Create temporary merge files in the given paramater path, and if
+UNIV_PFS_IO defined, register the file descriptor with Performance Schema.
+@param[in] path location for creating temporary merge files.
@return File descriptor */
UNIV_INTERN
int
-row_merge_file_create_low(void)
-/*===========================*/
+row_merge_file_create_low(
+ const char* path)
__attribute__((warn_unused_result));
/*********************************************************************//**
Destroy a merge file. And de-register the file from Performance Schema
@@ -268,8 +268,11 @@ row_merge_create_index(
/*===================*/
trx_t* trx, /*!< in/out: trx (sets error_state) */
dict_table_t* table, /*!< in: the index is on this table */
- const index_def_t* index_def);
+ const index_def_t* index_def,
/*!< in: the index definition */
+ const char** col_names);
+ /*! in: column names if columns are
+ renamed or NULL */
/*********************************************************************//**
Check if a transaction can use an index.
@return TRUE if index can be used by the transaction else FALSE */
@@ -369,15 +372,17 @@ row_merge_buf_empty(
/*================*/
row_merge_buf_t* buf) /*!< in,own: sort buffer */
__attribute__((warn_unused_result, nonnull));
-/*********************************************************************//**
-Create a merge file.
+
+/** Create a merge file in the given location.
+@param[out] merge_file merge file structure
+@param[in] path location for creating temporary file
@return file descriptor, or -1 on failure */
UNIV_INTERN
int
row_merge_file_create(
-/*==================*/
- merge_file_t* merge_file) /*!< out: merge file structure */
- __attribute__((nonnull));
+ merge_file_t* merge_file,
+ const char* path);
+
/*********************************************************************//**
Merge disk files.
@return DB_SUCCESS or error code */
diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h
index 8673a51b10f..422cfc3eaf6 100644
--- a/storage/innobase/include/srv0mon.h
+++ b/storage/innobase/include/srv0mon.h
@@ -2,7 +2,7 @@
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2016, MariaDB Corporation.
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
@@ -263,9 +263,6 @@ enum monitor_id_t {
MONITOR_OVLD_OS_LOG_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_WRITES,
- MONITOR_MERGE_BLOCKS_WRITTEN,
- MONITOR_MERGE_BLOCKS_READ,
- MONITOR_MERGE_BLOCKS_MERGED,
/* Transaction related counters */
MONITOR_MODULE_TRX,
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index d8e7d484a18..9a6107f4330 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2016, MariaDB Corporation
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -174,15 +174,6 @@ struct srv_stats_t {
/** Number of system rows inserted */
ulint_ctr_64_t n_system_rows_inserted;
- /** Number of merge buffers written */
- ulint_ctr_64_t merge_buffers_written;
-
- /** Number of merge buffers read */
- ulint_ctr_64_t merge_buffers_read;
-
- /** Number of merge buffers merged */
- ulint_ctr_64_t merge_buffers_merged;
-
/** Number of times secondary index lookup triggered cluster lookup */
ulint_ctr_64_t n_sec_rec_cluster_reads;
@@ -1001,9 +992,6 @@ struct export_var_t{
ulint innodb_purge_view_trx_id_age; /*!< rw_max_trx_id
- purged view's min trx_id */
#endif /* UNIV_DEBUG */
- ib_int64_t innodb_merge_buffers_written;
- ib_int64_t innodb_merge_buffers_read;
- ib_int64_t innodb_merge_buffers_merged;
ib_int64_t innodb_page_compression_saved;/*!< Number of bytes saved
by page compression */
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index a957b2cc98f..c2451fa8c21 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -45,7 +45,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 6
-#define INNODB_VERSION_BUGFIX 27
+#define INNODB_VERSION_BUGFIX 29
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 184b1a375ce..165db2d33ed 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -638,7 +638,7 @@ lock_sys_create(
lock_sys->rec_hash = hash_create(n_cells);
if (!srv_read_only_mode) {
- lock_latest_err_file = os_file_create_tmpfile();
+ lock_latest_err_file = os_file_create_tmpfile(NULL);
ut_a(lock_latest_err_file);
}
}
diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc
index 4f4a0eb223b..a87adcf94c0 100644
--- a/storage/innobase/lock/lock0wait.cc
+++ b/storage/innobase/lock/lock0wait.cc
@@ -33,6 +33,8 @@ Created 25/5/2010 Sunny Bains
#include "ha_prototypes.h"
#include "lock0priv.h"
+#include <mysql/service_wsrep.h>
+
/*********************************************************************//**
Print the contents of the lock_sys_t::waiting_threads array. */
static
@@ -184,6 +186,28 @@ lock_wait_table_reserve_slot(
return(NULL);
}
+#ifdef WITH_WSREP
+/*********************************************************************//**
+check if lock timeout was for priority thread,
+as a side effect trigger lock monitor
+@return false for regular lock timeout */
+static ibool
+wsrep_is_BF_lock_timeout(
+/*====================*/
+ trx_t* trx) /* in: trx to check for lock priority */
+{
+ if (wsrep_on(trx->mysql_thd) &&
+ wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
+ fprintf(stderr, "WSREP: BF lock wait long\n");
+ srv_print_innodb_monitor = TRUE;
+ srv_print_innodb_lock_monitor = TRUE;
+ os_event_set(srv_monitor_event);
+ return TRUE;
+ }
+ return FALSE;
+ }
+#endif /* WITH_WSREP */
+
/***************************************************************//**
Puts a user OS thread to wait for a lock to be released. If an error
occurs during the wait trx->error_state associated with thr is
@@ -371,9 +395,17 @@ lock_wait_suspend_thread(
if (lock_wait_timeout < 100000000
&& wait_time > (double) lock_wait_timeout) {
+#ifdef WITH_WSREP
+ if (!wsrep_on(trx->mysql_thd) ||
+ (!wsrep_is_BF_lock_timeout(trx) &&
+ trx->error_state != DB_DEADLOCK)) {
+#endif /* WITH_WSREP */
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
+#ifdef WITH_WSREP
+ }
+#endif /* WITH_WSREP */
MONITOR_INC(MONITOR_TIMEOUT);
}
@@ -457,8 +489,13 @@ lock_wait_check_and_cancel(
if (trx->lock.wait_lock) {
ut_a(trx->lock.que_state == TRX_QUE_LOCK_WAIT);
-
+#ifdef WITH_WSREP
+ if (!wsrep_is_BF_lock_timeout(trx)) {
+#endif /* WITH_WSREP */
lock_cancel_waiting_and_release(trx->lock.wait_lock);
+#ifdef WITH_WSREP
+ }
+#endif /* WITH_WSREP */
}
lock_mutex_exit();
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 2b9e877e765..dd6b066c647 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -918,19 +918,20 @@ os_io_init_simple(void)
}
}
-/***********************************************************************//**
-Creates a temporary file. This function is like tmpfile(3), but
-the temporary file is created in the MySQL temporary directory.
-@return temporary file handle, or NULL on error */
+/** Create a temporary file. This function is like tmpfile(3), but
+the temporary file is created in the given parameter path. If the path
+is null then it will create the file in the mysql server configuration
+parameter (--tmpdir).
+@param[in] path location for creating temporary file
+@return temporary file handle, or NULL on error */
UNIV_INTERN
FILE*
-os_file_create_tmpfile(void)
-/*========================*/
+os_file_create_tmpfile(
+ const char* path)
{
FILE* file = NULL;
- int fd;
WAIT_ALLOW_WRITES();
- fd = innobase_mysql_tmpfile();
+ int fd = innobase_mysql_tmpfile(path);
ut_ad(!srv_read_only_mode);
@@ -3910,7 +3911,7 @@ os_aio_native_aio_supported(void)
return(FALSE);
} else if (!srv_read_only_mode) {
/* Now check if tmpdir supports native aio ops. */
- fd = innobase_mysql_tmpfile();
+ fd = innobase_mysql_tmpfile(NULL);
if (fd < 0) {
ib_logf(IB_LOG_LEVEL_WARN,
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 4c021973b9a..9e340f24213 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, MariaDB Corporation.
+Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2015, 2016, MariaDB Corporation.
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
@@ -237,6 +237,9 @@ row_fts_psort_info_init(
crypt_data = NULL;
}
+ ut_ad(trx->mysql_thd != NULL);
+ const char* path = thd_innodb_tmpdir(trx->mysql_thd);
+
/* There will be FTS_NUM_AUX_INDEX number of "sort buckets" for
each parallel sort thread. Each "sort bucket" holds records for
a particular "FTS index partition" */
@@ -258,8 +261,8 @@ row_fts_psort_info_init(
psort_info[j].merge_buf[i] = row_merge_buf_create(
dup->index);
- if (row_merge_file_create(psort_info[j].merge_file[i])
- < 0) {
+ if (row_merge_file_create(psort_info[j].merge_file[i],
+ path) < 0) {
goto func_exit;
}
@@ -659,6 +662,11 @@ fts_parallel_tokenization(
dberr_t error = DB_SUCCESS;
fil_space_crypt_t* crypt_data = NULL;
+ ut_ad(psort_info->psort_common->trx->mysql_thd != NULL);
+
+ const char* path = thd_innodb_tmpdir(
+ psort_info->psort_common->trx->mysql_thd);
+
ut_ad(psort_info);
buf = psort_info->merge_buf;
@@ -902,7 +910,7 @@ exit:
continue;
}
- tmpfd[i] = row_merge_file_create_low();
+ tmpfd[i] = row_merge_file_create_low(path);
if (tmpfd[i] < 0) {
error = DB_OUT_OF_MEMORY;
goto func_exit;
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 16de943f901..bddc81d9fb3 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -198,8 +198,25 @@ struct row_log_t {
or by index->lock X-latch only */
row_log_buf_t head; /*!< reader context; protected by MDL only;
modifiable by row_log_apply_ops() */
+ const char* path; /*!< where to create temporary file during
+ log operation */
};
+/** Create the file or online log if it does not exist.
+@param[in,out] log online rebuild log
+@return file descriptor. */
+static __attribute__((warn_unused_result))
+int
+row_log_tmpfile(
+ row_log_t* log)
+{
+ DBUG_ENTER("row_log_tmpfile");
+ if (log->fd < 0) {
+ log->fd = row_merge_file_create_low(log->path);
+ }
+
+ DBUG_RETURN(log->fd);
+}
/** Allocate the memory for the log buffer.
@param[in,out] log_buf Buffer used for log operation
@@ -344,6 +361,12 @@ row_log_online_op(
log->tail.buf, avail_size);
}
UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size);
+
+ if (row_log_tmpfile(log) < 0) {
+ log->error = DB_OUT_OF_MEMORY;
+ goto err_exit;
+ }
+
ret = os_file_write(
"(modification log)",
OS_FILE_FROM_FD(log->fd),
@@ -454,6 +477,12 @@ row_log_table_close_func(
log->tail.buf, avail);
}
UNIV_MEM_ASSERT_RW(log->tail.block, srv_sort_buf_size);
+
+ if (row_log_tmpfile(log) < 0) {
+ log->error = DB_OUT_OF_MEMORY;
+ goto err_exit;
+ }
+
ret = os_file_write(
"(modification log)",
OS_FILE_FROM_FD(log->fd),
@@ -473,6 +502,7 @@ write_failed:
log->tail.total += size;
UNIV_MEM_INVALID(log->tail.buf, sizeof log->tail.buf);
+err_exit:
mutex_exit(&log->mutex);
os_atomic_increment_ulint(&onlineddl_rowlog_rows, 1);
@@ -2544,7 +2574,8 @@ corruption:
if (index->online_log->head.blocks) {
#ifdef HAVE_FTRUNCATE
/* Truncate the file in order to save space. */
- if (ftruncate(index->online_log->fd, 0) == -1) {
+ if (index->online_log->fd != -1
+ && ftruncate(index->online_log->fd, 0) == -1) {
fprintf(stderr, "InnoDB: Error: Truncate of file "
"\'%s\' failed with error %d:%s\n",
index->name + 1, errno, strerror(errno));
@@ -2863,8 +2894,9 @@ row_log_allocate(
const dtuple_t* add_cols,
/*!< in: default values of
added columns, or NULL */
- const ulint* col_map)/*!< in: mapping of old column
+ const ulint* col_map,/*!< in: mapping of old column
numbers to new ones, or NULL if !table */
+ const char* path) /*!< in: where to create temporary file */
{
row_log_t* log;
DBUG_ENTER("row_log_allocate");
@@ -2883,11 +2915,7 @@ row_log_allocate(
DBUG_RETURN(false);
}
- log->fd = row_merge_file_create_low();
- if (log->fd < 0) {
- ut_free(log);
- DBUG_RETURN(false);
- }
+ log->fd = -1;
mutex_create(index_online_log_key, &log->mutex,
SYNC_INDEX_ONLINE_LOG);
log->blobs = NULL;
@@ -2902,6 +2930,7 @@ row_log_allocate(
log->tail.block = log->head.block = NULL;
log->head.blocks = log->head.bytes = 0;
log->head.total = 0;
+ log->path = path;
dict_index_set_online_status(index, ONLINE_INDEX_CREATION);
index->online_log = log;
@@ -3379,7 +3408,8 @@ corruption:
if (index->online_log->head.blocks) {
#ifdef HAVE_FTRUNCATE
/* Truncate the file in order to save space. */
- if (ftruncate(index->online_log->fd, 0) == -1) {
+ if (index->online_log->fd != -1
+ && ftruncate(index->online_log->fd, 0) == -1) {
fprintf(stderr, "InnoDB: Error: Truncate of file "
"\'%s\' failed with error %d:%s\n",
index->name + 1, errno, strerror(errno));
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 13eeaeb72fa..94cf20b79f6 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1,7 +1,6 @@
/*****************************************************************************
Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2015, MariaDB Corporation.
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
@@ -969,7 +968,6 @@ row_merge_read(
success = os_file_read_no_error_handling(OS_FILE_FROM_FD(fd), buf,
ofs, srv_sort_buf_size);
- srv_stats.merge_buffers_read.inc();
/* For encrypted tables, decrypt data after reading and copy data */
if (crypt_data && crypt_buf) {
@@ -1025,7 +1023,6 @@ row_merge_write(
}
ret = os_file_write("(merge)", OS_FILE_FROM_FD(fd), out_buf, ofs, buf_len);
- srv_stats.merge_buffers_written.inc();
#ifdef UNIV_DEBUG
if (row_merge_print_block_write) {
@@ -1390,52 +1387,101 @@ row_merge_write_eof(
return(&block[0]);
}
-/********************************************************************//**
-Reads clustered index of the table and create temporary files
+/** Create a temporary file if it has not been created already.
+@param[in,out] tmpfd temporary file handle
+@param[in] path path to create temporary file
+@return file descriptor, or -1 on failure */
+static __attribute__((warn_unused_result))
+int
+row_merge_tmpfile_if_needed(
+ int* tmpfd,
+ const char* path)
+{
+ if (*tmpfd < 0) {
+ *tmpfd = row_merge_file_create_low(path);
+ }
+
+ return(*tmpfd);
+}
+
+/** Create a temporary file for merge sort if it was not created already.
+@param[in,out] file merge file structure
+@param[in,out] tmpfd temporary file structure
+@param[in] nrec number of records in the file
+@param[in] path path to create temporary files
+@return file descriptor, or -1 on failure */
+static __attribute__((warn_unused_result))
+int
+row_merge_file_create_if_needed(
+ merge_file_t* file,
+ int* tmpfd,
+ ulint nrec,
+ const char* path)
+{
+ ut_ad(file->fd < 0 || *tmpfd >=0);
+ if (file->fd < 0 && row_merge_file_create(file, path) >= 0) {
+ if (row_merge_tmpfile_if_needed(tmpfd, path) < 0) {
+ return(-1);
+ }
+
+ file->n_rec = nrec;
+ }
+
+ ut_ad(file->fd < 0 || *tmpfd >=0);
+ return(file->fd);
+}
+
+/** Reads clustered index of the table and create temporary files
containing the index entries for the indexes to be built.
-@return DB_SUCCESS or error */
+@param[in] trx transaction
+@param[in,out] table MySQL table object, for reporting erroneous
+ records
+@param[in] old_table table where rows are read from
+@param[in] new_table table where indexes are created; identical to
+ old_table unless creating a PRIMARY KEY
+@param[in] online true if creating indexes online
+@param[in] index indexes to be created
+@param[in] fts_sort_idx full-text index to be created, or NULL
+@param[in] psort_info parallel sort info for fts_sort_idx creation,
+ or NULL
+@param[in] files temporary files
+@param[in] key_numbers MySQL key numbers to create
+@param[in] n_index number of indexes to create
+@param[in] add_cols default values of added columns, or NULL
+@param[in] col_map mapping of old column numbers to new ones, or
+ NULL if old_table == new_table
+@param[in] add_autoinc number of added AUTO_INCREMENT columns, or
+ ULINT_UNDEFINED if none is added
+@param[in,out] sequence autoinc sequence
+@param[in,out] block file buffer
+@param[in,out] tmpfd temporary file handle
+@param[in] pct_cost percent of task weight out of total alter job
+@param[in] crypt_data crypt data or NULL
+@param[in,out] crypt_block crypted file buffer
+return DB_SUCCESS or error */
static __attribute__((nonnull(1,2,3,4,6,9,10,16), warn_unused_result))
dberr_t
row_merge_read_clustered_index(
-/*===========================*/
- trx_t* trx, /*!< in: transaction */
- struct TABLE* table, /*!< in/out: MySQL table object,
- for reporting erroneous records */
- const dict_table_t* old_table,/*!< in: table where rows are
- read from */
- const dict_table_t* new_table,/*!< in: table where indexes are
- created; identical to old_table
- unless creating a PRIMARY KEY */
- bool online, /*!< in: true if creating indexes
- online */
- dict_index_t** index, /*!< in: indexes to be created */
+ trx_t* trx,
+ struct TABLE* table,
+ const dict_table_t* old_table,
+ const dict_table_t* new_table,
+ bool online,
+ dict_index_t** index,
dict_index_t* fts_sort_idx,
- /*!< in: full-text index to be created,
- or NULL */
fts_psort_t* psort_info,
- /*!< in: parallel sort info for
- fts_sort_idx creation, or NULL */
- merge_file_t* files, /*!< in: temporary files */
+ merge_file_t* files,
const ulint* key_numbers,
- /*!< in: MySQL key numbers to create */
- ulint n_index,/*!< in: number of indexes to create */
+ ulint n_index,
const dtuple_t* add_cols,
- /*!< in: default values of
- added columns, or NULL */
- const ulint* col_map,/*!< in: mapping of old column
- numbers to new ones, or NULL
- if old_table == new_table */
+ const ulint* col_map,
ulint add_autoinc,
- /*!< in: number of added
- AUTO_INCREMENT column, or
- ULINT_UNDEFINED if none is added */
- ib_sequence_t& sequence,/*!< in/out: autoinc sequence */
- row_merge_block_t* block, /*!< in/out: file buffer */
- float pct_cost, /*!< in: percent of task weight
- out of total alter job */
- fil_space_crypt_t* crypt_data,/*!< in: crypt data or NULL */
- row_merge_block_t* crypt_block)/*!< in: in/out: crypted file
- buffer */
+ ib_sequence_t& sequence,
+ row_merge_block_t* block,
+ int* tmpfd,
+ float pct_cost,
+ fil_space_crypt_t* crypt_data,
+ row_merge_block_t* crypt_block)
{
dict_index_t* clust_index; /* Clustered index */
mem_heap_t* row_heap; /* Heap memory to create
@@ -1478,6 +1524,9 @@ row_merge_read_clustered_index(
DEBUG_FTS_SORT_PRINT("FTS_SORT: Start Create Index\n");
#endif
+ ut_ad(trx->mysql_thd != NULL);
+ const char* path = thd_innodb_tmpdir(trx->mysql_thd);
+
/* Create and initialize memory for record buffers */
merge_buf = static_cast<row_merge_buf_t**>(
@@ -1908,7 +1957,7 @@ write_buffers:
/* We have enough data tuples to form a block.
Sort them and write to disk. */
- if (UNIV_LIKELY(buf->n_tuples)) {
+ if (buf->n_tuples) {
if (dict_index_is_unique(buf->index)) {
row_merge_dup_t dup = {
buf->index, table, col_map, 0};
@@ -1949,8 +1998,16 @@ write_buffers:
dict_index_get_lock(buf->index));
}
- /* Do not write empty buffers to temporary file */
- if (buf->n_tuples) {
+ if (buf->n_tuples > 0) {
+
+ if (row_merge_file_create_if_needed(
+ file, tmpfd, buf->n_tuples, path) < 0) {
+ err = DB_OUT_OF_MEMORY;
+ trx->error_key_num = i;
+ break;
+ }
+
+ ut_ad(file->n_rec > 0);
row_merge_buf_write(buf, file, block);
@@ -2016,6 +2073,7 @@ write_buffers:
func_exit:
mtr_commit(&mtr);
+
mem_heap_free(row_heap);
if (nonnull) {
@@ -2277,8 +2335,6 @@ done1:
b2, of->fd, &of->offset,
crypt_data, crypt_block ? &crypt_block[2 * srv_sort_buf_size] : NULL, space);
- srv_stats.merge_buffers_merged.inc();
-
return(b2 ? DB_SUCCESS : DB_CORRUPTION);
}
@@ -3346,14 +3402,15 @@ row_merge_drop_temp_indexes(void)
trx_free_for_background(trx);
}
-/*********************************************************************//**
-Creates temporary merge files, and if UNIV_PFS_IO defined, register
-the file descriptor with Performance Schema.
-@return file descriptor, or -1 on failure */
+
+/** Create temporary merge files in the given paramater path, and if
+UNIV_PFS_IO defined, register the file descriptor with Performance Schema.
+@param[in] path location for creating temporary merge files.
+@return File descriptor */
UNIV_INTERN
int
-row_merge_file_create_low(void)
-/*===========================*/
+row_merge_file_create_low(
+ const char* path)
{
int fd;
#ifdef UNIV_PFS_IO
@@ -3367,7 +3424,7 @@ row_merge_file_create_low(void)
"Innodb Merge Temp File",
__FILE__, __LINE__);
#endif
- fd = innobase_mysql_tmpfile();
+ fd = innobase_mysql_tmpfile(path);
#ifdef UNIV_PFS_IO
register_pfs_file_open_end(locker, fd);
#endif
@@ -3380,16 +3437,18 @@ row_merge_file_create_low(void)
return(fd);
}
-/*********************************************************************//**
-Create a merge file.
+
+/** Create a merge file in the given location.
+@param[out] merge_file merge file structure
+@param[in] path location for creating temporary file
@return file descriptor, or -1 on failure */
UNIV_INTERN
int
row_merge_file_create(
-/*==================*/
- merge_file_t* merge_file) /*!< out: merge file structure */
+ merge_file_t* merge_file,
+ const char* path)
{
- merge_file->fd = row_merge_file_create_low();
+ merge_file->fd = row_merge_file_create_low(path);
merge_file->offset = 0;
merge_file->n_rec = 0;
@@ -3739,8 +3798,11 @@ row_merge_create_index(
/*===================*/
trx_t* trx, /*!< in/out: trx (sets error_state) */
dict_table_t* table, /*!< in: the index is on this table */
- const index_def_t* index_def)
+ const index_def_t* index_def,
/*!< in: the index definition */
+ const char** col_names)
+ /*! in: column names if columns are
+ renamed or NULL */
{
dict_index_t* index;
dberr_t err;
@@ -3760,9 +3822,24 @@ row_merge_create_index(
for (i = 0; i < n_fields; i++) {
index_field_t* ifield = &index_def->fields[i];
- const char * col_name = ifield->col_name ?
- dict_table_get_col_name_for_mysql(table, ifield->col_name) :
- dict_table_get_col_name(table, ifield->col_no);
+ const char * col_name;
+
+ /*
+ Alter table renaming a column and then adding a index
+ to this new name e.g ALTER TABLE t
+ CHANGE COLUMN b c INT NOT NULL, ADD UNIQUE INDEX (c);
+ requires additional check as column names are not yet
+ changed when new index definitions are created. Table's
+ new column names are on a array of column name pointers
+ if any of the column names are changed. */
+
+ if (col_names && col_names[i]) {
+ col_name = col_names[i];
+ } else {
+ col_name = ifield->col_name ?
+ dict_table_get_col_name_for_mysql(table, ifield->col_name) :
+ dict_table_get_col_name(table, ifield->col_no);
+ }
dict_mem_index_add_field(
index,
@@ -3942,10 +4019,6 @@ row_merge_build_indexes(
total_dynamic_cost = COST_BUILD_INDEX_DYNAMIC * n_indexes;
for (i = 0; i < n_indexes; i++) {
- if (row_merge_file_create(&merge_files[i]) < 0) {
- error = DB_OUT_OF_MEMORY;
- goto func_exit;
- }
if (indexes[i]->type & DICT_FTS) {
ibool opt_doc_id_size = FALSE;
@@ -3974,13 +4047,6 @@ row_merge_build_indexes(
}
}
- tmpfd = row_merge_file_create_low();
-
- if (tmpfd < 0) {
- error = DB_OUT_OF_MEMORY;
- goto func_exit;
- }
-
/* Reset the MySQL row buffer that is used when reporting
duplicate keys. */
innobase_rec_reset(table);
@@ -4006,11 +4072,11 @@ row_merge_build_indexes(
secondary index entries for merge sort */
error = row_merge_read_clustered_index(
- trx, table, old_table, new_table, online, indexes,
- fts_sort_idx, psort_info, merge_files, key_numbers,
- n_indexes, add_cols, col_map,
- add_autoinc, sequence, block, pct_cost,
- crypt_data, crypt_block);
+ trx, table, old_table, new_table, online, indexes,
+ fts_sort_idx, psort_info, merge_files, key_numbers,
+ n_indexes, add_cols, col_map,
+ add_autoinc, sequence, block, &tmpfd,
+ pct_cost, crypt_data, crypt_block);
pct_progress += pct_cost;
@@ -4103,71 +4169,67 @@ wait_again:
#ifdef FTS_INTERNAL_DIAG_PRINT
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif
- } else {
- /* Sorting and inserting is required only if
- there really is records */
- if (UNIV_LIKELY(merge_files[i].n_rec)) {
- char buf[3 * NAME_LEN];
- char *bufend;
- row_merge_dup_t dup = {
- sort_idx, table, col_map, 0};
+ } else if (merge_files[i].fd != -1) {
+ char buf[3 * NAME_LEN];
+ char *bufend;
+ row_merge_dup_t dup = {
+ sort_idx, table, col_map, 0};
- pct_cost = (COST_BUILD_INDEX_STATIC +
- (total_dynamic_cost * merge_files[i].offset /
- total_index_blocks)) /
- (total_static_cost + total_dynamic_cost)
- * PCT_COST_MERGESORT_INDEX * 100;
+ pct_cost = (COST_BUILD_INDEX_STATIC +
+ (total_dynamic_cost * merge_files[i].offset /
+ total_index_blocks)) /
+ (total_static_cost + total_dynamic_cost)
+ * PCT_COST_MERGESORT_INDEX * 100;
+
+ bufend = innobase_convert_name(buf, sizeof buf,
+ indexes[i]->name, strlen(indexes[i]->name),
+ trx ? trx->mysql_thd : NULL,
+ FALSE);
- bufend = innobase_convert_name(buf, sizeof buf,
- indexes[i]->name, strlen(indexes[i]->name),
- trx ? trx->mysql_thd : NULL,
- FALSE);
+ buf[bufend - buf]='\0';
- buf[bufend - buf]='\0';
+ sql_print_information("InnoDB: Online DDL : Start merge-sorting"
+ " index %s (%lu / %lu), estimated cost : %2.4f",
+ buf, (i+1), n_indexes, pct_cost);
- sql_print_information("InnoDB: Online DDL : Start merge-sorting"
- " index %s (%lu / %lu), estimated cost : %2.4f",
- buf, (i+1), n_indexes, pct_cost);
+ error = row_merge_sort(
+ trx, &dup, &merge_files[i],
+ block, &tmpfd, true,
+ pct_progress, pct_cost,
+ crypt_data, crypt_block, new_table->space);
- error = row_merge_sort(
- trx, &dup, &merge_files[i],
- block, &tmpfd, true,
- pct_progress, pct_cost,
- crypt_data, crypt_block, new_table->space);
+ pct_progress += pct_cost;
+ sql_print_information("InnoDB: Online DDL : End of "
+ " merge-sorting index %s (%lu / %lu)",
+ buf, (i+1), n_indexes);
+
+ DBUG_EXECUTE_IF(
+ "ib_merge_wait_after_sort",
+ os_thread_sleep(20000000);); /* 20 sec */
+
+ if (error == DB_SUCCESS) {
+ pct_cost = (COST_BUILD_INDEX_STATIC +
+ (total_dynamic_cost * merge_files[i].offset /
+ total_index_blocks)) /
+ (total_static_cost + total_dynamic_cost) *
+ PCT_COST_INSERT_INDEX * 100;
+
+ sql_print_information("InnoDB: Online DDL : Start "
+ "building index %s (%lu / %lu), estimated "
+ "cost : %2.4f", buf, (i+1),
+ n_indexes, pct_cost);
+
+ error = row_merge_insert_index_tuples(
+ trx->id, sort_idx, old_table,
+ merge_files[i].fd, block,
+ merge_files[i].n_rec, pct_progress, pct_cost,
+ crypt_data, crypt_block, new_table->space);
pct_progress += pct_cost;
- sql_print_information("InnoDB: Online DDL : End of "
- " merge-sorting index %s (%lu / %lu)",
+ sql_print_information("InnoDB: Online DDL : "
+ "End of building index %s (%lu / %lu)",
buf, (i+1), n_indexes);
-
- DBUG_EXECUTE_IF(
- "ib_merge_wait_after_sort",
- os_thread_sleep(20000000);); /* 20 sec */
-
- if (error == DB_SUCCESS) {
- pct_cost = (COST_BUILD_INDEX_STATIC +
- (total_dynamic_cost * merge_files[i].offset /
- total_index_blocks)) /
- (total_static_cost + total_dynamic_cost) *
- PCT_COST_INSERT_INDEX * 100;
-
- sql_print_information("InnoDB: Online DDL : Start "
- "building index %s (%lu / %lu), estimated "
- "cost : %2.4f", buf, (i+1),
- n_indexes, pct_cost);
-
- error = row_merge_insert_index_tuples(
- trx->id, sort_idx, old_table,
- merge_files[i].fd, block,
- merge_files[i].n_rec, pct_progress, pct_cost,
- crypt_data, crypt_block, new_table->space);
- pct_progress += pct_cost;
-
- sql_print_information("InnoDB: Online DDL : "
- "End of building index %s (%lu / %lu)",
- buf, (i+1), n_indexes);
- }
}
}
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index cf07362cdbf..24d25a0b2c8 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -4879,6 +4879,7 @@ row_rename_table_for_mysql(
pars_info_t* info = NULL;
int retry;
bool aux_fts_rename = false;
+ char* is_part = NULL;
ut_a(old_name != NULL);
ut_a(new_name != NULL);
@@ -4916,6 +4917,55 @@ row_rename_table_for_mysql(
table = dict_table_open_on_name(old_name, dict_locked, FALSE,
DICT_ERR_IGNORE_NONE);
+ /* We look for pattern #P# to see if the table is partitioned
+ MySQL table. */
+#ifdef __WIN__
+ is_part = strstr((char *)old_name, (char *)"#p#");
+#else
+ is_part = strstr((char *)old_name, (char *)"#P#");
+#endif /* __WIN__ */
+
+ /* MySQL partition engine hard codes the file name
+ separator as "#P#". The text case is fixed even if
+ lower_case_table_names is set to 1 or 2. This is true
+ for sub-partition names as well. InnoDB always
+ normalises file names to lower case on Windows, this
+ can potentially cause problems when copying/moving
+ tables between platforms.
+
+ 1) If boot against an installation from Windows
+ platform, then its partition table name could
+ be all be in lower case in system tables. So we
+ will need to check lower case name when load table.
+
+ 2) If we boot an installation from other case
+ sensitive platform in Windows, we might need to
+ check the existence of table name without lowering
+ case them in the system table. */
+ if (!table &&
+ is_part &&
+ innobase_get_lower_case_table_names() == 1) {
+ char par_case_name[MAX_FULL_NAME_LEN + 1];
+#ifndef __WIN__
+ /* Check for the table using lower
+ case name, including the partition
+ separator "P" */
+ memcpy(par_case_name, old_name,
+ strlen(old_name));
+ par_case_name[strlen(old_name)] = 0;
+ innobase_casedn_str(par_case_name);
+#else
+ /* On Windows platfrom, check
+ whether there exists table name in
+ system table whose name is
+ not being normalized to lower case */
+ normalize_table_name_low(
+ par_case_name, old_name, FALSE);
+#endif
+ table = dict_table_open_on_name(par_case_name, dict_locked, FALSE,
+ DICT_ERR_IGNORE_NONE);
+ }
+
if (!table) {
err = DB_TABLE_NOT_FOUND;
ut_print_timestamp(stderr);
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index 0054070eed5..1d6a4c008e8 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -2,7 +2,7 @@
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation
+Copyright (c) 2013, 2016, MariaDB Corporation
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
@@ -715,24 +715,6 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_PENDING_WRITES},
- {"os_merge_blocks_written", "os",
- "Number of merge blocks written (innodb_os_merge_blocks_written)",
- static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DEFAULT_ON),
- MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_WRITTEN},
-
- {"os_merge_blocks_read", "os",
- "Number of merge blocks read (innodb_os_merge_blocks_read)",
- static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DEFAULT_ON),
- MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_READ},
-
- {"os_merge_blocks_merged", "os",
- "Number of merge blocks merged (innodb_os_merge_blocks_merged)",
- static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DEFAULT_ON),
- MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_MERGED},
-
/* ========== Counters for Transaction Module ========== */
{"module_trx", "transaction", "Transaction Manager",
MONITOR_MODULE,
@@ -1790,21 +1772,6 @@ srv_mon_process_existing_counter(
update_min = TRUE;
break;
- /* innodb_os_merge_blocks_written */
- case MONITOR_MERGE_BLOCKS_WRITTEN:
- value = srv_stats.merge_buffers_written;
- break;
-
- /* innodb_os_merge_blocks_read */
- case MONITOR_MERGE_BLOCKS_READ:
- value = srv_stats.merge_buffers_read;
- break;
-
- /* innodb_os_merge_blocks_merged */
- case MONITOR_MERGE_BLOCKS_MERGED:
- value = srv_stats.merge_buffers_merged;
- break;
-
/* innodb_log_waits */
case MONITOR_OVLD_LOG_WAITS:
value = srv_stats.log_waits;
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index d8e8a615c07..c28f889dfcc 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1,9 +1,9 @@
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1647,10 +1647,6 @@ srv_export_innodb_status(void)
}
#endif /* UNIV_DEBUG */
- export_vars.innodb_merge_buffers_written = srv_stats.merge_buffers_written;
- export_vars.innodb_merge_buffers_read = srv_stats.merge_buffers_read;
- export_vars.innodb_merge_buffers_merged = srv_stats.merge_buffers_merged;
-
export_vars.innodb_sec_rec_cluster_reads =
srv_stats.n_sec_rec_cluster_reads;
export_vars.innodb_sec_rec_cluster_reads_avoided =
@@ -1860,6 +1856,8 @@ exit_func:
/*********************************************************************//**
A thread which prints warnings about semaphore waits which have lasted
too long. These can be used to track bugs which cause hangs.
+Note: In order to make sync_arr_wake_threads_if_sema_free work as expected,
+we should avoid waiting any mutexes in this function!
@return a dummy parameter */
extern "C" UNIV_INTERN
os_thread_ret_t
@@ -1899,23 +1897,21 @@ loop:
/* Try to track a strange bug reported by Harald Fuchs and others,
where the lsn seems to decrease at times */
- /* We have to use nowait to ensure we don't block */
- new_lsn= log_get_lsn_nowait();
-
- if (new_lsn && new_lsn < old_lsn) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Error: old log sequence number " LSN_PF
- " was greater\n"
- "InnoDB: than the new log sequence number " LSN_PF "!\n"
- "InnoDB: Please submit a bug report"
- " to http://bugs.mysql.com\n",
- old_lsn, new_lsn);
- ut_ad(0);
- }
+ if (log_peek_lsn(&new_lsn)) {
+ if (new_lsn < old_lsn) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: old log sequence number " LSN_PF
+ " was greater\n"
+ "InnoDB: than the new log sequence number " LSN_PF "!\n"
+ "InnoDB: Please submit a bug report"
+ " to http://bugs.mysql.com\n",
+ old_lsn, new_lsn);
+ ut_ad(0);
+ }
- if (new_lsn)
old_lsn = new_lsn;
+ }
if (difftime(time(NULL), srv_last_monitor_time) > 60) {
/* We referesh InnoDB Monitor values so that averages are
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index d7b37b5bc1e..4a457ae6f00 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1915,7 +1915,7 @@ innobase_start_or_create_for_mysql(void)
}
} else {
srv_monitor_file_name = NULL;
- srv_monitor_file = os_file_create_tmpfile();
+ srv_monitor_file = os_file_create_tmpfile(NULL);
if (!srv_monitor_file) {
return(DB_ERROR);
@@ -1925,7 +1925,7 @@ innobase_start_or_create_for_mysql(void)
mutex_create(srv_dict_tmpfile_mutex_key,
&srv_dict_tmpfile_mutex, SYNC_DICT_OPERATION);
- srv_dict_tmpfile = os_file_create_tmpfile();
+ srv_dict_tmpfile = os_file_create_tmpfile(NULL);
if (!srv_dict_tmpfile) {
return(DB_ERROR);
@@ -1934,7 +1934,7 @@ innobase_start_or_create_for_mysql(void)
mutex_create(srv_misc_tmpfile_mutex_key,
&srv_misc_tmpfile_mutex, SYNC_ANY_LATCH);
- srv_misc_tmpfile = os_file_create_tmpfile();
+ srv_misc_tmpfile = os_file_create_tmpfile(NULL);
if (!srv_misc_tmpfile) {
return(DB_ERROR);
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index 967d4a151be..ef6e8506ac6 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -90,6 +90,27 @@ static inline int
my_var_write(MARIA_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs);
/*
+ Sets the appropriate read and write methods for the MARIA_SORT_PARAM
+ based on the variable length key flag.
+*/
+static void set_sort_param_read_write(MARIA_SORT_PARAM *sort_param)
+{
+ if (sort_param->keyinfo->flag & HA_VAR_LENGTH_KEY)
+ {
+ sort_param->write_keys= write_keys_varlen;
+ sort_param->read_to_buffer= read_to_buffer_varlen;
+ sort_param->write_key= write_merge_key_varlen;
+ }
+ else
+ {
+ sort_param->write_keys= write_keys;
+ sort_param->read_to_buffer= read_to_buffer;
+ sort_param->write_key= write_merge_key;
+ }
+}
+
+
+/*
Creates a index of sorted keys
SYNOPSIS
@@ -118,18 +139,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
(ulong) sortbuff_size, info->key_length,
(ulong) info->sort_info->max_records));
- if (info->keyinfo->flag & HA_VAR_LENGTH_KEY)
- {
- info->write_keys= write_keys_varlen;
- info->read_to_buffer= read_to_buffer_varlen;
- info->write_key=write_merge_key_varlen;
- }
- else
- {
- info->write_keys= write_keys;
- info->read_to_buffer=read_to_buffer;
- info->write_key=write_merge_key;
- }
+ set_sort_param_read_write(info);
my_b_clear(&tempfile);
my_b_clear(&tempfile_for_exceptions);
@@ -378,18 +388,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
if (sort_param->sort_info->got_error)
goto err;
- if (sort_param->keyinfo->flag & HA_VAR_LENGTH_KEY)
- {
- sort_param->write_keys= write_keys_varlen;
- sort_param->read_to_buffer= read_to_buffer_varlen;
- sort_param->write_key= write_merge_key_varlen;
- }
- else
- {
- sort_param->write_keys= write_keys;
- sort_param->read_to_buffer= read_to_buffer;
- sort_param->write_key= write_merge_key;
- }
+ set_sort_param_read_write(sort_param);
my_b_clear(&sort_param->tempfile);
my_b_clear(&sort_param->tempfile_for_exceptions);
@@ -614,18 +613,9 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
{
if (got_error)
continue;
- if (sinfo->keyinfo->flag & HA_VAR_LENGTH_KEY)
- {
- sinfo->write_keys=write_keys_varlen;
- sinfo->read_to_buffer=read_to_buffer_varlen;
- sinfo->write_key=write_merge_key_varlen;
- }
- else
- {
- sinfo->write_keys=write_keys;
- sinfo->read_to_buffer=read_to_buffer;
- sinfo->write_key=write_merge_key;
- }
+
+ set_sort_param_read_write(sinfo);
+
if (sinfo->buffpek.elements)
{
uint maxbuffer=sinfo->buffpek.elements-1;
diff --git a/storage/mroonga/vendor/groonga/lib/com.c b/storage/mroonga/vendor/groonga/lib/com.c
index a7450ec31f0..a16a446022c 100644
--- a/storage/mroonga/vendor/groonga/lib/com.c
+++ b/storage/mroonga/vendor/groonga/lib/com.c
@@ -348,7 +348,7 @@ grn_com_event_add(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
struct epoll_event e;
memset(&e, 0, sizeof(struct epoll_event));
e.data.fd = (fd);
- e.events = (__uint32_t) events;
+ e.events = (uint32_t) events;
if (epoll_ctl(ev->epfd, EPOLL_CTL_ADD, (fd), &e) == -1) {
SERR("epoll_ctl");
return ctx->rc;
@@ -396,7 +396,7 @@ grn_com_event_mod(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
struct epoll_event e;
memset(&e, 0, sizeof(struct epoll_event));
e.data.fd = (fd);
- e.events = (__uint32_t) events;
+ e.events = (uint32_t) events;
if (epoll_ctl(ev->epfd, EPOLL_CTL_MOD, (fd), &e) == -1) {
SERR("epoll_ctl");
return ctx->rc;
diff --git a/storage/mroonga/vendor/groonga/lib/grn_com.h b/storage/mroonga/vendor/groonga/lib/grn_com.h
index 203ed56c88d..e5ad58981cf 100644
--- a/storage/mroonga/vendor/groonga/lib/grn_com.h
+++ b/storage/mroonga/vendor/groonga/lib/grn_com.h
@@ -83,7 +83,11 @@ GRN_API grn_com_queue_entry *grn_com_queue_deque(grn_ctx *ctx, grn_com_queue *q)
# define GRN_COM_POLLIN EVFILT_READ
# define GRN_COM_POLLOUT EVFILT_WRITE
# else /* USE_KQUEUE */
-# include <sys/poll.h>
+# if defined(HAVE_POLL_H)
+# include <poll.h>
+# elif defined(HAVE_SYS_POLL_H)
+# include <sys/poll.h>
+# endif /* defined(HAVE_POLL_H) */
# define GRN_COM_POLLIN POLLIN
# define GRN_COM_POLLOUT POLLOUT
# endif /* USE_KQUEUE */
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 604910e5099..f490e5f0b44 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -86,6 +86,28 @@ static int write_merge_key_varlen(MI_SORT_PARAM *info,
static inline int
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, uchar *bufs);
+
+/*
+ Sets the appropriate read and write methods for the MI_SORT_PARAM
+ based on the variable length key flag.
+*/
+static void set_sort_param_read_write(MI_SORT_PARAM *sort_param)
+{
+ if (sort_param->keyinfo->flag & HA_VAR_LENGTH_KEY)
+ {
+ sort_param->write_keys= write_keys_varlen;
+ sort_param->read_to_buffer= read_to_buffer_varlen;
+ sort_param->write_key= write_merge_key_varlen;
+ }
+ else
+ {
+ sort_param->write_keys= write_keys;
+ sort_param->read_to_buffer= read_to_buffer;
+ sort_param->write_key= write_merge_key;
+ }
+}
+
+
/*
Creates a index of sorted keys
@@ -113,18 +135,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
DBUG_ENTER("_create_index_by_sort");
DBUG_PRINT("enter",("sort_length: %u", info->key_length));
- if (info->keyinfo->flag & HA_VAR_LENGTH_KEY)
- {
- info->write_keys=write_keys_varlen;
- info->read_to_buffer=read_to_buffer_varlen;
- info->write_key= write_merge_key_varlen;
- }
- else
- {
- info->write_keys=write_keys;
- info->read_to_buffer=read_to_buffer;
- info->write_key=write_merge_key;
- }
+ set_sort_param_read_write(info);
my_b_clear(&tempfile);
my_b_clear(&tempfile_for_exceptions);
@@ -333,7 +344,6 @@ static ha_rows find_all_keys(MI_SORT_PARAM *info, ha_rows keys,
DBUG_RETURN((*maxbuffer)*(keys-1)+idx);
} /* find_all_keys */
-
/* Search after all keys and place them in a temp. file */
pthread_handler_t thr_find_all_keys(void *arg)
@@ -357,18 +367,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
if (sort_param->sort_info->got_error)
goto err;
- if (sort_param->keyinfo->flag & HA_VAR_LENGTH_KEY)
- {
- sort_param->write_keys= write_keys_varlen;
- sort_param->read_to_buffer= read_to_buffer_varlen;
- sort_param->write_key= write_merge_key_varlen;
- }
- else
- {
- sort_param->write_keys= write_keys;
- sort_param->read_to_buffer= read_to_buffer;
- sort_param->write_key= write_merge_key;
- }
+ set_sort_param_read_write(sort_param);
my_b_clear(&sort_param->tempfile);
my_b_clear(&sort_param->tempfile_for_exceptions);
@@ -593,18 +592,9 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
{
if (got_error)
continue;
- if (sinfo->keyinfo->flag & HA_VAR_LENGTH_KEY)
- {
- sinfo->write_keys=write_keys_varlen;
- sinfo->read_to_buffer=read_to_buffer_varlen;
- sinfo->write_key=write_merge_key_varlen;
- }
- else
- {
- sinfo->write_keys=write_keys;
- sinfo->read_to_buffer=read_to_buffer;
- sinfo->write_key=write_merge_key;
- }
+
+ set_sort_param_read_write(sinfo);
+
if (sinfo->buffpek.elements)
{
uint maxbuffer=sinfo->buffpek.elements-1;
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index e220d64d962..6f142a213b7 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -1,5 +1,6 @@
/* Copyright (C) 2007-2015 Arjen G Lentz & Antony T Curtis for Open Query
Copyright (C) 2013-2015 Andrew McDonnell
+ Copyright (C) 2014 Sergei Golubchik
Portions of this file copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
diff --git a/storage/oqgraph/mysql-test/oqgraph/general.inc b/storage/oqgraph/mysql-test/oqgraph/general.inc
index 357a8c786ee..f27b7585dd7 100644
--- a/storage/oqgraph/mysql-test/oqgraph/general.inc
+++ b/storage/oqgraph/mysql-test/oqgraph/general.inc
@@ -14,7 +14,7 @@ eval CREATE TABLE graph_base (
INDEX (to_id)
) ENGINE= $oqgraph_use_table_type ;
-
+# Since late June 2014 OQGraph supports 'assisted discovery' as per https://mariadb.atlassian.net/browse/MDEV-5871
CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
# Regression for MDEV-5891
diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.result b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.result
new file mode 100644
index 00000000000..d2dfc46d5ff
--- /dev/null
+++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.result
@@ -0,0 +1,86 @@
+DROP TABLE IF EXISTS graph_base;
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph_base (
+from_id INT UNSIGNED NOT NULL,
+to_id INT UNSIGNED NOT NULL,
+weight DOUBLE NOT NULL,
+PRIMARY KEY (from_id,to_id),
+INDEX (to_id)
+) ENGINE=MyISAM;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id';
+DESCRIBE graph;
+Field Type Null Key Default Extra
+latch varchar(32) YES MUL NULL
+origid bigint(20) unsigned YES NULL
+destid bigint(20) unsigned YES NULL
+weight double YES NULL
+seq bigint(20) unsigned YES NULL
+linkid bigint(20) unsigned YES NULL
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id' WEIGHT='weight';
+DESCRIBE graph;
+Field Type Null Key Default Extra
+latch varchar(32) YES MUL NULL
+origid bigint(20) unsigned YES NULL
+destid bigint(20) unsigned YES NULL
+weight double YES NULL
+seq bigint(20) unsigned YES NULL
+linkid bigint(20) unsigned YES NULL
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base_xxx' ORIGID='from_id' DESTID='to_id_xxx' WEIGHT='weight';
+# Expect 'Table 'test.graph_base_xxx' doesn't exist'
+DESCRIBE graph;
+ERROR 42S02: Table 'test.graph_base_xxx' doesn't exist
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id' WEIGHT='weight_xxx';
+# Expect 'Invalid OQGRAPH backing store description ('graph.weight' attribute not set to a valid column of 'graph_base')'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('graph.weight' attribute not set to a valid column of 'graph_base')' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id_xxx' WEIGHT='weight';
+# Expect 'Invalid OQGRAPH backing store description ('graph.destid' attribute not set to a valid column of 'graph_base')'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('graph.destid' attribute not set to a valid column of 'graph_base')' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id_xxx' DESTID='to_id' WEIGHT='weight';
+# Expect 'Invalid OQGRAPH backing store description ('graph.origid' attribute not set to a valid column of 'graph_base')'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store ('graph.origid' attribute not set to a valid column of 'graph_base')' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH;
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base';
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty origid attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty origid attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id';
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty destid attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty destid attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' DESTID='to_id';
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty origid attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty origid attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH ORIGID='from_id';
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH DESTID='to_id';
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+CREATE TABLE graph ENGINE=OQGRAPH ORIGID='from_id', DESTID='to_id';
+# Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+DESCRIBE graph;
+ERROR HY000: Got error -1 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)' from OQGRAPH
+DROP TABLE IF EXISTS graph;
+DROP TABLE IF EXISTS graph;
+DROP TABLE IF EXISTS graph_base;
diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.test b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.test
new file mode 100644
index 00000000000..15d1eff0142
--- /dev/null
+++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5871.test
@@ -0,0 +1,121 @@
+--disable_warnings
+DROP TABLE IF EXISTS graph_base;
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph_base (
+ from_id INT UNSIGNED NOT NULL,
+ to_id INT UNSIGNED NOT NULL,
+ weight DOUBLE NOT NULL,
+ PRIMARY KEY (from_id,to_id),
+ INDEX (to_id)
+ ) ENGINE=MyISAM;
+
+# Since late June 2014 OQGraph supports 'assisted discovery' as per https://mariadb.atlassian.net/browse/MDEV-5871
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id';
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id' WEIGHT='weight';
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base_xxx' ORIGID='from_id' DESTID='to_id_xxx' WEIGHT='weight';
+--echo # Expect 'Table 'test.graph_base_xxx' doesn't exist'
+--error 1146
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id' WEIGHT='weight_xxx';
+--echo # Expect 'Invalid OQGRAPH backing store description ('graph.weight' attribute not set to a valid column of 'graph_base')'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id' DESTID='to_id_xxx' WEIGHT='weight';
+--echo # Expect 'Invalid OQGRAPH backing store description ('graph.destid' attribute not set to a valid column of 'graph_base')'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id_xxx' DESTID='to_id' WEIGHT='weight';
+--echo # Expect 'Invalid OQGRAPH backing store description ('graph.origid' attribute not set to a valid column of 'graph_base')'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+# The following combinations should be invalid
+CREATE TABLE graph ENGINE=OQGRAPH;
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base';
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty origid attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id';
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty destid attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DATA_TABLE='graph_base' DESTID='to_id';
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty origid attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH ORIGID='from_id';
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH DESTID='to_id';
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+CREATE TABLE graph ENGINE=OQGRAPH ORIGID='from_id', DESTID='to_id';
+--echo # Expect: 'Invalid OQGRAPH backing store description (unspecified or empty data_table attribute)'
+--error 1296
+DESCRIBE graph;
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+--enable_warnings
+
+--disable_warnings
+DROP TABLE IF EXISTS graph;
+DROP TABLE IF EXISTS graph_base;
+--enable_warnings
+
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index dcdd9b90c56..2a87ffba999 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -225,7 +225,7 @@ maria_declare_plugin(perfschema)
0x0001,
pfs_status_vars,
NULL,
- "5.6.27",
+ "5.6.29",
MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index bbe99ffa794..17c608a7f4c 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2015, 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 +220,8 @@ void table_session_connect::make_row(PFS_thread *pfs, uint ordinal)
&m_row.m_attr_value_length))
{
/* we don't expect internal threads to have connection attributes */
- DBUG_ASSERT(pfs->m_processlist_id != 0);
+ if (pfs->m_processlist_id == 0)
+ return;
m_row.m_ordinal_position= ordinal;
m_row.m_process_id= pfs->m_processlist_id;
diff --git a/storage/sequence/mysql-test/sequence/group_by.result b/storage/sequence/mysql-test/sequence/group_by.result
index 86bb158d9fc..b3b56338aef 100644
--- a/storage/sequence/mysql-test/sequence/group_by.result
+++ b/storage/sequence/mysql-test/sequence/group_by.result
@@ -85,4 +85,10 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select count(*) from seq_1_to_15_step_2 group by mod(seq,2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE seq_1_to_15_step_2 index NULL PRIMARY 8 NULL 8 Using index; Using temporary; Using filesort
-drop table seq_1_to_15_step_2;
+create temporary table t1 select * from seq_1_to_3;
+select count(NULL) from t1;
+count(NULL)
+0
+select count(NULL) from seq_1_to_3;
+count(NULL)
+0
diff --git a/storage/sequence/mysql-test/sequence/group_by.test b/storage/sequence/mysql-test/sequence/group_by.test
index 870afd9ed89..b2e04037a8b 100644
--- a/storage/sequence/mysql-test/sequence/group_by.test
+++ b/storage/sequence/mysql-test/sequence/group_by.test
@@ -39,4 +39,9 @@ explain select count(*) from seq_1_to_15_step_2, seq_1_to_15_step_2 as t2;
explain select count(*) from seq_1_to_15_step_2 where seq > 0;
explain select count(*) from seq_1_to_15_step_2 group by mod(seq,2);
-drop table seq_1_to_15_step_2;
+#
+# MDEV-9550 COUNT(NULL) returns incorrect result with sequence storage engine
+#
+create temporary table t1 select * from seq_1_to_3;
+select count(NULL) from t1;
+select count(NULL) from seq_1_to_3;
diff --git a/storage/sequence/sequence.cc b/storage/sequence/sequence.cc
index 7b20615b15f..8d9465f08c5 100644
--- a/storage/sequence/sequence.cc
+++ b/storage/sequence/sequence.cc
@@ -452,7 +452,11 @@ int ha_seq_group_by_handler::next_row()
switch (item_sum->sum_func()) {
case Item_sum::COUNT_FUNC:
{
- field->store((longlong) elements, 1);
+ Item *arg0= ((Item_sum*) item_sum)->get_arg(0);
+ if (arg0->basic_const_item() && arg0->is_null())
+ field->store(0LL, 1);
+ else
+ field->store((longlong) elements, 1);
break;
}
case Item_sum::SUM_FUNC:
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 568d3695781..541ccf62260 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -634,8 +634,10 @@ protected:
void SendFloat ( float v ) { SendDword ( sphF2DW(v) ); }
};
+#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
template int CSphSEQuery::ParseArray<uint32> ( uint32 **, const char * );
template int CSphSEQuery::ParseArray<longlong> ( longlong **, const char * );
+#endif
//////////////////////////////////////////////////////////////////////////////
@@ -1411,6 +1413,14 @@ static bool myismagic ( char c )
return c=='@';
}
+static bool myisjson ( char c )
+{
+ return
+ c=='.' ||
+ c=='[' ||
+ c==']';
+}
+
bool CSphSEQuery::ParseField ( char * sField )
{
@@ -1622,7 +1632,7 @@ bool CSphSEQuery::ParseField ( char * sField )
break;
tFilter.m_sAttrName = sValue;
- while ( (*sValue) && ( myisattr(*sValue) || myismagic(*sValue) ) )
+ while ( (*sValue) && ( myisattr(*sValue) || myismagic(*sValue) || myisjson(*sValue) ) )
sValue++;
if ( !*sValue )
break;
diff --git a/storage/sphinx/mysql-test/sphinx/sphinx.result b/storage/sphinx/mysql-test/sphinx/sphinx.result
index 5fe11f4671b..3536ba42af8 100644
--- a/storage/sphinx/mysql-test/sphinx/sphinx.result
+++ b/storage/sphinx/mysql-test/sphinx/sphinx.result
@@ -4,17 +4,20 @@ id w q
1 2 test
2 2 test
4 1 test
+5 1 test
drop table ts;
create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:SPHINXSEARCH_PORT/*";
select * from ts where q='test;filter=gid,1;mode=extended';
id w q
-1 2421 test;filter=gid,1;mode=extended
-2 2421 test;filter=gid,1;mode=extended
+1 2379 test;filter=gid,1;mode=extended
+2 2379 test;filter=gid,1;mode=extended
+5 1412 test;filter=gid,1;mode=extended
select * from ts where q='test|one;mode=extended';
id w q
-1 3595 test|one;mode=extended
-2 2460 test|one;mode=extended
-4 1471 test|one;mode=extended
+1 3579 test|one;mode=extended
+2 2439 test|one;mode=extended
+4 1456 test|one;mode=extended
+5 1456 test|one;mode=extended
select * from ts where q='test;offset=1;limit=1';
id w q
2 2 test;offset=1;limit=1
@@ -32,10 +35,11 @@ id w q gid _sph_count
2 1 1 0
3 1 2 0
4 1 2 0
+5 1 1 0
select * from ts where q=';groupby=attr:gid';
id w q gid _sph_count
3 1 ;groupby=attr:gid 2 2
-1 1 ;groupby=attr:gid 1 2
+1 1 ;groupby=attr:gid 1 3
explain select * from ts where q=';groupby=attr:gid';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE ts ref q q 257 const 3 Using where with pushed condition
@@ -54,3 +58,20 @@ show status like "sphinx_word%";
Variable_name Value
Sphinx_word_count 0
Sphinx_words
+create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:SPHINXSEARCH_PORT/*";
+select * from ts where q=';filter=meta.foo_count,100';
+id w q
+1 1 ;filter=meta.foo_count,100
+select * from ts where q='test;filter=meta.sub.int,7';
+id w q
+5 1 test;filter=meta.sub.int,7
+select * from ts where q=';filter=meta.sub.list[0],4';
+id w q
+select * from ts where q=';filter=meta.sub.list[1],4';
+id w q
+5 1 ;filter=meta.sub.list[1],4
+select * from ts where q='test;range=meta.foo_count,100,500';
+id w q
+1 2 test;range=meta.foo_count,100,500
+5 1 test;range=meta.foo_count,100,500
+drop table ts;
diff --git a/storage/sphinx/mysql-test/sphinx/sphinx.test b/storage/sphinx/mysql-test/sphinx/sphinx.test
index 126131209c5..fe388f7ddd2 100644
--- a/storage/sphinx/mysql-test/sphinx/sphinx.test
+++ b/storage/sphinx/mysql-test/sphinx/sphinx.test
@@ -32,3 +32,12 @@ drop table ts;
show status like "sphinx_total%";
show status like "sphinx_word%";
+
+--replace_result $SPHINXSEARCH_PORT SPHINXSEARCH_PORT
+eval create table ts ( id bigint unsigned not null, w int not null, q varchar(255) not null, index(q) ) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/*";
+select * from ts where q=';filter=meta.foo_count,100';
+select * from ts where q='test;filter=meta.sub.int,7';
+select * from ts where q=';filter=meta.sub.list[0],4';
+select * from ts where q=';filter=meta.sub.list[1],4';
+select * from ts where q='test;range=meta.foo_count,100,500';
+drop table ts;
diff --git a/storage/sphinx/mysql-test/sphinx/testdata.xml b/storage/sphinx/mysql-test/sphinx/testdata.xml
index e0d7394190f..7ef05bce808 100644
--- a/storage/sphinx/mysql-test/sphinx/testdata.xml
+++ b/storage/sphinx/mysql-test/sphinx/testdata.xml
@@ -5,12 +5,14 @@
<sphinx:field name="title"/>
<sphinx:field name="content"/>
<sphinx:attr name="gid" type="int"/>
+<sphinx:attr name="meta" type="json"/>
</sphinx:schema>
<sphinx:document id="1">
<title>test one</title>
<content>this is my test document number one. also checking search within phrases.</content>
<gid>1</gid>
+<meta>{ "foo_count": 100 }</meta>
</sphinx:document>
<sphinx:document id="2">
@@ -31,5 +33,12 @@
<gid>2</gid>
</sphinx:document>
+<sphinx:document id="5">
+<title>doc number five</title>
+<content>this is to test json filtering</content>
+<gid>1</gid>
+<meta>{ "foo_count": 200, "sub": { "list": [ 3, 4 ], "int": 7 } }</meta>
+</sphinx:document>
+
</sphinx:docset>
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index 2b605d14677..19a311731e5 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -1,18 +1,15 @@
SET(TOKUDB_VERSION 5.6.26-74.0)
# PerconaFT only supports x86-64 and cmake-2.8.9+
-IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND
- NOT CMAKE_VERSION VERSION_LESS "2.8.9")
+IF(CMAKE_VERSION VERSION_LESS "2.8.9")
+ MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
+ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
+ CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
CHECK_CXX_SOURCE_COMPILES(
"
struct a {int b; int c; };
struct a d = { .b=1, .c=2 };
int main() { return 0; }
" TOKUDB_OK)
-ELSE()
- IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND
- CMAKE_VERSION VERSION_LESS "2.8.9")
- MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
- ENDIF()
ENDIF()
IF(NOT TOKUDB_OK)
diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake
index 4c5004cd6a5..e3c900fbadb 100644
--- a/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake
+++ b/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake
@@ -93,7 +93,7 @@ if (NOT HAVE_BACKTRACE_WITHOUT_EXECINFO)
if (HAVE_BACKTRACE_WITH_EXECINFO)
list(APPEND EXTRA_SYSTEM_LIBS execinfo)
else ()
- message(FATAL_ERROR "Cannot find backtrace(), even with -lexecinfo.")
+ message(WARNING "Cannot find backtrace(), even with -lexecinfo.")
endif ()
endif ()
diff --git a/storage/xtradb/btr/btr0btr.cc b/storage/xtradb/btr/btr0btr.cc
index c8018e6582b..caa35d31109 100644
--- a/storage/xtradb/btr/btr0btr.cc
+++ b/storage/xtradb/btr/btr0btr.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2014, 2015, MariaDB Corporation
@@ -796,6 +796,10 @@ btr_root_get(
buf_block_t* root = btr_root_block_get(index, RW_X_LATCH,
mtr);
+ if (root && root->page.encrypted == true) {
+ root = NULL;
+ }
+
return(root ? buf_block_get_frame(root) : NULL);
}
@@ -2281,7 +2285,7 @@ the tuple. It is assumed that mtr contains an x-latch on the tree.
NOTE that the operation of this function must always succeed,
we cannot reverse it: therefore enough free disk space must be
guaranteed to be available before this function is called.
-@return inserted record */
+@return inserted record or NULL if run out of space */
UNIV_INTERN
rec_t*
btr_root_raise_and_insert(
@@ -2342,6 +2346,11 @@ btr_root_raise_and_insert(
level = btr_page_get_level(root, mtr);
new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, mtr, mtr);
+
+ if (new_block == NULL && os_has_said_disk_full) {
+ return(NULL);
+ }
+
new_page = buf_block_get_frame(new_block);
new_page_zip = buf_block_get_page_zip(new_block);
ut_a(!new_page_zip == !root_page_zip);
@@ -3126,7 +3135,7 @@ this function is called.
NOTE: jonaso added support for calling function with tuple == NULL
which cause it to only split a page.
-@return inserted record */
+@return inserted record or NULL if run out of space */
UNIV_INTERN
rec_t*
btr_page_split_and_insert(
@@ -3240,9 +3249,18 @@ func_start:
}
}
+ DBUG_EXECUTE_IF("disk_is_full",
+ os_has_said_disk_full = true;
+ return(NULL););
+
/* 2. Allocate a new page to the index */
new_block = btr_page_alloc(cursor->index, hint_page_no, direction,
btr_page_get_level(page, mtr), mtr, mtr);
+
+ if (new_block == NULL && os_has_said_disk_full) {
+ return(NULL);
+ }
+
new_page = buf_block_get_frame(new_block);
new_page_zip = buf_block_get_page_zip(new_block);
btr_page_create(new_block, new_page_zip, cursor->index,
diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc
index c949bcae476..5bb94dfce2a 100644
--- a/storage/xtradb/btr/btr0cur.cc
+++ b/storage/xtradb/btr/btr0cur.cc
@@ -1785,6 +1785,10 @@ btr_cur_pessimistic_insert(
flags, cursor, offsets, heap, entry, n_ext, mtr);
}
+ if (*rec == NULL && os_has_said_disk_full) {
+ return(DB_OUT_OF_FILE_SPACE);
+ }
+
ut_ad(page_rec_get_next(btr_cur_get_rec(cursor)) == *rec);
if (!(flags & BTR_NO_LOCKING_FLAG)) {
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 72d078b3139..556096ca7e4 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -4790,10 +4790,10 @@ corrupt:
ib_push_warning(innobase_get_trx(), DB_DECRYPTION_FAILED,
"Table in tablespace %lu encrypted."
- "However key management plugin or used key_id %lu is not found or"
+ "However key management plugin or used key_id %u is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.",
- bpage->key_version);
+ (ulint)bpage->space, bpage->key_version);
if (bpage->space > TRX_SYS_SPACE) {
if (corrupted) {
@@ -4827,17 +4827,26 @@ corrupt:
block = NULL;
update_ibuf_bitmap = FALSE;
-
} else {
block = (buf_block_t *) bpage;
update_ibuf_bitmap = TRUE;
}
- ibuf_merge_or_delete_for_page(
- block, bpage->space,
- bpage->offset, buf_page_get_zip_size(bpage),
- update_ibuf_bitmap);
+ if (bpage && bpage->encrypted) {
+ fprintf(stderr,
+ "InnoDB: Warning: Table in tablespace %lu encrypted."
+ "However key management plugin or used key_id %u is not found or"
+ " used encryption algorithm or method does not match."
+ " Can't continue opening the table.\n",
+ (ulint)bpage->space, bpage->key_version);
+ } else {
+ ibuf_merge_or_delete_for_page(
+ block, bpage->space,
+ bpage->offset, buf_page_get_zip_size(bpage),
+ update_ibuf_bitmap);
+ }
+
}
} else {
/* io_type == BUF_IO_WRITE */
@@ -6333,6 +6342,7 @@ buf_page_decrypt_after_read(
bool page_compressed = fil_page_is_compressed(dst_frame);
bool page_compressed_encrypted = fil_page_is_compressed_encrypted(dst_frame);
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+ bool success = true;
/* If page is encrypted read post-encryption checksum */
if (!page_compressed_encrypted && key_version != 0) {
@@ -6391,16 +6401,21 @@ buf_page_decrypt_after_read(
}
/* decrypt using crypt_buf to dst_frame */
- fil_space_decrypt(bpage->space,
- slot->crypt_buf,
- size,
- dst_frame);
+ byte* res = fil_space_decrypt(bpage->space,
+ slot->crypt_buf,
+ size,
+ dst_frame);
+
+ if (!res) {
+ bpage->encrypted = true;
+ success = false;
+ }
#ifdef UNIV_DEBUG
fil_page_type_validate(dst_frame);
#endif
}
- if (page_compressed_encrypted) {
+ if (page_compressed_encrypted && success) {
if (!slot) {
slot = buf_pool_reserve_tmp_slot(buf_pool, page_compressed);
}
@@ -6413,11 +6428,11 @@ buf_page_decrypt_after_read(
dst_frame,
size,
&bpage->write_size);
- }
#ifdef UNIV_DEBUG
- fil_page_type_validate(dst_frame);
+ fil_page_type_validate(dst_frame);
#endif
+ }
/* Mark this slot as free */
if (slot) {
@@ -6427,5 +6442,5 @@ buf_page_decrypt_after_read(
bpage->key_version = key_version;
- return (TRUE);
+ return (success);
}
diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc
index 037d94dd514..5d64b75784a 100644
--- a/storage/xtradb/buf/buf0flu.cc
+++ b/storage/xtradb/buf/buf0flu.cc
@@ -2251,7 +2251,7 @@ Clears up tail of the LRU lists:
* Flush dirty pages at the tail of LRU to the disk
The depth to which we scan each buffer pool is controlled by dynamic
config parameter innodb_LRU_scan_depth.
-@return total pages flushed */
+@return number of pages flushed */
UNIV_INTERN
ulint
buf_flush_LRU_tail(void)
@@ -2671,19 +2671,24 @@ static
void
page_cleaner_adapt_lru_sleep_time(
/*==============================*/
- ulint* lru_sleep_time) /*!< in/out: desired page cleaner thread sleep
+ ulint* lru_sleep_time, /*!< in/out: desired page cleaner thread sleep
time for LRU flushes */
+ ulint lru_n_flushed) /*!< in: number of flushed in previous batch */
+
{
ulint free_len = buf_get_total_free_list_length();
ulint max_free_len = srv_LRU_scan_depth * srv_buf_pool_instances;
- if (free_len < max_free_len / 100) {
+ if (free_len < max_free_len / 100 && lru_n_flushed) {
- /* Free lists filled less than 1%, no sleep */
+ /* Free lists filled less than 1%
+ and iteration was able to flush, no sleep */
*lru_sleep_time = 0;
- } else if (free_len > max_free_len / 5) {
+ } else if (free_len > max_free_len / 5
+ || (free_len < max_free_len / 100 && lru_n_flushed == 0)) {
- /* Free lists filled more than 20%, sleep a bit more */
+ /* Free lists filled more than 20%
+ or no pages flushed in previous batch, sleep a bit more */
*lru_sleep_time += 50;
if (*lru_sleep_time > srv_cleaner_max_lru_time)
*lru_sleep_time = srv_cleaner_max_lru_time;
@@ -2885,6 +2890,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
{
ulint next_loop_time = ut_time_ms() + 1000;
ulint lru_sleep_time = srv_cleaner_max_lru_time;
+ ulint lru_n_flushed = 1;
#ifdef UNIV_PFS_THREAD
pfs_register_thread(buf_lru_manager_thread_key);
@@ -2911,11 +2917,11 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
page_cleaner_sleep_if_needed(next_loop_time);
- page_cleaner_adapt_lru_sleep_time(&lru_sleep_time);
+ page_cleaner_adapt_lru_sleep_time(&lru_sleep_time, lru_n_flushed);
next_loop_time = ut_time_ms() + lru_sleep_time;
- buf_flush_LRU_tail();
+ lru_n_flushed = buf_flush_LRU_tail();
}
buf_lru_manager_is_active = false;
diff --git a/storage/xtradb/dict/dict0boot.cc b/storage/xtradb/dict/dict0boot.cc
index 94a3af2852b..0a21264e23d 100644
--- a/storage/xtradb/dict/dict0boot.cc
+++ b/storage/xtradb/dict/dict0boot.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
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
@@ -456,27 +457,29 @@ dict_boot(void)
/* Initialize the insert buffer table and index for each tablespace */
- ibuf_init_at_db_start();
-
dberr_t err = DB_SUCCESS;
- if (srv_read_only_mode && !ibuf_is_empty()) {
+ err = ibuf_init_at_db_start();
- ib_logf(IB_LOG_LEVEL_ERROR,
- "Change buffer must be empty when --innodb-read-only "
- "is set!");
+ if (err == DB_SUCCESS) {
+ if (srv_read_only_mode && !ibuf_is_empty()) {
- err = DB_ERROR;
- } else {
- /* Load definitions of other indexes on system tables */
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "Change buffer must be empty when --innodb-read-only "
+ "is set!");
- dict_load_sys_table(dict_sys->sys_tables);
- dict_load_sys_table(dict_sys->sys_columns);
- dict_load_sys_table(dict_sys->sys_indexes);
- dict_load_sys_table(dict_sys->sys_fields);
- }
+ err = DB_ERROR;
+ } else {
+ /* Load definitions of other indexes on system tables */
- mutex_exit(&(dict_sys->mutex));
+ dict_load_sys_table(dict_sys->sys_tables);
+ dict_load_sys_table(dict_sys->sys_columns);
+ dict_load_sys_table(dict_sys->sys_indexes);
+ dict_load_sys_table(dict_sys->sys_fields);
+ }
+
+ mutex_exit(&(dict_sys->mutex));
+ }
return(err);
}
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index f6621473077..206038d36c9 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -1659,10 +1659,13 @@ dict_table_rename_in_cache(
to preserve the original table name
in constraints which reference it */
{
+ dberr_t err;
dict_foreign_t* foreign;
dict_index_t* index;
ulint fold;
char old_name[MAX_FULL_NAME_LEN + 1];
+ os_file_type_t ftype;
+ ibool exists;
ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -1700,8 +1703,6 @@ dict_table_rename_in_cache(
.ibd file and rebuild the .isl file if needed. */
if (dict_table_is_discarded(table)) {
- os_file_type_t type;
- ibool exists;
char* filepath;
ut_ad(table->space != TRX_SYS_SPACE);
@@ -1720,7 +1721,7 @@ dict_table_rename_in_cache(
fil_delete_tablespace(table->space, BUF_REMOVE_ALL_NO_WRITE);
/* Delete any temp file hanging around. */
- if (os_file_status(filepath, &exists, &type)
+ if (os_file_status(filepath, &exists, &ftype)
&& exists
&& !os_file_delete_if_exists(innodb_file_temp_key,
filepath)) {
@@ -1732,8 +1733,6 @@ dict_table_rename_in_cache(
mem_free(filepath);
} else if (table->space != TRX_SYS_SPACE) {
- char* new_path = NULL;
-
if (DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY)) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: trying to rename a"
@@ -1747,34 +1746,43 @@ dict_table_rename_in_cache(
}
return(DB_ERROR);
+ }
- } else if (DICT_TF_HAS_DATA_DIR(table->flags)) {
- char* old_path;
-
- old_path = fil_space_get_first_path(table->space);
+ char* new_path = NULL;
+ char* old_path = fil_space_get_first_path(table->space);
+ if (DICT_TF_HAS_DATA_DIR(table->flags)) {
new_path = os_file_make_new_pathname(
old_path, new_name);
- mem_free(old_path);
-
- dberr_t err = fil_create_link_file(
- new_name, new_path);
-
+ err = fil_create_link_file(new_name, new_path);
if (err != DB_SUCCESS) {
mem_free(new_path);
+ mem_free(old_path);
return(DB_TABLESPACE_EXISTS);
}
+ } else {
+ new_path = fil_make_ibd_name(new_name, false);
+ }
+
+ /* New filepath must not exist. */
+ err = fil_rename_tablespace_check(
+ table->space, old_path, new_path, false);
+ if (err != DB_SUCCESS) {
+ mem_free(old_path);
+ mem_free(new_path);
+ return(err);
}
ibool success = fil_rename_tablespace(
old_name, table->space, new_name, new_path);
+ mem_free(old_path);
+ mem_free(new_path);
+
/* If the tablespace is remote, a new .isl file was created
If success, delete the old one. If not, delete the new one. */
- if (new_path) {
-
- mem_free(new_path);
+ if (DICT_TF_HAS_DATA_DIR(table->flags)) {
fil_delete_link_file(success ? old_name : new_name);
}
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 3d9d6a18122..03020896542 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -799,6 +799,7 @@ fil_space_decrypt(
byte* src_frame) /*!< in/out: page buffer */
{
dberr_t err = DB_SUCCESS;
+ byte* res = NULL;
bool encrypted = fil_space_decrypt(
fil_space_get_crypt_data(space),
@@ -807,13 +808,17 @@ fil_space_decrypt(
src_frame,
&err);
- if (encrypted) {
- /* Copy the decrypted page back to page buffer, not
- really any other options. */
- memcpy(src_frame, tmp_frame, page_size);
+ if (err == DB_SUCCESS) {
+ if (encrypted) {
+ /* Copy the decrypted page back to page buffer, not
+ really any other options. */
+ memcpy(src_frame, tmp_frame, page_size);
+ }
+
+ res = src_frame;
}
- return src_frame;
+ return res;
}
/******************************************************************
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 65827717230..5f0c52b5cc8 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -2994,6 +2994,48 @@ fil_make_isl_name(
return(filename);
}
+/** Test if a tablespace file can be renamed to a new filepath by checking
+if that the old filepath exists and the new filepath does not exist.
+@param[in] space_id tablespace id
+@param[in] old_path old filepath
+@param[in] new_path new filepath
+@param[in] is_discarded whether the tablespace is discarded
+@return innodb error code */
+dberr_t
+fil_rename_tablespace_check(
+ ulint space_id,
+ const char* old_path,
+ const char* new_path,
+ bool is_discarded)
+{
+ ulint exists = false;
+ os_file_type_t ftype;
+
+ if (!is_discarded
+ && os_file_status(old_path, &exists, &ftype)
+ && !exists) {
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "Cannot rename '%s' to '%s' for space ID %lu"
+ " because the source file does not exist.",
+ old_path, new_path, space_id);
+
+ return(DB_TABLESPACE_NOT_FOUND);
+ }
+
+ exists = false;
+ if (!os_file_status(new_path, &exists, &ftype) || exists) {
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "Cannot rename '%s' to '%s' for space ID %lu"
+ " because the target file exists."
+ " Remove the target file and try again.",
+ old_path, new_path, space_id);
+
+ return(DB_TABLESPACE_EXISTS);
+ }
+
+ return(DB_SUCCESS);
+}
+
/*******************************************************************//**
Renames a single-table tablespace. The tablespace must be cached in the
tablespace memory cache.
@@ -6918,31 +6960,110 @@ fil_get_space_names(
return(err);
}
-/****************************************************************//**
-Generate redo logs for swapping two .ibd files */
+/** Generate redo log for swapping two .ibd files
+@param[in] old_table old table
+@param[in] new_table new table
+@param[in] tmp_name temporary table name
+@param[in,out] mtr mini-transaction
+@return innodb error code */
UNIV_INTERN
-void
+dberr_t
fil_mtr_rename_log(
-/*===============*/
- ulint old_space_id, /*!< in: tablespace id of the old
- table. */
- const char* old_name, /*!< in: old table name */
- ulint new_space_id, /*!< in: tablespace id of the new
- table */
- const char* new_name, /*!< in: new table name */
- const char* tmp_name, /*!< in: temp table name used while
- swapping */
- mtr_t* mtr) /*!< in/out: mini-transaction */
+ const dict_table_t* old_table,
+ const dict_table_t* new_table,
+ const char* tmp_name,
+ mtr_t* mtr)
{
- if (old_space_id != TRX_SYS_SPACE) {
- fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
- 0, 0, old_name, tmp_name, mtr);
+ dberr_t err = DB_SUCCESS;
+ char* old_path;
+
+ /* If neither table is file-per-table,
+ there will be no renaming of files. */
+ if (old_table->space == TRX_SYS_SPACE
+ && new_table->space == TRX_SYS_SPACE) {
+ return(DB_SUCCESS);
+ }
+
+ if (DICT_TF_HAS_DATA_DIR(old_table->flags)) {
+ old_path = os_file_make_remote_pathname(
+ old_table->data_dir_path, old_table->name, "ibd");
+ } else {
+ old_path = fil_make_ibd_name(old_table->name, false);
+ }
+ if (old_path == NULL) {
+ return(DB_OUT_OF_MEMORY);
+ }
+
+ if (old_table->space != TRX_SYS_SPACE) {
+ char* tmp_path;
+
+ if (DICT_TF_HAS_DATA_DIR(old_table->flags)) {
+ tmp_path = os_file_make_remote_pathname(
+ old_table->data_dir_path, tmp_name, "ibd");
+ }
+ else {
+ tmp_path = fil_make_ibd_name(tmp_name, false);
+ }
+
+ if (tmp_path == NULL) {
+ mem_free(old_path);
+ return(DB_OUT_OF_MEMORY);
+ }
+
+ /* Temp filepath must not exist. */
+ err = fil_rename_tablespace_check(
+ old_table->space, old_path, tmp_path,
+ dict_table_is_discarded(old_table));
+ mem_free(tmp_path);
+ if (err != DB_SUCCESS) {
+ mem_free(old_path);
+ return(err);
+ }
+
+ fil_op_write_log(MLOG_FILE_RENAME, old_table->space,
+ 0, 0, old_table->name, tmp_name, mtr);
}
- if (new_space_id != TRX_SYS_SPACE) {
- fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
- 0, 0, new_name, old_name, mtr);
+ if (new_table->space != TRX_SYS_SPACE) {
+
+ /* Destination filepath must not exist unless this ALTER
+ TABLE starts and ends with a file_per-table tablespace. */
+ if (old_table->space == TRX_SYS_SPACE) {
+ char* new_path = NULL;
+
+ if (DICT_TF_HAS_DATA_DIR(new_table->flags)) {
+ new_path = os_file_make_remote_pathname(
+ new_table->data_dir_path,
+ new_table->name, "ibd");
+ }
+ else {
+ new_path = fil_make_ibd_name(
+ new_table->name, false);
+ }
+
+ if (new_path == NULL) {
+ mem_free(old_path);
+ return(DB_OUT_OF_MEMORY);
+ }
+
+ err = fil_rename_tablespace_check(
+ new_table->space, new_path, old_path,
+ dict_table_is_discarded(new_table));
+ mem_free(new_path);
+ if (err != DB_SUCCESS) {
+ mem_free(old_path);
+ return(err);
+ }
+ }
+
+ fil_op_write_log(MLOG_FILE_RENAME, new_table->space,
+ 0, 0, new_table->name, old_table->name, mtr);
+
}
+
+ mem_free(old_path);
+
+ return(err);
}
/*************************************************************************
diff --git a/storage/xtradb/fsp/fsp0fsp.cc b/storage/xtradb/fsp/fsp0fsp.cc
index 9af25b53a90..790232edb66 100644
--- a/storage/xtradb/fsp/fsp0fsp.cc
+++ b/storage/xtradb/fsp/fsp0fsp.cc
@@ -961,10 +961,20 @@ fsp_try_extend_data_file(
}
} else {
/* We extend single-table tablespaces first one extent
- at a time, but for bigger tablespaces more. It is not
- enough to extend always by one extent, because some
- extents are frag page extents. */
+ at a time, but 4 at a time for bigger tablespaces. It is
+ not enough to extend always by one extent, because we need
+ to add at least one extent to FSP_FREE.
+ A single extent descriptor page will track many extents.
+ And the extent that uses its extent descriptor page is
+ put onto the FSP_FREE_FRAG list. Extents that do not
+ use their extent descriptor page are added to FSP_FREE.
+ The physical page size is used to determine how many
+ extents are tracked on one extent descriptor page. */
ulint extent_size; /*!< one megabyte, in pages */
+ ulint threshold; /*!< The size of the tablespace
+ (in number of pages) where we
+ start allocating more than one
+ extent at a time. */
if (!zip_size) {
extent_size = FSP_EXTENT_SIZE;
@@ -973,6 +983,14 @@ fsp_try_extend_data_file(
* UNIV_PAGE_SIZE / zip_size;
}
+ /* Threshold is set at 32mb except when the page
+ size is small enough that it must be done sooner.
+ For page size less than 4k, we may reach the
+ extent contains extent descriptor page before
+ 32 mb. */
+ threshold = ut_min((32 * extent_size),
+ (zip_size ? zip_size : UNIV_PAGE_SIZE));
+
if (size < extent_size) {
/* Let us first extend the file to extent_size */
success = fsp_try_extend_data_file_with_pages(
@@ -989,7 +1007,7 @@ fsp_try_extend_data_file(
size = extent_size;
}
- if (size < 32 * extent_size) {
+ if (size < threshold) {
size_increase = extent_size;
} else {
/* Below in fsp_fill_free_list() we assume
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index c50d3fd934b..517f7aa2636 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -5,7 +5,7 @@ Copyright (c) 2013, 2015, MariaDB Corporation.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2014 SkySQL Ab. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -944,12 +944,6 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_os_log_pending_writes, SHOW_LONG},
{"os_log_written",
(char*) &export_vars.innodb_os_log_written, SHOW_LONGLONG},
- {"os_merge_buffers_written",
- (char*) &export_vars.innodb_merge_buffers_written, SHOW_LONGLONG},
- {"os_merge_buffers_read",
- (char*) &export_vars.innodb_merge_buffers_read, SHOW_LONGLONG},
- {"os_merge_buffers_merged",
- (char*) &export_vars.innodb_merge_buffers_merged, SHOW_LONGLONG},
{"page_size",
(char*) &export_vars.innodb_page_size, SHOW_LONG},
{"pages_created",
@@ -1490,7 +1484,6 @@ Normalizes a table name string. A normalized name consists of the
database name catenated to '/' and table name. An example:
test/mytable. On Windows normalization puts both the database name and the
table name always to lower case if "set_lower_case" is set to TRUE. */
-static
void
normalize_table_name_low(
/*=====================*/
@@ -5386,7 +5379,6 @@ Normalizes a table name string. A normalized name consists of the
database name catenated to '/' and table name. Example: test/mytable.
On Windows normalization puts both the database name and the
table name always to lower case if "set_lower_case" is set to TRUE. */
-static
void
normalize_table_name_low(
/*=====================*/
@@ -8323,7 +8315,13 @@ ha_innobase::write_row(
ha_statistic_increment(&SSV::ha_write_count);
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -8651,7 +8649,7 @@ report_error:
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
!wsrep_consistency_check(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL))
{
@@ -8670,7 +8668,13 @@ wsrep_error:
func_exit:
innobase_active_small();
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -9084,7 +9088,13 @@ ha_innobase::update_row(
ha_statistic_increment(&SSV::ha_update_count);
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -9185,7 +9195,7 @@ func_exit:
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
DBUG_PRINT("wsrep", ("update row key"));
@@ -9199,7 +9209,13 @@ func_exit:
wsrep_error:
#endif /* WITH_WSREP */
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -9265,7 +9281,7 @@ ha_innobase::delete_row(
if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_thd_skip_append_keys(user_thd))
+ !wsrep_thd_ignore_table(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL)) {
DBUG_PRINT("wsrep", ("delete fail"));
@@ -12721,7 +12737,13 @@ ha_innobase::truncate()
update_thd(ha_thd());
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -12736,7 +12758,13 @@ ha_innobase::truncate()
err = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -14126,7 +14154,13 @@ ha_innobase::analyze(
{
int ret;
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
return(HA_ADMIN_CORRUPT);
}
@@ -14136,7 +14170,13 @@ ha_innobase::analyze(
HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE,
true /* this is ANALYZE */);
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
return(HA_ADMIN_CORRUPT);
}
@@ -15345,7 +15385,13 @@ ha_innobase::transactional_table_lock(
update_thd(thd);
- if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
+ if (share->ib_table != prebuilt->table) {
+ fprintf(stderr,
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %d.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
+ }
+
+ if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
DBUG_RETURN(HA_ERR_CRASHED);
}
@@ -18445,7 +18491,6 @@ innodb_sched_priority_purge_update(
return;
}
- ut_ad(purge_sys->state == PURGE_STATE_RUN);
for (ulint i = 0; i < srv_n_purge_threads; i++) {
ulint nice = os_thread_get_priority(srv_purge_tids[i]);
ulint actual_priority
@@ -19203,6 +19248,15 @@ wsrep_innobase_kill_one_trx(
(thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void");
wsrep_thd_LOCK(thd);
+ DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock",
+ {
+ const char act[]=
+ "now "
+ "wait_for signal.wsrep_after_BF_victim_lock";
+ DBUG_ASSERT(!debug_sync_set_action(bf_thd,
+ STRING_WITH_LEN(act)));
+ };);
+
if (wsrep_thd_query_state(thd) == QUERY_EXITING) {
WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id);
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 7ea581f99a2..c0d85451a9e 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -167,10 +167,13 @@ my_error_innodb(
/* TODO: report the row, as we do for DB_DUPLICATE_KEY */
my_error(ER_INVALID_USE_OF_NULL, MYF(0));
break;
+ case DB_TABLESPACE_EXISTS:
+ my_error(ER_TABLESPACE_EXISTS, MYF(0), table);
+ break;
+
#ifdef UNIV_DEBUG
case DB_SUCCESS:
case DB_DUPLICATE_KEY:
- case DB_TABLESPACE_EXISTS:
case DB_ONLINE_LOG_TOO_BIG:
/* These codes should not be passed here. */
ut_error;
@@ -202,12 +205,14 @@ innobase_fulltext_exist(
/*******************************************************************//**
Determine if ALTER TABLE needs to rebuild the table.
@param ha_alter_info the DDL operation
+@param altered_table MySQL original table
@return whether it is necessary to rebuild the table */
static __attribute__((nonnull, warn_unused_result))
bool
innobase_need_rebuild(
/*==================*/
- const Alter_inplace_info* ha_alter_info)
+ const Alter_inplace_info* ha_alter_info,
+ const TABLE* altered_table)
{
if (ha_alter_info->handler_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
@@ -219,6 +224,34 @@ innobase_need_rebuild(
return(false);
}
+ /* If alter table changes column name and adds a new
+ index, we need to check is this new index created
+ to new column name. This is because column name
+ changes are done normally after creating indexes. */
+ if ((ha_alter_info->handler_flags
+ & Alter_inplace_info::ALTER_COLUMN_NAME) &&
+ ((ha_alter_info->handler_flags
+ & Alter_inplace_info::ADD_INDEX) ||
+ (ha_alter_info->handler_flags
+ & Alter_inplace_info::ADD_FOREIGN_KEY))) {
+ for (ulint i = 0; i < ha_alter_info->key_count; i++) {
+ const KEY* key = &ha_alter_info->key_info_buffer[
+ ha_alter_info->index_add_buffer[i]];
+
+ for (ulint j = 0; j < key->user_defined_key_parts; j++) {
+ const KEY_PART_INFO* key_part = &(key->key_part[j]);
+ const Field* field = altered_table->field[key_part->fieldnr];
+
+ /* Field used on added index is renamed on
+ this same alter table. We need table
+ rebuild. */
+ if (field->flags & FIELD_IS_RENAMED) {
+ return (true);
+ }
+ }
+ }
+ }
+
return(!!(ha_alter_info->handler_flags & INNOBASE_ALTER_REBUILD));
}
@@ -557,7 +590,7 @@ ha_innobase::check_if_supported_inplace_alter(
operation is possible. */
} else if (((ha_alter_info->handler_flags
& Alter_inplace_info::ADD_PK_INDEX)
- || innobase_need_rebuild(ha_alter_info))
+ || innobase_need_rebuild(ha_alter_info, table))
&& (innobase_fulltext_exist(altered_table))) {
/* Refuse to rebuild the table online, if
fulltext indexes are to survive the rebuild. */
@@ -1558,7 +1591,8 @@ innobase_create_index_def(
index_def_t* index, /*!< out: index definition */
mem_heap_t* heap, /*!< in: heap where memory
is allocated */
- const Field** fields) /*!z in: MySQL table fields */
+ const Field** fields) /*!< in: MySQL table fields
+ */
{
const KEY* key = &keys[key_number];
ulint i;
@@ -1854,9 +1888,11 @@ innobase_create_key_defs(
bool& add_fts_doc_id,
/*!< in: whether we need to add new DOC ID
column for FTS index */
- bool& add_fts_doc_idx)
+ bool& add_fts_doc_idx,
/*!< in: whether we need to add new DOC ID
index for FTS index */
+ const TABLE* table)
+ /*!< in: MySQL table that is being altered */
{
index_def_t* indexdef;
index_def_t* indexdefs;
@@ -1906,7 +1942,8 @@ innobase_create_key_defs(
}
const bool rebuild = new_primary || add_fts_doc_id
- || innobase_need_rebuild(ha_alter_info);
+ || innobase_need_rebuild(ha_alter_info, table);
+
/* Reserve one more space if new_primary is true, and we might
need to add the FTS_DOC_ID_INDEX */
indexdef = indexdefs = static_cast<index_def_t*>(
@@ -2744,7 +2781,8 @@ prepare_inplace_alter_table_dict(
ctx->heap, ha_alter_info, altered_table, ctx->num_to_add_index,
num_fts_index,
row_table_got_default_clust_index(ctx->new_table),
- fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx);
+ fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx,
+ old_table);
new_clustered = DICT_CLUSTERED & index_defs[0].ind_type;
@@ -2757,7 +2795,7 @@ prepare_inplace_alter_table_dict(
/* This is not an online operation (LOCK=NONE). */
} else if (ctx->add_autoinc == ULINT_UNDEFINED
&& num_fts_index == 0
- && (!innobase_need_rebuild(ha_alter_info)
+ && (!innobase_need_rebuild(ha_alter_info, old_table)
|| !innobase_fulltext_exist(altered_table))) {
/* InnoDB can perform an online operation (LOCK=NONE). */
} else {
@@ -2774,7 +2812,7 @@ prepare_inplace_alter_table_dict(
is just copied from old table and stored in indexdefs[0] */
DBUG_ASSERT(!add_fts_doc_id || new_clustered);
DBUG_ASSERT(!!new_clustered ==
- (innobase_need_rebuild(ha_alter_info)
+ (innobase_need_rebuild(ha_alter_info, old_table)
|| add_fts_doc_id));
/* Allocate memory for dictionary index definitions */
@@ -3034,7 +3072,7 @@ prepare_inplace_alter_table_dict(
add_cols, ctx->heap);
ctx->add_cols = add_cols;
} else {
- DBUG_ASSERT(!innobase_need_rebuild(ha_alter_info));
+ DBUG_ASSERT(!innobase_need_rebuild(ha_alter_info, old_table));
if (!ctx->new_table->fts
&& innobase_fulltext_exist(altered_table)) {
@@ -3055,7 +3093,7 @@ prepare_inplace_alter_table_dict(
ctx->add_index[a] = row_merge_create_index(
ctx->trx, ctx->new_table,
- &index_defs[a]);
+ &index_defs[a], ctx->col_names);
add_key_nums[a] = index_defs[a].key_number;
@@ -3925,7 +3963,7 @@ err_exit:
if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA)
|| (ha_alter_info->handler_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
- && !innobase_need_rebuild(ha_alter_info))) {
+ && !innobase_need_rebuild(ha_alter_info, table))) {
if (heap) {
ha_alter_info->handler_ctx
@@ -4099,7 +4137,7 @@ ok_exit:
if (ha_alter_info->handler_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
- && !innobase_need_rebuild(ha_alter_info)) {
+ && !innobase_need_rebuild(ha_alter_info, table)) {
goto ok_exit;
}
@@ -4811,9 +4849,11 @@ commit_get_autoinc(
Field* autoinc_field =
old_table->found_next_number_field;
+ KEY* autoinc_key =
+ old_table->key_info + old_table->s->next_number_index;
- dict_index_t* index = dict_table_get_index_on_first_col(
- ctx->old_table, autoinc_field->field_index);
+ dict_index_t* index = dict_table_get_index_on_name(
+ ctx->old_table, autoinc_key->name);
max_autoinc = ha_alter_info->create_info->auto_increment_value;
@@ -5221,6 +5261,61 @@ commit_cache_rebuild(
DBUG_VOID_RETURN;
}
+/** Store the column number of the columns in a list belonging
+to indexes which are not being dropped.
+@param[in] ctx In-place ALTER TABLE context
+@param[out] drop_col_list list which will be set, containing columns
+ which is part of index being dropped */
+static
+void
+get_col_list_to_be_dropped(
+ ha_innobase_inplace_ctx* ctx,
+ std::set<ulint>& drop_col_list)
+{
+ for (ulint index_count = 0; index_count < ctx->num_to_drop_index;
+ index_count++) {
+ dict_index_t* index = ctx->drop_index[index_count];
+
+ for (ulint col = 0; col < index->n_user_defined_cols; col++) {
+ ulint col_no = dict_index_get_nth_col_no(index, col);
+ drop_col_list.insert(col_no);
+ }
+ }
+}
+
+/** For each column, which is part of an index which is not going to be
+dropped, it checks if the column number of the column is same as col_no
+argument passed.
+@param[in] table table object
+@param[in] col_no column number of the column which is to be checked
+@retval true column exists
+@retval false column does not exist. */
+static
+bool
+check_col_exists_in_indexes(
+ const dict_table_t* table,
+ ulint col_no)
+{
+ for (dict_index_t* index = dict_table_get_first_index(table); index;
+ index = dict_table_get_next_index(index)) {
+
+ if (index->to_be_dropped) {
+ continue;
+ }
+
+ for (ulint col = 0; col < index->n_user_defined_cols; col++) {
+
+ ulint index_col_no = dict_index_get_nth_col_no(
+ index, col);
+ if (col_no == index_col_no) {
+ return(true);
+ }
+ }
+ }
+
+ return(false);
+}
+
/** Commit the changes made during prepare_inplace_alter_table()
and inplace_alter_table() inside the data dictionary tables,
when not rebuilding the table.
@@ -5356,6 +5451,20 @@ commit_cache_norebuild(
DBUG_ASSERT(!ctx->need_rebuild());
+ std::set<ulint> drop_list;
+ std::set<ulint>::const_iterator col_it;
+
+ /* Check if the column, part of an index to be dropped is part of any
+ other index which is not being dropped. If it so, then set the ord_part
+ of the column to 0. */
+ get_col_list_to_be_dropped(ctx, drop_list);
+
+ for(col_it = drop_list.begin(); col_it != drop_list.end(); ++col_it) {
+ if (!check_col_exists_in_indexes(ctx->new_table, *col_it)) {
+ ctx->new_table->cols[*col_it].ord_part = 0;
+ }
+ }
+
for (ulint i = 0; i < ctx->num_to_add_index; i++) {
dict_index_t* index = ctx->add_index[i];
DBUG_ASSERT(dict_index_get_online_status(index)
@@ -5556,6 +5665,7 @@ ha_innobase::commit_inplace_alter_table(
Alter_inplace_info* ha_alter_info,
bool commit)
{
+ dberr_t error;
ha_innobase_inplace_ctx* ctx0
= static_cast<ha_innobase_inplace_ctx*>
(ha_alter_info->handler_ctx);
@@ -5637,7 +5747,7 @@ ha_innobase::commit_inplace_alter_table(
transactions collected during crash recovery could be
holding InnoDB locks only, not MySQL locks. */
- dberr_t error = row_merge_lock_table(
+ error = row_merge_lock_table(
prebuilt->trx, ctx->old_table, LOCK_X);
if (error != DB_SUCCESS) {
@@ -5772,14 +5882,20 @@ ha_innobase::commit_inplace_alter_table(
= static_cast<ha_innobase_inplace_ctx*>(*pctx);
DBUG_ASSERT(ctx->need_rebuild());
- /* Generate the redo log for the file
- operations that will be performed in
- commit_cache_rebuild(). */
- fil_mtr_rename_log(ctx->old_table->space,
- ctx->old_table->name,
- ctx->new_table->space,
- ctx->new_table->name,
- ctx->tmp_name, &mtr);
+ /* Check for any possible problems for any
+ file operations that will be performed in
+ commit_cache_rebuild(), and if none, generate
+ the redo log for these operations. */
+ error = fil_mtr_rename_log(ctx->old_table,
+ ctx->new_table,
+ ctx->tmp_name, &mtr);
+ if (error != DB_SUCCESS) {
+ /* Out of memory or a problem will occur
+ when renaming files. */
+ fail = true;
+ my_error_innodb(error, ctx->old_table->name,
+ ctx->old_table->flags);
+ }
DBUG_INJECT_CRASH("ib_commit_inplace_crash",
crash_inject_count++);
}
@@ -5792,18 +5908,25 @@ ha_innobase::commit_inplace_alter_table(
DBUG_EXECUTE_IF("innodb_alter_commit_crash_before_commit",
log_buffer_flush_to_disk();
DBUG_SUICIDE(););
- ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
ut_ad(!trx->fts_trx);
- ut_ad(trx->insert_undo || trx->update_undo);
- /* The following call commits the
- mini-transaction, making the data dictionary
- transaction committed at mtr.end_lsn. The
- transaction becomes 'durable' by the time when
- log_buffer_flush_to_disk() returns. In the
- logical sense the commit in the file-based
- data structures happens here. */
- trx_commit_low(trx, &mtr);
+ if (fail) {
+ mtr_set_log_mode(&mtr, MTR_LOG_NO_REDO);
+ mtr_commit(&mtr);
+ trx_rollback_for_mysql(trx);
+ } else {
+ /* The following call commits the
+ mini-transaction, making the data dictionary
+ transaction committed at mtr.end_lsn. The
+ transaction becomes 'durable' by the time when
+ log_buffer_flush_to_disk() returns. In the
+ logical sense the commit in the file-based
+ data structures happens here. */
+ ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE));
+ ut_ad(trx->insert_undo || trx->update_undo);
+
+ trx_commit_low(trx, &mtr);
+ }
/* If server crashes here, the dictionary in
InnoDB and MySQL will differ. The .ibd files
@@ -5825,7 +5948,6 @@ ha_innobase::commit_inplace_alter_table(
update the in-memory structures, close some handles, release
temporary files, and (unless we rolled back) update persistent
statistics. */
- dberr_t error = DB_SUCCESS;
for (inplace_alter_handler_ctx** pctx = ctx_array;
*pctx; pctx++) {
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc
index 9ee22d4d0f7..bac2a92dd0b 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.cc
+++ b/storage/xtradb/ibuf/ibuf0ibuf.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
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
@@ -384,12 +385,18 @@ ibuf_header_page_get(
buf_block_t* block;
ut_ad(!ibuf_inside(mtr));
+ page_t* page = NULL;
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
- buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
- return(buf_block_get_frame(block));
+ if (!block->page.encrypted) {
+ buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
+
+ page = buf_block_get_frame(block);
+ }
+
+ return page;
}
/******************************************************************//**
@@ -540,9 +547,10 @@ ibuf_size_update(
/******************************************************************//**
Creates the insert buffer data structure at a database startup and initializes
-the data structures for the insert buffer. */
+the data structures for the insert buffer.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void)
/*=======================*/
{
@@ -553,7 +561,7 @@ ibuf_init_at_db_start(void)
dict_index_t* index;
ulint n_used;
page_t* header_page;
- dberr_t error;
+ dberr_t error= DB_SUCCESS;
ibuf = static_cast<ibuf_t*>(mem_zalloc(sizeof(ibuf_t)));
@@ -583,6 +591,10 @@ ibuf_init_at_db_start(void)
header_page = ibuf_header_page_get(&mtr);
+ if (!header_page) {
+ return (DB_DECRYPTION_FAILED);
+ }
+
fseg_n_reserved_pages(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
&n_used, &mtr);
ibuf_enter(&mtr);
@@ -634,6 +646,7 @@ ibuf_init_at_db_start(void)
ut_a(error == DB_SUCCESS);
ibuf->index = dict_table_get_first_index(table);
+ return (error);
}
/*********************************************************************//**
diff --git a/storage/xtradb/include/buf0flu.h b/storage/xtradb/include/buf0flu.h
index c51010e33bc..87ce7d88bdf 100644
--- a/storage/xtradb/include/buf0flu.h
+++ b/storage/xtradb/include/buf0flu.h
@@ -211,7 +211,7 @@ Clears up tail of the LRU lists:
* Flush dirty pages at the tail of LRU to the disk
The depth to which we scan each buffer pool is controlled by dynamic
config parameter innodb_LRU_scan_depth.
-@return total pages flushed */
+@return number of pages flushed */
UNIV_INTERN
ulint
buf_flush_LRU_tail(void);
diff --git a/storage/xtradb/include/fil0crypt.h b/storage/xtradb/include/fil0crypt.h
index c42a0cf7e3f..32462661cd6 100644
--- a/storage/xtradb/include/fil0crypt.h
+++ b/storage/xtradb/include/fil0crypt.h
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2015, MariaDB Corporation.
+Copyright (c) 2015, 2016, MariaDB Corporation.
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
@@ -212,6 +212,7 @@ bool
fil_space_check_encryption_read(
/*============================*/
ulint space); /*!< in: tablespace id */
+
/******************************************************************
Decrypt a page
@return true if page is decrypted, false if not. */
@@ -226,7 +227,6 @@ fil_space_decrypt(
dberr_t* err); /*!< in: out: DB_SUCCESS or
error code */
-
/*********************************************************************
Encrypt buffer page
@return encrypted page, or original not encrypted page if encrypt
@@ -253,7 +253,8 @@ fil_space_decrypt(
ulint space, /*!< in: tablespace id */
byte* src_frame, /*!< in: page frame */
ulint page_size, /*!< in: size of data to encrypt */
- byte* dst_frame); /*!< in: where to decrypt to */
+ byte* dst_frame) /*!< in: where to decrypt to */
+ __attribute__((warn_unused_result));
/*********************************************************************
fil_space_verify_crypt_checksum
diff --git a/storage/xtradb/include/fil0fil.h b/storage/xtradb/include/fil0fil.h
index 2a3995519a7..973882a50b4 100644
--- a/storage/xtradb/include/fil0fil.h
+++ b/storage/xtradb/include/fil0fil.h
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation.
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
@@ -699,6 +699,21 @@ fil_discard_tablespace(
ulint id) /*!< in: space id */
__attribute__((warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
+
+/** Test if a tablespace file can be renamed to a new filepath by checking
+if that the old filepath exists and the new filepath does not exist.
+@param[in] space_id tablespace id
+@param[in] old_path old filepath
+@param[in] new_path new filepath
+@param[in] is_discarded whether the tablespace is discarded
+@return innodb error code */
+dberr_t
+fil_rename_tablespace_check(
+ ulint space_id,
+ const char* old_path,
+ const char* new_path,
+ bool is_discarded);
+
/*******************************************************************//**
Renames a single-table tablespace. The tablespace must be cached in the
tablespace memory cache.
@@ -1223,21 +1238,19 @@ fil_get_space_names(
/*!< in/out: Vector for collecting the names. */
__attribute__((warn_unused_result));
-/****************************************************************//**
-Generate redo logs for swapping two .ibd files */
+/** Generate redo log for swapping two .ibd files
+@param[in] old_table old table
+@param[in] new_table new table
+@param[in] tmp_name temporary table name
+@param[in,out] mtr mini-transaction
+@return innodb error code */
UNIV_INTERN
-void
+dberr_t
fil_mtr_rename_log(
-/*===============*/
- ulint old_space_id, /*!< in: tablespace id of the old
- table. */
- const char* old_name, /*!< in: old table name */
- ulint new_space_id, /*!< in: tablespace id of the new
- table */
- const char* new_name, /*!< in: new table name */
- const char* tmp_name, /*!< in: temp table name used while
- swapping */
- mtr_t* mtr) /*!< in/out: mini-transaction */
+ const dict_table_t* old_table,
+ const dict_table_t* new_table,
+ const char* tmp_name,
+ mtr_t* mtr)
__attribute__((nonnull));
/*******************************************************************//**
diff --git a/storage/xtradb/include/ha_prototypes.h b/storage/xtradb/include/ha_prototypes.h
index 9ec6a7ff4b4..a9c003d5bb1 100644
--- a/storage/xtradb/include/ha_prototypes.h
+++ b/storage/xtradb/include/ha_prototypes.h
@@ -655,4 +655,18 @@ ib_push_warning(
ulint error, /*!< in: error code to push as warning */
const char *format,/*!< in: warning message */
...);
+
+/*****************************************************************//**
+Normalizes a table name string. A normalized name consists of the
+database name catenated to '/' and table name. An example:
+test/mytable. On Windows normalization puts both the database name and the
+table name always to lower case if "set_lower_case" is set to TRUE. */
+void
+normalize_table_name_low(
+/*=====================*/
+ char* norm_name, /*!< out: normalized name as a
+ null-terminated string */
+ const char* name, /*!< in: table name string */
+ ibool set_lower_case); /*!< in: TRUE if we want to set
+ name to lower case */
#endif /* HA_INNODB_PROTOTYPES_H */
diff --git a/storage/xtradb/include/ibuf0ibuf.h b/storage/xtradb/include/ibuf0ibuf.h
index ac16b10e097..3c8fa874dcf 100644
--- a/storage/xtradb/include/ibuf0ibuf.h
+++ b/storage/xtradb/include/ibuf0ibuf.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, MariaDB Corporation.
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
@@ -91,9 +92,10 @@ separately committed mini-transaction, because in crash recovery, the
free bits could momentarily be set too high. */
/******************************************************************//**
-Creates the insert buffer data structure at a database startup. */
+Creates the insert buffer data structure at a database startup.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void);
/*=======================*/
/*********************************************************************//**
diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h
index 196543f25e1..3e3459b8703 100644
--- a/storage/xtradb/include/row0merge.h
+++ b/storage/xtradb/include/row0merge.h
@@ -268,8 +268,11 @@ row_merge_create_index(
/*===================*/
trx_t* trx, /*!< in/out: trx (sets error_state) */
dict_table_t* table, /*!< in: the index is on this table */
- const index_def_t* index_def);
+ const index_def_t* index_def,
/*!< in: the index definition */
+ const char** col_names);
+ /*! in: column names if columns are
+ renamed or NULL */
/*********************************************************************//**
Check if a transaction can use an index.
@return TRUE if index can be used by the transaction else FALSE */
diff --git a/storage/xtradb/include/srv0mon.h b/storage/xtradb/include/srv0mon.h
index 658cd94d1ec..33ae7749ca5 100644
--- a/storage/xtradb/include/srv0mon.h
+++ b/storage/xtradb/include/srv0mon.h
@@ -2,7 +2,7 @@
Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2016, MariaDB Corporation.
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
@@ -263,9 +263,6 @@ enum monitor_id_t {
MONITOR_OVLD_OS_LOG_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_FSYNC,
MONITOR_OVLD_OS_LOG_PENDING_WRITES,
- MONITOR_MERGE_BLOCKS_WRITTEN,
- MONITOR_MERGE_BLOCKS_READ,
- MONITOR_MERGE_BLOCKS_MERGED,
/* Transaction related counters */
MONITOR_MODULE_TRX,
diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h
index 9a3bf4e74ae..a2d300957ba 100644
--- a/storage/xtradb/include/srv0srv.h
+++ b/storage/xtradb/include/srv0srv.h
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -186,13 +186,6 @@ struct srv_stats_t {
/** Number of lock waits that have been up to max time (i.e.) lock
wait timeout */
ulint_ctr_1_t n_lock_max_wait_time;
-
- /** Number of merge buffers written */
- ulint_ctr_64_t merge_buffers_written;
- /** Number of merge buffers read */
- ulint_ctr_64_t merge_buffers_read;
- /** Number of merge buffers merged */
- ulint_ctr_64_t merge_buffers_merged;
};
extern const char* srv_main_thread_op_info;
@@ -1214,9 +1207,6 @@ struct export_var_t{
ulint innodb_purge_view_trx_id_age; /*!< rw_max_trx_id
- purged view's min trx_id */
#endif /* UNIV_DEBUG */
- ib_int64_t innodb_merge_buffers_written;
- ib_int64_t innodb_merge_buffers_read;
- ib_int64_t innodb_merge_buffers_merged;
ib_int64_t innodb_page_compression_saved;/*!< Number of bytes saved
by page compression */
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index dabaee4110c..f4a0da12476 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -45,10 +45,10 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 6
-#define INNODB_VERSION_BUGFIX 26
+#define INNODB_VERSION_BUGFIX 28
#ifndef PERCONA_INNODB_VERSION
-#define PERCONA_INNODB_VERSION 76.0
+#define PERCONA_INNODB_VERSION 76.1
#endif
/* Enable UNIV_LOG_ARCHIVE in XtraDB */
diff --git a/storage/xtradb/lock/lock0wait.cc b/storage/xtradb/lock/lock0wait.cc
index 2482c88d3b7..a87adcf94c0 100644
--- a/storage/xtradb/lock/lock0wait.cc
+++ b/storage/xtradb/lock/lock0wait.cc
@@ -396,7 +396,9 @@ lock_wait_suspend_thread(
if (lock_wait_timeout < 100000000
&& wait_time > (double) lock_wait_timeout) {
#ifdef WITH_WSREP
- if (!wsrep_is_BF_lock_timeout(trx)) {
+ if (!wsrep_on(trx->mysql_thd) ||
+ (!wsrep_is_BF_lock_timeout(trx) &&
+ trx->error_state != DB_DEADLOCK)) {
#endif /* WITH_WSREP */
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc
index b0e69107723..c9bf5cf3f9e 100644
--- a/storage/xtradb/log/log0recv.cc
+++ b/storage/xtradb/log/log0recv.cc
@@ -849,6 +849,10 @@ not_consistent:
fprintf(stderr,
"InnoDB: No valid checkpoint found.\n"
+ "InnoDB: If you are attempting downgrade"
+ " from MySQL 5.7.9 or later,\n"
+ "InnoDB: please refer to " REFMAN
+ "upgrading-downgrading.html\n"
"InnoDB: If this error appears when you are"
" creating an InnoDB database,\n"
"InnoDB: the problem may be that during"
diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc
index ac6380e5a27..893ffcab3da 100644
--- a/storage/xtradb/row/row0import.cc
+++ b/storage/xtradb/row/row0import.cc
@@ -2070,8 +2070,20 @@ PageConverter::validate(
return(IMPORT_PAGE_STATUS_CORRUPTED);
} else if (offset > 0 && page_get_page_no(page) == 0) {
- const byte* b = page;
- const byte* e = b + m_page_size;
+ ulint checksum;
+
+ checksum = mach_read_from_4(page + FIL_PAGE_SPACE_OR_CHKSUM);
+ if (checksum != 0) {
+ /* Checksum check passed in buf_page_is_corrupted(). */
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "%s: Page %lu checksum %lu should be zero.",
+ m_filepath, (ulong) (offset / m_page_size),
+ checksum);
+ }
+
+ const byte* b = page + FIL_PAGE_OFFSET;
+ const byte* e = page + m_page_size
+ - FIL_PAGE_END_LSN_OLD_CHKSUM;
/* If the page number is zero and offset > 0 then
the entire page MUST consist of zeroes. If not then
diff --git a/storage/xtradb/row/row0log.cc b/storage/xtradb/row/row0log.cc
index 7014b8b99d2..b0c6f881f81 100644
--- a/storage/xtradb/row/row0log.cc
+++ b/storage/xtradb/row/row0log.cc
@@ -1462,6 +1462,7 @@ row_log_table_apply_insert_low(
dtuple_t* entry;
const row_log_t*log = dup->index->online_log;
dict_index_t* index = dict_table_get_first_index(log->table);
+ ulint n_index = 0;
ut_ad(dtuple_validate(row));
ut_ad(trx_id);
@@ -1497,6 +1498,8 @@ row_log_table_apply_insert_low(
}
do {
+ n_index++;
+
if (!(index = dict_table_get_next_index(index))) {
break;
}
@@ -1509,6 +1512,12 @@ row_log_table_apply_insert_low(
error = row_ins_sec_index_entry_low(
flags, BTR_MODIFY_TREE,
index, offsets_heap, heap, entry, trx_id, thr);
+
+ /* Report correct index name for duplicate key error. */
+ if (error == DB_DUPLICATE_KEY) {
+ thr_get_trx(thr)->error_key_num = n_index;
+ }
+
} while (error == DB_SUCCESS);
return(error);
@@ -1816,6 +1825,7 @@ row_log_table_apply_update(
mtr_t mtr;
btr_pcur_t pcur;
dberr_t error;
+ ulint n_index = 0;
ut_ad(dtuple_get_n_fields_cmp(old_pk)
== dict_index_get_n_unique(index));
@@ -2091,6 +2101,8 @@ func_exit_committed:
break;
}
+ n_index++;
+
if (index->type & DICT_FTS) {
continue;
}
@@ -2134,6 +2146,11 @@ func_exit_committed:
BTR_MODIFY_TREE, index, offsets_heap, heap,
entry, trx_id, thr);
+ /* Report correct index name for duplicate key error. */
+ if (error == DB_DUPLICATE_KEY) {
+ thr_get_trx(thr)->error_key_num = n_index;
+ }
+
mtr_start(&mtr);
}
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index ad3e7619c8a..8d7fcd7388c 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -1,7 +1,6 @@
/*****************************************************************************
Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2015, MariaDB Corporation.
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
@@ -971,7 +970,6 @@ row_merge_read(
success = os_file_read_no_error_handling(OS_FILE_FROM_FD(fd), buf,
ofs, srv_sort_buf_size);
- srv_stats.merge_buffers_read.inc();
/* For encrypted tables, decrypt data after reading and copy data */
if (crypt_data && crypt_buf) {
@@ -1027,7 +1025,6 @@ row_merge_write(
}
ret = os_file_write("(merge)", OS_FILE_FROM_FD(fd), out_buf, ofs, buf_len);
- srv_stats.merge_buffers_written.inc();
#ifdef UNIV_DEBUG
if (row_merge_print_block_write) {
@@ -1916,7 +1913,7 @@ write_buffers:
/* We have enough data tuples to form a block.
Sort them and write to disk. */
- if (UNIV_LIKELY(buf->n_tuples)) {
+ if (buf->n_tuples) {
if (dict_index_is_unique(buf->index)) {
row_merge_dup_t dup = {
buf->index, table, col_map, 0};
@@ -1957,17 +1954,13 @@ write_buffers:
dict_index_get_lock(buf->index));
}
- /* Do not write empty buffers to temporary file */
- if (buf->n_tuples) {
-
- row_merge_buf_write(buf, file, block);
+ row_merge_buf_write(buf, file, block);
- if (!row_merge_write(file->fd, file->offset++, block,
- crypt_data, crypt_block, new_table->space)) {
- err = DB_TEMP_FILE_WRITE_FAILURE;
- trx->error_key_num = i;
- break;
- }
+ if (!row_merge_write(file->fd, file->offset++, block,
+ crypt_data, crypt_block, new_table->space)) {
+ err = DB_TEMP_FILE_WRITE_FAILURE;
+ trx->error_key_num = i;
+ break;
}
UNIV_MEM_INVALID(&block[0], srv_sort_buf_size);
@@ -2284,8 +2277,6 @@ done1:
b2, of->fd, &of->offset,
crypt_data, crypt_block ? &crypt_block[2 * srv_sort_buf_size] : NULL, space);
- srv_stats.merge_buffers_merged.inc();
-
return(b2 ? DB_SUCCESS : DB_CORRUPTION);
}
@@ -3746,8 +3737,11 @@ row_merge_create_index(
/*===================*/
trx_t* trx, /*!< in/out: trx (sets error_state) */
dict_table_t* table, /*!< in: the index is on this table */
- const index_def_t* index_def)
+ const index_def_t* index_def,
/*!< in: the index definition */
+ const char** col_names)
+ /*! in: column names if columns are
+ renamed or NULL */
{
dict_index_t* index;
dberr_t err;
@@ -3767,9 +3761,24 @@ row_merge_create_index(
for (i = 0; i < n_fields; i++) {
index_field_t* ifield = &index_def->fields[i];
- const char * col_name = ifield->col_name ?
- dict_table_get_col_name_for_mysql(table, ifield->col_name) :
- dict_table_get_col_name(table, ifield->col_no);
+ const char * col_name;
+
+ /*
+ Alter table renaming a column and then adding a index
+ to this new name e.g ALTER TABLE t
+ CHANGE COLUMN b c INT NOT NULL, ADD UNIQUE INDEX (c);
+ requires additional check as column names are not yet
+ changed when new index definitions are created. Table's
+ new column names are on a array of column name pointers
+ if any of the column names are changed. */
+
+ if (col_names && col_names[i]) {
+ col_name = col_names[i];
+ } else {
+ col_name = ifield->col_name ?
+ dict_table_get_col_name_for_mysql(table, ifield->col_name) :
+ dict_table_get_col_name(table, ifield->col_no);
+ }
dict_mem_index_add_field(
index,
@@ -4110,71 +4119,67 @@ wait_again:
#ifdef FTS_INTERNAL_DIAG_PRINT
DEBUG_FTS_SORT_PRINT("FTS_SORT: Complete Insert\n");
#endif
- } else {
- /* Sorting and inserting is required only if
- there really is records */
- if (UNIV_LIKELY(merge_files[i].n_rec)) {
- char buf[3 * NAME_LEN];
- char *bufend;
- row_merge_dup_t dup = {
- sort_idx, table, col_map, 0};
+ } else if (UNIV_LIKELY(merge_files[i].n_rec)) {
+ char buf[3 * NAME_LEN];
+ char *bufend;
+ row_merge_dup_t dup = {
+ sort_idx, table, col_map, 0};
- pct_cost = (COST_BUILD_INDEX_STATIC +
- (total_dynamic_cost * merge_files[i].offset /
- total_index_blocks)) /
- (total_static_cost + total_dynamic_cost)
- * PCT_COST_MERGESORT_INDEX * 100;
+ pct_cost = (COST_BUILD_INDEX_STATIC +
+ (total_dynamic_cost * merge_files[i].offset /
+ total_index_blocks)) /
+ (total_static_cost + total_dynamic_cost)
+ * PCT_COST_MERGESORT_INDEX * 100;
+
+ bufend = innobase_convert_name(buf, sizeof buf,
+ indexes[i]->name, strlen(indexes[i]->name),
+ trx ? trx->mysql_thd : NULL,
+ FALSE);
- bufend = innobase_convert_name(buf, sizeof buf,
- indexes[i]->name, strlen(indexes[i]->name),
- trx ? trx->mysql_thd : NULL,
- FALSE);
+ buf[bufend - buf]='\0';
- buf[bufend - buf]='\0';
+ sql_print_information("InnoDB: Online DDL : Start merge-sorting"
+ " index %s (%lu / %lu), estimated cost : %2.4f",
+ buf, (i+1), n_indexes, pct_cost);
- sql_print_information("InnoDB: Online DDL : Start merge-sorting"
- " index %s (%lu / %lu), estimated cost : %2.4f",
- buf, (i+1), n_indexes, pct_cost);
+ error = row_merge_sort(
+ trx, &dup, &merge_files[i],
+ block, &tmpfd, true,
+ pct_progress, pct_cost,
+ crypt_data, crypt_block, new_table->space);
- error = row_merge_sort(
- trx, &dup, &merge_files[i],
- block, &tmpfd, true,
- pct_progress, pct_cost,
- crypt_data, crypt_block, new_table->space);
+ pct_progress += pct_cost;
+
+ sql_print_information("InnoDB: Online DDL : End of "
+ " merge-sorting index %s (%lu / %lu)",
+ buf, (i+1), n_indexes);
+
+ DBUG_EXECUTE_IF(
+ "ib_merge_wait_after_sort",
+ os_thread_sleep(20000000);); /* 20 sec */
+ if (error == DB_SUCCESS) {
+ pct_cost = (COST_BUILD_INDEX_STATIC +
+ (total_dynamic_cost * merge_files[i].offset /
+ total_index_blocks)) /
+ (total_static_cost + total_dynamic_cost) *
+ PCT_COST_INSERT_INDEX * 100;
+
+ sql_print_information("InnoDB: Online DDL : Start "
+ "building index %s (%lu / %lu), estimated "
+ "cost : %2.4f", buf, (i+1),
+ n_indexes, pct_cost);
+
+ error = row_merge_insert_index_tuples(
+ trx->id, sort_idx, old_table,
+ merge_files[i].fd, block,
+ merge_files[i].n_rec, pct_progress, pct_cost,
+ crypt_data, crypt_block, new_table->space);
pct_progress += pct_cost;
- sql_print_information("InnoDB: Online DDL : End of "
- " merge-sorting index %s (%lu / %lu)",
+ sql_print_information("InnoDB: Online DDL : "
+ "End of building index %s (%lu / %lu)",
buf, (i+1), n_indexes);
-
- DBUG_EXECUTE_IF(
- "ib_merge_wait_after_sort",
- os_thread_sleep(20000000);); /* 20 sec */
-
- if (error == DB_SUCCESS) {
- pct_cost = (COST_BUILD_INDEX_STATIC +
- (total_dynamic_cost * merge_files[i].offset /
- total_index_blocks)) /
- (total_static_cost + total_dynamic_cost) *
- PCT_COST_INSERT_INDEX * 100;
-
- sql_print_information("InnoDB: Online DDL : Start "
- "building index %s (%lu / %lu), estimated "
- "cost : %2.4f", buf, (i+1),
- n_indexes, pct_cost);
-
- error = row_merge_insert_index_tuples(
- trx->id, sort_idx, old_table,
- merge_files[i].fd, block,
- merge_files[i].n_rec, pct_progress, pct_cost,
- crypt_data, crypt_block, new_table->space);
- pct_progress += pct_cost;
-
- sql_print_information("InnoDB: Online DDL : "
- "End of building index %s (%lu / %lu)",
- buf, (i+1), n_indexes);
- }
}
}
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index 55e685ac19c..9427b20daf9 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -4894,6 +4894,7 @@ row_rename_table_for_mysql(
pars_info_t* info = NULL;
int retry;
bool aux_fts_rename = false;
+ char* is_part = NULL;
ut_a(old_name != NULL);
ut_a(new_name != NULL);
@@ -4931,6 +4932,55 @@ row_rename_table_for_mysql(
table = dict_table_open_on_name(old_name, dict_locked, FALSE,
DICT_ERR_IGNORE_NONE);
+ /* We look for pattern #P# to see if the table is partitioned
+ MySQL table. */
+#ifdef __WIN__
+ is_part = strstr((char *)old_name, (char *)"#p#");
+#else
+ is_part = strstr((char *)old_name, (char *)"#P#");
+#endif /* __WIN__ */
+
+ /* MySQL partition engine hard codes the file name
+ separator as "#P#". The text case is fixed even if
+ lower_case_table_names is set to 1 or 2. This is true
+ for sub-partition names as well. InnoDB always
+ normalises file names to lower case on Windows, this
+ can potentially cause problems when copying/moving
+ tables between platforms.
+
+ 1) If boot against an installation from Windows
+ platform, then its partition table name could
+ be all be in lower case in system tables. So we
+ will need to check lower case name when load table.
+
+ 2) If we boot an installation from other case
+ sensitive platform in Windows, we might need to
+ check the existence of table name without lowering
+ case them in the system table. */
+ if (!table &&
+ is_part &&
+ innobase_get_lower_case_table_names() == 1) {
+ char par_case_name[MAX_FULL_NAME_LEN + 1];
+#ifndef __WIN__
+ /* Check for the table using lower
+ case name, including the partition
+ separator "P" */
+ memcpy(par_case_name, old_name,
+ strlen(old_name));
+ par_case_name[strlen(old_name)] = 0;
+ innobase_casedn_str(par_case_name);
+#else
+ /* On Windows platfrom, check
+ whether there exists table name in
+ system table whose name is
+ not being normalized to lower case */
+ normalize_table_name_low(
+ par_case_name, old_name, FALSE);
+#endif
+ table = dict_table_open_on_name(par_case_name, dict_locked, FALSE,
+ DICT_ERR_IGNORE_NONE);
+ }
+
if (!table) {
err = DB_TABLE_NOT_FOUND;
ut_print_timestamp(stderr);
diff --git a/storage/xtradb/srv/srv0mon.cc b/storage/xtradb/srv/srv0mon.cc
index 597e7cadc6a..e72868c6450 100644
--- a/storage/xtradb/srv/srv0mon.cc
+++ b/storage/xtradb/srv/srv0mon.cc
@@ -2,7 +2,7 @@
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2016, MariaDB Corporation.
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
@@ -715,24 +715,6 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_PENDING_WRITES},
- {"os_merge_blocks_written", "os",
- "Number of merge blocks written (innodb_os_merge_blocks_written)",
- static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DEFAULT_ON),
- MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_WRITTEN},
-
- {"os_merge_blocks_read", "os",
- "Number of merge blocks read (innodb_os_merge_blocks_read)",
- static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DEFAULT_ON),
- MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_READ},
-
- {"os_merge_blocks_merged", "os",
- "Number of merge blocks merged (innodb_os_merge_blocks_merged)",
- static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DEFAULT_ON),
- MONITOR_DEFAULT_START, MONITOR_MERGE_BLOCKS_MERGED},
-
/* ========== Counters for Transaction Module ========== */
{"module_trx", "transaction", "Transaction Manager",
MONITOR_MODULE,
@@ -1790,21 +1772,6 @@ srv_mon_process_existing_counter(
update_min = TRUE;
break;
- /* innodb_os_merge_blocks_written */
- case MONITOR_MERGE_BLOCKS_WRITTEN:
- value = srv_stats.merge_buffers_written;
- break;
-
- /* innodb_os_merge_blocks_read */
- case MONITOR_MERGE_BLOCKS_READ:
- value = srv_stats.merge_buffers_read;
- break;
-
- /* innodb_os_merge_blocks_merged */
- case MONITOR_MERGE_BLOCKS_MERGED:
- value = srv_stats.merge_buffers_merged;
- break;
-
/* innodb_log_waits */
case MONITOR_OVLD_LOG_WAITS:
value = srv_stats.log_waits;
diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc
index 2164451225b..794b119a090 100644
--- a/storage/xtradb/srv/srv0srv.cc
+++ b/storage/xtradb/srv/srv0srv.cc
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -2034,10 +2034,6 @@ srv_export_innodb_status(void)
}
#endif /* UNIV_DEBUG */
- export_vars.innodb_merge_buffers_written = srv_stats.merge_buffers_written;
- export_vars.innodb_merge_buffers_read = srv_stats.merge_buffers_read;
- export_vars.innodb_merge_buffers_merged = srv_stats.merge_buffers_merged;
-
export_vars.innodb_sec_rec_cluster_reads =
srv_stats.n_sec_rec_cluster_reads;
export_vars.innodb_sec_rec_cluster_reads_avoided =
diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc
index e0f9bde63fa..17f9e53e76f 100644
--- a/storage/xtradb/srv/srv0start.cc
+++ b/storage/xtradb/srv/srv0start.cc
@@ -188,6 +188,9 @@ static const ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES =
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
#define SRV_MAX_N_PENDING_SYNC_IOS 100
+/** The round off to MB is similar as done in srv_parse_megabytes() */
+#define CALC_NUMBER_OF_PAGES(size) ((size) / (1024 * 1024)) * \
+ ((1024 * 1024) / (UNIV_PAGE_SIZE))
#ifdef UNIV_PFS_THREAD
/* Keys to register InnoDB threads with performance schema */
UNIV_INTERN mysql_pfs_key_t io_handler_thread_key;
@@ -1020,10 +1023,16 @@ open_or_create_data_files(
size_check:
size = os_file_get_size(files[i]);
ut_a(size != (os_offset_t) -1);
- /* Round size downward to megabytes */
- rounded_size_pages = (ulint)
- (size >> UNIV_PAGE_SIZE_SHIFT);
+ /* Under some error conditions like disk full
+ narios or file size reaching filesystem
+ limit the data file could contain an incomplete
+ extent at the end. When we extend a data file
+ and if some failure happens, then also the data
+ file could contain an incomplete extent. So we
+ need to round the size downward to a megabyte.*/
+
+ rounded_size_pages = (ulint) CALC_NUMBER_OF_PAGES(size);
if (i == srv_n_data_files - 1
&& srv_auto_extend_last_data_file) {
diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc
index 3facb99ac0a..702dd240f16 100644
--- a/storage/xtradb/sync/sync0sync.cc
+++ b/storage/xtradb/sync/sync0sync.cc
@@ -1657,34 +1657,49 @@ sync_print_wait_info(
/*=================*/
FILE* file) /*!< in: file where to print */
{
+ // Sum counter values once
+ ib_int64_t mutex_spin_wait_count_val
+ = static_cast<ib_int64_t>(mutex_spin_wait_count);
+ ib_int64_t mutex_spin_round_count_val
+ = static_cast<ib_int64_t>(mutex_spin_round_count);
+ ib_int64_t mutex_os_wait_count_val
+ = static_cast<ib_int64_t>(mutex_os_wait_count);
+ ib_int64_t rw_s_spin_wait_count_val
+ = static_cast<ib_int64_t>(rw_lock_stats.rw_s_spin_wait_count);
+ ib_int64_t rw_s_spin_round_count_val
+ = static_cast<ib_int64_t>(rw_lock_stats.rw_s_spin_round_count);
+ ib_int64_t rw_s_os_wait_count_val
+ = static_cast<ib_int64_t>(rw_lock_stats.rw_s_os_wait_count);
+ ib_int64_t rw_x_spin_wait_count_val
+ = static_cast<ib_int64_t>(rw_lock_stats.rw_x_spin_wait_count);
+ ib_int64_t rw_x_spin_round_count_val
+ = static_cast<ib_int64_t>(rw_lock_stats.rw_x_spin_round_count);
+ ib_int64_t rw_x_os_wait_count_val
+ = static_cast<ib_int64_t>(rw_lock_stats.rw_x_os_wait_count);
+
fprintf(file,
- "Mutex spin waits " UINT64PF ", rounds " UINT64PF ", "
- "OS waits " UINT64PF "\n"
- "RW-shared spins " UINT64PF ", rounds " UINT64PF ", "
- "OS waits " UINT64PF "\n"
- "RW-excl spins " UINT64PF ", rounds " UINT64PF ", "
- "OS waits " UINT64PF "\n",
- (ib_uint64_t) mutex_spin_wait_count,
- (ib_uint64_t) mutex_spin_round_count,
- (ib_uint64_t) mutex_os_wait_count,
- (ib_uint64_t) rw_lock_stats.rw_s_spin_wait_count,
- (ib_uint64_t) rw_lock_stats.rw_s_spin_round_count,
- (ib_uint64_t) rw_lock_stats.rw_s_os_wait_count,
- (ib_uint64_t) rw_lock_stats.rw_x_spin_wait_count,
- (ib_uint64_t) rw_lock_stats.rw_x_spin_round_count,
- (ib_uint64_t) rw_lock_stats.rw_x_os_wait_count);
+ "Mutex spin waits " INT64PF ", rounds " INT64PF ", "
+ "OS waits " INT64PF "\n"
+ "RW-shared spins " INT64PF ", rounds " INT64PF ", "
+ "OS waits " INT64PF "\n"
+ "RW-excl spins " INT64PF ", rounds " INT64PF ", "
+ "OS waits " INT64PF "\n",
+ mutex_spin_wait_count_val, mutex_spin_round_count_val,
+ mutex_os_wait_count_val,
+ rw_s_spin_wait_count_val, rw_s_spin_round_count_val,
+ rw_s_os_wait_count_val,
+ rw_x_spin_wait_count_val, rw_x_spin_round_count_val,
+ rw_x_os_wait_count_val);
fprintf(file,
"Spin rounds per wait: %.2f mutex, %.2f RW-shared, "
"%.2f RW-excl\n",
- (double) mutex_spin_round_count /
- (mutex_spin_wait_count ? mutex_spin_wait_count : 1),
- (double) rw_lock_stats.rw_s_spin_round_count /
- (rw_lock_stats.rw_s_spin_wait_count
- ? rw_lock_stats.rw_s_spin_wait_count : 1),
- (double) rw_lock_stats.rw_x_spin_round_count /
- (rw_lock_stats.rw_x_spin_wait_count
- ? rw_lock_stats.rw_x_spin_wait_count : 1));
+ (double) mutex_spin_round_count_val /
+ (mutex_spin_wait_count_val ? mutex_spin_wait_count_val : 1LL),
+ (double) rw_s_spin_round_count_val /
+ (rw_s_spin_wait_count_val ? rw_s_spin_wait_count_val : 1LL),
+ (double) rw_x_spin_round_count_val /
+ (rw_x_spin_wait_count_val ? rw_x_spin_wait_count_val : 1LL));
}
/*******************************************************************//**
diff --git a/strings/ctype.c b/strings/ctype.c
index f871a219245..620c7e13503 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1030,19 +1030,18 @@ my_charset_is_ascii_compatible(CHARSET_INFO *cs)
@return Number of bytes copied to 'to' string
*/
-static uint32
-my_convert_internal(char *to, uint32 to_length,
- CHARSET_INFO *to_cs,
- const char *from, uint32 from_length,
- CHARSET_INFO *from_cs, uint *errors)
+uint32
+my_convert_using_func(char *to, uint32 to_length,
+ CHARSET_INFO *to_cs, my_charset_conv_wc_mb wc_mb,
+ const char *from, uint32 from_length,
+ CHARSET_INFO *from_cs, my_charset_conv_mb_wc mb_wc,
+ uint *errors)
{
int cnvres;
my_wc_t wc;
const uchar *from_end= (const uchar*) from + from_length;
char *to_start= to;
uchar *to_end= (uchar*) to + to_length;
- my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
- my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
uint error_count= 0;
while (1)
@@ -1119,8 +1118,11 @@ my_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
immediately switch to slow mb_wc->wc_mb method.
*/
if ((to_cs->state | from_cs->state) & MY_CS_NONASCII)
- return my_convert_internal(to, to_length, to_cs,
- from, from_length, from_cs, errors);
+ return my_convert_using_func(to, to_length,
+ to_cs, to_cs->cset->wc_mb,
+ from, from_length,
+ from_cs, from_cs->cset->mb_wc,
+ errors);
length= length2= MY_MIN(to_length, from_length);
@@ -1152,9 +1154,11 @@ my_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
uint32 copied_length= length2 - length;
to_length-= copied_length;
from_length-= copied_length;
- return copied_length + my_convert_internal(to, to_length, to_cs,
- from, from_length, from_cs,
- errors);
+ return copied_length + my_convert_using_func(to, to_length, to_cs,
+ to_cs->cset->wc_mb,
+ from, from_length, from_cs,
+ from_cs->cset->mb_wc,
+ errors);
}
}
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 1584a9e2cef..4178b20789d 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -831,7 +831,7 @@ void my_strerror(char *buf, size_t len, int nr)
(defined _XOPEN_SOURCE && (_XOPEN_SOURCE >= 600))) && \
! defined _GNU_SOURCE
strerror_r(nr, buf, len); /* I can build with or without GNU */
-#elif defined _GNU_SOURCE
+#elif defined(__GLIBC__) && defined (_GNU_SOURCE)
char *r= strerror_r(nr, buf, len);
if (r != buf) /* Want to help, GNU? */
strmake(buf, r, len - 1); /* Then don't. */
diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt
index 9455ad83849..ad5195a843e 100644
--- a/unittest/mysys/CMakeLists.txt
+++ b/unittest/mysys/CMakeLists.txt
@@ -13,9 +13,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc aes
- my_getopt
+MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring
+ aes
LINK_LIBRARIES mysys)
+MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys)
ADD_DEFINITIONS(${SSL_DEFINES})
diff --git a/unittest/mysys/dynstring-t.c b/unittest/mysys/dynstring-t.c
new file mode 100644
index 00000000000..fed8488da2c
--- /dev/null
+++ b/unittest/mysys/dynstring-t.c
@@ -0,0 +1,74 @@
+/* Copyright (c) 2016, MariaDB
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+//#include <my_global.h>
+#include <m_string.h>
+#include <my_sys.h>
+#include <tap.h>
+
+DYNAMIC_STRING str1;
+
+static void check(const char *res)
+{
+ ok(strcmp(str1.str, res) == 0, "strcmp: %s", str1.str);
+ str1.length= 0;
+}
+
+int main(void)
+{
+ plan(23);
+
+ IF_WIN(skip_all("Test of POSIX shell escaping rules, not for CMD.EXE\n"), );
+
+ ok(init_dynamic_string(&str1, NULL, 0, 32) == 0, "init");
+
+ ok(dynstr_append_os_quoted(&str1, "test1", NULL) == 0, "append");
+ check("'test1'");
+
+ ok(dynstr_append_os_quoted(&str1, "con", "cat", NULL) == 0, "append");
+ check("'concat'");
+
+ ok(dynstr_append_os_quoted(&str1, "", NULL) == 0, "append");
+ check("''");
+
+ ok(dynstr_append_os_quoted(&str1, "space inside", NULL) == 0, "append");
+ check("'space inside'");
+
+ ok(dynstr_append_os_quoted(&str1, "single'quote", NULL) == 0, "append");
+ check("'single'\"'\"'quote'");
+
+ ok(dynstr_append_os_quoted(&str1, "many'single'quotes", NULL) == 0, "append");
+ check("'many'\"'\"'single'\"'\"'quotes'");
+
+ ok(dynstr_append_os_quoted(&str1, "'single quoted'", NULL) == 0, "append");
+ check("''\"'\"'single quoted'\"'\"''");
+
+ ok(dynstr_append_os_quoted(&str1, "double\"quote", NULL) == 0, "append");
+ check("'double\"quote'");
+
+ ok(dynstr_append_os_quoted(&str1, "mixed\"single'and\"double'quotes", NULL) == 0, "append");
+ check("'mixed\"single'\"'\"'and\"double'\"'\"'quotes'");
+
+ ok(dynstr_append_os_quoted(&str1, "back\\space", NULL) == 0, "append");
+ check("'back\\space'");
+
+ ok(dynstr_append_os_quoted(&str1, "backspace\\'and\\\"quote", NULL) == 0, "append");
+ check("'backspace\\'\"'\"'and\\\"quote'");
+
+ dynstr_free(&str1);
+
+ return exit_status();
+}
+
diff --git a/unittest/strings/CMakeLists.txt b/unittest/strings/CMakeLists.txt
index 10791edfb61..245747538c9 100644
--- a/unittest/strings/CMakeLists.txt
+++ b/unittest/strings/CMakeLists.txt
@@ -1,3 +1,3 @@
-MY_ADD_TESTS(strings LINK_LIBRARIES strings)
+MY_ADD_TESTS(strings LINK_LIBRARIES strings mysys)
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index ca4669f81ba..3117cdf82ae 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -17,6 +17,10 @@
#include "vio_priv.h"
#ifdef HAVE_OPENSSL
+#ifndef HAVE_YASSL
+#include <openssl/dh.h>
+#include <openssl/bn.h>
+#endif
static my_bool ssl_algorithms_added = FALSE;
static my_bool ssl_error_strings_loaded= FALSE;
diff --git a/win/packaging/ca/CMakeLists.txt b/win/packaging/ca/CMakeLists.txt
index c57ae4b2113..04d5408b9c9 100644
--- a/win/packaging/ca/CMakeLists.txt
+++ b/win/packaging/ca/CMakeLists.txt
@@ -18,9 +18,6 @@ SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
-
-
-
ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY}