summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-03-23 22:36:46 +0100
committerSergei Golubchik <serg@mariadb.org>2016-03-23 22:36:46 +0100
commitf67a2211ec48b1b1502a7095c50cd9195d8235f8 (patch)
tree93e5d158a4a2a1dca4be915f8cf9dc79b3b6d96c
parenta75d26946423d2142921411bf7bdc731eba4df1a (diff)
parent2783fc7d14bc8ad16acfeb509d3b19615023f47a (diff)
downloadmariadb-git-f67a2211ec48b1b1502a7095c50cd9195d8235f8.tar.gz
Merge branch '10.1' into 10.2
-rw-r--r--Docs/mysql.info6
-rw-r--r--Docs/sp-imp-spec.txt4
-rw-r--r--INSTALL-SOURCE2
-rw-r--r--INSTALL-WIN-SOURCE2
-rw-r--r--VERSION1
-rw-r--r--client/mysql.cc2
-rw-r--r--client/mysql_upgrade.c2
-rw-r--r--client/mysqlcheck.c5
-rw-r--r--client/mysqltest.cc6
-rw-r--r--cmake/cpack_rpm.cmake13
-rw-r--r--cmake/plugin.cmake9
-rw-r--r--debian/additions/innotop/innotop4
-rw-r--r--debian/additions/innotop/innotop.12
-rwxr-xr-xdebian/additions/mysqlreport2
-rw-r--r--debian/control13
-rw-r--r--debian/copyright2
-rw-r--r--debian/mariadb-gssapi-client-10.1.files1
-rw-r--r--debian/mariadb-gssapi-server-10.1.files1
-rw-r--r--debian/mariadb-server-10.2.mysql-server.logrotate17
-rw-r--r--debian/mariadb-server-10.2.mysql.init5
-rw-r--r--debian/mariadb-server-10.2.postinst5
-rw-r--r--extra/yassl/src/yassl_error.cpp4
-rw-r--r--include/my_context.h2
-rw-r--r--include/mysql/service_progress_report.h2
-rw-r--r--libmysql/libmysql.c2
-rw-r--r--man/mysql-test-run.pl.12
-rw-r--r--mysql-test/README2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test2
-rw-r--r--mysql-test/include/mtr_warnings.sql2
-rw-r--r--mysql-test/lib/My/SafeProcess.pm2
-rw-r--r--mysql-test/lib/v1/mtr_report.pl2
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/r/analyze.result2
-rw-r--r--mysql-test/r/contributors.result6
-rw-r--r--mysql-test/r/delayed.result2
-rw-r--r--mysql-test/r/events_bugs.result2
-rw-r--r--mysql-test/r/func_gconcat.result81
-rw-r--r--mysql-test/r/func_group.result9
-rw-r--r--mysql-test/r/func_hybrid_type.result39
-rw-r--r--mysql-test/r/index_merge_myisam.result2
-rw-r--r--mysql-test/r/log_slow.result2
-rw-r--r--mysql-test/r/mysqlcheck.result60
-rw-r--r--mysql-test/r/mysqldump.result2
-rw-r--r--mysql-test/r/null.result40
-rw-r--r--mysql-test/r/row.result14
-rw-r--r--mysql-test/r/statistics.result14
-rw-r--r--mysql-test/r/subselect_mat.result24
-rw-r--r--mysql-test/r/subselect_sj_mat.result24
-rw-r--r--mysql-test/r/trigger_null-8605.result14
-rw-r--r--mysql-test/r/type_datetime.result17
-rw-r--r--mysql-test/r/type_num.result28
-rw-r--r--mysql-test/r/type_temporal_innodb.result156
-rw-r--r--mysql-test/r/type_time.result16
-rw-r--r--mysql-test/r/type_timestamp.result15
-rw-r--r--mysql-test/r/view.result19
-rw-r--r--mysql-test/std_data/empty_file0
-rw-r--r--mysql-test/suite/archive/partition_archive.result6
-rw-r--r--mysql-test/suite/archive/partition_archive.test7
-rw-r--r--mysql-test/suite/binlog/r/binlog_concurrent_drop_create.result52
-rw-r--r--mysql-test/suite/binlog/t/binlog_concurrent_drop_create.test85
-rw-r--r--mysql-test/suite/encryption/r/filekeys_emptyfile.result10
-rw-r--r--mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result19
-rw-r--r--mysql-test/suite/encryption/r/innodb-log-encrypt.result36
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_is.result14
-rw-r--r--mysql-test/suite/encryption/t/filekeys_emptyfile.opt1
-rw-r--r--mysql-test/suite/encryption/t/filekeys_emptyfile.test4
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt6
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test38
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt.test20
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_is.opt1
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_is.test31
-rw-r--r--mysql-test/suite/galera/disabled.def1
-rw-r--r--mysql-test/suite/galera/r/galera_forced_binlog_format.result35
-rw-r--r--mysql-test/suite/galera/r/galera_server.result20
-rw-r--r--mysql-test/suite/galera/r/galera_sync_wait_show.result8
-rw-r--r--mysql-test/suite/galera/t/galera_forced_binlog_format.test22
-rw-r--r--mysql-test/suite/galera/t/galera_server.test28
-rw-r--r--mysql-test/suite/galera/t/galera_sync_wait_show.test1
-rw-r--r--mysql-test/suite/innodb/r/innodb-agregate.result21
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result2
-rw-r--r--mysql-test/suite/innodb/t/innodb-agregate.test18
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-fic.result1
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result2
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb-zip.result2
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.test2
-rw-r--r--mysql-test/suite/parts/r/partition_repair_myisam.result1
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test2
-rw-r--r--mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test2
-rw-r--r--mysql-test/suite/plugins/r/simple_password_check.result2
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.result107
-rw-r--r--mysql-test/suite/roles/prepare_stmt_with_role.test85
-rw-r--r--mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorlog.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result2
-rw-r--r--mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test35
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_errorlog.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log.test33
-rw-r--r--mysql-test/suite/stress/include/ddl1.inc4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result46
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff41
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff219
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result28
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff231
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result28
-rw-r--r--mysql-test/suite/sys_vars/r/wait_timeout_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test61
-rw-r--r--mysql-test/suite/sys_vars/t/secure_file_priv.test40
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_basic.test14
-rw-r--r--mysql-test/t/delayed.test4
-rw-r--r--mysql-test/t/events_bugs.test2
-rw-r--r--mysql-test/t/func_gconcat.test41
-rw-r--r--mysql-test/t/func_group.test8
-rw-r--r--mysql-test/t/func_hybrid_type.test23
-rw-r--r--mysql-test/t/index_merge_myisam.test2
-rw-r--r--mysql-test/t/merge.test2
-rw-r--r--mysql-test/t/mysqld--help.test2
-rw-r--r--mysql-test/t/mysqldump.test2
-rw-r--r--mysql-test/t/null.test49
-rw-r--r--mysql-test/t/row.test11
-rw-r--r--mysql-test/t/statistics.test13
-rw-r--r--mysql-test/t/trigger_null-8605.test12
-rw-r--r--mysql-test/t/type_num.test24
-rw-r--r--mysql-test/t/type_temporal_innodb.test60
-rw-r--r--mysql-test/t/view.test17
-rw-r--r--mysys/lf_alloc-pin.c9
-rw-r--r--mysys/mf_iocache2.c2
-rw-r--r--mysys/mf_keycache.c2
-rw-r--r--mysys/my_default.c2
-rw-r--r--mysys/my_delete.c2
-rw-r--r--mysys/my_lock.c4
-rw-r--r--plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm2
-rw-r--r--plugin/aws_key_management/CMakeLists.txt154
-rw-r--r--plugin/aws_key_management/aws_key_management_plugin.cc587
-rw-r--r--plugin/cracklib_password_check/cracklib_password_check.c2
-rw-r--r--plugin/file_key_management/file_key_management_plugin.cc2
-rw-r--r--plugin/file_key_management/parser.cc2
-rw-r--r--plugin/handler_socket/docs-en/perl-client.en.txt6
-rw-r--r--plugin/handler_socket/handlersocket/database.cpp3
-rw-r--r--plugin/locale_info/locale_info.cc2
-rw-r--r--plugin/metadata_lock_info/metadata_lock_info.cc2
-rw-r--r--plugin/qc_info/qc_info.cc2
-rw-r--r--plugin/query_response_time/mysql-test/query_response_time/basic.result2
-rw-r--r--plugin/query_response_time/plugin.cc2
-rw-r--r--plugin/semisync/semisync_master.h6
-rw-r--r--plugin/semisync/semisync_master_plugin.cc2
-rw-r--r--plugin/semisync/semisync_slave_plugin.cc2
-rw-r--r--plugin/simple_password_check/simple_password_check.c2
-rw-r--r--plugin/sql_errlog/sql_errlog.c2
-rw-r--r--plugin/userstat/userstat.cc4
-rw-r--r--plugin/wsrep_info/plugin.cc4
-rw-r--r--scripts/mysqlaccess.sh18
-rw-r--r--scripts/wsrep_sst_rsync.sh17
-rw-r--r--sql-bench/bench-init.pl.sh4
-rw-r--r--sql-common/client_plugin.c2
-rw-r--r--sql-common/mysql_async.c12
-rw-r--r--sql/contributors.h8
-rw-r--r--sql/discover.cc5
-rw-r--r--sql/event_db_repository.cc2
-rw-r--r--sql/event_queue.cc2
-rw-r--r--sql/events.cc29
-rw-r--r--sql/field.cc50
-rw-r--r--sql/field_conv.cc3
-rw-r--r--sql/gcalc_slicescan.h2
-rw-r--r--sql/ha_partition.cc2
-rw-r--r--sql/handler.cc2
-rw-r--r--sql/handler.h4
-rw-r--r--sql/item.cc21
-rw-r--r--sql/item.h15
-rw-r--r--sql/item_cmpfunc.cc241
-rw-r--r--sql/item_cmpfunc.h114
-rw-r--r--sql/item_func.cc38
-rw-r--r--sql/item_func.h20
-rw-r--r--sql/item_row.h11
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/item_sum.cc56
-rw-r--r--sql/item_sum.h14
-rw-r--r--sql/log.cc14
-rw-r--r--sql/log_event.cc21
-rw-r--r--sql/log_event_old.cc4
-rw-r--r--sql/my_apc.cc2
-rw-r--r--sql/mysql_install_db.cc6
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/mysqld.h15
-rw-r--r--sql/rpl_parallel.cc6
-rw-r--r--sql/rpl_parallel.h2
-rw-r--r--sql/rpl_record.cc4
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/set_var.h6
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/signal_handler.cc4
-rw-r--r--sql/slave.cc1
-rw-r--r--sql/sp.cc79
-rw-r--r--sql/sp.h2
-rw-r--r--sql/sp_head.cc18
-rw-r--r--sql/sp_head.h2
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_admin.cc94
-rw-r--r--sql/sql_base.cc10
-rw-r--r--sql/sql_class.h6
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_join_cache.cc2
-rw-r--r--sql/sql_lex.cc32
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_parse.cc62
-rw-r--r--sql/sql_prepare.cc6
-rw-r--r--sql/sql_repl.cc4
-rw-r--r--sql/sql_select.cc77
-rw-r--r--sql/sql_select.h9
-rw-r--r--sql/sql_show.cc10
-rw-r--r--sql/sql_string.cc4
-rw-r--r--sql/sql_trigger.cc3
-rw-r--r--sql/sql_union.cc11
-rw-r--r--sql/sql_update.cc2
-rw-r--r--sql/sql_view.cc12
-rw-r--r--sql/sys_vars.cc13
-rw-r--r--sql/table.h57
-rw-r--r--sql/threadpool_win.cc4
-rw-r--r--sql/tztime.cc8
-rw-r--r--sql/wsrep_sst.cc134
-rw-r--r--storage/archive/ha_archive.cc2
-rw-r--r--storage/connect/ha_connect.cc31
-rw-r--r--storage/connect/mysql-test/connect/r/infoschema-9739.result12
-rw-r--r--storage/connect/mysql-test/connect/r/tbl.result45
-rw-r--r--storage/connect/mysql-test/connect/t/infoschema-9739.test9
-rw-r--r--storage/connect/mysql-test/connect/t/tbl.test45
-rw-r--r--storage/connect/odbconn.cpp9
-rw-r--r--storage/connect/plgcnx.h2
-rw-r--r--storage/connect/tabdos.cpp2
-rw-r--r--storage/connect/tabmysql.cpp4
-rw-r--r--storage/connect/tabodbc.cpp4
-rw-r--r--storage/connect/tabtbl.cpp4
-rw-r--r--storage/connect/tabtbl.h3
-rw-r--r--storage/connect/value.cpp33
-rw-r--r--storage/csv/ha_tina.h2
-rw-r--r--storage/federated/ha_federated.cc2
-rw-r--r--storage/federatedx/ha_federatedx.cc2
-rw-r--r--storage/innobase/fil/fil0crypt.cc37
-rw-r--r--storage/innobase/fil/fil0fil.cc8
-rw-r--r--storage/innobase/fts/fts0fts.cc2
-rw-r--r--storage/innobase/fts/fts0opt.cc2
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/handler/i_s.cc77
-rw-r--r--storage/innobase/include/fil0crypt.h1
-rw-r--r--storage/innobase/include/fts0priv.ic4
-rw-r--r--storage/innobase/include/log0recv.h12
-rw-r--r--storage/innobase/include/os0file.h7
-rw-r--r--storage/innobase/log/log0crypt.cc41
-rw-r--r--storage/innobase/log/log0log.cc21
-rw-r--r--storage/innobase/log/log0recv.cc32
-rw-r--r--storage/innobase/os/os0file.cc66
-rw-r--r--storage/innobase/row/row0merge.cc2
-rw-r--r--storage/innobase/ut/crc32_power8/crc32.S51
-rw-r--r--storage/maria/ma_packrec.c2
-rw-r--r--storage/mroonga/mrn_table.cpp8
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/myisam/mi_packrec.c2
-rw-r--r--storage/myisam/myisamlog.c2
-rw-r--r--storage/oqgraph/graphcore.cc6
-rw-r--r--storage/oqgraph/ha_oqgraph.cc6
-rw-r--r--storage/spider/spd_copy_tables.cc20
-rw-r--r--storage/spider/spd_direct_sql.cc20
-rw-r--r--storage/spider/spd_table.cc34
-rw-r--r--storage/tokudb/PerconaFT/buildheader/CMakeLists.txt4
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar_hidden.test4
-rw-r--r--storage/xtradb/fil/fil0crypt.cc37
-rw-r--r--storage/xtradb/fil/fil0fil.cc5
-rw-r--r--storage/xtradb/fts/fts0fts.cc2
-rw-r--r--storage/xtradb/fts/fts0opt.cc2
-rw-r--r--storage/xtradb/handler/ha_innodb.cc41
-rw-r--r--storage/xtradb/handler/i_s.cc81
-rw-r--r--storage/xtradb/handler/xtradb_i_s.cc6
-rw-r--r--storage/xtradb/include/fil0crypt.h1
-rw-r--r--storage/xtradb/include/fts0priv.ic4
-rw-r--r--storage/xtradb/include/log0recv.h3
-rw-r--r--storage/xtradb/log/log0crypt.cc41
-rw-r--r--storage/xtradb/log/log0log.cc36
-rw-r--r--storage/xtradb/log/log0online.cc2
-rw-r--r--storage/xtradb/log/log0recv.cc37
-rw-r--r--storage/xtradb/os/os0file.cc24
-rw-r--r--storage/xtradb/row/row0sel.cc6
-rw-r--r--storage/xtradb/ut/crc32_power8/crc32.S51
-rw-r--r--strings/str2int.c2
-rw-r--r--tests/async_queries.c2
-rw-r--r--tests/mysql_client_test.c8
-rw-r--r--tests/nonblock-wrappers.h2
-rw-r--r--win/packaging/CPackWixConfig.cmake4
298 files changed, 4434 insertions, 1471 deletions
diff --git a/Docs/mysql.info b/Docs/mysql.info
index 684c0d23437..02692f341d3 100644
--- a/Docs/mysql.info
+++ b/Docs/mysql.info
@@ -1,11 +1,11 @@
MariaDB is in most aspects identical to MySQL.
Differences between MySQL and MariaDB can be found at:
-http://kb.askmonty.org/en/mariadb-versus-mysql-features/
-http://kb.askmonty.org/en/mariadb-versus-mysql-compatibility/
+https://mariadb.com/kb/en/mariadb-vs-mysql-features/
+https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/
The MariaDB manual can be found at:
-http://kb.askmonty.org/
+https://mariadb.com/kb/
The MySQL Reference Manual is available in various formats on
http://dev.mysql.com/doc.
diff --git a/Docs/sp-imp-spec.txt b/Docs/sp-imp-spec.txt
index 9795dd72252..259d76ab5bb 100644
--- a/Docs/sp-imp-spec.txt
+++ b/Docs/sp-imp-spec.txt
@@ -243,7 +243,7 @@
in the caller's frame is set in the new context as well.
4) For each instruction, call its execute() method.
The result is a pointer to the next instruction to execute (or NULL)
- if an error occured.
+ if an error occurred.
5) On success, set the new values of the OUT and INOUT parameters in
the caller's frame.
@@ -853,7 +853,7 @@
// '*nextp' will be set to the index of the next instruction
// to execute. (For most instruction this will be the
// instruction following this one.)
- // Returns 0 on success, non-zero if some error occured.
+ // Returns 0 on success, non-zero if some error occurred.
virtual int execute(THD *, uint *nextp)
}
diff --git a/INSTALL-SOURCE b/INSTALL-SOURCE
index 32cfa9792a7..93c985f2c1d 100644
--- a/INSTALL-SOURCE
+++ b/INSTALL-SOURCE
@@ -1,3 +1,3 @@
Instructions for building MariaDB can be found at:
-https://kb.askmonty.org/en/compiling-mariadb-from-source/
+https://mariadb.com/kb/en/compiling-mariadb-from-source
diff --git a/INSTALL-WIN-SOURCE b/INSTALL-WIN-SOURCE
index 269bc2c3d1c..f10d13aa93b 100644
--- a/INSTALL-WIN-SOURCE
+++ b/INSTALL-WIN-SOURCE
@@ -1,3 +1,3 @@
Up-to-date instructions about building MariaDB on Windows can be found
-at: http://kb.askmonty.org/en/building-mariadb-on-windows
+at: https://mariadb.com/kb/en/Building_MariaDB_on_Windows
diff --git a/VERSION b/VERSION
index f2746ce77e1..368d3a7c331 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=0
-MYSQL_VERSION_EXTRA=
diff --git a/client/mysql.cc b/client/mysql.cc
index 3f1b796bedb..9c6320fe10a 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3354,7 +3354,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
end:
- /* Show warnings if any or error occured */
+ /* Show warnings if any or error occurred */
if (show_warnings == 1 && (warnings >= 1 || error))
print_warnings();
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 2e6e8030f34..cdeaebf478f 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -658,7 +658,7 @@ static int get_upgrade_info_file_name(char* name)
/*
Read the content of mysql_upgrade_info file and
compare the version number form file against
- version number wich mysql_upgrade was compiled for
+ version number which mysql_upgrade was compiled for
NOTE
This is an optimization to avoid running mysql_upgrade
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 9b7e1b6c8d4..627fbcb1873 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -277,8 +277,8 @@ static void usage(void)
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
- puts("Please consult the MariaDB/MySQL knowledgebase at");
- puts("http://kb.askmonty.org/v/mysqlcheck for latest information about");
+ puts("Please consult the MariaDB Knowledge Base at");
+ puts("https://mariadb.com/kb/en/mysqlcheck for latest information about");
puts("this program.");
print_defaults("my", load_default_groups);
puts("");
@@ -523,7 +523,6 @@ static int is_view(const char *table)
{
fprintf(stderr, "Failed to %s\n", query);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
- my_free(query);
DBUG_RETURN(-1);
}
res= mysql_store_result(sock);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 860e442a290..8fc8f30a9e4 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1104,7 +1104,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
Run query and dump the result to stderr in vertical format
NOTE! This function should be safe to call when an error
- has occured and thus any further errors will be ignored(although logged)
+ has occurred and thus any further errors will be ignored (although logged)
SYNOPSIS
show_query
@@ -1170,7 +1170,7 @@ static void show_query(MYSQL* mysql, const char* query)
is added to the warning stack, only print @@warning_count-1 warnings.
NOTE! This function should be safe to call when an error
- has occured and this any further errors will be ignored(although logged)
+ has occurred and this any further errors will be ignored(although logged)
SYNOPSIS
show_warnings_before_error
@@ -4699,7 +4699,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
master_pos_wait returned NULL. This indicates that
slave SQL thread is not started, the slave's master
information is not initialized, the arguments are
- incorrect, or an error has occured
+ incorrect, or an error has occurred
*/
die("%.*s failed: '%s' returned NULL " \
"indicating slave SQL thread failure",
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 4ec16369354..0e0a121dbb8 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -43,8 +43,8 @@ SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_SUMMARY}
It is GPL v2 licensed, which means you can use the it free of charge under the
conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
-MariaDB documentation can be found at http://kb.askmonty.org/
-MariaDB bug reports should be submitted through https://mariadb.atlassian.net/
+MariaDB documentation can be found at https://mariadb.com/kb
+MariaDB bug reports should be submitted through https://jira.mariadb.org
")
@@ -78,14 +78,16 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib"
+ "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd"
+ "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64"
"%ignore ${CMAKE_INSTALL_PREFIX}/sbin"
"%ignore ${CMAKE_INSTALL_PREFIX}/share"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/doc"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man"
- "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*"
- "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
+ "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1"
+ "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
)
@@ -123,6 +125,7 @@ SETA(CPACK_RPM_server_PACKAGE_OBSOLETES
"MySQL"
"mysql-server"
"MySQL-server"
+ "MariaDB-Galera-server"
"MySQL-OurDelta-server")
SETA(CPACK_RPM_server_PACKAGE_PROVIDES
"MariaDB"
@@ -176,7 +179,7 @@ MACRO(ALTERNATIVE_NAME real alt)
SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES")
SET(${p} "${${p}} ${alt} = ${ver} ${alt}%{?_isa} = ${ver} config(${alt}) = ${ver}")
SET(o "CPACK_RPM_${real}_PACKAGE_OBSOLETES")
- SET(${o} "${${o}} ${alt} ${alt}%{_isa}")
+ SET(${o} "${${o}} ${alt} ${alt}%{?_isa}")
ENDMACRO(ALTERNATIVE_NAME)
ALTERNATIVE_NAME("devel" "mysql-devel")
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 49c38b3577b..c4edd585a8d 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -74,7 +74,9 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(compat "with${compat}")
ENDIF()
- IF (compat STREQUAL ".")
+ IF (ARG_DISABLED)
+ SET(howtobuild NO)
+ ELSEIF (compat STREQUAL ".")
SET(howtobuild DYNAMIC)
ELSEIF (compat STREQUAL "with.")
IF (NOT ARG_MODULE_ONLY)
@@ -122,7 +124,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Build either static library or module
IF (PLUGIN_${plugin} MATCHES "(STATIC|AUTO|YES)" AND NOT ARG_MODULE_ONLY
- AND NOT ARG_DISABLED AND NOT ARG_CLIENT)
+ AND NOT ARG_CLIENT)
IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
# If there is a shared library from previous shared build,
@@ -178,8 +180,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE)
ENDIF()
ELSEIF(PLUGIN_${plugin} MATCHES "(DYNAMIC|AUTO|YES)"
- AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS
- AND NOT ARG_DISABLED)
+ AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
ADD_VERSION_INFO(${target} MODULE SOURCES)
ADD_LIBRARY(${target} MODULE ${SOURCES})
diff --git a/debian/additions/innotop/innotop b/debian/additions/innotop/innotop
index 646f0d7f0fb..9179a0d7a81 100644
--- a/debian/additions/innotop/innotop
+++ b/debian/additions/innotop/innotop
@@ -1503,7 +1503,7 @@ my %exprs = (
my %columns = (
active_secs => { hdr => 'SecsActive', num => 1, label => 'Seconds transaction has been active', },
- add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additonal pool allocated' },
+ add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additional pool allocated' },
attempted_op => { hdr => 'Action', num => 0, label => 'The action that caused the error' },
awe_mem_alloc => { hdr => 'AWE Memory', num => 1, label => '[Windows] AWE memory allocated' },
binlog_cache_overflow => { hdr => 'Binlog Cache', num => 1, label => 'Transactions too big for binlog cache that went to disk' },
@@ -10365,7 +10365,7 @@ show you something like this:
pages_modified Dirty Pages Pages modified (dirty IB_bp_pages_m
buf_pool_hit_rate Hit Rate Buffer pool hit rate IB_bp_buf_poo
total_mem_alloc Memory Total memory allocate IB_bp_total_m
- add_pool_alloc Add'l Pool Additonal pool alloca IB_bp_add_poo
+ add_pool_alloc Add'l Pool Additional pool alloca IB_bp_add_poo
The first line shows which table you're editing, and reminds you again to press
'?' for a list of key mappings. The rest is a tabular representation of the
diff --git a/debian/additions/innotop/innotop.1 b/debian/additions/innotop/innotop.1
index b2e7fce084e..fbb481f9b94 100644
--- a/debian/additions/innotop/innotop.1
+++ b/debian/additions/innotop/innotop.1
@@ -1579,7 +1579,7 @@ show you something like this:
\& pages_modified Dirty Pages Pages modified (dirty IB_bp_pages_m
\& buf_pool_hit_rate Hit Rate Buffer pool hit rate IB_bp_buf_poo
\& total_mem_alloc Memory Total memory allocate IB_bp_total_m
-\& add_pool_alloc Add\*(Aql Pool Additonal pool alloca IB_bp_add_poo
+\& add_pool_alloc Add\*(Aql Pool Additional pool alloca IB_bp_add_poo
.Ve
.PP
The first line shows which table you're editing, and reminds you again to press
diff --git a/debian/additions/mysqlreport b/debian/additions/mysqlreport
index 772d6399437..3e116bf4a43 100755
--- a/debian/additions/mysqlreport
+++ b/debian/additions/mysqlreport
@@ -366,7 +366,7 @@ sub read_relative_infiles
# The infile must begin with the system variable values.
# Therefore, the first occurance of Aborted_clients indicates the beginning
- # of the first set of status values if no sets have occured yet ($stat_n == 0).
+ # of the first set of status values if no sets have occurred yet ($stat_n == 0).
# In this case, the following status values are printed to the current fh,
# along with the system variable values read thus far, until Aborted_clients
# occurs again. Then begins the second and subsequent sets of status values.
diff --git a/debian/control b/debian/control
index 2e706e6b548..e88325b49a6 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends: bison,
libaio-dev,
libboost-dev,
libjudy-dev,
+ libkrb5-dev,
libncurses5-dev (>= 5.0-6~),
libpam0g-dev,
libreadline-gplv2-dev,
@@ -441,3 +442,15 @@ Depends: libcrack2 (>= 2.9.0), mariadb-server-10.2
Description: CrackLib Password Validation Plugin for MariaDB
This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.
+
+Package: mariadb-gssapi-server-10.1
+Section: database
+Architecture: any
+Depends: libgssapi-krb5-2, mariadb-server-10.1
+Description: GSSAPI authentication plugin for MariaDB server
+
+Package: mariadb-gssapi-client-10.1
+Section: database
+Architecture: any
+Depends: libgssapi-krb5-2, mariadb-client-10.1
+Description: GSSAPI authentication plugin for MariaDB client
diff --git a/debian/copyright b/debian/copyright
index 5207620b411..1a31a958b99 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -9,7 +9,7 @@ The MariaDB packages were initally made by http://ourdelta.org/, and
are now managed by the MariaDB development team,
maria-developers@lists.launchpad.net
-MariaDB can be downloaded from http://downloads.askmonty.org/mariadb/
+MariaDB can be downloaded from https://downloads.mariadb.org/
Copyright:
diff --git a/debian/mariadb-gssapi-client-10.1.files b/debian/mariadb-gssapi-client-10.1.files
new file mode 100644
index 00000000000..5a089e9352e
--- /dev/null
+++ b/debian/mariadb-gssapi-client-10.1.files
@@ -0,0 +1 @@
+usr/lib/mysql/plugin/auth_gssapi_client.so
diff --git a/debian/mariadb-gssapi-server-10.1.files b/debian/mariadb-gssapi-server-10.1.files
new file mode 100644
index 00000000000..d5e7b362a74
--- /dev/null
+++ b/debian/mariadb-gssapi-server-10.1.files
@@ -0,0 +1 @@
+usr/lib/mysql/plugin/auth_gssapi.so
diff --git a/debian/mariadb-server-10.2.mysql-server.logrotate b/debian/mariadb-server-10.2.mysql-server.logrotate
index 789ad353e43..a19e9ec46a2 100644
--- a/debian/mariadb-server-10.2.mysql-server.logrotate
+++ b/debian/mariadb-server-10.2.mysql-server.logrotate
@@ -10,18 +10,11 @@
compress
sharedscripts
postrotate
- test -x /usr/bin/mysqladmin || exit 0
+ test -x /usr/bin/mysqladmin || exit 0
- # If this fails, check debian.conf!
- MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
- if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
- # Really no mysqld or rather a missing debian-sys-maint user?
- # If this occurs and is not a error please report a bug.
- if ps cax | grep -q mysqld; then
- exit 1
- fi
- else
- $MYADMIN flush-logs
- fi
+ if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then
+ # If this fails, check debian.conf!
+ mysqladmin --defaults-file=/etc/mysql/debian.cnf flush-logs
+ fi
endscript
}
diff --git a/debian/mariadb-server-10.2.mysql.init b/debian/mariadb-server-10.2.mysql.init
index ba92317c1cd..d5d0ab4ba93 100644
--- a/debian/mariadb-server-10.2.mysql.init
+++ b/debian/mariadb-server-10.2.mysql.init
@@ -37,6 +37,9 @@ umask 077
# so break my scripts.
export HOME=/etc/mysql/
+# Source default config file.
+[ -r /etc/default/mariadb ] && . /etc/default/mariadb
+
## Fetch a particular option from mysql's invocation.
#
# Usage: void mysqld_get_param option
@@ -109,7 +112,7 @@ case "${1:-''}" in
/usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &
# 6s was reported in #352070 to be too little
- for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
+ for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-60}"); do
sleep 1
if mysqld_status check_alive nowarn ; then break; fi
log_progress_msg "."
diff --git a/debian/mariadb-server-10.2.postinst b/debian/mariadb-server-10.2.postinst
index 50b1000a26a..83f5d5e3cd0 100644
--- a/debian/mariadb-server-10.2.postinst
+++ b/debian/mariadb-server-10.2.postinst
@@ -240,7 +240,10 @@ db_stop # in case invoke failes
# Thus MariaDB server is started via init.d script, which in turn redirects to
# systemctl. If we upgrade from MySQL mysql.service may be masked, which also
# means init.d script is disabled. Unmask mysql service explicitely.
-deb-systemd-helper unmask mysql.service >/dev/null || true
+# Check first that the command exists, to avoid emitting any warning messages.
+if [ -x "$(command -v deb-systemd-helper)" ]; then
+ deb-systemd-helper unmask mysql.service > /dev/null
+fi
#DEBHELPER#
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index fec6a3394ca..f339655be3d 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -121,11 +121,11 @@ void SetErrorString(YasslError error, char* buffer)
break;
case certificate_error :
- strncpy(buffer, "unable to proccess cerificate", max);
+ strncpy(buffer, "unable to process cerificate", max);
break;
case privateKey_error :
- strncpy(buffer, "unable to proccess private key, bad format", max);
+ strncpy(buffer, "unable to process private key, bad format", max);
break;
case badVersion_error :
diff --git a/include/my_context.h b/include/my_context.h
index 228f0c18f62..ea0e3496887 100644
--- a/include/my_context.h
+++ b/include/my_context.h
@@ -178,7 +178,7 @@ struct mysql_async_context {
resumed, eg. whether we woke up due to connection completed or timeout
in mysql_real_connect_cont().
*/
- unsigned int events_occured;
+ unsigned int events_occurred;
/*
This is set to the result of the whole asynchronous operation when it
completes. It uses a union, as different calls have different return
diff --git a/include/mysql/service_progress_report.h b/include/mysql/service_progress_report.h
index 670b1c37630..7ec3aa4c946 100644
--- a/include/mysql/service_progress_report.h
+++ b/include/mysql/service_progress_report.h
@@ -22,7 +22,7 @@
if requested.
The functions are documented at
- http://kb.askmonty.org/en/progress-reporting#how-to-add-support-for-progress-reporting-to-a-storage-engine
+ https://mariadb.com/kb/en/progress-reporting/#how-to-add-support-for-progress-reporting-to-a-storage-engine
*/
#ifdef __cplusplus
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 69ddb155f52..d5d673bb895 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -2233,7 +2233,7 @@ static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row)
/*
Read one row from network: unbuffered non-cursor fetch.
- If last row was read, or error occured, erase this statement
+ If last row was read, or error occurred, erase this statement
from record pointing to object unbuffered fetch is performed from.
SYNOPSIS
diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1
index 883aef4d5ad..6292bd2ffcd 100644
--- a/man/mysql-test-run.pl.1
+++ b/man/mysql-test-run.pl.1
@@ -1583,7 +1583,7 @@ may fail in total, as each repetition is considered a new test case, which may i
\fB\-\-retry\-failure=\fR\fB\fIN\fR\fR
.sp
When using the \fB-\-retry\fR option to retry failed tests,
-stop when N failures have occured (default 2)\&. Setting it to 0 or 1 effectively turns off retries\&.
+stop when N failures have occurred (default 2)\&. Setting it to 0 or 1 effectively turns off retries\&.
.RE
.sp
.RS 4
diff --git a/mysql-test/README b/mysql-test/README
index 162551ad69c..0fba1cc07e3 100644
--- a/mysql-test/README
+++ b/mysql-test/README
@@ -11,7 +11,7 @@ All tests must pass. If one or more of them fail on your system, please
read the following manual section for instructions on how to report the
problem:
-http://kb.askmonty.org/v/reporting-bugs
+https://mariadb.com/kb/en/reporting-bugs
If you want to use an already running MySQL server for specific tests,
use the --extern option to mysql-test-run. Please note that in this mode,
diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
index e1faec8440b..0f46b00f683 100644
--- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
@@ -375,7 +375,7 @@ source include/start_slave.inc;
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
-CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
connection master;
TRUNCATE t1;
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 1ee0658204d..278add92ba5 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -133,7 +133,7 @@ INSERT INTO global_suppressions VALUES
("Slave: Query caused different errors on master and slave"),
("Slave: Table .* doesn't exist"),
("Slave: Table width mismatch"),
- ("Slave: The incident LOST_EVENTS occured on the master"),
+ ("Slave: The incident LOST_EVENTS occurred on the master"),
("Slave: Unknown error.* 1105"),
("Slave: Can't drop database.* database doesn't exist"),
("Warning:\s+One can only use the --user.*root"),
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index e7917f8fb16..a9b4f9a4ecc 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -34,7 +34,7 @@ package My::SafeProcess;
# will zap the "monitored process" and exit
# - the "monitored process" to exit, in which case it will exit
# itself with same exit code as the "monitored process"
-# - the parent process to send the "shutdown" signal in wich case
+# - the parent process to send the "shutdown" signal in which case
# monitor will kill the "monitored process" hard and exit
#
#
diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl
index e2556d17093..738236a731e 100644
--- a/mysql-test/lib/v1/mtr_report.pl
+++ b/mysql-test/lib/v1/mtr_report.pl
@@ -306,7 +306,7 @@ sub mtr_report_stats ($) {
/Slave: Query caused different errors on master and slave/ or
/Slave: Table .* doesn't exist/ or
/Slave: Table width mismatch/ or
- /Slave: The incident LOST_EVENTS occured on the master/ or
+ /Slave: The incident LOST_EVENTS occurred on the master/ or
/Slave: Unknown error.* 1105/ or
/Slave: Can't drop database.* database doesn't exist/ or
/Slave SQL:.*(?:error.* \d+|Query:.*)/ or
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 1575d6368ae..7e5292c1a8e 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -6183,7 +6183,7 @@ Misc options
failures before stopping, set with the --retry-failure
option
retry-failure=N When using the --retry option to retry failed tests,
- stop when N failures have occured (default $opt_retry_failure)
+ stop when N failures have occurred (default $opt_retry_failure)
reorder Reorder tests to get fewer server restarts
help Get this help text
diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result
index 5a05d1c5da8..9dff94ab08c 100644
--- a/mysql-test/r/analyze.result
+++ b/mysql-test/r/analyze.result
@@ -34,11 +34,9 @@ create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_g
insert into t1 values ('hello');
analyze table t1;
Table Op Msg_type Msg_text
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status OK
analyze table t1;
Table Op Msg_type Msg_text
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status Table is already up to date
drop table t1;
CREATE TABLE t1 (a int);
diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result
index 5669c6b5269..1820c0a5f06 100644
--- a/mysql-test/r/contributors.result
+++ b/mysql-test/r/contributors.result
@@ -3,12 +3,12 @@ Name Location Comment
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
+Visma http://visma.com Member of the MariaDB Foundation
+Nexedi http://www.nexedi.com 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
+Google USA Sponsoring encryption, parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
Sheeri Kritzer Boston, Mass. USA EFF contribution for UC2006 Auction
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index 0eb0661b0e2..98c8b599e88 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -379,7 +379,7 @@ SELECT * FROM t1 WHERE a=0;
a
# Connection con1
# Sending:
-ALTER TABLE t1 COMMENT 'test';
+ALTER TABLE t1 MODIFY a INT UNSIGNED;;
# Connection default
# Wait until ALTER TABLE is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (3);
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 8920c89fcab..bde4f1c785b 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -603,7 +603,7 @@ INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp(
ROLLBACK;
END IF;
END;|
-Sleep till the first INSERT into events_test.event_log occured
+Sleep till the first INSERT into events_test.event_log occurred
SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
Expect 1
1
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 0bc31a5e85b..9014450bef3 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -1119,3 +1119,84 @@ GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0)
1,1
2,2
DROP TABLE t1;
+#
+# WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
+# Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
+#
+SET group_concat_max_len= 9999999;
+CREATE TABLE t1 (f1 LONGTEXT , f2 INTEGER);
+INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+1500002
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC))
+1500002
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
+SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5)
+ccccc
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT f1))
+1500002
+SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2))
+1500002
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1))
+1500002
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
+SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5)
+AAAAA
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
+LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1)))
+1500002
+CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `GROUP_CONCAT(f1 order by f2)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `GROUP_CONCAT(UPPER(f1) ORDER BY f2)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SET group_concat_max_len= DEFAULT;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+1024
+Warnings:
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+SET group_concat_max_len= 499999;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+499999
+499999
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
+499999
+499999
+499999
+499999
+499999
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+Warning 1260 Row 5 was cut by GROUP_CONCAT()
+DROP TABLE t1;
+SET group_concat_max_len= DEFAULT;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 659580059b5..0d9d4ffff9f 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -2298,6 +2298,15 @@ id avg cast_avg
2 9223372036854775807.0000 9223372036854775807
DROP TABLE t1;
#
+# MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
+VAR_POP(1)
+0.0000
+DROP TABLE t1;
+#
# MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
#
CREATE TABLE t1 (id INT, a DOUBLE);
diff --git a/mysql-test/r/func_hybrid_type.result b/mysql-test/r/func_hybrid_type.result
index 95a8a8235d4..eeaa79e7dce 100644
--- a/mysql-test/r/func_hybrid_type.result
+++ b/mysql-test/r/func_hybrid_type.result
@@ -2175,10 +2175,10 @@ def case_____a_b 12 19 19 Y 128 0 63
def case_____b_a 12 19 19 Y 128 0 63
def coalesce_a_b 12 19 19 Y 128 0 63
def coalesce_b_a 12 19 19 Y 128 0 63
-def if_______a_b 12 10 19 Y 128 0 63
-def if_______b_a 12 10 19 Y 128 0 63
-def ifnull___a_b 12 10 19 Y 128 0 63
-def ifnull___b_a 12 10 19 Y 128 0 63
+def if_______a_b 12 19 19 Y 128 0 63
+def if_______b_a 12 19 19 Y 128 0 63
+def ifnull___a_b 12 19 19 Y 128 0 63
+def ifnull___b_a 12 19 19 Y 128 0 63
def least____a_b 12 10 19 Y 128 0 63
def least____b_a 12 10 19 Y 128 0 63
def greatest_a_b 12 10 19 Y 128 0 63
@@ -3396,5 +3396,36 @@ c1
DROP TABLE t2;
DROP TABLE t1;
#
+# MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+#
+SELECT CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END;
+CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END
+NULL
+SELECT CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END;
+CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END
+NULL
+SELECT CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END;
+CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END
+NULL
+SELECT COALESCE(COALESCE(NULL), 1.1) AS c0, IF(0, COALESCE(NULL), 1.1) AS c1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c0 246 4 3 Y 32896 1 63
+def c1 246 4 3 Y 32896 1 63
+c0 c1
+1.1 1.1
+#
+# MDEV-9752 Wrong data type for COALEASCE(?,1) in prepared statements
+#
+PREPARE stmt FROM "CREATE TABLE t1 AS SELECT CONCAT(COALESCE(?,1)) AS a, CONCAT(CASE WHEN TRUE THEN ? ELSE 1 END) AS b";
+SET @a=1;
+EXECUTE stmt USING @a,@a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(21) DEFAULT NULL,
+ `b` varchar(21) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
# End of 10.1 tests
#
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 9820170aa59..a857e2a21ff 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -1595,7 +1595,7 @@ explain select * from t1 where a=10 and b=10 or c=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b,c a,c 5,5 NULL 54 Using union(a,c); Using where
This will switch to sort-union (intersection will be gone, too,
-thats a known limitation:
+that's a known limitation:
set optimizer_switch='default,index_merge_union=off';
explain select * from t1 where a=10 and b=10 or c=10;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/log_slow.result b/mysql-test/r/log_slow.result
index f7670f3d3db..6a3f48506e3 100644
--- a/mysql-test/r/log_slow.result
+++ b/mysql-test/r/log_slow.result
@@ -9,8 +9,10 @@ select @@log_slow_verbosity;
show variables like "log_slow%";
Variable_name Value
+log_slow_admin_statements OFF
log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
log_slow_rate_limit 1
+log_slow_slave_statements OFF
log_slow_verbosity
set @org_slow_query_log= @@global.slow_query_log;
set @@log_slow_filter= "filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk,admin";
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index eb05f056321..033b4086985 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -7,34 +7,19 @@ mtr.test_suppressions OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
-mysql.event
-Warning : Engine-independent statistics are not collected for column 'body'
-Warning : Engine-independent statistics are not collected for column 'body_utf8'
-status : OK
+mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
-mysql.help_category
-Warning : Engine-independent statistics are not collected for column 'url'
-status : OK
+mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
-mysql.help_topic
-Warning : Engine-independent statistics are not collected for column 'description'
-Warning : Engine-independent statistics are not collected for column 'example'
-Warning : Engine-independent statistics are not collected for column 'url'
-status : OK
+mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
-mysql.proc
-Warning : Engine-independent statistics are not collected for column 'param_list'
-Warning : Engine-independent statistics are not collected for column 'returns'
-Warning : Engine-independent statistics are not collected for column 'body'
-Warning : Engine-independent statistics are not collected for column 'comment'
-Warning : Engine-independent statistics are not collected for column 'body_utf8'
-status : OK
+mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
@@ -46,12 +31,7 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
-mysql.user
-Warning : Engine-independent statistics are not collected for column 'ssl_cipher'
-Warning : Engine-independent statistics are not collected for column 'x509_issuer'
-Warning : Engine-independent statistics are not collected for column 'x509_subject'
-Warning : Engine-independent statistics are not collected for column 'authentication_string'
-status : OK
+mysql.user OK
mtr.global_suppressions Table is already up to date
mtr.test_suppressions Table is already up to date
mysql.column_stats OK
@@ -89,34 +69,19 @@ mysql.user OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
-mysql.event
-Warning : Engine-independent statistics are not collected for column 'body'
-Warning : Engine-independent statistics are not collected for column 'body_utf8'
-status : OK
+mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
-mysql.help_category
-Warning : Engine-independent statistics are not collected for column 'url'
-status : OK
+mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
-mysql.help_topic
-Warning : Engine-independent statistics are not collected for column 'description'
-Warning : Engine-independent statistics are not collected for column 'example'
-Warning : Engine-independent statistics are not collected for column 'url'
-status : OK
+mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
-mysql.proc
-Warning : Engine-independent statistics are not collected for column 'param_list'
-Warning : Engine-independent statistics are not collected for column 'returns'
-Warning : Engine-independent statistics are not collected for column 'body'
-Warning : Engine-independent statistics are not collected for column 'comment'
-Warning : Engine-independent statistics are not collected for column 'body_utf8'
-status : OK
+mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
@@ -128,12 +93,7 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
-mysql.user
-Warning : Engine-independent statistics are not collected for column 'ssl_cipher'
-Warning : Engine-independent statistics are not collected for column 'x509_issuer'
-Warning : Engine-independent statistics are not collected for column 'x509_subject'
-Warning : Engine-independent statistics are not collected for column 'authentication_string'
-status : OK
+mysql.user OK
mysql.column_stats Table is already up to date
mysql.columns_priv Table is already up to date
mysql.db Table is already up to date
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 6652701090c..559f8885b0d 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1821,7 +1821,7 @@ a b
Osnabrück Köln
drop table t1;
#
-# Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
+# Bug#15328 Segmentation fault occurred if my.cnf is invalid for escape sequence
#
--fields-optionally-enclosed-by="
#
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index cd4fa259b3f..3da7e4805c2 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -1531,6 +1531,46 @@ 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;
+create table t1 (col1 varchar(50) default null);
+insert into t1 (col1) values ('hello'), ('hello'), ('hello');
+create view v1 as select nullif(count(col1),0) from t1;
+select * from v1;
+nullif(count(col1),0)
+3
+select nullif(count(col1),0) from t1;
+nullif(count(col1),0)
+3
+drop view v1;
+drop table t1;
+select nullif((select 1), (select 2));
+nullif((select 1), (select 2))
+1
+create table t1 (f int);
+insert into t1 values (1),(2);
+select nullif( not f, 1 ) from t1;
+nullif( not f, 1 )
+0
+0
+drop table t1;
+set names utf8;
+create table t1 (f1 varchar(10));
+insert into t1 values ('2015-12-31');
+select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
+ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = '2015-12-31' then NULL else '2002-09-08' end) as datetime(6)),24)'
+drop table t1;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1 )";
+EXECUTE stmt;
+f1
+EXECUTE stmt;
+f1
+DROP TABLE t1;
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
+i
+DROP TABLE t1;
#
# End of 10.1 tests
#
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 59a606128f5..9a19c3b0604 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -50,6 +50,12 @@ 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 ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))`
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)));
+row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)))
+0
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)));
+row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)))
+NULL
SELECT (1,2,3)=(0,NULL,3);
(1,2,3)=(0,NULL,3)
0
@@ -130,7 +136,7 @@ ROW(c,2,3) IN(row(1,b,a), row(2,3,1))
0
0
1
-NULL
+0
select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1;
ROW(a,b,c) IN(row(1,2,3), row(3,2,1))
1
@@ -509,5 +515,11 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10))
DROP TABLE t1;
#
+# MDEV-9369 IN operator with ( num, NULL ) gives inconsistent result
+#
+SELECT (1,null) NOT IN ((2,2),(3,3)), (1,null) NOT IN ((2,2)), (1,null) NOT IN ((3,3));
+(1,null) NOT IN ((2,2),(3,3)) (1,null) NOT IN ((2,2)) (1,null) NOT IN ((3,3))
+1 1 1
+#
# End of 10.1 tests
#
diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result
index fdda572f396..be2e39665b3 100644
--- a/mysql-test/r/statistics.result
+++ b/mysql-test/r/statistics.result
@@ -1663,3 +1663,17 @@ FROM mysql.column_stats;
db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_frequency hist_size hist_type HEX(histogram)
test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL
drop table t1;
+#
+# MDEV-9590: Always print "Engine-independent statistic" warnings and
+# might be filtering columns unintentionally from engines
+#
+set use_stat_tables='NEVER';
+create table t1 (test blob);
+show variables like 'use_stat_tables';
+Variable_name Value
+use_stat_tables NEVER
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+drop table t1;
+set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index b5ec6082d68..c9fa7c0c672 100644
--- a/mysql-test/r/subselect_mat.result
+++ b/mysql-test/r/subselect_mat.result
@@ -762,6 +762,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_512
@@ -775,6 +779,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_512, t2_512, t3_512;
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
@@ -855,6 +863,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
@@ -868,6 +880,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
@@ -948,6 +964,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
@@ -961,6 +981,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));
diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result
index d5e9fc776f8..2f3777a47fd 100644
--- a/mysql-test/r/subselect_sj_mat.result
+++ b/mysql-test/r/subselect_sj_mat.result
@@ -787,6 +787,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_512
@@ -801,6 +805,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_512, t2_512, t3_512;
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
@@ -882,6 +890,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
@@ -896,6 +908,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
@@ -977,6 +993,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
@@ -991,6 +1011,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));
diff --git a/mysql-test/r/trigger_null-8605.result b/mysql-test/r/trigger_null-8605.result
index 85fc51987d7..e024bc6b7d2 100644
--- a/mysql-test/r/trigger_null-8605.result
+++ b/mysql-test/r/trigger_null-8605.result
@@ -341,3 +341,17 @@ 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;
+create table t1 (a int not null, primary key (a));
+insert into t1 (a) values (1);
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL
+create trigger t1bu before update on t1 for each row begin end;
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL
+insert into t1 (a) values (3);
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL
+drop table t1;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index d0cd2c97510..bf3b6a6b7da 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -747,7 +747,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref AtTime AtTime 6 const 1 100.00
Warnings:
-Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = '2010-02-22 18:40:07')
+Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = TIMESTAMP'2010-02-22 18:40:07')
DROP TABLE t1;
SET NAMES latin1;
#
@@ -963,21 +963,20 @@ a
2001-01-01 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
-Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01 00:00:00x')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01 00:00:00x') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@@ -993,20 +992,20 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ' 2001-01-01 00:00:00')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Incorrect datetime value: ' garbage '
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' garbage ') and (length(`test`.`t1`.`a`) = (30 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and (<cache>(length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@@ -1076,13 +1075,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
DROP TABLE t1;
#
# MDEV-8795 Equal expression propagation does not work for temporal literals
diff --git a/mysql-test/r/type_num.result b/mysql-test/r/type_num.result
index cbac7b6f445..9ee67ac8f33 100644
--- a/mysql-test/r/type_num.result
+++ b/mysql-test/r/type_num.result
@@ -1220,3 +1220,31 @@ Warning 1292 Truncated incorrect DOUBLE value: '1E+'
#
# End of 10.0 tests
#
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+#
+SELECT NULL+1 AS c0,
+COALESCE(NULL)+1 AS c2,
+COALESCE(COALESCE(NULL))+1 AS c3,
+''+1 AS c4,
+COALESCE('')+1 AS c5,
+COALESCE(COALESCE(''))+1 AS c6;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def c0 5 17 0 Y 32896 0 63
+def c2 5 17 0 Y 32896 0 63
+def c3 5 17 0 Y 32896 0 63
+def c4 5 23 1 N 32897 31 63
+def c5 5 17 1 N 32897 0 63
+def c6 5 17 1 N 32897 0 63
+c0 c2 c3 c4 c5 c6
+NULL NULL NULL 1 1 1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: ''
+#
+# Start of 10.1 tests
+#
diff --git a/mysql-test/r/type_temporal_innodb.result b/mysql-test/r/type_temporal_innodb.result
new file mode 100644
index 00000000000..425e499a5d3
--- /dev/null
+++ b/mysql-test/r/type_temporal_innodb.result
@@ -0,0 +1,156 @@
+#
+# MDEV-9604 crash in Item::save_in_field with empty enum value
+#
+SELECT TIME'00:00:00'='';
+TIME'00:00:00'=''
+1
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+CREATE TABLE t1 (a ENUM('a'), b TIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','00:00:00',0);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1 WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 00:00:00 0
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+DROP TABLE t1;
+SELECT DATE'0000-00-00'='';
+DATE'0000-00-00'=''
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+CREATE TABLE t1 (a ENUM('a'), b DATE, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00',0);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+DROP TABLE t1;
+SELECT TIMESTAMP'0000-00-00 00:00:00'='';
+TIMESTAMP'0000-00-00 00:00:00'=''
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+CREATE TABLE t1 (a ENUM('a'), b DATETIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00 00:00:00',0);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT * FROM t1 WHERE a=b;
+a b c
+ 0000-00-00 00:00:00 0
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: ''
+DROP TABLE t1;
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index e4347509d5e..e4525f34ab4 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -989,7 +989,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(00:00:00))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00)
# TIME cast + DATE literal
SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11';
a
@@ -999,7 +999,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(00:00:00))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00)
# TIME literal + DATE cast
SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11');
a
@@ -1029,7 +1029,7 @@ SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00))
# TIME-alike string literal + DATE literal
SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11';
a
@@ -1049,7 +1049,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00))
# TIME-alike integer literal + DATE literal
SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11';
a
@@ -1069,7 +1069,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)
# DATE cast + TIME literal
SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00';
a
@@ -1079,7 +1079,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)
# DATE cast + TIME-alike string literal
SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00';
a
@@ -1089,7 +1089,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)) and (coalesce(`test`.`t1`.`a`) = '00:00:00'))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = '00:00:00'))
# DATE cast + TIME-alike integer literal
SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
a
@@ -1099,7 +1099,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)) and (coalesce(`test`.`t1`.`a`) = 0))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = 0))
# DATE literal + TIME cast
SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00');
a
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index fcdef627ded..a579f6930a0 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -818,21 +818,20 @@ a
2001-01-01 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
-Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01 00:00:00x')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01 00:00:00x') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@@ -848,20 +847,20 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ' 2001-01-01 00:00:00')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Incorrect datetime value: ' garbage '
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' garbage ') and (length(`test`.`t1`.`a`) = (30 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and (<cache>(length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@@ -931,13 +930,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
DROP TABLE t1;
#
# End of 10.1 tests
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 18bbb0da2ab..4a295762530 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -826,6 +826,9 @@ drop table t2;
create table t1 (a int);
insert into t1 values (1), (2);
create view v1 as select 5 from t1 order by 1;
+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 5 AS `5` from `t1` order by 1 latin1 latin1_swedish_ci
select * from v1;
5
5
@@ -5884,6 +5887,22 @@ a
DROP VIEW v1;
DROP TABLE t1;
#
+# MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
+# produces invalid definition
+#
+CREATE TABLE t1 ( i INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS
+SELECT 3 AS three, COUNT(*) FROM t1 GROUP BY three;
+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 3 AS `three`,count(0) AS `COUNT(*)` from `t1` group by '' latin1 latin1_swedish_ci
+SELECT * FROM v1;
+three COUNT(*)
+3 2
+drop view v1;
+drop table t1;
+#
# End of 10.1 tests
#
#
diff --git a/mysql-test/std_data/empty_file b/mysql-test/std_data/empty_file
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/std_data/empty_file
diff --git a/mysql-test/suite/archive/partition_archive.result b/mysql-test/suite/archive/partition_archive.result
index eb1fca46522..c4cccc03a04 100644
--- a/mysql-test/suite/archive/partition_archive.result
+++ b/mysql-test/suite/archive/partition_archive.result
@@ -153,3 +153,9 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
#Cleanup.
DROP TABLE t1;
+create database mysqltest1;
+create table mysqltest1.t1 (a int not null, b int not null) engine=archive
+partition by list(a) subpartition by hash(b)
+(partition p1 values in (1),
+partition p2 values in (2));
+drop database mysqltest1;
diff --git a/mysql-test/suite/archive/partition_archive.test b/mysql-test/suite/archive/partition_archive.test
index 899f266c09c..aa2adb7e44d 100644
--- a/mysql-test/suite/archive/partition_archive.test
+++ b/mysql-test/suite/archive/partition_archive.test
@@ -147,3 +147,10 @@ SHOW CREATE TABLE t1;
--echo #Cleanup.
DROP TABLE t1;
+
+create database mysqltest1;
+create table mysqltest1.t1 (a int not null, b int not null) engine=archive
+ partition by list(a) subpartition by hash(b)
+ (partition p1 values in (1),
+ partition p2 values in (2));
+drop database mysqltest1;
diff --git a/mysql-test/suite/binlog/r/binlog_concurrent_drop_create.result b/mysql-test/suite/binlog/r/binlog_concurrent_drop_create.result
new file mode 100644
index 00000000000..8db1dc4b75e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_concurrent_drop_create.result
@@ -0,0 +1,52 @@
+include/master-slave.inc
+[connection master]
+RESET MASTER;
+DROP DATABASE IF EXISTS db_717;
+DROP EVENT IF EXISTS test.e_x1;
+set @saved_global_binlog_format = @@global.binlog_format;
+set @saved_local_binlog_format = @@session.binlog_format;
+SET GLOBAL BINLOG_FORMAT = STATEMENT;
+SET SESSION BINLOG_FORMAT = STATEMENT;
+CREATE DATABASE db_717;
+CREATE FUNCTION db_717.f1() RETURNS INT RETURN 1;
+DROP DATABASE db_717;
+CREATE FUNCTION db_717.f2() RETURNS INT RETURN 1;
+CREATE DATABASE db_717;
+CREATE EVENT db_717.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
+DROP DATABASE db_717;
+CREATE EVENT db_717.e_x2 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
+CREATE DATABASE db_717;
+CREATE EVENT test.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
+DROP DATABASE db_717;
+ALTER EVENT test.e_x1 RENAME TO db_717.e_x2;
+DROP EVENT test.e_x1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS test.e_x1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # CREATE DATABASE db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `db_717`.`f1`() RETURNS int(11)
+RETURN 1
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # CREATE DATABASE db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_717.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # CREATE DATABASE db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT test.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int)
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # DROP DATABASE db_717
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP EVENT test.e_x1
+SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format;
+SET SESSION BINLOG_FORMAT = @saved_local_binlog_format;
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog/t/binlog_concurrent_drop_create.test b/mysql-test/suite/binlog/t/binlog_concurrent_drop_create.test
new file mode 100644
index 00000000000..c885a7291f7
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_concurrent_drop_create.test
@@ -0,0 +1,85 @@
+# MDEV-717
+# DROP DATABASE and CREATE PROCEDURE|FUNCTION|EVENT
+# statements can appear in wrong order in the binlog.
+#
+# Note - the test can be undeterministic.
+
+--source include/master-slave.inc
+RESET MASTER;
+
+--disable_warnings
+DROP DATABASE IF EXISTS db_717;
+DROP EVENT IF EXISTS test.e_x1;
+--enable_warnings
+
+set @saved_global_binlog_format = @@global.binlog_format;
+set @saved_local_binlog_format = @@session.binlog_format;
+SET GLOBAL BINLOG_FORMAT = STATEMENT;
+SET SESSION BINLOG_FORMAT = STATEMENT;
+
+# test function creation
+CREATE DATABASE db_717;
+
+CREATE FUNCTION db_717.f1() RETURNS INT RETURN 1;
+
+--send
+
+DROP DATABASE db_717;
+
+--connection master1
+
+--error 0,ER_BAD_DB_ERROR
+
+CREATE FUNCTION db_717.f2() RETURNS INT RETURN 1;
+
+--connection master
+
+--reap
+
+# test event creation
+CREATE DATABASE db_717;
+
+CREATE EVENT db_717.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
+
+--send
+
+DROP DATABASE db_717;
+
+--connection master1
+
+--error 0,ER_BAD_DB_ERROR
+
+CREATE EVENT db_717.e_x2 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
+
+--connection master
+
+--reap
+
+# test event modification
+CREATE DATABASE db_717;
+
+CREATE EVENT test.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
+
+--send
+
+DROP DATABASE db_717;
+
+--connection master1
+
+--error 0,ER_BAD_DB_ERROR
+
+ALTER EVENT test.e_x1 RENAME TO db_717.e_x2;
+
+--connection master
+
+--reap
+
+DROP EVENT test.e_x1;
+
+source include/show_binlog_events.inc;
+
+SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format;
+SET SESSION BINLOG_FORMAT = @saved_local_binlog_format;
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/encryption/r/filekeys_emptyfile.result b/mysql-test/suite/encryption/r/filekeys_emptyfile.result
new file mode 100644
index 00000000000..f94f11d9f08
--- /dev/null
+++ b/mysql-test/suite/encryption/r/filekeys_emptyfile.result
@@ -0,0 +1,10 @@
+call mtr.add_suppression("System key id 1 is missing at");
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+FOUND /System key id 1 is missing at/ in mysqld.1.err
+create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
+ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+select plugin_status from information_schema.plugins
+where plugin_name = 'file_key_management';
+plugin_status
+# Test checks if opening an empty filekeys does not crash the server.
diff --git a/mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result b/mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result
new file mode 100644
index 00000000000..5310fb6ace2
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-log-encrypt-crash.result
@@ -0,0 +1,19 @@
+call mtr.add_suppression("InnoDB: New log files created, LSN=.*");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
+call mtr.add_suppression("InnoDB: Error: Table .*");
+CREATE TABLE t1 (
+pk bigint auto_increment,
+col_int int,
+col_int_key int,
+col_char char(12),
+col_char_key char(12),
+primary key (pk),
+key (`col_int_key` ),
+key (`col_char_key` )
+) ENGINE=InnoDB;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (NULL,1,1,'foo','foo'),(NULL,2,2,'bar','bar'),(NULL,3,3,'baz','baz'),(NULL,4,4,'qux','qux');
+INSERT INTO t2
+SELECT NULL, a1.col_int, a1.col_int_key, a1.col_char, a1.col_char_key
+FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5, t1 a6, t1 a7, t1 a8, t1 a9, t1 a10;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/r/innodb-log-encrypt.result b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
index 3e281efd08a..655e3023f7a 100644
--- a/mysql-test/suite/encryption/r/innodb-log-encrypt.result
+++ b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
@@ -8,7 +8,7 @@ begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
-insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('secredsecredsecred',10));
+insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
set current_num = current_num + 1;
end while;
end//
@@ -22,34 +22,34 @@ select count(*) from t1;
count(*)
2000
# ibdata1 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in ibdata1
+NOT FOUND /privatejanprivate/ in ibdata1
# t1 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in t1.ibd
+NOT FOUND /privatejanprivate/ in t1.ibd
# log0 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in ib_logfile0
+NOT FOUND /privatejanprivate/ in ib_logfile0
# log1 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in ib_logfile1
+NOT FOUND /privatejanprivate/ in ib_logfile1
# Restart mysqld --innodb_encrypt_log=0
-insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
# ibdata1 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in ibdata1
+NOT FOUND /privatejanprivate/ in ibdata1
# t1 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in t1.ibd
+NOT FOUND /privatejanprivate/ in t1.ibd
# log0 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in ib_logfile0
+NOT FOUND /privatejanprivate/ in ib_logfile0
# log1 yes on expecting NOT FOUND
-NOT FOUND /secredsecred/ in ib_logfile1
+NOT FOUND /privatejanprivate/ in ib_logfile1
# ibdata1 yes on expecting NOT FOUND
-NOT FOUND /notsecred/ in ibdata1
+NOT FOUND /publicmessage/ in ibdata1
# t1 yes on expecting NOT FOUND
-NOT FOUND /notsecred/ in t1.ibd
+NOT FOUND /publicmessage/ in t1.ibd
# log0 no on expecting FOUND/NOTFOUND depending where insert goes
-FOUND /notsecred/ in ib_logfile0
+FOUND /publicmessage/ in ib_logfile0
# log1 no on expecting FOUND/NOTFOUND depending where insert goes
-NOT FOUND /notsecred/ in ib_logfile1
+NOT FOUND /publicmessage/ in ib_logfile1
drop procedure innodb_insert_proc;
drop table t1;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption.result b/mysql-test/suite/encryption/r/innodb_encryption.result
index 283c78e33d3..9b762bbba11 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption.result
@@ -16,6 +16,7 @@ MIN_KEY_VERSION int(11) unsigned NO 0
CURRENT_KEY_VERSION int(11) unsigned NO 0
KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL
KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL
+CURRENT_KEY_ID int(11) unsigned NO 0
# Wait max 5 min for key encryption threads to encrypt one space
# Success!
# Wait max 10 min for key encryption threads to encrypt all space
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_is.result b/mysql-test/suite/encryption/r/innodb_encryption_is.result
new file mode 100644
index 00000000000..5bbcbbe6bb6
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_is.result
@@ -0,0 +1,14 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
+INSERT INTO t1 VALUES ('foobar');
+INSERT INTO t2 VALUES ('foobar');
+SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
+CURRENT_KEY_ID
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
+NAME ENCRYPTION_SCHEME MIN_KEY_VERSION CURRENT_KEY_VERSION CURRENT_KEY_ID
+test/t1 1 1 1 1
+test/t2 1 1 1 2
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/t/filekeys_emptyfile.opt b/mysql-test/suite/encryption/t/filekeys_emptyfile.opt
new file mode 100644
index 00000000000..7c5f6d05dde
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_emptyfile.opt
@@ -0,0 +1 @@
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/empty_file
diff --git a/mysql-test/suite/encryption/t/filekeys_emptyfile.test b/mysql-test/suite/encryption/t/filekeys_emptyfile.test
new file mode 100644
index 00000000000..39f2ccf260a
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_emptyfile.test
@@ -0,0 +1,4 @@
+let SEARCH_PATTERN=System key id 1 is missing at;
+source filekeys_badtest.inc;
+
+--echo # Test checks if opening an empty filekeys does not crash the server.
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt
new file mode 100644
index 00000000000..e76aa060879
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.opt
@@ -0,0 +1,6 @@
+--innodb-encrypt-log=ON
+--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
+--loose-file-key-management
+--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
+--file-key-management-encryption-algorithm=aes_cbc
+--innodb-buffer-pool-size=128M
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test
new file mode 100644
index 00000000000..8bb5f9f2c49
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test
@@ -0,0 +1,38 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source filekeys_plugin.inc
+
+call mtr.add_suppression("InnoDB: New log files created, LSN=.*");
+call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
+call mtr.add_suppression("InnoDB: Error: Table .*");
+
+#
+# MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables
+#
+
+CREATE TABLE t1 (
+ pk bigint auto_increment,
+ col_int int,
+ col_int_key int,
+ col_char char(12),
+ col_char_key char(12),
+ primary key (pk),
+ key (`col_int_key` ),
+ key (`col_char_key` )
+) ENGINE=InnoDB;
+CREATE TABLE t2 LIKE t1;
+
+INSERT INTO t1 VALUES (NULL,1,1,'foo','foo'),(NULL,2,2,'bar','bar'),(NULL,3,3,'baz','baz'),(NULL,4,4,'qux','qux');
+INSERT INTO t2
+ SELECT NULL, a1.col_int, a1.col_int_key, a1.col_char, a1.col_char_key
+ FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5, t1 a6, t1 a7, t1 a8, t1 a9, t1 a10;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server 0
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt.test b/mysql-test/suite/encryption/t/innodb-log-encrypt.test
index b2abfadccc2..7c2e6f847b1 100644
--- a/mysql-test/suite/encryption/t/innodb-log-encrypt.test
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt.test
@@ -28,7 +28,7 @@ begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
- insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('secredsecredsecred',10));
+ insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
set current_num = current_num + 1;
end while;
end//
@@ -43,13 +43,15 @@ set autocommit=1;
update t1 set c1 = c1 +1;
select count(*) from t1;
+-- source include/restart_mysqld.inc
+
--let $MYSQLD_DATADIR=`select @@datadir`
--let ib1_IBD = $MYSQLD_DATADIR/ibdata1
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
--let log0 = $MYSQLD_DATADIR/ib_logfile0
--let log1 = $MYSQLD_DATADIR/ib_logfile1
--let SEARCH_RANGE = 10000000
---let SEARCH_PATTERN=secredsecred
+--let SEARCH_PATTERN=privatejanprivate
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
@@ -68,13 +70,13 @@ select count(*) from t1;
-- let $restart_parameters=--innodb_encrypt_log=0
-- source include/restart_mysqld.inc
-insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
-insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
+insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
---let SEARCH_PATTERN=secredsecred
+--let SEARCH_PATTERN=privatejanprivate
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
@@ -88,7 +90,7 @@ insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10))
-- let SEARCH_FILE=$log1
-- source include/search_pattern_in_file.inc
---let SEARCH_PATTERN=notsecred
+--let SEARCH_PATTERN=publicmessage
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_is.opt b/mysql-test/suite/encryption/t/innodb_encryption_is.opt
new file mode 100644
index 00000000000..26c706840e8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_is.opt
@@ -0,0 +1 @@
+--loose-innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_is.test b/mysql-test/suite/encryption/t/innodb_encryption_is.test
new file mode 100644
index 00000000000..333bb84c634
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_is.test
@@ -0,0 +1,31 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.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;
+
+CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
+CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
+INSERT INTO t1 VALUES ('foobar');
+INSERT INTO t2 VALUES ('foobar');
+
+#
+# MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+#
+SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
+CURRENT_KEY_ID
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
+
+DROP TABLE t1, t2;
+
+# reset system
+--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
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 9391f97732b..25f20e01521 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -20,7 +20,6 @@ galera_parallel_simple : Failing sporadically
galera_bf_abort : Failing sporadically
galera_log_output_csv : Failing sporadically
galera_as_slave_preordered : wsrep-preordered is not available in MariaDB Galera cluster
-galera_forced_binlog_format : TODO: investigate
galera_gra_log : TODO: investigate
galera_as_slave_replication_bundle : TODO: investigate
galera_ssl_upgrade : TODO: investigate
diff --git a/mysql-test/suite/galera/r/galera_forced_binlog_format.result b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
index 857e44d2dfc..92e78685b58 100644
--- a/mysql-test/suite/galera/r/galera_forced_binlog_format.result
+++ b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
@@ -1,18 +1,43 @@
RESET MASTER;
SET SESSION binlog_format = 'STATEMENT';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
+Warnings:
+Warning 1105 MariaDB Galera does not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
-SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 249;
Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 <Pos> Gtid_list 1 <End_log_pos> []
+mysqld-bin.000001 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000001
+mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1
mysqld-bin.000001 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
-mysqld-bin.000001 <Pos> Query 1 <End_log_pos> BEGIN
+mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2
mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
-mysqld-bin.000001 <Pos> Write_rows 1 <End_log_pos> table_id: ### flags: STMT_END_F
+mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F
mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
-mysqld-bin.000001 <Pos> Query 1 <End_log_pos> BEGIN
+mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-3
mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
-mysqld-bin.000001 <Pos> Write_rows 1 <End_log_pos> table_id: ### flags: STMT_END_F
+mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F
mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
DROP TABLE t1;
+#
+# MDEV-9401: wsrep_forced_binlog_format with binlog causes crash
+#
+SET SESSION binlog_format = 'ROW';
+CREATE DATABASE testdb_9401;
+USE testdb_9401;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE USER dummy@localhost;
+GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
+FLUSH PRIVILEGES;
+SHOW GRANTS FOR dummy@localhost;
+Grants for dummy@localhost
+GRANT USAGE ON *.* TO 'dummy'@'localhost'
+GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
+DROP USER dummy@localhost;
+DROP DATABASE testdb_9401;
+# End of tests
diff --git a/mysql-test/suite/galera/r/galera_server.result b/mysql-test/suite/galera/r/galera_server.result
new file mode 100644
index 00000000000..ef81bf376b0
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_server.result
@@ -0,0 +1,20 @@
+# On node_1
+CREATE SERVER s1
+FOREIGN DATA WRAPPER mysql
+OPTIONS (HOST 'foo');
+# On node_2
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 foo 3306 mysql
+ALTER SERVER s1
+OPTIONS (HOST 'bar');
+# On node_1
+SELECT * FROM mysql.servers;
+Server_name Host Db Username Password Port Socket Wrapper Owner
+s1 bar 3306 mysql
+DROP SERVER s1;
+# On node_2
+SELECT COUNT(*)=0 FROM mysql.servers;
+COUNT(*)=0
+1
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-test/suite/galera/r/galera_sync_wait_show.result
index c719aaab5d8..2f030c26bb8 100644
--- a/mysql-test/suite/galera/r/galera_sync_wait_show.result
+++ b/mysql-test/suite/galera/r/galera_sync_wait_show.result
@@ -7,7 +7,7 @@ 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`()
+p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 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;
@@ -18,7 +18,7 @@ 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)
+f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 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;
@@ -30,10 +30,10 @@ 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
+tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 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
+event1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 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/t/galera_forced_binlog_format.test b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
index 934c15399e0..982276cc317 100644
--- a/mysql-test/suite/galera/t/galera_forced_binlog_format.test
+++ b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
@@ -20,6 +20,26 @@ INSERT INTO t1 VALUES (2);
--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
--replace_column 2 <Pos> 5 <End_log_pos>
-SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 249;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9401: wsrep_forced_binlog_format with binlog causes crash
+--echo #
+SET SESSION binlog_format = 'ROW';
+CREATE DATABASE testdb_9401;
+USE testdb_9401;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE USER dummy@localhost;
+GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
+FLUSH PRIVILEGES;
+SHOW GRANTS FOR dummy@localhost;
+# Cleanup
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
+DROP USER dummy@localhost;
+DROP DATABASE testdb_9401;
+
+--source include/galera_end.inc
+--echo # End of tests
+
diff --git a/mysql-test/suite/galera/t/galera_server.test b/mysql-test/suite/galera/t/galera_server.test
new file mode 100644
index 00000000000..30b39028b96
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_server.test
@@ -0,0 +1,28 @@
+# Test for CREATE/ALTER/DROP SERVER in Galera cluster
+
+--source include/galera_cluster.inc
+
+--connection node_1
+--echo # On node_1
+CREATE SERVER s1
+ FOREIGN DATA WRAPPER mysql
+ OPTIONS (HOST 'foo');
+
+--connection node_2
+--echo # On node_2
+SELECT * FROM mysql.servers;
+ALTER SERVER s1
+ OPTIONS (HOST 'bar');
+
+--connection node_1
+--echo # On node_1
+SELECT * FROM mysql.servers;
+DROP SERVER s1;
+
+--connection node_2
+--echo # On node_2
+SELECT COUNT(*)=0 FROM mysql.servers;
+
+--source include/galera_end.inc
+--echo # End of test
+
diff --git a/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-test/suite/galera/t/galera_sync_wait_show.test
index 0d0207a2ebe..250b1f76e98 100644
--- a/mysql-test/suite/galera/t/galera_sync_wait_show.test
+++ b/mysql-test/suite/galera/t/galera_sync_wait_show.test
@@ -4,6 +4,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--source include/have_debug.inc
--connection node_2
SET SESSION wsrep_sync_wait = 1;
diff --git a/mysql-test/suite/innodb/r/innodb-agregate.result b/mysql-test/suite/innodb/r/innodb-agregate.result
new file mode 100644
index 00000000000..d3e096c7eb0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-agregate.result
@@ -0,0 +1,21 @@
+create table t2 (a smallint(6) not null, b int(10) not null, name varchar(20), primary key(a,b), key(name)) engine=InnoDB;
+insert into t2 values (8355,3,"sanja"),(8355,4,"wlad"),(8366,5, "lawrin"),(8366,6,"markusjm");
+select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
+count(distinct name)
+1
+select count(distinct name) from t2 where a=8366 and b=5;
+count(distinct name)
+1
+select count(distinct name) from t2 where a=8366 and b between 5 and 5.5;
+count(distinct name)
+1
+select sum(distinct a) from t2 where a=8366 and b>=5 and b<=5;
+sum(distinct a)
+8366
+select sum(distinct a) from t2 where a=8366 and b=5;
+sum(distinct a)
+8366
+select sum(distinct a) from t2 where a=8366 and b between 5 and 5.5;
+sum(distinct a)
+8366
+drop table t2;
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 db7be5c9586..3280726729f 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
@@ -376,7 +376,7 @@ space_id page_id start_lsn end_lsn
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_changed_pages but the InnoDB storage engine is not installed
select * from information_schema.innodb_tablespaces_encryption;
-SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER
+SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_encryption but the InnoDB storage engine is not installed
select * from information_schema.innodb_tablespaces_scrubbing;
diff --git a/mysql-test/suite/innodb/t/innodb-agregate.test b/mysql-test/suite/innodb/t/innodb-agregate.test
new file mode 100644
index 00000000000..e15548c087a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-agregate.test
@@ -0,0 +1,18 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-9667: Server hangs after select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
+#
+
+create table t2 (a smallint(6) not null, b int(10) not null, name varchar(20), primary key(a,b), key(name)) engine=InnoDB;
+
+insert into t2 values (8355,3,"sanja"),(8355,4,"wlad"),(8366,5, "lawrin"),(8366,6,"markusjm");
+
+select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
+select count(distinct name) from t2 where a=8366 and b=5;
+select count(distinct name) from t2 where a=8366 and b between 5 and 5.5;
+select sum(distinct a) from t2 where a=8366 and b>=5 and b<=5;
+select sum(distinct a) from t2 where a=8366 and b=5;
+select sum(distinct a) from t2 where a=8366 and b between 5 and 5.5;
+
+drop table t2;
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result b/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
index ee7277af640..e5df6ca8b05 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
@@ -36,7 +36,6 @@ count
2
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
-test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('+MySQL -YourSQL' IN BOOLEAN MODE);
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
index e0ba456b51c..ea0ec381faa 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
@@ -247,7 +247,6 @@ articles CREATE TABLE `articles` (
ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body);
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
-test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will");
id title body
@@ -570,7 +569,6 @@ select @@innodb_ft_enable_stopword;
1
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
-test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will");
id title body
diff --git a/mysql-test/suite/innodb_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result
index 2113c6e1069..dbfae3c0630 100644
--- a/mysql-test/suite/innodb_zip/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result
@@ -122,11 +122,9 @@ a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
analyze table t1;
Table Op Msg_type Msg_text
-mysqltest_innodb_zip.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
mysqltest_innodb_zip.t1 analyze status OK
analyze table t2;
Table Op Msg_type Msg_text
-mysqltest_innodb_zip.t2 analyze Warning Engine-independent statistics are not collected for column 'b'
mysqltest_innodb_zip.t2 analyze status OK
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
table_schema table_name row_format data_length index_length
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
index 1eea038f8c9..4d98b5c2ee7 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
@@ -337,7 +337,7 @@ START SLAVE;
--source include/wait_for_slave_to_start.inc
--replace_result $gtid GTID
eval SELECT MASTER_GTID_WAIT("$gtid", 30);
-# The bug occured here, the slave would get an out-of-order binlog error
+# The bug occurred here, the slave would get an out-of-order binlog error
# due to trying to re-apply the 100-x-x transaction.
# Restart stopped multi-source connections, and sync up.
diff --git a/mysql-test/suite/parts/r/partition_repair_myisam.result b/mysql-test/suite/parts/r/partition_repair_myisam.result
index cbc425b48db..3652698f634 100644
--- a/mysql-test/suite/parts/r/partition_repair_myisam.result
+++ b/mysql-test/suite/parts/r/partition_repair_myisam.result
@@ -322,7 +322,6 @@ FLUSH TABLES;
# replacing p6 with a crashed MYD file (1) (splitted dynamic record)
ANALYZE TABLE t1_will_crash;
Table Op Msg_type Msg_text
-test.t1_will_crash analyze Warning Engine-independent statistics are not collected for column 'c'
test.t1_will_crash analyze status OK
OPTIMIZE TABLE t1_will_crash;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
index bf04e62e1b5..99f89bd3225 100644
--- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
@@ -1653,7 +1653,7 @@ if($print_details)
--enable_result_log
--horizontal_results
--echo # Dump detailed differences after - before statement execution
- --echo # 1. The statement executing connection and hopefully noone else
+ --echo # 1. The statement executing connection and hopefully no one else
SELECT @default_object_instance_begin;
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
index cefaf1de549..0ecb51af203 100644
--- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
+++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
@@ -1663,7 +1663,7 @@ if($print_details)
--enable_result_log
--horizontal_results
--echo # Dump detailed differences after - before statement execution
- --echo # 1. The statement executing connection and hopefully noone else
+ --echo # 1. The statement executing connection and hopefully no one else
SELECT @default_object_instance_begin;
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
COUNT_READ, SUM_NUMBER_OF_BYTES_READ,
diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result
index c74b4e99992..a0b43a94137 100644
--- a/mysql-test/suite/plugins/r/simple_password_check.result
+++ b/mysql-test/suite/plugins/r/simple_password_check.result
@@ -11,7 +11,7 @@ PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Simple password strength checks
PLUGIN_LICENSE GPL
LOAD_OPTION ON
-PLUGIN_MATURITY Alpha
+PLUGIN_MATURITY Gamma
PLUGIN_AUTH_VERSION 1.0
select * from information_schema.system_variables where variable_name like 'simple_password_check%' order by 1;
VARIABLE_NAME SIMPLE_PASSWORD_CHECK_DIGITS
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.result b/mysql-test/suite/roles/prepare_stmt_with_role.result
new file mode 100644
index 00000000000..e859b2e304b
--- /dev/null
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.result
@@ -0,0 +1,107 @@
+#
+# Test user to check if we can grant the created role to it.
+#
+create user test_user;
+#
+# First create the role.
+#
+SET @createRole = 'CREATE ROLE developers';
+PREPARE stmtCreateRole FROM @createRole;
+EXECUTE stmtCreateRole;
+#
+# Test to see if the role is created.
+#
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+user host is_role
+developers Y
+SHOW GRANTS;
+Grants for root@localhost
+GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+# Test reexecution.
+EXECUTE stmtCreateRole;
+ERROR HY000: Operation CREATE ROLE failed for 'developers'
+#
+# Now grant the role to the test user.
+#
+SET @grantRole = 'GRANT developers to test_user';
+PREPARE stmtGrantRole FROM @grantRole;
+EXECUTE stmtGrantRole;
+# Test reexecution.
+EXECUTE stmtGrantRole;
+#
+# We should see 2 entries in the roles_mapping table.
+#
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+% test_user developers N
+localhost root developers Y
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT developers TO 'test_user'@'%'
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Test revoking a role.
+#
+SET @revokeRole = 'REVOKE developers FROM test_user';
+PREPARE stmtRevokeRole FROM @revokeRole;
+EXECUTE stmtRevokeRole;
+EXECUTE stmtRevokeRole;
+ERROR HY000: Cannot revoke role 'developers' from: 'test_user'@'%'.
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+EXECUTE stmtGrantRole;
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT developers TO 'test_user'@'%'
+GRANT USAGE ON *.* TO 'test_user'@'%'
+EXECUTE stmtRevokeRole;
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Now drop the role.
+#
+SET @dropRole = 'DROP ROLE developers';
+PREPARE stmtDropRole FROM @dropRole;
+EXECUTE stmtDropRole;
+#
+# Check both user and roles_mapping table for traces of our role.
+#
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+user host is_role
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+SHOW GRANTS;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Test reexecution.
+#
+EXECUTE stmtCreateRole;
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+user host is_role
+developers Y
+SELECT * FROM mysql.roles_mapping;
+Host User Role Admin_option
+localhost root developers Y
+SHOW GRANTS;
+Grants for root@localhost
+GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+SHOW GRANTS FOR test_user;
+Grants for test_user@%
+GRANT USAGE ON *.* TO 'test_user'@'%'
+EXECUTE stmtDropRole;
+# Cleanup.
+DROP USER test_user;
diff --git a/mysql-test/suite/roles/prepare_stmt_with_role.test b/mysql-test/suite/roles/prepare_stmt_with_role.test
new file mode 100644
index 00000000000..516e9ddab34
--- /dev/null
+++ b/mysql-test/suite/roles/prepare_stmt_with_role.test
@@ -0,0 +1,85 @@
+--source include/not_embedded.inc
+
+
+--echo #
+--echo # Test user to check if we can grant the created role to it.
+--echo #
+create user test_user;
+--echo #
+--echo # First create the role.
+--echo #
+SET @createRole = 'CREATE ROLE developers';
+PREPARE stmtCreateRole FROM @createRole;
+EXECUTE stmtCreateRole;
+--echo #
+--echo # Test to see if the role is created.
+--echo #
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+SHOW GRANTS;
+
+--echo # Test reexecution.
+--error ER_CANNOT_USER
+EXECUTE stmtCreateRole;
+
+--echo #
+--echo # Now grant the role to the test user.
+--echo #
+SET @grantRole = 'GRANT developers to test_user';
+PREPARE stmtGrantRole FROM @grantRole;
+EXECUTE stmtGrantRole;
+--echo # Test reexecution.
+EXECUTE stmtGrantRole;
+
+--echo #
+--echo # We should see 2 entries in the roles_mapping table.
+--echo #
+--sorted_result
+SELECT * FROM mysql.roles_mapping;
+SHOW GRANTS FOR test_user;
+
+--echo #
+--echo # Test revoking a role.
+--echo #
+SET @revokeRole = 'REVOKE developers FROM test_user';
+PREPARE stmtRevokeRole FROM @revokeRole;
+EXECUTE stmtRevokeRole;
+--error ER_CANNOT_REVOKE_ROLE
+EXECUTE stmtRevokeRole;
+SHOW GRANTS FOR test_user;
+
+EXECUTE stmtGrantRole;
+SHOW GRANTS FOR test_user;
+EXECUTE stmtRevokeRole;
+SHOW GRANTS FOR test_user;
+
+--echo #
+--echo # Now drop the role.
+--echo #
+SET @dropRole = 'DROP ROLE developers';
+PREPARE stmtDropRole FROM @dropRole;
+EXECUTE stmtDropRole;
+
+--echo #
+--echo # Check both user and roles_mapping table for traces of our role.
+--echo #
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+SELECT * FROM mysql.roles_mapping;
+SHOW GRANTS;
+SHOW GRANTS FOR test_user;
+
+--echo #
+--echo # Test reexecution.
+--echo #
+EXECUTE stmtCreateRole;
+SELECT user, host,is_role FROM mysql.user
+WHERE user = 'developers';
+SELECT * FROM mysql.roles_mapping;
+
+SHOW GRANTS;
+SHOW GRANTS FOR test_user;
+EXECUTE stmtDropRole;
+
+--echo # Cleanup.
+DROP USER test_user;
diff --git a/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result b/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
new file mode 100644
index 00000000000..b036bde349a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+create table t1(id int auto_increment primary key);
+create table t2(id int auto_increment primary key);
+create table slave_only(id int auto_increment primary key);
+insert into slave_only values(NULL);
+create trigger t1i after insert on t1 for each row insert into slave_only values(NULL);
+stop slave;
+set global replicate_ignore_table="test.t2";
+start slave;
+insert into t2 values(NULL);
+insert into t1 values(NULL);
+drop table t1, t2, slave_only;
+stop slave;
+set global replicate_ignore_table="";
+start slave;
+drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index b8c718ff821..bd5b23c2228 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -142,8 +142,8 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
include/wait_for_slave_sql_error.inc [errno=1590]
-Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: error writing to the binary log'
-FOUND /Slave SQL: The incident LOST_EVENTS occured on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
+Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log'
+FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
SELECT * FROM t4 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
index ab615d0510a..e247ea9c2a7 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
@@ -39,6 +39,6 @@ a
4
5
FOUND /Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error/ in mysqld.2.err
-FOUND /Slave SQL: The incident LOST_EVENTS occured on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
+FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index 5e725e36389..7cb8168c6a9 100644
--- a/mysql-test/suite/rpl/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -16,9 +16,9 @@ a
2
3
4
-call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
include/wait_for_slave_sql_error.inc [errno=1590]
-Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: <none>'
+Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: <none>'
**** On Slave ****
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
index 06f9f5617b5..80f76169472 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
@@ -151,7 +151,7 @@ include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
-CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
index a4f76da1872..71edcd749e5 100644
--- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
@@ -152,7 +152,7 @@ include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
-CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
index 79b83b4ceb9..2de0f5ccd82 100644
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -76,6 +76,21 @@ ALTER TABLE t1 ADD INDEX id1(a);
INSERT INTO t1 values(1, sleep(3));
### Assertion is good. Both Master and Slave exhibit the
### same number of queries in slow log: 1
+********************************************************************
+**** TRUNCATE the slow log then check whether runtime changes of
+**** log_slow_slave_statements work without slave restart.
+********************************************************************
+SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements = off;
+TRUNCATE mysql.slow_log;
+INSERT INTO t1 values(1, sleep(3));;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
+sql_text
+SET @@global.log_slow_slave_statements = on;
+INSERT INTO t1 values(1, sleep(3));;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
+sql_text
+INSERT INTO t1 values(1, sleep(3))
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
index 06f9f5617b5..80f76169472 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
@@ -151,7 +151,7 @@ include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
-CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
diff --git a/mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test b/mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test
new file mode 100644
index 00000000000..405d1a929f1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/ignore_table_autoinc-9737.test
@@ -0,0 +1,35 @@
+#
+# MDEV-9737 Duplicate error in replication with slave triggers and auto increment
+#
+source include/master-slave.inc;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+
+
+create table t1(id int auto_increment primary key);
+create table t2(id int auto_increment primary key);
+
+sync_slave_with_master;
+create table slave_only(id int auto_increment primary key);
+insert into slave_only values(NULL);
+create trigger t1i after insert on t1 for each row insert into slave_only values(NULL);
+
+stop slave;
+set global replicate_ignore_table="test.t2";
+start slave;
+
+connection master;
+insert into t2 values(NULL);
+insert into t1 values(NULL);
+
+sync_slave_with_master;
+
+drop table t1, t2, slave_only;
+stop slave;
+set global replicate_ignore_table="";
+start slave;
+
+connection master;
+drop table t1, t2;
+
+source include/rpl_end.inc;
+
diff --git a/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test
index ff7d2801911..50b6e712b90 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum.test
@@ -299,7 +299,7 @@ if(!$log_error_)
}
--let SEARCH_FILE= $log_error_
--let SEARCH_RANGE=-50000
---let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occured on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
+--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
--source include/search_pattern_in_file.inc
SELECT * FROM t4 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test b/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test
index 24298e9893a..137ac6c0f5d 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_errorlog.test
@@ -66,7 +66,7 @@ if(!$log_error_)
--let SEARCH_RANGE=-50000
--let SEARCH_PATTERN=Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error
--source include/search_pattern_in_file.inc
---let SEARCH_PATTERN=Slave SQL: The incident LOST_EVENTS occured on the master\. Message: <none>, Internal MariaDB error code: 1590
+--let SEARCH_PATTERN=Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590
--source include/search_pattern_in_file.inc
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index c591a8261c4..adf20953b0f 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -22,7 +22,7 @@ eval SET GLOBAL debug_dbug= '$debug_save';
connection slave;
# Wait until SQL thread stops with error LOST_EVENT on master
-call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
let $slave_sql_errno= 1590;
let $show_slave_sql_error= 1;
source include/wait_for_slave_sql_error.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
index faf037a9dff..3505883c58e 100644
--- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
@@ -299,6 +299,39 @@ if ($master_slow_query == $slave_slow_query)
-- echo ### same number of queries in slow log: $master_slow_query
}
+-- echo ********************************************************************
+-- echo **** TRUNCATE the slow log then check whether runtime changes of
+-- echo **** log_slow_slave_statements work without slave restart.
+-- echo ********************************************************************
+
+SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements = off;
+TRUNCATE mysql.slow_log;
+
+-- connection master
+
+--disable_warnings
+-- eval $slow_query;
+--enable_warnings
+sync_slave_with_master;
+
+-- connection slave
+
+eval SELECT sql_text FROM mysql.slow_log WHERE sql_text like '$slow_query';
+
+SET @@global.log_slow_slave_statements = on;
+
+-- connection master
+
+--disable_warnings
+-- eval $slow_query;
+--enable_warnings
+sync_slave_with_master;
+
+-- connection slave
+
+eval SELECT sql_text FROM mysql.slow_log WHERE sql_text like '$slow_query';
+
-- connection master
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
diff --git a/mysql-test/suite/stress/include/ddl1.inc b/mysql-test/suite/stress/include/ddl1.inc
index 96adadc5af5..00e64cee395 100644
--- a/mysql-test/suite/stress/include/ddl1.inc
+++ b/mysql-test/suite/stress/include/ddl1.inc
@@ -111,10 +111,10 @@
#
# 6. Hints for analysis of test failures:
# 1. Look into the protocol and check in which ddl*.inc
-# script the difference to the expected result occured.
+# script the difference to the expected result occurred.
# 2. Comment the sourcing of all other ddl*.inc scripts
# out.
-# 3. Edit the ddl*.inc script where the error occured and
+# 3. Edit the ddl*.inc script where the error occurred and
# remove all
# - "--disable_query_log", "--disable_result_log"
# - successful passed subtests.
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
index 0335db8e859..ebb99559255 100644
--- a/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result
@@ -42,7 +42,9 @@ ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay=18446744073709551616;
-ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
+Warnings:
+Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
+Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '9223372036854775807'
set global innodb_thread_sleep_delay=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7'
diff --git a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
new file mode 100644
index 00000000000..daddc4af627
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
@@ -0,0 +1,46 @@
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_long_query_time= @@session.long_query_time;
+SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements;
+USE test;
+CREATE TABLE log_slow_admin_statements (
+i INT PRIMARY KEY AUTO_INCREMENT,
+j VARCHAR(255)
+) ENGINE=InnoDB;
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+SET SESSION long_query_time = 0;
+SET GLOBAL log_slow_admin_statements = on;
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
+CREATE PROCEDURE add_rows()
+BEGIN
+DECLARE count INT;
+SET count = 1;
+INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255));
+WHILE count <= 15 DO
+INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements;
+SET count = count + 1;
+END WHILE;
+END
+$
+CALL add_rows();
+OPTIMIZE TABLE log_slow_admin_statements;
+Table Op Msg_type Msg_text
+test.log_slow_admin_statements optimize note Table does not support optimize, doing recreate + analyze instead
+test.log_slow_admin_statements optimize status OK
+CHECK TABLE log_slow_admin_statements EXTENDED;
+Table Op Msg_type Msg_text
+test.log_slow_admin_statements check status OK
+DROP TABLE log_slow_admin_statements;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%';
+sql_text
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17
+OPTIMIZE TABLE log_slow_admin_statements
+CHECK TABLE log_slow_admin_statements EXTENDED
+DROP TABLE log_slow_admin_statements
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@session.long_query_time= @old_long_query_time;
+SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+DROP PROCEDURE add_rows;
+TRUNCATE TABLE mysql.slow_log;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
index 4ac8b9fb53b..cad46e36f42 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
@@ -1119,14 +1119,21 @@
VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000000
-@@ -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
@@ -1145,16 +1152,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
-@@ -2251,7 +2713,7 @@
+ NUMERIC_MIN_VALUE NULL
+ NUMERIC_MAX_VALUE NULL
+ NUMERIC_BLOCK_SIZE NULL
+@@ -2265,7 +2713,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 128
VARIABLE_SCOPE GLOBAL
@@ -1163,7 +1164,7 @@
VARIABLE_COMMENT Number of undo logs to use.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -2265,7 +2727,7 @@
+@@ -2279,7 +2727,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -1172,7 +1173,7 @@
VARIABLE_COMMENT Number of undo tablespaces to use.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 126
-@@ -2280,7 +2742,7 @@
+@@ -2294,7 +2742,7 @@
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -1181,7 +1182,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
@@ -1202,7 +1203,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
@@ -1223,12 +1224,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
@@ -1238,7 +1239,7 @@
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-@@ -2363,7 +2853,7 @@
+@@ -2377,7 +2853,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 4
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
index 59a04978a21..d2b99e23514 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
@@ -296,7 +296,7 @@
VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -1681,7 +1681,7 @@
+@@ -1695,7 +1695,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -305,7 +305,7 @@
VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1709,7 +1709,7 @@
+@@ -1737,7 +1737,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -314,7 +314,7 @@
VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1751,7 +1751,7 @@
+@@ -1779,7 +1779,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4194304
VARIABLE_SCOPE SESSION
@@ -323,7 +323,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -1761,14 +1761,14 @@
+@@ -1789,14 +1789,14 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_BINLOG_CACHE_SIZE
SESSION_VALUE NULL
@@ -341,7 +341,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1779,7 +1779,7 @@
+@@ -1807,7 +1807,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1073741824
VARIABLE_SCOPE GLOBAL
@@ -350,7 +350,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
-@@ -1789,14 +1789,14 @@
+@@ -1817,14 +1817,14 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE
SESSION_VALUE NULL
@@ -368,7 +368,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1807,7 +1807,7 @@
+@@ -1835,7 +1835,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 151
VARIABLE_SCOPE GLOBAL
@@ -377,7 +377,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
-@@ -1821,7 +1821,7 @@
+@@ -1849,7 +1849,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -386,7 +386,7 @@
VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1835,7 +1835,7 @@
+@@ -1863,7 +1863,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 20
VARIABLE_SCOPE SESSION
@@ -395,7 +395,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -1863,7 +1863,7 @@
+@@ -1891,7 +1891,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 64
VARIABLE_SCOPE SESSION
@@ -404,7 +404,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -1880,7 +1880,7 @@
+@@ -1908,7 +1908,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
@@ -413,7 +413,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1891,7 +1891,7 @@
+@@ -1919,7 +1919,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 20
VARIABLE_SCOPE SESSION
@@ -422,7 +422,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -1919,7 +1919,7 @@
+@@ -1947,7 +1947,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE SESSION
@@ -431,7 +431,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -1933,7 +1933,7 @@
+@@ -1961,7 +1961,7 @@
GLOBAL_VALUE_ORIGIN AUTO
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -440,7 +440,7 @@
VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -1947,7 +1947,7 @@
+@@ -1975,7 +1975,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16382
VARIABLE_SCOPE GLOBAL
@@ -449,7 +449,7 @@
VARIABLE_COMMENT Maximum number of prepared statements in the server
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -1961,7 +1961,7 @@
+@@ -1989,7 +1989,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4294967295
VARIABLE_SCOPE SESSION
@@ -458,7 +458,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1975,7 +1975,7 @@
+@@ -2003,7 +2003,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE SESSION
@@ -467,7 +467,7 @@
VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -1989,7 +1989,7 @@
+@@ -2017,7 +2017,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE SESSION
@@ -476,7 +476,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -2017,7 +2017,7 @@
+@@ -2045,7 +2045,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32
VARIABLE_SCOPE SESSION
@@ -485,7 +485,7 @@
VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2045,7 +2045,7 @@
+@@ -2073,7 +2073,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4294967295
VARIABLE_SCOPE GLOBAL
@@ -494,7 +494,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2059,7 +2059,7 @@
+@@ -2087,7 +2087,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -503,7 +503,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
-@@ -2073,7 +2073,7 @@
+@@ -2101,7 +2101,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8
VARIABLE_SCOPE GLOBAL
@@ -512,7 +512,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -2087,7 +2087,7 @@
+@@ -2115,7 +2115,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE SESSION
@@ -521,7 +521,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2101,7 +2101,7 @@
+@@ -2129,7 +2129,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 262144
VARIABLE_SCOPE SESSION
@@ -530,7 +530,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -2115,10 +2115,10 @@
+@@ -2143,10 +2143,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 256
VARIABLE_SCOPE SESSION
@@ -543,7 +543,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2129,7 +2129,7 @@
+@@ -2157,7 +2157,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -552,7 +552,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
-@@ -2143,7 +2143,7 @@
+@@ -2171,7 +2171,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 6
VARIABLE_SCOPE GLOBAL
@@ -561,7 +561,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
-@@ -2153,9 +2153,9 @@
+@@ -2181,9 +2181,9 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE
SESSION_VALUE NULL
@@ -573,7 +573,7 @@
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this
-@@ -2167,14 +2167,14 @@
+@@ -2195,14 +2195,14 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_MMAP_SIZE
SESSION_VALUE NULL
@@ -591,7 +591,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -2199,10 +2199,10 @@
+@@ -2227,10 +2227,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -604,7 +604,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2216,7 +2216,7 @@
+@@ -2244,7 +2244,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
NUMERIC_MIN_VALUE 4096
@@ -613,7 +613,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2269,7 +2269,7 @@
+@@ -2297,7 +2297,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16384
VARIABLE_SCOPE SESSION
@@ -622,7 +622,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
-@@ -2283,7 +2283,7 @@
+@@ -2311,7 +2311,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 30
VARIABLE_SCOPE SESSION
@@ -631,7 +631,7 @@
VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2297,7 +2297,7 @@
+@@ -2325,7 +2325,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE SESSION
@@ -640,7 +640,7 @@
VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2311,7 +2311,7 @@
+@@ -2339,7 +2339,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 60
VARIABLE_SCOPE SESSION
@@ -649,7 +649,7 @@
VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2381,7 +2381,7 @@
+@@ -2409,7 +2409,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -658,7 +658,7 @@
VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1
-@@ -2395,7 +2395,7 @@
+@@ -2423,7 +2423,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 62
VARIABLE_SCOPE SESSION
@@ -667,7 +667,7 @@
VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2409,7 +2409,7 @@
+@@ -2437,7 +2437,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE SESSION
@@ -676,7 +676,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
-@@ -2437,7 +2437,7 @@
+@@ -2465,7 +2465,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -685,7 +685,7 @@
VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5
-@@ -2465,7 +2465,7 @@
+@@ -2493,7 +2493,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -694,7 +694,7 @@
VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2479,7 +2479,7 @@
+@@ -2507,7 +2507,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -703,7 +703,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 200
-@@ -2493,7 +2493,7 @@
+@@ -2521,7 +2521,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -712,7 +712,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2507,7 +2507,7 @@
+@@ -2535,7 +2535,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -721,7 +721,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2521,7 +2521,7 @@
+@@ -2549,7 +2549,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -730,7 +730,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2535,7 +2535,7 @@
+@@ -2563,7 +2563,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -739,7 +739,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2549,7 +2549,7 @@
+@@ -2577,7 +2577,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -748,7 +748,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2563,7 +2563,7 @@
+@@ -2591,7 +2591,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -757,7 +757,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2577,7 +2577,7 @@
+@@ -2605,7 +2605,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -766,7 +766,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2591,7 +2591,7 @@
+@@ -2619,7 +2619,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 80
VARIABLE_SCOPE GLOBAL
@@ -775,7 +775,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2605,7 +2605,7 @@
+@@ -2633,7 +2633,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -784,7 +784,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2619,7 +2619,7 @@
+@@ -2647,7 +2647,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -793,7 +793,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2633,7 +2633,7 @@
+@@ -2661,7 +2661,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 50
VARIABLE_SCOPE GLOBAL
@@ -802,7 +802,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2647,7 +2647,7 @@
+@@ -2675,7 +2675,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32768
VARIABLE_SCOPE GLOBAL
@@ -811,7 +811,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2661,7 +2661,7 @@
+@@ -2689,7 +2689,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -820,7 +820,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2675,7 +2675,7 @@
+@@ -2703,7 +2703,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 200
VARIABLE_SCOPE GLOBAL
@@ -829,7 +829,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2689,7 +2689,7 @@
+@@ -2717,7 +2717,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -838,7 +838,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2703,7 +2703,7 @@
+@@ -2731,7 +2731,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 40
VARIABLE_SCOPE GLOBAL
@@ -847,7 +847,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2717,7 +2717,7 @@
+@@ -2745,7 +2745,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -856,7 +856,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2731,7 +2731,7 @@
+@@ -2759,7 +2759,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE GLOBAL
@@ -865,7 +865,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2745,7 +2745,7 @@
+@@ -2773,7 +2773,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -874,7 +874,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2759,7 +2759,7 @@
+@@ -2787,7 +2787,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 150
VARIABLE_SCOPE GLOBAL
@@ -883,16 +883,16 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2773,7 +2773,7 @@
+@@ -2801,7 +2801,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 178
+ DEFAULT_VALUE 181
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2787,7 +2787,7 @@
+@@ -2815,7 +2815,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -901,7 +901,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2801,7 +2801,7 @@
+@@ -2829,7 +2829,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -910,7 +910,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2815,7 +2815,7 @@
+@@ -2843,7 +2843,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 50
VARIABLE_SCOPE GLOBAL
@@ -919,7 +919,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2829,7 +2829,7 @@
+@@ -2857,7 +2857,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -928,7 +928,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2843,7 +2843,7 @@
+@@ -2871,7 +2871,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -937,7 +937,7 @@
VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2857,7 +2857,7 @@
+@@ -2885,7 +2885,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -946,7 +946,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
-@@ -2871,7 +2871,7 @@
+@@ -2899,7 +2899,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -955,7 +955,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2885,7 +2885,7 @@
+@@ -2913,7 +2913,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -964,7 +964,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2955,7 +2955,7 @@
+@@ -2983,7 +2983,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32768
VARIABLE_SCOPE SESSION
@@ -973,7 +973,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -2983,7 +2983,7 @@
+@@ -3011,7 +3011,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 15
VARIABLE_SCOPE SESSION
@@ -982,7 +982,7 @@
VARIABLE_COMMENT Limit of query profiling memory
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -2997,7 +2997,7 @@
+@@ -3025,7 +3025,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 5
VARIABLE_SCOPE SESSION
@@ -991,7 +991,20 @@
VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3067,7 +3067,7 @@
+@@ -3081,10 +3081,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION ONLY
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT This variable is for internal server use
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3095,7 +3095,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16384
VARIABLE_SCOPE SESSION
@@ -1000,7 +1013,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3081,7 +3081,7 @@
+@@ -3109,7 +3109,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -1009,7 +1022,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3095,7 +3095,7 @@
+@@ -3123,7 +3123,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4096
VARIABLE_SCOPE GLOBAL
@@ -1018,7 +1031,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3112,7 +3112,7 @@
+@@ -3140,7 +3140,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
@@ -1027,7 +1040,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3165,7 +3165,7 @@
+@@ -3193,7 +3193,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 24576
VARIABLE_SCOPE SESSION
@@ -1036,7 +1049,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3179,7 +3179,7 @@
+@@ -3207,7 +3207,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4096
VARIABLE_SCOPE SESSION
@@ -1045,7 +1058,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
-@@ -3193,7 +3193,7 @@
+@@ -3221,7 +3221,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 131072
VARIABLE_SCOPE SESSION
@@ -1054,7 +1067,7 @@
VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -3221,7 +3221,7 @@
+@@ -3249,7 +3249,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 262144
VARIABLE_SCOPE SESSION
@@ -1063,7 +1076,7 @@
VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 2147483647
-@@ -3235,10 +3235,10 @@
+@@ -3263,10 +3263,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8388608
VARIABLE_SCOPE SESSION
@@ -1076,7 +1089,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3277,7 +3277,7 @@
+@@ -3305,7 +3305,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 0
VARIABLE_SCOPE SESSION
@@ -1085,7 +1098,7 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3375,7 +3375,7 @@
+@@ -3403,7 +3403,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1073741824
VARIABLE_SCOPE GLOBAL
@@ -1094,7 +1107,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3389,7 +3389,7 @@
+@@ -3417,7 +3417,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
@@ -1103,7 +1116,7 @@
VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -3448,7 +3448,7 @@
+@@ -3476,7 +3476,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
NUMERIC_MIN_VALUE 1024
@@ -1112,7 +1125,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3725,7 +3725,7 @@
+@@ -3753,7 +3753,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 256
VARIABLE_SCOPE GLOBAL
@@ -1121,7 +1134,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
-@@ -3795,7 +3795,7 @@
+@@ -3823,7 +3823,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 400
VARIABLE_SCOPE GLOBAL
@@ -1130,7 +1143,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 524288
-@@ -3809,7 +3809,7 @@
+@@ -3837,7 +3837,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
@@ -1139,16 +1152,16 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 524288
-@@ -3823,7 +3823,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
+@@ -3851,7 +3851,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 256
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT How many threads we should keep in a cache for reuse
+ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -3837,7 +3837,7 @@
+@@ -3865,7 +3865,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE GLOBAL
@@ -1157,7 +1170,7 @@
VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 512
-@@ -3952,7 +3952,7 @@
+@@ -3980,7 +3980,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table
NUMERIC_MIN_VALUE 1024
@@ -1166,7 +1179,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3963,7 +3963,7 @@
+@@ -3991,7 +3991,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8192
VARIABLE_SCOPE SESSION
@@ -1175,7 +1188,7 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -3977,7 +3977,7 @@
+@@ -4005,7 +4005,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4096
VARIABLE_SCOPE SESSION
@@ -1184,7 +1197,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -4075,7 +4075,7 @@
+@@ -4103,7 +4103,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 28800
VARIABLE_SCOPE SESSION
@@ -1193,7 +1206,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -4179,7 +4179,7 @@
+@@ -4207,7 +4207,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -1202,7 +1215,7 @@
VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -4192,7 +4192,7 @@
+@@ -4220,7 +4220,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1211,7 +1224,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4202,7 +4202,7 @@
+@@ -4230,7 +4230,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1220,7 +1233,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4287,7 +4287,7 @@
+@@ -4315,7 +4315,7 @@
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 7dbbc0865fe..cfd336ef15b 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -1661,6 +1661,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_FILTER
SESSION_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
GLOBAL_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
@@ -1689,6 +1703,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_SLOW_SLAVE_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_VERBOSITY
SESSION_VALUE
GLOBAL_VALUE
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
index 62294b7c13c..650bdc24681 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
@@ -1,5 +1,5 @@
--- suite/sys_vars/r/sysvars_server_notembedded.result
-+++ suite/sys_vars/r/sysvars_server_notembedded,32bit.reject
++++ suite/sys_vars/r/sysvars_server_notembedded.reject
@@ -57,7 +57,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 1
@@ -296,7 +296,7 @@
VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -1849,7 +1849,7 @@
+@@ -1863,7 +1863,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -305,7 +305,7 @@
VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1877,7 +1877,7 @@
+@@ -1905,7 +1905,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -314,7 +314,7 @@
VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1933,7 +1933,7 @@
+@@ -1961,7 +1961,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4194304
VARIABLE_SCOPE SESSION
@@ -323,7 +323,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -1943,14 +1943,14 @@
+@@ -1971,14 +1971,14 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_BINLOG_CACHE_SIZE
SESSION_VALUE NULL
@@ -341,7 +341,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1961,7 +1961,7 @@
+@@ -1989,7 +1989,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1073741824
VARIABLE_SCOPE GLOBAL
@@ -350,7 +350,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
-@@ -1971,14 +1971,14 @@
+@@ -1999,14 +1999,14 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE
SESSION_VALUE NULL
@@ -368,7 +368,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1989,7 +1989,7 @@
+@@ -2017,7 +2017,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 151
VARIABLE_SCOPE GLOBAL
@@ -377,7 +377,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
-@@ -2003,7 +2003,7 @@
+@@ -2031,7 +2031,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -386,7 +386,7 @@
VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2017,7 +2017,7 @@
+@@ -2045,7 +2045,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 20
VARIABLE_SCOPE SESSION
@@ -395,7 +395,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -2045,7 +2045,7 @@
+@@ -2073,7 +2073,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 64
VARIABLE_SCOPE SESSION
@@ -404,7 +404,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -2062,7 +2062,7 @@
+@@ -2090,7 +2090,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
@@ -413,7 +413,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2073,7 +2073,7 @@
+@@ -2101,7 +2101,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 20
VARIABLE_SCOPE SESSION
@@ -422,7 +422,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -2101,7 +2101,7 @@
+@@ -2129,7 +2129,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE SESSION
@@ -431,7 +431,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -2115,7 +2115,7 @@
+@@ -2143,7 +2143,7 @@
GLOBAL_VALUE_ORIGIN AUTO
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -440,7 +440,7 @@
VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -2129,7 +2129,7 @@
+@@ -2157,7 +2157,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16382
VARIABLE_SCOPE GLOBAL
@@ -449,7 +449,7 @@
VARIABLE_COMMENT Maximum number of prepared statements in the server
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2157,7 +2157,7 @@
+@@ -2185,7 +2185,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4294967295
VARIABLE_SCOPE SESSION
@@ -458,7 +458,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2171,7 +2171,7 @@
+@@ -2199,7 +2199,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE SESSION
@@ -467,7 +467,7 @@
VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -2185,7 +2185,7 @@
+@@ -2213,7 +2213,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE SESSION
@@ -476,7 +476,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -2213,7 +2213,7 @@
+@@ -2241,7 +2241,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32
VARIABLE_SCOPE SESSION
@@ -485,7 +485,7 @@
VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2241,7 +2241,7 @@
+@@ -2269,7 +2269,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4294967295
VARIABLE_SCOPE GLOBAL
@@ -494,7 +494,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2255,7 +2255,7 @@
+@@ -2283,7 +2283,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -503,7 +503,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
-@@ -2269,7 +2269,7 @@
+@@ -2297,7 +2297,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8
VARIABLE_SCOPE GLOBAL
@@ -512,7 +512,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -2283,7 +2283,7 @@
+@@ -2311,7 +2311,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE SESSION
@@ -521,7 +521,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2297,7 +2297,7 @@
+@@ -2325,7 +2325,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 262144
VARIABLE_SCOPE SESSION
@@ -530,7 +530,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -2311,10 +2311,10 @@
+@@ -2339,10 +2339,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 256
VARIABLE_SCOPE SESSION
@@ -543,7 +543,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2325,7 +2325,7 @@
+@@ -2353,7 +2353,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -552,7 +552,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
-@@ -2339,7 +2339,7 @@
+@@ -2367,7 +2367,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 6
VARIABLE_SCOPE GLOBAL
@@ -561,7 +561,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
-@@ -2349,9 +2349,9 @@
+@@ -2377,9 +2377,9 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE
SESSION_VALUE NULL
@@ -573,7 +573,7 @@
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this
-@@ -2363,14 +2363,14 @@
+@@ -2391,14 +2391,14 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_MMAP_SIZE
SESSION_VALUE NULL
@@ -591,7 +591,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -2395,10 +2395,10 @@
+@@ -2423,10 +2423,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -604,7 +604,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2412,7 +2412,7 @@
+@@ -2440,7 +2440,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
NUMERIC_MIN_VALUE 4096
@@ -613,7 +613,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2465,7 +2465,7 @@
+@@ -2493,7 +2493,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16384
VARIABLE_SCOPE SESSION
@@ -622,7 +622,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
-@@ -2479,7 +2479,7 @@
+@@ -2507,7 +2507,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 30
VARIABLE_SCOPE SESSION
@@ -631,7 +631,7 @@
VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2493,7 +2493,7 @@
+@@ -2521,7 +2521,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE SESSION
@@ -640,7 +640,7 @@
VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2507,7 +2507,7 @@
+@@ -2535,7 +2535,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 60
VARIABLE_SCOPE SESSION
@@ -649,7 +649,7 @@
VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2577,7 +2577,7 @@
+@@ -2605,7 +2605,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -658,7 +658,7 @@
VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1
-@@ -2591,7 +2591,7 @@
+@@ -2619,7 +2619,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 62
VARIABLE_SCOPE SESSION
@@ -667,7 +667,7 @@
VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2605,7 +2605,7 @@
+@@ -2633,7 +2633,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE SESSION
@@ -676,7 +676,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
-@@ -2633,7 +2633,7 @@
+@@ -2661,7 +2661,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -685,7 +685,7 @@
VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5
-@@ -2661,7 +2661,7 @@
+@@ -2689,7 +2689,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -694,7 +694,7 @@
VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2675,7 +2675,7 @@
+@@ -2703,7 +2703,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -703,7 +703,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 200
-@@ -2689,7 +2689,7 @@
+@@ -2717,7 +2717,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -712,7 +712,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2703,7 +2703,7 @@
+@@ -2731,7 +2731,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -721,7 +721,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2717,7 +2717,7 @@
+@@ -2745,7 +2745,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -730,7 +730,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2731,7 +2731,7 @@
+@@ -2759,7 +2759,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -739,7 +739,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2745,7 +2745,7 @@
+@@ -2773,7 +2773,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -748,7 +748,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2759,7 +2759,7 @@
+@@ -2787,7 +2787,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -757,7 +757,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2773,7 +2773,7 @@
+@@ -2801,7 +2801,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -766,7 +766,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2787,7 +2787,7 @@
+@@ -2815,7 +2815,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 80
VARIABLE_SCOPE GLOBAL
@@ -775,7 +775,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2801,7 +2801,7 @@
+@@ -2829,7 +2829,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -784,7 +784,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2815,7 +2815,7 @@
+@@ -2843,7 +2843,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1024
VARIABLE_SCOPE GLOBAL
@@ -793,7 +793,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2829,7 +2829,7 @@
+@@ -2857,7 +2857,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 50
VARIABLE_SCOPE GLOBAL
@@ -802,7 +802,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2843,7 +2843,7 @@
+@@ -2871,7 +2871,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32768
VARIABLE_SCOPE GLOBAL
@@ -811,7 +811,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2857,7 +2857,7 @@
+@@ -2885,7 +2885,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -820,7 +820,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2871,7 +2871,7 @@
+@@ -2899,7 +2899,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 200
VARIABLE_SCOPE GLOBAL
@@ -829,7 +829,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2885,7 +2885,7 @@
+@@ -2913,7 +2913,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -838,7 +838,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2899,7 +2899,7 @@
+@@ -2927,7 +2927,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 40
VARIABLE_SCOPE GLOBAL
@@ -847,7 +847,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2913,7 +2913,7 @@
+@@ -2941,7 +2941,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -856,7 +856,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2927,7 +2927,7 @@
+@@ -2955,7 +2955,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE GLOBAL
@@ -865,7 +865,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2941,7 +2941,7 @@
+@@ -2969,7 +2969,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -874,7 +874,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2955,7 +2955,7 @@
+@@ -2983,7 +2983,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 150
VARIABLE_SCOPE GLOBAL
@@ -883,16 +883,16 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2969,7 +2969,7 @@
+@@ -2997,7 +2997,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 178
+ DEFAULT_VALUE 181
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2983,7 +2983,7 @@
+@@ -3011,7 +3011,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -901,7 +901,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2997,7 +2997,7 @@
+@@ -3025,7 +3025,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -910,7 +910,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -3011,7 +3011,7 @@
+@@ -3039,7 +3039,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 50
VARIABLE_SCOPE GLOBAL
@@ -919,7 +919,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -3025,7 +3025,7 @@
+@@ -3053,7 +3053,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -928,7 +928,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -3039,7 +3039,7 @@
+@@ -3067,7 +3067,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -937,7 +937,7 @@
VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -3053,7 +3053,7 @@
+@@ -3081,7 +3081,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -946,7 +946,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
-@@ -3067,7 +3067,7 @@
+@@ -3095,7 +3095,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -955,7 +955,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -3081,7 +3081,7 @@
+@@ -3109,7 +3109,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE -1
VARIABLE_SCOPE GLOBAL
@@ -964,7 +964,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -3151,7 +3151,7 @@
+@@ -3179,7 +3179,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 32768
VARIABLE_SCOPE SESSION
@@ -973,7 +973,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3179,7 +3179,7 @@
+@@ -3207,7 +3207,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 15
VARIABLE_SCOPE SESSION
@@ -982,7 +982,7 @@
VARIABLE_COMMENT Limit of query profiling memory
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -3193,7 +3193,7 @@
+@@ -3221,7 +3221,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 5
VARIABLE_SCOPE SESSION
@@ -991,7 +991,20 @@
VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3263,7 +3263,7 @@
+@@ -3277,10 +3277,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE SESSION ONLY
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT This variable is for internal server use
+ NUMERIC_MIN_VALUE 0
+-NUMERIC_MAX_VALUE 18446744073709551615
++NUMERIC_MAX_VALUE 4294967295
+ NUMERIC_BLOCK_SIZE 1
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+@@ -3291,7 +3291,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16384
VARIABLE_SCOPE SESSION
@@ -1000,7 +1013,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3277,7 +3277,7 @@
+@@ -3305,7 +3305,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1048576
VARIABLE_SCOPE GLOBAL
@@ -1009,7 +1022,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3291,7 +3291,7 @@
+@@ -3319,7 +3319,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4096
VARIABLE_SCOPE GLOBAL
@@ -1018,7 +1031,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3308,7 +3308,7 @@
+@@ -3336,7 +3336,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
@@ -1027,7 +1040,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3361,7 +3361,7 @@
+@@ -3389,7 +3389,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 24576
VARIABLE_SCOPE SESSION
@@ -1036,7 +1049,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3375,7 +3375,7 @@
+@@ -3403,7 +3403,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4096
VARIABLE_SCOPE SESSION
@@ -1045,7 +1058,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
-@@ -3389,7 +3389,7 @@
+@@ -3417,7 +3417,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 131072
VARIABLE_SCOPE SESSION
@@ -1054,7 +1067,7 @@
VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -3417,7 +3417,7 @@
+@@ -3445,7 +3445,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 262144
VARIABLE_SCOPE SESSION
@@ -1063,7 +1076,7 @@
VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 2147483647
-@@ -3697,10 +3697,10 @@
+@@ -3725,10 +3725,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8388608
VARIABLE_SCOPE SESSION
@@ -1076,7 +1089,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3739,7 +3739,7 @@
+@@ -3767,7 +3767,7 @@
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 0
VARIABLE_SCOPE SESSION
@@ -1085,7 +1098,7 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3865,7 +3865,7 @@
+@@ -3893,7 +3893,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -1094,7 +1107,7 @@
VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -3907,7 +3907,7 @@
+@@ -3935,7 +3935,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1073741824
VARIABLE_SCOPE GLOBAL
@@ -1103,7 +1116,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3935,7 +3935,7 @@
+@@ -3963,7 +3963,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 131072
VARIABLE_SCOPE GLOBAL
@@ -1112,7 +1125,7 @@
VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2147483647
-@@ -3963,7 +3963,7 @@
+@@ -3991,7 +3991,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -1121,7 +1134,7 @@
VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -3977,7 +3977,7 @@
+@@ -4005,7 +4005,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -1130,7 +1143,7 @@
VARIABLE_COMMENT Alias for slave_parallel_threads
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -4033,7 +4033,7 @@
+@@ -4061,7 +4061,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE GLOBAL
@@ -1139,7 +1152,7 @@
VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -4061,7 +4061,7 @@
+@@ -4089,7 +4089,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2
VARIABLE_SCOPE GLOBAL
@@ -1148,7 +1161,7 @@
VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -4120,7 +4120,7 @@
+@@ -4148,7 +4148,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
NUMERIC_MIN_VALUE 1024
@@ -1157,7 +1170,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4411,7 +4411,7 @@
+@@ -4439,7 +4439,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 256
VARIABLE_SCOPE GLOBAL
@@ -1166,7 +1179,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
-@@ -4509,7 +4509,7 @@
+@@ -4537,7 +4537,7 @@
GLOBAL_VALUE_ORIGIN AUTO
DEFAULT_VALUE 400
VARIABLE_SCOPE GLOBAL
@@ -1175,7 +1188,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 524288
-@@ -4523,7 +4523,7 @@
+@@ -4551,7 +4551,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
@@ -1184,16 +1197,16 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 524288
-@@ -4537,7 +4537,7 @@
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 0
+@@ -4565,7 +4565,7 @@
+ GLOBAL_VALUE_ORIGIN AUTO
+ DEFAULT_VALUE 256
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT How many threads we should keep in a cache for reuse
+ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -4551,7 +4551,7 @@
+@@ -4579,7 +4579,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10
VARIABLE_SCOPE GLOBAL
@@ -1202,7 +1215,7 @@
VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 512
-@@ -4736,7 +4736,7 @@
+@@ -4764,7 +4764,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table
NUMERIC_MIN_VALUE 1024
@@ -1211,7 +1224,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4747,7 +4747,7 @@
+@@ -4775,7 +4775,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8192
VARIABLE_SCOPE SESSION
@@ -1220,7 +1233,7 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -4761,7 +4761,7 @@
+@@ -4789,7 +4789,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 4096
VARIABLE_SCOPE SESSION
@@ -1229,7 +1242,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -4859,7 +4859,7 @@
+@@ -4887,7 +4887,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 28800
VARIABLE_SCOPE SESSION
@@ -1238,7 +1251,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -4963,7 +4963,7 @@
+@@ -4991,7 +4991,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -1247,7 +1260,7 @@
VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -4976,7 +4976,7 @@
+@@ -5004,7 +5004,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1256,7 +1269,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4986,7 +4986,7 @@
+@@ -5014,7 +5014,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1265,7 +1278,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -5071,7 +5071,7 @@
+@@ -5099,7 +5099,7 @@
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index e4ecc28584e..09c3d6e6c98 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -1829,6 +1829,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_FILTER
SESSION_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
GLOBAL_VALUE admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
@@ -1857,6 +1871,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME LOG_SLOW_SLAVE_STATEMENTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Log slow statements executed by slave thread to the slow log if it is open.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_VERBOSITY
SESSION_VALUE
GLOBAL_VALUE
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
index 6dc99dcd5e3..d0e5188b508 100644
--- a/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic.result
@@ -124,5 +124,17 @@ SELECT session.wait_timeout;
ERROR 42S02: Unknown table 'session' in field list
SELECT wait_timeout = @@session.wait_timeout;
ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
+#
+# MDEV-9516 type error when setting session variable
+#
+SET SESSION wait_timeout= 28000;
+SET SESSION wait_timeout= GREATEST(28000, @@wait_timeout);
+SET SESSION wait_timeout= COALESCE(28000, @@wait_timeout);
+SET SESSION wait_timeout= IFNULL(28000, @@wait_timeout);
+SET SESSION wait_timeout= CASE WHEN TRUE THEN 28000 ELSE @@wait_timeout END;
+SET SESSION wait_timeout= 28000.0;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET SESSION wait_timeout= 28000.1;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
SET @@global.wait_timeout = @start_global_value;
SET @@session.wait_timeout = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
index fe376a3032e..160b3ba52cc 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
@@ -8,12 +8,24 @@
SET @orig = @@global.innodb_buffer_pool_load_now;
SELECT @orig;
+let $old_status= `SELECT variable_value FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;
+
+# A previous test could have run buffer pool dump already;
+# in this case we want to make sure that the current time is different
+# from the timestamp in the status variable
+
+let $wait_condition =
+ SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
+-- source include/wait_condition.inc
+
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
# Wait for the dump to complete
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ SELECT variable_value != '$old_status'
+ AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
index 85ae2358db5..bc4efdd1d6f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test
@@ -39,7 +39,7 @@ set global innodb_thread_sleep_delay=1.1;
set global innodb_thread_sleep_delay=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_thread_sleep_delay="foo";
---error ER_WRONG_TYPE_FOR_VAR
+
set global innodb_thread_sleep_delay=18446744073709551616;
set global innodb_thread_sleep_delay=-7;
diff --git a/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
new file mode 100644
index 00000000000..78e4d35f69a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
@@ -0,0 +1,61 @@
+--source include/no_valgrind_without_big.inc
+-- source include/have_innodb.inc
+
+SET @old_log_output= @@global.log_output;
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_long_query_time= @@session.long_query_time;
+SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements;
+
+USE test;
+CREATE TABLE log_slow_admin_statements (
+ i INT PRIMARY KEY AUTO_INCREMENT,
+ j VARCHAR(255)
+) ENGINE=InnoDB;
+
+# enable slow logging to table
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+SET SESSION long_query_time = 0;
+SET GLOBAL log_slow_admin_statements = on;
+
+# test ALTER, OPTIMIZE and CHECK against the table shown up
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
+
+# add rows so OPTIMIZE and CHECK runs
+DELIMITER $;
+
+CREATE PROCEDURE add_rows()
+BEGIN
+ DECLARE count INT;
+ SET count = 1;
+ INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255));
+ WHILE count <= 15 DO
+ INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements;
+ SET count = count + 1;
+ END WHILE;
+END
+$
+
+DELIMITER ;$
+
+CALL add_rows();
+
+# OPTIMIZE TABLE
+OPTIMIZE TABLE log_slow_admin_statements;
+
+# CHECK TABLE
+CHECK TABLE log_slow_admin_statements EXTENDED;
+
+# DROP TABLE
+DROP TABLE log_slow_admin_statements;
+
+# ALTER, OPTIMIZE, CHECK and DROP operations should be logged in slow query log.
+SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%';
+
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+SET @@session.long_query_time= @old_long_query_time;
+SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+
+DROP PROCEDURE add_rows;
+TRUNCATE TABLE mysql.slow_log;
diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv.test b/mysql-test/suite/sys_vars/t/secure_file_priv.test
index 3e2a4fa467a..5c53da58275 100644
--- a/mysql-test/suite/sys_vars/t/secure_file_priv.test
+++ b/mysql-test/suite/sys_vars/t/secure_file_priv.test
@@ -5,17 +5,39 @@ CREATE TABLE t1 (c1 VARCHAR(50));
INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five");
SHOW VARIABLES LIKE 'secure_file_priv';
--disable_query_log
+
# Atempt to create a file where we normally aren't allowed to create one.
+#
# Doing this in a portable manner is difficult but we should be able to
-# count on the depth of the directory hierarchy used. Three steps up from
-# the datadir is the 'mysql_test' directory.
---let $PROTECTED_FILE=`SELECT concat(@@datadir,'/../../../bug50373.txt')`
---eval SELECT * FROM t1 INTO OUTFILE '$PROTECTED_FILE';
-DELETE FROM t1;
---eval LOAD DATA INFILE '$PROTECTED_FILE' INTO TABLE t1;
-SELECT * FROM t1;
---eval SELECT load_file('$PROTECTED_FILE') AS loaded_file;
+# count on the directory hierarchy used. A step up from MYSQLTEST_VARDIR
+# should definitely lead us to a "protected" directory,
+# but at the same time should still be writable since MTR was able
+# to create the vardir itself there.
+# If we run tests normally, it will be mysql-test directory.
+# If we run tests with --mem, it will be /dev/shm.
+# If we run tests with --parallel, it will be mysql-test/var
+# (because MYSQLTEST_VARDIR in this case is mysql-test/var/N).
+
+--perl
+use File::Basename;
+my $protected_file= dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
+open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/bug50373.inc") or die;
+print FILE "SELECT * FROM t1 INTO OUTFILE '".$protected_file."';\n";
+print FILE "DELETE FROM t1;\n";
+print FILE "LOAD DATA INFILE '".$protected_file."' INTO TABLE t1;\n";
+print FILE "SELECT * FROM t1;\n";
+print FILE "SELECT load_file('",$protected_file,"') AS loaded_file;\n";
+close(FILE);
+EOF
+
+--source $MYSQL_TMP_DIR/bug50373.inc
+--remove_file $MYSQL_TMP_DIR/bug50373.inc
--enable_query_log
-remove_file $PROTECTED_FILE;
+
DROP TABLE t1;
+--perl
+use File::Basename;
+unlink dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
+EOF
+
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
index e92a3294b86..598f6cb44fd 100644
--- a/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic.test
@@ -203,6 +203,20 @@ SELECT session.wait_timeout;
--Error ER_BAD_FIELD_ERROR
SELECT wait_timeout = @@session.wait_timeout;
+--echo #
+--echo # MDEV-9516 type error when setting session variable
+--echo #
+
+SET SESSION wait_timeout= 28000;
+SET SESSION wait_timeout= GREATEST(28000, @@wait_timeout);
+SET SESSION wait_timeout= COALESCE(28000, @@wait_timeout);
+SET SESSION wait_timeout= IFNULL(28000, @@wait_timeout);
+SET SESSION wait_timeout= CASE WHEN TRUE THEN 28000 ELSE @@wait_timeout END;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET SESSION wait_timeout= 28000.0;
+--error ER_WRONG_TYPE_FOR_VAR
+SET SESSION wait_timeout= 28000.1;
####################################
# Restore initial value #
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 1898d1a4691..2886dff8f91 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -457,7 +457,7 @@ SELECT * FROM t1 WHERE a=0;
--echo # Connection con1
connection con1;
--echo # Sending:
---send ALTER TABLE t1 COMMENT 'test'
+--send ALTER TABLE t1 MODIFY a INT UNSIGNED;
--echo # Connection default
connection default;
@@ -465,7 +465,7 @@ connection default;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE state = "Waiting for table metadata lock"
- AND info = "ALTER TABLE t1 COMMENT 'test'";
+ AND info LIKE "ALTER TABLE t1%";
--source include/wait_condition.inc
--error ER_LOCK_DEADLOCK
INSERT DELAYED INTO t1 VALUES (3);
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index df40b840a68..cace397e92a 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -944,7 +944,7 @@ DELIMITER ;|
# reasonable time like 4 seconds. Till ~ 2 seconds could pass on a heavy
# loaded testing box before something gets executed).
# Detection of execution is via the records inserted by the event.
---echo Sleep till the first INSERT into events_test.event_log occured
+--echo Sleep till the first INSERT into events_test.event_log occurred
let $wait_timeout= 4;
let $wait_condition=
SELECT COUNT(*) > 0 FROM events_test.event_log;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 5550eebf1a3..3cc244339d3 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -832,3 +832,44 @@ PREPARE stmt FROM "SELECT GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0) FROM t1 AS t1a
EXECUTE stmt;
EXECUTE stmt;
DROP TABLE t1;
+
+--echo #
+--echo # WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
+--echo # Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
+--echo #
+
+
+SET group_concat_max_len= 9999999;
+CREATE TABLE t1 (f1 LONGTEXT , f2 INTEGER);
+INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
+
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
+
+SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
+SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
+SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
+
+CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+SET group_concat_max_len= DEFAULT;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
+
+SET group_concat_max_len= 499999;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+
+INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
+SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
+
+DROP TABLE t1;
+SET group_concat_max_len= DEFAULT;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index b5270743465..47477c72004 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1582,6 +1582,14 @@ SELECT id, AVG(a) AS avg, CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id
DROP TABLE t1;
--echo #
+--echo # MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
+--echo #
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
+DROP TABLE t1;
+
+--echo #
--echo # MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
--echo #
CREATE TABLE t1 (id INT, a DOUBLE);
diff --git a/mysql-test/t/func_hybrid_type.test b/mysql-test/t/func_hybrid_type.test
index 047e5f7b72e..dd8a399025b 100644
--- a/mysql-test/t/func_hybrid_type.test
+++ b/mysql-test/t/func_hybrid_type.test
@@ -434,5 +434,28 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+--echo #
+SELECT CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END;
+SELECT CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END;
+SELECT CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END;
+
+--disable_ps_protocol
+--enable_metadata
+SELECT COALESCE(COALESCE(NULL), 1.1) AS c0, IF(0, COALESCE(NULL), 1.1) AS c1;
+--disable_metadata
+--enable_ps_protocol
+
+
+--echo #
+--echo # MDEV-9752 Wrong data type for COALEASCE(?,1) in prepared statements
+--echo #
+PREPARE stmt FROM "CREATE TABLE t1 AS SELECT CONCAT(COALESCE(?,1)) AS a, CONCAT(CASE WHEN TRUE THEN ? ELSE 1 END) AS b";
+SET @a=1;
+EXECUTE stmt USING @a,@a;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/index_merge_myisam.test b/mysql-test/t/index_merge_myisam.test
index 82d0474e28e..d265007431e 100644
--- a/mysql-test/t/index_merge_myisam.test
+++ b/mysql-test/t/index_merge_myisam.test
@@ -117,7 +117,7 @@ set optimizer_switch='default,index_merge_intersection=off';
explain select * from t1 where a=10 and b=10 or c=10;
--echo This will switch to sort-union (intersection will be gone, too,
---echo thats a known limitation:
+--echo that's a known limitation:
set optimizer_switch='default,index_merge_union=off';
explain select * from t1 where a=10 and b=10 or c=10;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 5bfe22697dd..519094d6350 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -655,7 +655,7 @@ insert into t1 values (1);
flush tables;
# Open t2 and (implicitly) t1.
select * from t2;
-# Truncate t1, wich was not recognized as open without the bugfix.
+# Truncate t1, which was not recognized as open without the bugfix.
# After fix for Bug#8306 and before fix for Bug#26379,
# it should fail with a table-in-use error message, otherwise succeed.
truncate table t1;
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index ed6b2d3894e..12fd968b212 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -31,7 +31,7 @@ perl;
connect null-audit aria oqgraph sphinx thread-handling
test-sql-discovery rpl-semi-sync query-cache-info
query-response-time metadata-lock-info locales unix-socket
- wsrep file-key-management user-variables/;
+ wsrep file-key-management cracklib-password-check user-variables/;
# And substitute the content some environment variables with their
# names:
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index e5ae109088c..9cde1f93a4a 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -702,7 +702,7 @@ drop table t1;
--echo #
---echo # Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
+--echo # Bug#15328 Segmentation fault occurred if my.cnf is invalid for escape sequence
--echo #
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 8857195d0e1..a5db4442183 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -958,6 +958,55 @@ show create view v1;
drop view v1;
drop table t1;
+#
+# MDEV-9637 select nullif(count(col1),0) gives wrong result if in a view
+#
+create table t1 (col1 varchar(50) default null);
+insert into t1 (col1) values ('hello'), ('hello'), ('hello');
+create view v1 as select nullif(count(col1),0) from t1;
+select * from v1;
+select nullif(count(col1),0) from t1;
+drop view v1;
+drop table t1;
+
+#
+# MDEV-9644 Assertion `args[0] == args[2] || thd->stmt_arena->is_stmt_execute()' failed in Item_func_nullif::fix_length_and_dec()
+#
+select nullif((select 1), (select 2));
+create table t1 (f int);
+insert into t1 values (1),(2);
+select nullif( not f, 1 ) from t1;
+drop table t1;
+
+#
+# MDEV-9641 Assertion `args[0] == args[2] || _current_thd()->lex->context_analysis_only' failed in Item_func_nullif::print(String*, enum_query_type)
+#
+set names utf8;
+create table t1 (f1 varchar(10));
+insert into t1 values ('2015-12-31');
+--error ER_DATA_OUT_OF_RANGE
+select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
+drop table t1;
+
+#
+# MDEV-9682 Assertion `0' failed in Item_cache_row::illegal_method_call on 2nd execution of PS with NULLIF
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1 )";
+EXECUTE stmt;
+EXECUTE stmt;
+DROP TABLE t1;
+
+#
+# MDEV-9683 Server crashes in Item::basic_const_item on numerous nested NULLIFs
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
+DROP TABLE t1;
+
+
--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index 9268a3e1086..1c1d1b00910 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -19,10 +19,12 @@ select (1,2,(3,4)) IN ((3,2,(3,4)), (1,2,(3,4)));
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4));
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)));
+select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)));
+
SELECT (1,2,3)=(0,NULL,3);
SELECT (1,2,3)=(1,NULL,3);
-# here's something for Sanja to fix :)
SELECT (1,2,3)=(1,NULL,0);
SELECT ROW(1,2,3)=ROW(1,2,3);
@@ -300,6 +302,13 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND b=10 AND a>=10;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a,b)=(10,10) AND a>=10;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9369 IN operator with ( num, NULL ) gives inconsistent result
+--echo #
+SELECT (1,null) NOT IN ((2,2),(3,3)), (1,null) NOT IN ((2,2)), (1,null) NOT IN ((3,3));
+
+
--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test
index 3b57b8f2c52..805c169b2a4 100644
--- a/mysql-test/t/statistics.test
+++ b/mysql-test/t/statistics.test
@@ -728,3 +728,16 @@ select db_name, table_name, column_name,
FROM mysql.column_stats;
drop table t1;
+
+--echo #
+--echo # MDEV-9590: Always print "Engine-independent statistic" warnings and
+--echo # might be filtering columns unintentionally from engines
+--echo #
+
+set use_stat_tables='NEVER';
+create table t1 (test blob);
+show variables like 'use_stat_tables';
+analyze table t1;
+drop table t1;
+
+set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/t/trigger_null-8605.test b/mysql-test/t/trigger_null-8605.test
index c9b0257afc8..4b51ccd5606 100644
--- a/mysql-test/t/trigger_null-8605.test
+++ b/mysql-test/t/trigger_null-8605.test
@@ -360,3 +360,15 @@ 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;
+
+#
+# MDEV-9629 Disappearing PRI from Key column after creating a trigger
+#
+create table t1 (a int not null, primary key (a));
+insert into t1 (a) values (1);
+show columns from t1;
+create trigger t1bu before update on t1 for each row begin end;
+show columns from t1;
+insert into t1 (a) values (3);
+show columns from t1;
+drop table t1;
diff --git a/mysql-test/t/type_num.test b/mysql-test/t/type_num.test
index 6ed04c8e1d3..64242e34160 100644
--- a/mysql-test/t/type_num.test
+++ b/mysql-test/t/type_num.test
@@ -681,3 +681,27 @@ SELECT
--echo #
--echo # End of 10.0 tests
--echo #
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
+--echo #
+
+--disable_ps_protocol
+--enable_metadata
+SELECT NULL+1 AS c0,
+ COALESCE(NULL)+1 AS c2,
+ COALESCE(COALESCE(NULL))+1 AS c3,
+ ''+1 AS c4,
+ COALESCE('')+1 AS c5,
+ COALESCE(COALESCE(''))+1 AS c6;
+--disable_metadata
+--enable_ps_protocol
+
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_temporal_innodb.test b/mysql-test/t/type_temporal_innodb.test
new file mode 100644
index 00000000000..ac5daca6508
--- /dev/null
+++ b/mysql-test/t/type_temporal_innodb.test
@@ -0,0 +1,60 @@
+--source include/have_innodb.inc
+
+#
+# testing of temporal data types with InnoDB
+#
+
+
+--echo #
+--echo # MDEV-9604 crash in Item::save_in_field with empty enum value
+--echo #
+
+SELECT TIME'00:00:00'='';
+
+CREATE TABLE t1 (a ENUM('a'), b TIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','00:00:00',0);
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+DROP TABLE t1;
+
+
+SELECT DATE'0000-00-00'='';
+
+CREATE TABLE t1 (a ENUM('a'), b DATE, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00',0);
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+DROP TABLE t1;
+
+
+SELECT TIMESTAMP'0000-00-00 00:00:00'='';
+
+CREATE TABLE t1 (a ENUM('a'), b DATETIME, c INT, KEY(b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('','0000-00-00 00:00:00',0);
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+
+ALTER TABLE t1 ENGINE=MyISAM;
+SELECT * FROM t1 WHERE b='';
+SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
+SELECT * FROM t1 WHERE a=b;
+SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
+DROP TABLE t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 1d1b64d323e..83b7e5839ef 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -731,6 +731,7 @@ drop table t2;
create table t1 (a int);
insert into t1 values (1), (2);
create view v1 as select 5 from t1 order by 1;
+show create view v1;
select * from v1;
drop view v1;
drop table t1;
@@ -5747,6 +5748,22 @@ SELECT * FROM v1 WHERE a=_latin1'a' COLLATE latin1_bin;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
+--echo # produces invalid definition
+--echo #
+CREATE TABLE t1 ( i INT );
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE VIEW v1 AS
+SELECT 3 AS three, COUNT(*) FROM t1 GROUP BY three;
+
+show create view v1;
+
+SELECT * FROM v1;
+
+drop view v1;
+drop table t1;
--echo #
--echo # End of 10.1 tests
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index f8a15829fb1..b349ef88ed1 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -103,6 +103,12 @@
#include <my_sys.h>
#include <lf.h>
+/*
+ when using alloca() leave at least that many bytes of the stack -
+ for functions we might be calling from within this stack frame
+*/
+#define ALLOCA_SAFETY_MARGIN 8192
+
#define LF_PINBOX_MAX_PINS 65536
static void lf_pinbox_real_free(LF_PINS *pins);
@@ -345,7 +351,8 @@ static void lf_pinbox_real_free(LF_PINS *pins)
{
int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
/* create a sorted list of pinned addresses, to speed up searches */
- if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size)
+ if (available_stack_size(&pinbox, *pins->stack_ends_here) >
+ alloca_size + ALLOCA_SAFETY_MARGIN)
{
struct st_harvester hv;
addr= (void **) alloca(alloca_size);
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 93caa7bc74a..2499094037d 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -44,7 +44,7 @@
RETURN VALUE
0 All OK
- 1 An error occured
+ 1 An error occurred
*/
int
my_b_copy_to_file(IO_CACHE *cache, FILE *file)
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 188a8d0429e..3077415b243 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -274,7 +274,7 @@ struct st_hash_link
};
/* simple states of a block */
-#define BLOCK_ERROR 1 /* an error occured when performing file i/o */
+#define BLOCK_ERROR 1 /* an error occurred when performing file i/o */
#define BLOCK_READ 2 /* file block is in the block buffer */
#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
#define BLOCK_REASSIGNED 8 /* blk does not accept requests for old page */
diff --git a/mysys/my_default.c b/mysys/my_default.c
index 34ba9eef218..7f41551f779 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -363,7 +363,7 @@ err:
RETURN
0 - ok
- 1 - error occured
+ 1 - error occurred
*/
static int handle_default_option(void *in_ctx, const char *group_name,
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index e99c7ff5fcb..3dfe290dabe 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -110,7 +110,7 @@ static int my_win_unlink(const char *name)
if (handle != INVALID_HANDLE_VALUE)
{
/*
- We opened file without sharing flags (exclusive), noone else has this file
+ We opened file without sharing flags (exclusive), no one else has this file
opened, thus it is save to close handle to remove it. No renaming is
necessary.
*/
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 0abbc6c3084..082d8e9f5a0 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -131,7 +131,7 @@ error:
RETURN VALUE
0 Success
- -1 An error has occured and 'my_errno' is set
+ -1 An error has occurred and 'my_errno' is set
to indicate the actual error code.
*/
@@ -203,7 +203,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
== MY_FILEPOS_ERROR)
{
/*
- If an error has occured in my_seek then we will already
+ If an error has occurred in my_seek then we will already
have an error code in my_errno; Just return error code.
*/
DBUG_RETURN(-1);
diff --git a/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm b/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm
index 50137ca0211..aa225536a1e 100644
--- a/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm
+++ b/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm
@@ -19,7 +19,7 @@ else
{
if (!$ENV{'GSSAPI_FULLNAME'})
{
- my $s = `klist |grep 'Default principal: '`;
+ my $s = `klist 2>/dev/null |grep 'Default principal: '`;
if ($s)
{
chomp($s);
diff --git a/plugin/aws_key_management/CMakeLists.txt b/plugin/aws_key_management/CMakeLists.txt
new file mode 100644
index 00000000000..97bcfbb04db
--- /dev/null
+++ b/plugin/aws_key_management/CMakeLists.txt
@@ -0,0 +1,154 @@
+# We build parts of AWS C++ SDK as CMake external project
+# The restrictions of the SDK (https://github.com/awslabs/aws-sdk-cpp/blob/master/README.md)
+# are
+
+# - OS : Windows,Linux or OSX
+# - C++11 compiler : VS2013+, gcc 4.7+, clang 3.3+
+# - libcurl development package needs to be present on Unixes
+#
+# If we build SDK outselves, we'll need require GIT to be present on the build machine
+
+
+# Give message why the building this plugin is skipped (only if -DVERBOSE is defined)
+# or if plugin is explicitely requested to build. Then bail out.
+MACRO(SKIP_AWS_PLUGIN msg)
+ IF(VERBOSE OR "${PLUGIN_AWS_KEY_MANAGEMENT}" MATCHES "^(STATIC|DYNAMIC)$")
+ MESSAGE(STATUS "Skip aws_key_management - ${msg}")
+ ENDIF()
+ RETURN()
+ENDMACRO()
+
+MYSQL_ADD_PLUGIN(aws_key_management aws_key_management_plugin.cc DISABLED
+ COMPONENT aws-key-management)
+
+IF(NOT TARGET aws_key_management)
+ RETURN()
+ENDIF()
+
+# This plugin needs recent C++ compilers (AWS C++ SDK header files are using C++11 features)
+SET(CXX11_FLAGS)
+SET(OLD_COMPILER_MSG "AWS SDK requires c++11 -capable compiler (minimal supported versions are g++ 4.7, clang 3.3, VS2103)")
+
+IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+ IF (GCC_VERSION VERSION_LESS 4.8)
+ SKIP_AWS_PLUGIN("${OLD_COMPILER_MSG}")
+ ENDIF()
+ SET(CXX11_FLAGS "-std=c++11")
+ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ IF ((CMAKE_CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) OR
+ (CLANG_VERSION_STRING AND CLANG_VERSION_STRING VERSION_LESS 3.3))
+ SKIP_AWS_PLUGIN("${OLD_COMPILER_MSG}")
+ ENDIF()
+ SET(CXX11_FLAGS "-stdlib=libc++")
+ELSEIF(MSVC)
+ IF (MSVC_VERSION LESS 1800)
+ SKIP_AWS_PLUGIN("${OLD_COMPILER_MSG}")
+ ENDIF()
+ELSE()
+ SKIP_AWS_PLUGIN("Compiler not supported by AWS C++ SDK")
+ENDIF()
+
+IF (NOT(WIN32 OR APPLE OR (CMAKE_SYSTEM_NAME MATCHES "Linux")))
+ SKIP_AWS_PLUGIN("OS unsupported by AWS SDK")
+ENDIF()
+
+
+# Figure out where AWS installs SDK libraries
+# The below is defined in AWS SDK's CMakeLists.txt
+# (and their handling is weird, every OS has special install directory)
+IF(WIN32)
+ SET(SDK_INSTALL_BINARY_PREFIX "windows")
+ELSEIF(APPLE)
+ SET(SDK_INSTALL_BINARY_PREFIX "mac")
+ELSEIF(UNIX)
+ SET(SDK_INSTALL_BINARY_PREFIX "linux")
+ENDIF()
+IF(NOT APPLE)
+ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(SDK_INSTALL_BINARY_PREFIX "${SDK_INSTALL_BINARY_PREFIX}/intel64")
+ ELSE()
+ SET(SDK_INSTALL_BINARY_PREFIX "${SDK_INSTALL_BINARY_PREFIX}/ia32")
+ ENDIF()
+ENDIF()
+IF(CMAKE_CONFIGURATION_TYPES)
+ SET(SDK_INSTALL_BINARY_PREFIX "${SDK_INSTALL_BINARY_PREFIX}/${CMAKE_CFG_INTDIR}")
+ENDIF()
+
+FIND_LIBRARY(AWS_CPP_SDK_CORE NAMES aws-cpp-sdk-core PATH_SUFFIXES "${SDK_INSTALL_BINARY_PREFIX}")
+FIND_LIBRARY(AWS_CPP_SDK_KMS NAMES aws-cpp-sdk-core PATH_SUFFIXES "${SDK_INSTALL_BINARY_PREFIX}")
+SET(CMAKE_REQUIRED_FLAGS ${CXX11_FLAGS})
+CHECK_INCLUDE_FILE_CXX(aws/kms/KMSClient.h HAVE_AWS_HEADERS)
+
+IF(AWS_CPP_SDK_CORE AND AWS_CPP_SDK_KMS AND HAVE_AWS_HEADERS)
+ # AWS C++ SDK installed
+ SET(AWS_SDK_LIBS ${AWS_CPP_SDK_CORE} ${AWS_CPP_SDK_KMS})
+ELSE()
+ # Build from source, using ExternalProject_Add
+ IF(CMAKE_VERSION VERSION_LESS "2.8.8")
+ SKIP_AWS_PLUGIN("CMake is too old")
+ ENDIF()
+ FIND_PACKAGE(Git)
+ IF(NOT GIT_FOUND)
+ SKIP_AWS_PLUGIN("no GIT")
+ ENDIF()
+ INCLUDE(ExternalProject)
+ IF(UNIX)
+ FIND_PACKAGE(CURL)
+ IF(NOT CURL_FOUND)
+ SKIP_AWS_PLUGIN("AWS C++ SDK requires libcurl development package")
+ ENDIF()
+ SET(PIC_FLAG -fPIC)
+ ENDIF()
+ IF(MSVC)
+ SET(EXTRA_SDK_CMAKE_FLAGS -DCMAKE_CXX_FLAGS_DEBUGOPT="" -DCMAKE_EXE_LINKER_FLAGS_DEBUGOPT="" -DCMAKE_CXX_FLAGS=/wd4592)
+ ENDIF()
+ IF(CMAKE_CXX_COMPILER)
+ SET(EXTRA_SDK_CMAKE_FLAGS ${EXTRA_SDK_CMAKE_FLAGS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
+ ENDIF()
+
+ # Relax AWS C++ SDK unreasonably high requirements for CMake version. Use replace utility (from MariaDB build)
+ # to patch their CMakeLists.txt
+ SET(AWS_SDK_PATCH_COMMAND )
+ ExternalProject_Add(
+ aws_sdk_cpp
+ GIT_REPOSITORY "https://github.com/awslabs/aws-sdk-cpp.git"
+ GIT_TAG "0.9.6" # single tag
+ UPDATE_COMMAND ""
+ PATCH_COMMAND replace 3.1.2 2.8 -- ${CMAKE_BINARY_DIR}/aws-sdk-cpp/CMakeLists.txt
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/aws-sdk-cpp"
+ CMAKE_ARGS
+ -DBUILD_ONLY=aws-cpp-sdk-kms -DSTATIC_LINKING=1
+ "-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} ${PIC_FLAG}"
+ "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${PIC_FLAG}"
+ "-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} ${PIC_FLAG}"
+ "-DCMAKE_CXX_FLAGS_MINSIZEREL=${CMAKE_CXX_FLAGS_MINSIZEREL} ${PIC_FLAG}"
+ ${EXTRA_SDK_CMAKE_FLAGS}
+ -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/aws_sdk_cpp
+ TEST_COMMAND ""
+ )
+
+ # We do not need to build the whole SDK , just 2 of its libs
+ set(AWS_SDK_LIBS aws-cpp-sdk-core aws-cpp-sdk-kms)
+ FOREACH(lib ${AWS_SDK_LIBS})
+ ADD_LIBRARY(${lib} STATIC IMPORTED GLOBAL)
+ ADD_DEPENDENCIES(${lib} aws_sdk_cpp)
+ SET(loc "${CMAKE_BINARY_DIR}/aws_sdk_cpp/lib/${SDK_INSTALL_BINARY_PREFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LOCATION ${loc})
+ IF(WIN32)
+ SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "bcrypt;winhttp;wininet;userenv")
+ ELSE()
+ SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${SSL_LIBRARIES};${CURL_LIBRARIES}")
+ ENDIF()
+ ENDFOREACH()
+
+ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # Need whole-archive , otherwise static libraries are not linked
+ SET(AWS_SDK_LIBS -Wl,--whole-archive ${AWS_SDK_LIBS} -Wl,--no-whole-archive)
+ ENDIF()
+ SET_TARGET_PROPERTIES(aws_sdk_cpp PROPERTIES EXCLUDE_FROM_ALL TRUE)
+ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/aws_sdk_cpp/include)
+ENDIF()
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
+TARGET_LINK_LIBRARIES(aws_key_management ${AWS_SDK_LIBS})
diff --git a/plugin/aws_key_management/aws_key_management_plugin.cc b/plugin/aws_key_management/aws_key_management_plugin.cc
new file mode 100644
index 00000000000..3913d2c3145
--- /dev/null
+++ b/plugin/aws_key_management/aws_key_management_plugin.cc
@@ -0,0 +1,587 @@
+/*
+ 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 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 <my_pthread.h>
+#include <my_sys.h>
+#include <my_dir.h>
+#include <mysql/plugin_encryption.h>
+#include <my_crypt.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <mysqld_error.h>
+#include <base64.h>
+#include <map>
+#include <algorithm>
+#include <string>
+#include <vector>
+#include <iterator>
+#include <sstream>
+#include <fstream>
+
+#include <aws/core/client/AWSError.h>
+#include <aws/core/utils/logging/AWSLogging.h>
+#include <aws/core/utils/logging/ConsoleLogSystem.h>
+#include <aws/kms/KMSClient.h>
+#include <aws/kms/model/DecryptRequest.h>
+#include <aws/kms/model/DecryptResult.h>
+#include <aws/kms/model/GenerateDataKeyWithoutPlaintextRequest.h>
+#include <aws/kms/model/GenerateDataKeyWithoutPlaintextResult.h>
+#include <aws/core/utils/Outcome.h>
+
+using namespace std;
+using namespace Aws::KMS;
+using namespace Aws::KMS::Model;
+using namespace Aws::Utils::Logging;
+extern void sql_print_error(const char *format, ...);
+extern void sql_print_warning(const char *format, ...);
+extern void sql_print_information(const char *format, ...);
+
+
+/* Plaintext key info struct */
+struct KEY_INFO
+{
+ unsigned int key_id;
+ unsigned int key_version;
+ unsigned int length;
+ unsigned char data[MY_AES_MAX_KEY_LENGTH];
+ bool load_failed; /* if true, do not attempt to reload?*/
+public:
+ KEY_INFO() : key_id(0), key_version(0), length(0), load_failed(false){};
+};
+#define KEY_ID_AND_VERSION(key_id,version) ((longlong)key_id << 32 | version)
+
+/* Cache for the latest version, per key id */
+static std::map<uint, uint> latest_version_cache;
+
+/* Cache for plaintext keys */
+static std::map<ulonglong, KEY_INFO> key_info_cache;
+
+static const char *key_spec_names[]={ "AES_128", "AES_256", 0 };
+
+/* Plugin variables */
+static char* master_key_id;
+static unsigned long key_spec;
+static unsigned long log_level;
+static int rotate_key;
+
+/* AWS functionality*/
+static int aws_decrypt_key(const char *path, KEY_INFO *info);
+static int aws_generate_datakey(uint key_id, uint version);
+
+static int extract_id_and_version(const char *name, uint *id, uint *ver);
+static unsigned int get_latest_key_version(unsigned int key_id);
+static unsigned int get_latest_key_version_nolock(unsigned int key_id);
+static int load_key(KEY_INFO *info);
+
+/* Mutex to serialize access to caches */
+static mysql_mutex_t mtx;
+
+#ifdef HAVE_PSI_INTERFACE
+static uint mtx_key;
+static PSI_mutex_info mtx_info = {&mtx_key, "mtx", 0};
+#endif
+
+static Aws::KMS::KMSClient *client;
+
+/* Redirect AWS trace to error log */
+class MySQLLogSystem : public Aws::Utils::Logging::FormattedLogSystem
+{
+public:
+
+ using Base = FormattedLogSystem;
+ MySQLLogSystem(LogLevel logLevel) :
+ Base(logLevel)
+ {
+ }
+ virtual LogLevel GetLogLevel(void) const override
+ {
+ return (LogLevel)log_level;
+ }
+ virtual ~MySQLLogSystem()
+ {
+ }
+
+protected:
+ virtual void ProcessFormattedStatement(Aws::String&& statement) override
+ {
+#ifdef _WIN32
+ /*
+ On Windows, we can't use C runtime functions to write to stdout,
+ because we compile with static C runtime, so plugin has a stdout
+ different from server. Thus we're using WriteFile().
+ */
+ DWORD nSize= (DWORD)statement.size();
+ DWORD nWritten;
+ const char *s= statement.c_str();
+ HANDLE h= GetStdHandle(STD_OUTPUT_HANDLE);
+
+ WriteFile(h, s, nSize, &nWritten, NULL);
+#else
+ printf("%s", statement.c_str());
+#endif
+ }
+};
+
+
+/*
+ Plugin initialization.
+
+ Create KMS client and scan datadir to find out which keys and versions
+ are present.
+*/
+static int plugin_init(void *p)
+{
+ DBUG_ENTER("plugin_init");
+ client = new KMSClient();
+ if (!client)
+ {
+ sql_print_error("Can not initialize KMS client");
+ DBUG_RETURN(-1);
+ }
+ InitializeAWSLogging(Aws::MakeShared<MySQLLogSystem>("aws_key_management_plugin", (Aws::Utils::Logging::LogLevel) log_level));
+#ifdef HAVE_PSI_INTERFACE
+ mysql_mutex_register("aws_key_management", &mtx_info, 1);
+#endif
+ mysql_mutex_init(mtx_key, &mtx, NULL);
+
+ MY_DIR *dirp = my_dir(".", MYF(0));
+ if (!dirp)
+ {
+ sql_print_error("Can't scan current directory");
+ DBUG_RETURN(-1);
+ }
+ for (unsigned int i=0; i < dirp->number_of_files; i++)
+ {
+
+ KEY_INFO info;
+ if (extract_id_and_version(dirp->dir_entry[i].name, &info.key_id, &info.key_version) == 0)
+ {
+ key_info_cache[KEY_ID_AND_VERSION(info.key_id, info.key_version)]= info;
+ latest_version_cache[info.key_id]= max(info.key_version, latest_version_cache[info.key_id]);
+ }
+ }
+ my_dirend(dirp);
+ DBUG_RETURN(0);
+}
+
+
+static int plugin_deinit(void *p)
+{
+ DBUG_ENTER("plugin_deinit");
+ latest_version_cache.clear();
+ key_info_cache.clear();
+ mysql_mutex_destroy(&mtx);
+ delete client;
+ ShutdownAWSLogging();
+ DBUG_RETURN(0);
+}
+
+/* Generate filename to store the ciphered key */
+static void format_keyfile_name(char *buf, size_t size, uint key_id, uint version)
+{
+ snprintf(buf, size, "aws-kms-key.%u.%u", key_id, version);
+}
+
+/* Extract key id and version from file name */
+static int extract_id_and_version(const char *name, uint *id, uint *ver)
+{
+ int len;
+ int n= sscanf(name, "aws-kms-key.%u.%u%n", id, ver, &len);
+ if (n == 2 && *id > 0 && *ver > 0 && len == (int)strlen(name))
+ return 0;
+ return 1;
+}
+
+/*
+ Decrypt key stored in aws-kms-key.<id>.<version>
+ Cache the decrypted key.
+*/
+static int load_key(KEY_INFO *info)
+{
+ int ret;
+ char path[256];
+ DBUG_ENTER("load_key");
+ DBUG_PRINT("enter", ("id=%u,ver=%u", info->key_id, info->key_version));
+ format_keyfile_name(path, sizeof(path), info->key_id, info->key_version);
+ ret= aws_decrypt_key(path, info);
+ if (ret)
+ info->load_failed= true;
+
+ latest_version_cache[info->key_id]= max(latest_version_cache[info->key_id], info->key_version);
+ key_info_cache[KEY_ID_AND_VERSION(info->key_id, info->key_version)]= *info;
+
+ if (!ret)
+ {
+ sql_print_information("AWS KMS plugin: loaded key %u, version %u, key length %u bit",
+ info->key_id, info->key_version,(uint)info->length*8);
+ }
+ else
+ {
+ sql_print_warning("AWS KMS plugin: key %u, version %u could not be decrypted",
+ info->key_id, info->key_version);
+ }
+ DBUG_RETURN(ret);
+}
+
+
+/*
+ Get latest version for the key.
+
+ If key is not decrypted yet, this function also decrypt the key
+ and error will be returned if decryption fails.
+
+ The reason for that is that Innodb crashes
+ in case errors are returned by get_key(),
+
+ A new key will be created if it does not exist, provided there is
+ valid master_key_id.
+*/
+static unsigned int get_latest_key_version(unsigned int key_id)
+{
+ unsigned int ret;
+ DBUG_ENTER("get_latest_key_version");
+ mysql_mutex_lock(&mtx);
+ ret= get_latest_key_version_nolock(key_id);
+ mysql_mutex_unlock(&mtx);
+ DBUG_PRINT("info", ("key=%u,ret=%u", key_id, ret));
+ DBUG_RETURN(ret);
+}
+
+static unsigned int get_latest_key_version_nolock(unsigned int key_id)
+{
+ KEY_INFO info;
+ uint ver;
+ DBUG_ENTER("get_latest_key_version_nolock");
+ ver= latest_version_cache[key_id];
+ if (ver > 0)
+ {
+ info= key_info_cache[KEY_ID_AND_VERSION(key_id, ver)];
+ }
+ if (info.load_failed)
+ {
+ /* Decryption failed previously, don't retry */
+ DBUG_RETURN(ENCRYPTION_KEY_VERSION_INVALID);
+ }
+ else if (ver > 0)
+ {
+ /* Key exists already, return it*/
+ if (info.length > 0)
+ DBUG_RETURN(ver);
+ }
+ else // (ver == 0)
+ {
+ /* Generate a new key, version 1 */
+ if (!master_key_id[0])
+ {
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "Can't generate encryption key %u, because 'aws_key_management_master_key_id' parameter is not set",
+ MYF(0), key_id);
+ DBUG_RETURN(ENCRYPTION_KEY_VERSION_INVALID);
+ }
+ if (aws_generate_datakey(key_id, 1) != 0)
+ DBUG_RETURN(ENCRYPTION_KEY_VERSION_INVALID);
+ info.key_id= key_id;
+ info.key_version= 1;
+ info.length= 0;
+ }
+
+ if (load_key(&info))
+ DBUG_RETURN(ENCRYPTION_KEY_VERSION_INVALID);
+ DBUG_RETURN(info.key_version);
+}
+
+
+/*
+ Decrypt a file with KMS
+*/
+static int aws_decrypt_key(const char *path, KEY_INFO *info)
+{
+ DBUG_ENTER("aws_decrypt_key");
+
+ /* Read file content into memory */
+ ifstream ifs(path, ios::binary | ios::ate);
+ if (!ifs.good())
+ {
+ sql_print_error("can't open file %s", path);
+ DBUG_RETURN(-1);
+ }
+ size_t pos = (size_t)ifs.tellg();
+ if (!pos || pos == SIZE_T_MAX)
+ {
+ sql_print_error("invalid key file %s", path);
+ DBUG_RETURN(-1);
+ }
+ std::vector<char> contents(pos);
+ ifs.seekg(0, ios::beg);
+ ifs.read(&contents[0], pos);
+
+ /* Decrypt data the with AWS */
+ DecryptRequest request;
+ Aws::Utils::ByteBuffer byteBuffer((unsigned char *)contents.data(), pos);
+ request.SetCiphertextBlob(byteBuffer);
+ DecryptOutcome outcome = client->Decrypt(request);
+ if (!outcome.IsSuccess())
+ {
+ sql_print_error("AWS KMS plugin: Decrypt failed for %s : %s", path,
+ outcome.GetError().GetMessage().c_str());
+ DBUG_RETURN(-1);
+ }
+ Aws::Utils::ByteBuffer plaintext = outcome.GetResult().GetPlaintext();
+ size_t len = plaintext.GetLength();
+
+ if (len > (int)sizeof(info->data))
+ {
+ sql_print_error("AWS KMS plugin: encoding key too large for %s", path);
+ DBUG_RETURN(ENCRYPTION_KEY_BUFFER_TOO_SMALL);
+ }
+ memcpy(info->data, plaintext.GetUnderlyingData(), len);
+ info->length= len;
+ DBUG_RETURN(0);
+}
+
+
+/* Generate a new datakey and store it a file */
+static int aws_generate_datakey(uint keyid, uint version)
+{
+
+ DBUG_ENTER("aws_generate_datakey");
+ GenerateDataKeyWithoutPlaintextRequest request;
+ request.SetKeyId(master_key_id);
+ request.SetKeySpec(DataKeySpecMapper::GetDataKeySpecForName(key_spec_names[key_spec]));
+
+ GenerateDataKeyWithoutPlaintextOutcome outcome;
+ outcome= client->GenerateDataKeyWithoutPlaintext(request);
+ if (!outcome.IsSuccess())
+ {
+ sql_print_error("AWS KMS plugin : GenerateDataKeyWithoutPlaintext failed : %s - %s",
+ outcome.GetError().GetExceptionName().c_str(),
+ outcome.GetError().GetMessage().c_str());
+ DBUG_RETURN(-1);
+ }
+
+ string out;
+ char filename[20];
+ Aws::Utils::ByteBuffer byteBuffer = outcome.GetResult().GetCiphertextBlob();
+
+ format_keyfile_name(filename, sizeof(filename), keyid, version);
+ int fd= my_open(filename, O_RDWR | O_CREAT, 0);
+ if (fd < 0)
+ {
+ sql_print_error("AWS KMS plugin: Can't create file %s", filename);
+ DBUG_RETURN(-1);
+ }
+ size_t len= byteBuffer.GetLength();
+ if (my_write(fd, byteBuffer.GetUnderlyingData(), len, 0) != len)
+ {
+ sql_print_error("AWS KMS plugin: can't write to %s", filename);
+ my_close(fd, 0);
+ my_delete(filename, 0);
+ DBUG_RETURN(-1);
+ }
+ my_close(fd, 0);
+ sql_print_information("AWS KMS plugin: generated encrypted datakey for key id=%u, version=%u",
+ keyid, version);
+ DBUG_RETURN(0);
+}
+
+/* Key rotation for a single key */
+static int rotate_single_key(uint key_id)
+{
+ uint ver;
+ ver= latest_version_cache[key_id];
+
+ if (!ver)
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "key %u does not exist", MYF(ME_JUST_WARNING), key_id);
+ return -1;
+ }
+ else if (aws_generate_datakey(key_id, ver + 1))
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "Could not generate datakey for key id= %u, ver= %u",
+ MYF(ME_JUST_WARNING), key_id, ver);
+ return -1;
+ }
+ else
+ {
+ KEY_INFO info;
+ info.key_id= key_id;
+ info.key_version = ver + 1;
+ if (load_key(&info))
+ {
+ my_printf_error(ER_UNKNOWN_ERROR, "Could not load datakey for key id= %u, ver= %u",
+ MYF(ME_JUST_WARNING), key_id, ver);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+/* Key rotation for all key ids */
+static int rotate_all_keys()
+{
+ int ret= 0;
+ for (map<uint, uint>::iterator it= latest_version_cache.begin(); it != latest_version_cache.end(); it++)
+ {
+ ret= rotate_single_key(it->first);
+ if (ret)
+ break;
+ }
+ return ret;
+}
+
+static void update_rotate(MYSQL_THD, struct st_mysql_sys_var *, void *, const void *val)
+{
+ if (!master_key_id[0])
+ {
+ my_printf_error(ER_UNKNOWN_ERROR,
+ "aws_key_management_master_key_id must be set to generate new data keys", MYF(ME_JUST_WARNING));
+ return;
+ }
+ mysql_mutex_lock(&mtx);
+ rotate_key= *(int *)val;
+ switch (rotate_key)
+ {
+ case 0:
+ break;
+ case -1:
+ rotate_all_keys();
+ break;
+ default:
+ rotate_single_key(rotate_key);
+ break;
+ }
+ rotate_key= 0;
+ mysql_mutex_unlock(&mtx);
+}
+
+static unsigned int get_key(
+ unsigned int key_id,
+ unsigned int version,
+ unsigned char* dstbuf,
+ unsigned int* buflen)
+{
+ KEY_INFO info;
+
+ DBUG_ENTER("get_key");
+ mysql_mutex_lock(&mtx);
+ info= key_info_cache[KEY_ID_AND_VERSION(key_id, version)];
+ if (info.length == 0 && !info.load_failed)
+ {
+ info.key_id= key_id;
+ info.key_version= version;
+ load_key(&info);
+ }
+ mysql_mutex_unlock(&mtx);
+ if (info.load_failed)
+ DBUG_RETURN(ENCRYPTION_KEY_VERSION_INVALID);
+ if (*buflen < info.length)
+ {
+ *buflen= info.length;
+ DBUG_RETURN(ENCRYPTION_KEY_BUFFER_TOO_SMALL);
+ }
+ *buflen= info.length;
+ memcpy(dstbuf, info.data, info.length);
+ DBUG_RETURN(0);
+}
+
+
+/* Plugin defs */
+struct st_mariadb_encryption aws_key_management_plugin= {
+ MariaDB_ENCRYPTION_INTERFACE_VERSION,
+ get_latest_key_version,
+ get_key,
+ // use default encrypt/decrypt functions
+ 0, 0, 0, 0, 0
+};
+
+
+static TYPELIB key_spec_typelib =
+{
+ array_elements(key_spec_names) - 1, "",
+ key_spec_names, NULL
+};
+
+const char *log_level_names[] =
+{
+ "Off",
+ "Fatal",
+ "Error",
+ "Warn",
+ "Info",
+ "Debug",
+ "Trace",
+ 0
+};
+
+static TYPELIB log_level_typelib =
+{
+ array_elements(log_level_names) - 1, "",
+ log_level_names, NULL
+};
+
+static MYSQL_SYSVAR_STR(master_key_id, master_key_id,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Key id for master encryption key. Used to create new datakeys. If not set, no new keys will be created",
+ NULL, NULL, "");
+
+static MYSQL_SYSVAR_ENUM(key_spec, key_spec,
+ PLUGIN_VAR_RQCMDARG,
+ "Encryption algorithm used to create new keys.",
+ NULL, NULL, 0, &key_spec_typelib);
+
+
+static MYSQL_SYSVAR_ENUM(log_level, log_level,
+ PLUGIN_VAR_RQCMDARG,
+ "Logging for AWS API",
+ NULL, NULL, 0, &log_level_typelib);
+
+
+static MYSQL_SYSVAR_INT(rotate_key, rotate_key,
+ PLUGIN_VAR_RQCMDARG,
+ "Set this variable to key id to perform rotation of the key. Specify -1 to rotate all keys",
+ NULL, update_rotate, 0, -1, INT_MAX, 1);
+
+static struct st_mysql_sys_var* settings[]= {
+ MYSQL_SYSVAR(master_key_id),
+ MYSQL_SYSVAR(key_spec),
+ MYSQL_SYSVAR(rotate_key),
+ MYSQL_SYSVAR(log_level),
+ NULL
+};
+
+/*
+ Plugin library descriptor
+*/
+maria_declare_plugin(aws_key_management)
+{
+ MariaDB_ENCRYPTION_PLUGIN,
+ &aws_key_management_plugin,
+ "aws_key_management",
+ "MariaDB Corporation",
+ "AWS key management plugin",
+ PLUGIN_LICENSE_GPL,
+ plugin_init,
+ plugin_deinit,
+ 0x0100,
+ NULL,
+ settings,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL
+}
+maria_declare_plugin_end;
diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c
index c16075df74b..c593173942d 100644
--- a/plugin/cracklib_password_check/cracklib_password_check.c
+++ b/plugin/cracklib_password_check/cracklib_password_check.c
@@ -78,6 +78,6 @@ maria_declare_plugin(cracklib_password_check)
NULL,
sysvars,
"1.0",
- MariaDB_PLUGIN_MATURITY_ALPHA,
+ MariaDB_PLUGIN_MATURITY_GAMMA,
}
maria_declare_plugin_end;
diff --git a/plugin/file_key_management/file_key_management_plugin.cc b/plugin/file_key_management/file_key_management_plugin.cc
index 970fae9c189..e0afbd68cc9 100644
--- a/plugin/file_key_management/file_key_management_plugin.cc
+++ b/plugin/file_key_management/file_key_management_plugin.cc
@@ -186,6 +186,6 @@ maria_declare_plugin(file_key_management)
NULL, /* status variables */
settings,
"1.0",
- MariaDB_PLUGIN_MATURITY_ALPHA
+ MariaDB_PLUGIN_MATURITY_GAMMA
}
maria_declare_plugin_end;
diff --git a/plugin/file_key_management/parser.cc b/plugin/file_key_management/parser.cc
index 28cd981df79..628412bc171 100644
--- a/plugin/file_key_management/parser.cc
+++ b/plugin/file_key_management/parser.cc
@@ -220,7 +220,7 @@ bool Parser::parse_file(Dynamic_array<keyentry> *keys, const char *secret)
keys->sort(sort_keys);
my_free(buffer);
- if (keys->at(0).id != 1)
+ if (keys->elements() == 0 || keys->at(0).id != 1)
{
report_error("System key id 1 is missing", 0);
return 1;
diff --git a/plugin/handler_socket/docs-en/perl-client.en.txt b/plugin/handler_socket/docs-en/perl-client.en.txt
index 448d33b5f12..cc9138518ee 100644
--- a/plugin/handler_socket/docs-en/perl-client.en.txt
+++ b/plugin/handler_socket/docs-en/perl-client.en.txt
@@ -42,7 +42,7 @@ to be retrieved are specified by the 5th argument for the
corresponding open_index call.
The execute_single method always returns an arrayref. The first
-element is the error code, which is 0 when no error is occured.
+element is the error code, which is 0 when no error is occurred.
The remaining are the field values. If more than one record is
returned, it is flatten to an 1-dimensional array. For example,
when 5 records that have 3 columns are returned, you can retrieve
@@ -125,9 +125,9 @@ methods.
die $hs->get_error() if $res->[0] != 0;
-----------------------------------------------------------------
-When an error is occured, the first element of the returned
+When an error is occurred, the first element of the returned
arrayref becomes a non-zero value. A negative value indicates
-that an I/O error is occured and the Net::HandlerSocket object
+that an I/O error is occurred and the Net::HandlerSocket object
should be disposed. A positive value means that the connection is
still active and the Net::HandlerSocket object can be reused
later.
diff --git a/plugin/handler_socket/handlersocket/database.cpp b/plugin/handler_socket/handlersocket/database.cpp
index cfed9c42c0a..94eedbf6d04 100644
--- a/plugin/handler_socket/handlersocket/database.cpp
+++ b/plugin/handler_socket/handlersocket/database.cpp
@@ -304,6 +304,7 @@ dbcontext::init_thread(const void *stack_bottom, volatile int& shutdown_flag)
thd->db = 0;
thd->db = my_strdup("handlersocket", MYF(0));
}
+ thd->variables.option_bits |= OPTION_TABLE_LOCK;
my_pthread_setspecific_ptr(THR_THD, thd);
DBG_THR(fprintf(stderr, "HNDSOCK x0 %p\n", thd));
}
@@ -341,7 +342,7 @@ void
dbcontext::term_thread()
{
DBG_THR(fprintf(stderr, "HNDSOCK thread end %p\n", thd));
- unlock_tables_if();
+ close_tables_if();
my_pthread_setspecific_ptr(THR_THD, 0);
{
pthread_mutex_lock(&LOCK_thread_count);
diff --git a/plugin/locale_info/locale_info.cc b/plugin/locale_info/locale_info.cc
index dd14dcbb769..3d775c0be7c 100644
--- a/plugin/locale_info/locale_info.cc
+++ b/plugin/locale_info/locale_info.cc
@@ -117,6 +117,6 @@ maria_declare_plugin(locales)
NULL, /* Status variables */
NULL, /* System variables */
"1.0", /* String version representation */
- MariaDB_PLUGIN_MATURITY_GAMMA /* Maturity (see include/mysql/plugin.h)*/
+ MariaDB_PLUGIN_MATURITY_STABLE /* Maturity (see include/mysql/plugin.h)*/
}
maria_declare_plugin_end;
diff --git a/plugin/metadata_lock_info/metadata_lock_info.cc b/plugin/metadata_lock_info/metadata_lock_info.cc
index fcfdb59da30..83db2c7ca5c 100644
--- a/plugin/metadata_lock_info/metadata_lock_info.cc
+++ b/plugin/metadata_lock_info/metadata_lock_info.cc
@@ -164,7 +164,7 @@ maria_declare_plugin(metadata_lock_info)
NULL,
NULL,
NULL,
- MariaDB_PLUGIN_MATURITY_GAMMA,
+ MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
#else
diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc
index 998076dadf7..4ccfdc8f8c2 100644
--- a/plugin/qc_info/qc_info.cc
+++ b/plugin/qc_info/qc_info.cc
@@ -282,7 +282,7 @@ maria_declare_plugin(query_cache_info)
NULL, /* status variables */
NULL, /* system variables */
"1.1", /* version as a string */
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/plugin/query_response_time/mysql-test/query_response_time/basic.result b/plugin/query_response_time/mysql-test/query_response_time/basic.result
index 15746424b1d..86fba87e056 100644
--- a/plugin/query_response_time/mysql-test/query_response_time/basic.result
+++ b/plugin/query_response_time/mysql-test/query_response_time/basic.result
@@ -17,7 +17,7 @@ PLUGIN_TYPE INFORMATION SCHEMA
PLUGIN_AUTHOR Percona and Sergey Vojtovich
PLUGIN_DESCRIPTION Query Response Time Distribution INFORMATION_SCHEMA Plugin
PLUGIN_LICENSE GPL
-PLUGIN_MATURITY Gamma
+PLUGIN_MATURITY Stable
PLUGIN_NAME QUERY_RESPONSE_TIME_AUDIT
PLUGIN_VERSION 1.0
PLUGIN_TYPE AUDIT
diff --git a/plugin/query_response_time/plugin.cc b/plugin/query_response_time/plugin.cc
index c34e4cb6e02..37d52c3ce85 100644
--- a/plugin/query_response_time/plugin.cc
+++ b/plugin/query_response_time/plugin.cc
@@ -144,7 +144,7 @@ maria_declare_plugin(query_response_time)
NULL,
query_response_time_info_vars,
"1.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
},
{
MYSQL_AUDIT_PLUGIN,
diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h
index d9dc4ce024b..c2862476ec8 100644
--- a/plugin/semisync/semisync_master.h
+++ b/plugin/semisync/semisync_master.h
@@ -102,7 +102,7 @@ public:
it are in use. A new Block is allocated and is put into the rear of the
Block link table if no Block is free.
- @return Return a TranxNode *, or NULL if an error occured.
+ @return Return a TranxNode *, or NULL if an error occurred.
*/
TranxNode *allocate_node()
{
@@ -134,7 +134,7 @@ public:
/**
All nodes are freed.
- @return Return 0, or 1 if an error occured.
+ @return Return 0, or 1 if an error occurred.
*/
int free_all_nodes()
{
@@ -150,7 +150,7 @@ public:
@param node All nodes before 'node' will be freed
- @return Return 0, or 1 if an error occured.
+ @return Return 0, or 1 if an error occurred.
*/
int free_nodes_before(TranxNode* node)
{
diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc
index 7bb0eea44ee..309910312c4 100644
--- a/plugin/semisync/semisync_master_plugin.cc
+++ b/plugin/semisync/semisync_master_plugin.cc
@@ -489,7 +489,7 @@ maria_declare_plugin(semisync_master)
semi_sync_master_status_vars, /* status variables */
semi_sync_master_system_vars, /* system variables */
"1.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc
index 572ead214de..3a6c7625d93 100644
--- a/plugin/semisync/semisync_slave_plugin.cc
+++ b/plugin/semisync/semisync_slave_plugin.cc
@@ -227,7 +227,7 @@ maria_declare_plugin(semisync_slave)
semi_sync_slave_status_vars, /* status variables */
semi_sync_slave_system_vars, /* system variables */
"1.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/plugin/simple_password_check/simple_password_check.c b/plugin/simple_password_check/simple_password_check.c
index f6d3e5b7a69..7ad8bfc811a 100644
--- a/plugin/simple_password_check/simple_password_check.c
+++ b/plugin/simple_password_check/simple_password_check.c
@@ -104,6 +104,6 @@ maria_declare_plugin(simple_password_check)
NULL,
sysvars,
"1.0",
- MariaDB_PLUGIN_MATURITY_ALPHA,
+ MariaDB_PLUGIN_MATURITY_GAMMA
}
maria_declare_plugin_end;
diff --git a/plugin/sql_errlog/sql_errlog.c b/plugin/sql_errlog/sql_errlog.c
index 1c7e141c022..6ec4659d407 100644
--- a/plugin/sql_errlog/sql_errlog.c
+++ b/plugin/sql_errlog/sql_errlog.c
@@ -158,6 +158,6 @@ maria_declare_plugin(sql_errlog)
NULL,
vars,
"1.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
diff --git a/plugin/userstat/userstat.cc b/plugin/userstat/userstat.cc
index 6ffee44f43c..69832f817c1 100644
--- a/plugin/userstat/userstat.cc
+++ b/plugin/userstat/userstat.cc
@@ -31,7 +31,7 @@ maria_declare_plugin(userstat)
NULL,
NULL,
"2.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
},
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
@@ -46,7 +46,7 @@ maria_declare_plugin(userstat)
NULL,
NULL,
"2.0",
- MariaDB_PLUGIN_MATURITY_GAMMA
+ MariaDB_PLUGIN_MATURITY_STABLE
},
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
diff --git a/plugin/wsrep_info/plugin.cc b/plugin/wsrep_info/plugin.cc
index f3de177c85f..b8aaee5a132 100644
--- a/plugin/wsrep_info/plugin.cc
+++ b/plugin/wsrep_info/plugin.cc
@@ -245,7 +245,7 @@ maria_declare_plugin(wsrep_info)
NULL, /* Status variables */
NULL, /* System variables */
"1.0", /* Version (string) */
- MariaDB_PLUGIN_MATURITY_ALPHA /* Maturity */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* Maturity */
},
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
@@ -260,7 +260,7 @@ maria_declare_plugin(wsrep_info)
NULL, /* Status variables */
NULL, /* System variables */
"1.0", /* Version (string) */
- MariaDB_PLUGIN_MATURITY_ALPHA /* Maturity */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* Maturity */
}
maria_declare_plugin_end;
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 6fc090ab972..a7cc2eccf38 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -441,7 +441,7 @@ use IPC::Open3;
$DEBUG = 0;
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>8
-# Normaly nothing should be changed beneeth this line
+# Normally nothing should be changed beneeth this line
# ****************************
@@ -2342,7 +2342,7 @@ BEGIN {
."of `$MySQLaccess::script'."
,'Access_denied'
=> "Sorry,\n"
- ."An error occured when trying to connect to the database\n"
+ ."An error occurred when trying to connect to the database\n"
."with the grant-tables:\n"
."* Maybe YOU do not have READ-access to this database?\n"
."* If you used the -U option, you may have supplied an invalid username?\n"
@@ -2352,24 +2352,24 @@ BEGIN {
."* If you used the -P option, you may have supplied an invalid password?\n"
,'Dbaccess_denied'
=> "Sorry,\n"
- ."An error occured when trying to connect to the database\n"
+ ."An error occurred when trying to connect to the database\n"
."with the grant-tables. (dbaccess denied)\n"
,'Unknown_tmp_table'
=> "Sorry,\n"
- ."An error occured when trying to work with the temporary tables in the database\n"
+ ."An error occurred when trying to work with the temporary tables in the database\n"
."with the grant-tables. (One of the temporary tables does not exist)\n"
,'Unknown_table'
=> "Sorry,\n"
- ."An error occured when trying to work with some tables in the database\n"
+ ."An error occurred when trying to work with some tables in the database\n"
."with the grant-tables. (table does not exist)\n"
,'use_old_server'
=> "Sorry,\n"
- ."An error occured when executing an SQL statement.\n"
+ ."An error occurred when executing an SQL statement.\n"
."You might consider altering the use of the parameter `--old_server' when \n"
."calling `$MySQLaccess::script'."
,'unknown_error'
=> "Sorry,\n"
- ."An error occured when trying to connect to the database\n"
+ ."An error occurred when trying to connect to the database\n"
."with the grant-tables. (unknown error)\n"
,'anonymous_access'
=> "Accessing the db as an anonymous user.\n"
@@ -2422,7 +2422,7 @@ sub Print_Header {
sub Print_Footer {
if ($MySQLaccess::CMD) { #command-line mode
print "\n"
- ."BUGs can be reported at https://mariadb.atlassian.net/browse/MDEV\n";
+ ."BUGs can be reported at https://jira.mariadb.org\n";
}
if ($MySQLaccess::CGI) { #CGI-BIN mode
if ($MySQLaccess::Param{'brief'}) {
@@ -2430,7 +2430,7 @@ sub Print_Footer {
}
print "<HR>\n"
."<ADDRESS>\n"
- ."BUGs can be reported at <a href=\"https://mariadb.atlassian.net/browse/MDEV\">MariaDB JIRA</a><BR>\n"
+ ."BUGs can be reported at <a href=\"https://jira.mariadb.org\">MariaDB JIRA</a><BR>\n"
# ."Don't forget to mention the version $VERSION!<BR>\n"
."</ADDRESS>\n"
."</BODY>\n"
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index a93ab940593..7e895aa4eb2 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -127,7 +127,10 @@ then
then
FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed"
+ ERROR="$WSREP_SST_OPT_DATA/sst_error"
+
rm -rf "$FLUSHED"
+ rm -rf "$ERROR"
# Use deltaxfer only for WAN
inv=$(basename $0)
@@ -137,10 +140,20 @@ then
echo "flush tables"
# Wait for :
- # (a) tables to be flushed, and
- # (b) state ID & wsrep_gtid_domain_id to be written to the file.
+ # (a) Tables to be flushed, AND
+ # (b) Cluster state ID & wsrep_gtid_domain_id to be written to the file, OR
+ # (c) ERROR file, in case flush tables operation failed.
+
while [ ! -r "$FLUSHED" ] && ! grep -q ':' "$FLUSHED" >/dev/null 2>&1
do
+ # Check whether ERROR file exists.
+ if [ -f "$ERROR" ]
+ then
+ # Flush tables operation failed.
+ rm -rf "$ERROR"
+ exit 255
+ fi
+
sleep 0.2
done
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh
index a46bb2d7a49..7bc7c23be66 100644
--- a/sql-bench/bench-init.pl.sh
+++ b/sql-bench/bench-init.pl.sh
@@ -265,7 +265,7 @@ sub fetch_all_rows
if (!($sth= $dbh->prepare($query)))
{
print "\n" if ($opt_debug);
- die "Error occured with prepare($query)\n -> $DBI::errstr\n";
+ die "Error occurred with prepare($query)\n -> $DBI::errstr\n";
return undef;
}
if (!$sth->execute)
@@ -282,7 +282,7 @@ sub fetch_all_rows
print "0\n" if ($opt_debug);
return 0;
}
- die "Error occured with execute($query)\n -> $DBI::errstr\n";
+ die "Error occurred with execute($query)\n -> $DBI::errstr\n";
$sth->finish;
return undef;
}
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index 063fc5c6dc6..dd87b01d932 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -235,7 +235,7 @@ static void load_env_plugins(MYSQL *mysql)
This function must be called before any other client plugin function.
@retval 0 successful
- @retval != 0 error occured
+ @retval != 0 error occurred
*/
int mysql_client_plugin_init()
{
diff --git a/sql-common/mysql_async.c b/sql-common/mysql_async.c
index ef01f292180..80b4f390641 100644
--- a/sql-common/mysql_async.c
+++ b/sql-common/mysql_async.c
@@ -102,7 +102,7 @@ my_connect_async(struct mysql_async_context *b, my_socket fd,
my_context_yield(&b->async_context);
if (b->suspend_resume_hook)
(*b->suspend_resume_hook)(FALSE, b->suspend_resume_hook_user_data);
- if (b->events_occured & MYSQL_WAIT_TIMEOUT)
+ if (b->events_occurred & MYSQL_WAIT_TIMEOUT)
return -1;
s_err_size= sizeof(res);
@@ -149,7 +149,7 @@ my_recv_async(struct mysql_async_context *b, int fd,
my_context_yield(&b->async_context);
if (b->suspend_resume_hook)
(*b->suspend_resume_hook)(FALSE, b->suspend_resume_hook_user_data);
- if (b->events_occured & MYSQL_WAIT_TIMEOUT)
+ if (b->events_occurred & MYSQL_WAIT_TIMEOUT)
return -1;
}
}
@@ -177,7 +177,7 @@ my_send_async(struct mysql_async_context *b, int fd,
my_context_yield(&b->async_context);
if (b->suspend_resume_hook)
(*b->suspend_resume_hook)(FALSE, b->suspend_resume_hook_user_data);
- if (b->events_occured & MYSQL_WAIT_TIMEOUT)
+ if (b->events_occurred & MYSQL_WAIT_TIMEOUT)
return -1;
}
}
@@ -210,7 +210,7 @@ my_io_wait_async(struct mysql_async_context *b, enum enum_vio_io_event event,
my_context_yield(&b->async_context);
if (b->suspend_resume_hook)
(*b->suspend_resume_hook)(FALSE, b->suspend_resume_hook_user_data);
- return (b->events_occured & MYSQL_WAIT_TIMEOUT) ? 0 : 1;
+ return (b->events_occurred & MYSQL_WAIT_TIMEOUT) ? 0 : 1;
}
@@ -349,7 +349,7 @@ mysql_get_timeout_value_ms(const MYSQL *mysql)
} \
\
b->active= 1; \
- b->events_occured= ready_status; \
+ b->events_occurred= ready_status; \
res= my_context_continue(&b->async_context); \
b->active= 0; \
if (res > 0) \
@@ -405,7 +405,7 @@ mysql_get_timeout_value_ms(const MYSQL *mysql)
} \
\
b->active= 1; \
- b->events_occured= ready_status; \
+ b->events_occurred= ready_status; \
res= my_context_continue(&b->async_context); \
b->active= 0; \
if (res > 0) \
diff --git a/sql/contributors.h b/sql/contributors.h
index 255decd19cc..04f8b74aa65 100644
--- a/sql/contributors.h
+++ b/sql/contributors.h
@@ -39,17 +39,17 @@ 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"},
{"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"},
+ {"Auttomattic", "http://automattic.com", "Member of the MariaDB Foundation"},
+ {"Visma", "http://visma.com", "Member of the MariaDB Foundation"},
+ {"Nexedi", "http://www.nexedi.com", "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", "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" },
+ {"Google", "USA", "Sponsoring encryption, parallel replication and GTID"},
{"Facebook", "USA", "Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc"},
/* Individual contributors, names in historical order, newer first */
diff --git a/sql/discover.cc b/sql/discover.cc
index 82648e94bc5..d8ed718fc58 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -199,14 +199,15 @@ int extension_based_table_discovery(MY_DIR *dirp, const char *ext_meta,
end= cur + dirp->number_of_files;
while (cur < end)
{
- char *octothorp= strrchr(cur->name + 1, '#');
+ char *octothorp= strchr(cur->name + 1, '#');
char *ext= strchr(octothorp ? octothorp : cur->name, FN_EXTCHAR);
if (ext)
{
size_t len= (octothorp ? octothorp : ext) - cur->name;
if (from != cur &&
- (my_strnncoll(cs, (uchar*)from->name, len, (uchar*)cur->name, len) ||
+ (strlen(from->name) <= len ||
+ my_strnncoll(cs, (uchar*)from->name, len, (uchar*)cur->name, len) ||
(from->name[len] != FN_EXTCHAR && from->name[len] != '#')))
advance(from, to, cur, skip);
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index e7554da1969..5d0754cf766 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -948,7 +948,7 @@ end:
@retval FALSE an event with such db/name key exists
- @retval TRUE no record found or an error occured.
+ @retval TRUE no record found or an error occurred.
*/
bool
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 35187af23ac..ae8ba258717 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -191,7 +191,7 @@ Event_queue::deinit_queue()
@param[out] created set to TRUE if no error and the element is
added to the queue, FALSE otherwise
- @retval TRUE an error occured. The value of created is undefined,
+ @retval TRUE an error occurred. The value of created is undefined,
the element was not deleted.
@retval FALSE success
*/
diff --git a/sql/events.cc b/sql/events.cc
index df487e88f67..f428bc17927 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -333,6 +333,10 @@ Events::create_event(THD *thd, Event_parse_data *parse_data)
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
+ if (lock_object_name(thd, MDL_key::EVENT,
+ parse_data->dbname.str, parse_data->name.str))
+ DBUG_RETURN(TRUE);
+
if (check_db_dir_existence(parse_data->dbname.str))
{
my_error(ER_BAD_DB_ERROR, MYF(0), parse_data->dbname.str);
@@ -347,10 +351,6 @@ Events::create_event(THD *thd, Event_parse_data *parse_data)
*/
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
- if (lock_object_name(thd, MDL_key::EVENT,
- parse_data->dbname.str, parse_data->name.str))
- DBUG_RETURN(TRUE);
-
if (thd->lex->create_info.or_replace() && event_queue)
event_queue->drop_event(thd, parse_data->dbname, parse_data->name);
@@ -454,6 +454,16 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
+ if (lock_object_name(thd, MDL_key::EVENT,
+ parse_data->dbname.str, parse_data->name.str))
+ DBUG_RETURN(TRUE);
+
+ if (check_db_dir_existence(parse_data->dbname.str))
+ {
+ my_error(ER_BAD_DB_ERROR, MYF(0), parse_data->dbname.str);
+ DBUG_RETURN(TRUE);
+ }
+
if (new_dbname) /* It's a rename */
{
@@ -476,6 +486,13 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
if (check_access(thd, EVENT_ACL, new_dbname->str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
+ /*
+ Acquire mdl exclusive lock on target database name.
+ */
+ if (lock_object_name(thd, MDL_key::EVENT,
+ new_dbname->str, new_name->str))
+ DBUG_RETURN(TRUE);
+
/* Check that the target database exists */
if (check_db_dir_existence(new_dbname->str))
{
@@ -490,10 +507,6 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
*/
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
- if (lock_object_name(thd, MDL_key::EVENT,
- parse_data->dbname.str, parse_data->name.str))
- DBUG_RETURN(TRUE);
-
/* On error conditions my_error() is called so no need to handle here */
if (!(ret= db_repository->update_event(thd, parse_data,
new_dbname, new_name)))
diff --git a/sql/field.cc b/sql/field.cc
index 177f219c137..6be45005d48 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5647,6 +5647,18 @@ Item *Field_temporal::get_equal_const_item_datetime(THD *thd,
}
break;
case ANY_SUBST:
+ if (!is_temporal_type_with_date(const_item->field_type()))
+ {
+ MYSQL_TIME ltime;
+ if (const_item->get_date_with_conversion(&ltime,
+ TIME_FUZZY_DATES |
+ TIME_INVALID_DATES))
+ return NULL;
+ return new (thd->mem_root)
+ Item_datetime_literal_for_invalid_dates(thd, &ltime,
+ ltime.second_part ?
+ TIME_SECOND_PART_DIGITS : 0);
+ }
break;
}
return const_item;
@@ -5955,7 +5967,10 @@ Item *Field_time::get_equal_const_item(THD *thd, const Context &ctx,
{
MYSQL_TIME ltime;
// Get the value of const_item with conversion from DATETIME to TIME
- if (const_item->get_time_with_conversion(thd, &ltime, TIME_TIME_ONLY))
+ if (const_item->get_time_with_conversion(thd, &ltime,
+ TIME_TIME_ONLY |
+ TIME_FUZZY_DATES |
+ TIME_INVALID_DATES))
return NULL;
/*
Replace a DATE/DATETIME constant to a TIME constant:
@@ -7868,7 +7883,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
uint copy_length, new_length;
String_copier copier;
- const char *tmp;
+ char *tmp;
char buff[STRING_BUFFER_USUAL_SIZE];
String tmpstr(buff,sizeof(buff), &my_charset_bin);
@@ -7878,6 +7893,29 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
return 0;
}
+ if (table->blob_storage) // GROUP_CONCAT with ORDER BY | DISTINCT
+ {
+ DBUG_ASSERT(!f_is_hex_escape(flags));
+ DBUG_ASSERT(field_charset == cs);
+ DBUG_ASSERT(length <= max_data_length());
+
+ new_length= length;
+ copy_length= table->in_use->variables.group_concat_max_len;
+ if (new_length > copy_length)
+ {
+ int well_formed_error;
+ new_length= cs->cset->well_formed_len(cs, from, from + copy_length,
+ new_length, &well_formed_error);
+ table->blob_storage->set_truncated_value(true);
+ }
+ if (!(tmp= table->blob_storage->store(from, new_length)))
+ goto oom_error;
+
+ Field_blob::store_length(new_length);
+ bmove(ptr + packlength, (uchar*) &tmp, sizeof(char*));
+ return 0;
+ }
+
/*
If the 'from' address is in the range of the temporary 'value'-
object we need to copy the content to a different location or it will be
@@ -7904,15 +7942,14 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
new_length= MY_MIN(max_data_length(), field_charset->mbmaxlen * length);
if (value.alloc(new_length))
goto oom_error;
-
+ tmp= const_cast<char*>(value.ptr());
if (f_is_hex_escape(flags))
{
copy_length= my_copy_with_hex_escaping(field_charset,
- (char*) value.ptr(), new_length,
- from, length);
+ tmp, new_length,
+ from, length);
Field_blob::store_length(copy_length);
- tmp= value.ptr();
bmove(ptr + packlength, (uchar*) &tmp, sizeof(char*));
return 0;
}
@@ -7920,7 +7957,6 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
(char*) value.ptr(), new_length,
cs, from, length);
Field_blob::store_length(copy_length);
- tmp= value.ptr();
bmove(ptr+packlength,(uchar*) &tmp,sizeof(char*));
return check_conversion_status(&copier, from + length, cs, true);
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 6823329132d..263c5bb5017 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -642,9 +642,6 @@ void Copy_field::set(uchar *to,Field *from)
Field_blob::store. Is this in order to trigger the call to
well_formed_copy_nchars, by changing the pointer copy->tmp.ptr()?
That call will take place anyway in all known cases.
-
- - The above causes a truncation to MAX_FIELD_WIDTH. Is this the intended
- effect? Truncation is handled by well_formed_copy_nchars anyway.
*/
void Copy_field::set(Field *to,Field *from,bool save)
{
diff --git a/sql/gcalc_slicescan.h b/sql/gcalc_slicescan.h
index 5a0399bc8da..4996287ca88 100644
--- a/sql/gcalc_slicescan.h
+++ b/sql/gcalc_slicescan.h
@@ -26,7 +26,7 @@
#ifndef GCALC_DBUG_OFF
#define GCALC_DBUG_PRINT(b) DBUG_PRINT("Gcalc", b)
-#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc "a)
+#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc " a)
#define GCALC_DBUG_RETURN(r) DBUG_RETURN(r)
#define GCALC_DBUG_VOID_RETURN DBUG_VOID_RETURN
#define GCALC_DBUG_ASSERT(r) DBUG_ASSERT(r)
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 5d789fa31e3..173a5f709c1 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -8306,7 +8306,7 @@ bool ha_partition::inplace_alter_table(TABLE *altered_table,
/*
Note that this function will try rollback failed ADD INDEX by
executing DROP INDEX for the indexes that were committed (if any)
- before the error occured. This means that the underlying storage
+ before the error occurred. This means that the underlying storage
engine must be able to drop index in-place with X-lock held.
(As X-lock will be held here if new indexes are to be committed)
*/
diff --git a/sql/handler.cc b/sql/handler.cc
index 863a6f15241..748a51f5c59 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -324,7 +324,7 @@ int ha_init_errors(void)
/* Set the dedicated error messages. */
SETMSG(HA_ERR_KEY_NOT_FOUND, ER_DEFAULT(ER_KEY_NOT_FOUND));
SETMSG(HA_ERR_FOUND_DUPP_KEY, ER_DEFAULT(ER_DUP_KEY));
- SETMSG(HA_ERR_RECORD_CHANGED, "Update wich is recoverable");
+ SETMSG(HA_ERR_RECORD_CHANGED, "Update which is recoverable");
SETMSG(HA_ERR_WRONG_INDEX, "Wrong index given to function");
SETMSG(HA_ERR_CRASHED, ER_DEFAULT(ER_NOT_KEYFILE));
SETMSG(HA_ERR_WRONG_IN_RECORD, ER_DEFAULT(ER_CRASHED_ON_USAGE));
diff --git a/sql/handler.h b/sql/handler.h
index 2b535fb34dd..6054ec2db35 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1302,7 +1302,7 @@ struct handlerton
};
/*
- By default (if not implemented by the engine, but the discovery_table() is
+ By default (if not implemented by the engine, but the discover_table() is
implemented) it will perform a file-based discovery:
- if tablefile_extensions[0] is not null, this will discovers all tables
@@ -3626,7 +3626,7 @@ public:
*) a) If the previous step succeeds, handler::ha_commit_inplace_alter_table() is
called to allow the storage engine to do any final updates to its structures,
to make all earlier changes durable and visible to other connections.
- b) If we have failed to upgrade lock or any errors have occured during the
+ b) If we have failed to upgrade lock or any errors have occurred during the
handler functions calls (including commit), we call
handler::ha_commit_inplace_alter_table()
to rollback all changes which were done during previous steps.
diff --git a/sql/item.cc b/sql/item.cc
index 910a4faa24d..7cdb2d2e7e4 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1259,6 +1259,22 @@ err:
if allowed, otherwise - null.
*/
bzero((char*) ltime,sizeof(*ltime));
+ if (fuzzydate & TIME_TIME_ONLY)
+ {
+ /*
+ In the following scenario:
+ - The caller expected to get a TIME value
+ - Item returned a not NULL string or numeric value
+ - But then conversion from string or number to TIME failed
+ we need to change the default time_type from MYSQL_TIMESTAMP_DATE
+ (which was set in bzero) to MYSQL_TIMESTAMP_TIME and therefore
+ return TIME'00:00:00' rather than DATE'0000-00-00'.
+ If we don't do this, methods like Item::get_time_with_conversion()
+ will erroneously subtract CURRENT_DATE from '0000-00-00 00:00:00'
+ and return TIME'-838:59:59' instead of TIME'00:00:00' as a result.
+ */
+ ltime->time_type= MYSQL_TIMESTAMP_TIME;
+ }
return null_value|= !(fuzzydate & TIME_FUZZY_DATES);
}
@@ -4565,7 +4581,7 @@ bool is_outer_table(TABLE_LIST *table, SELECT_LEX *select)
@retval
0 column fully fixed and fix_fields() should return FALSE
@retval
- -1 error occured
+ -1 error occurred
*/
int
@@ -6388,6 +6404,7 @@ bool Item::cache_const_expr_analyzer(uchar **arg)
!(basic_const_item() || item->basic_const_item() ||
item->type() == Item::FIELD_ITEM ||
item->type() == SUBSELECT_ITEM ||
+ item->type() == CACHE_ITEM ||
/*
Do not cache GET_USER_VAR() function as its const_item() may
return TRUE for the current thread but it still may change
@@ -6485,7 +6502,7 @@ void Item_field::update_null_value()
UPDATE statement.
RETURN
- 0 if error occured
+ 0 if error occurred
ref if all conditions are met
this field otherwise
*/
diff --git a/sql/item.h b/sql/item.h
index 9954b0ab31d..d67a29dee5a 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -428,7 +428,7 @@ public:
RETURN
FALSE if parameter value has been set,
- TRUE if error has occured.
+ TRUE if error has occurred.
*/
virtual bool set_value(THD *thd, sp_rcontext *ctx, Item **it)= 0;
@@ -660,9 +660,7 @@ protected:
Field *tmp_table_field_from_field_type(TABLE *table,
bool fixed_length,
bool set_blob_packlength);
- Field *create_tmp_field(bool group, TABLE *table,
- uint convert_blob_length,
- uint convert_int_length);
+ Field *create_tmp_field(bool group, TABLE *table, uint convert_int_length);
public:
/*
@@ -1660,16 +1658,13 @@ public:
// used in row subselects to get value of elements
virtual void bring_value() {}
- virtual Field *create_tmp_field(bool group, TABLE *table,
- uint convert_blob_length)
+ virtual Field *create_tmp_field(bool group, TABLE *table)
{
/*
Values with MY_INT32_NUM_DECIMAL_DIGITS digits may or may not fit into
Field_long : make them Field_longlong.
*/
- return create_tmp_field(false, table,
- convert_blob_length,
- MY_INT32_NUM_DECIMAL_DIGITS - 2);
+ return create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS - 2);
}
virtual Item_field *field_for_view_update() { return 0; }
@@ -2738,7 +2733,7 @@ public:
/*
If value for parameter was not set we treat it as non-const
- so noone will use parameters value in fix_fields still
+ so no one will use parameters value in fix_fields still
parameter is constant during execution.
*/
virtual table_map used_tables() const
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 44dc8ff9e09..01dcfb39e0e 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2246,50 +2246,6 @@ void Item_func_between::print(String *str, enum_query_type query_type)
}
-void
-Item_func_case_abbreviation2::fix_length_and_dec2(Item **args)
-{
- uint32 char_length;
- set_handler_by_field_type(agg_field_type(args, 2, true));
- maybe_null=args[0]->maybe_null || args[1]->maybe_null;
- decimals= MY_MAX(args[0]->decimals, args[1]->decimals);
- unsigned_flag= args[0]->unsigned_flag && args[1]->unsigned_flag;
-
- if (Item_func_case_abbreviation2::result_type() == DECIMAL_RESULT ||
- Item_func_case_abbreviation2::result_type() == INT_RESULT)
- {
- int len0= args[0]->max_char_length() - args[0]->decimals
- - (args[0]->unsigned_flag ? 0 : 1);
-
- int len1= args[1]->max_char_length() - args[1]->decimals
- - (args[1]->unsigned_flag ? 0 : 1);
-
- char_length= MY_MAX(len0, len1) + decimals + (unsigned_flag ? 0 : 1);
- }
- else
- char_length= MY_MAX(args[0]->max_char_length(), args[1]->max_char_length());
-
- switch (Item_func_case_abbreviation2::result_type()) {
- case STRING_RESULT:
- if (count_string_result_length(Item_func_case_abbreviation2::field_type(),
- args, 2))
- return;
- break;
- case DECIMAL_RESULT:
- case REAL_RESULT:
- break;
- case INT_RESULT:
- decimals= 0;
- break;
- case ROW_RESULT:
- case TIME_RESULT:
- DBUG_ASSERT(0);
- }
- fix_char_length(char_length);
-}
-
-
-
uint Item_func_case_abbreviation2::decimal_precision2(Item **args) const
{
int arg0_int_part= args[0]->decimal_int_part();
@@ -2561,8 +2517,15 @@ void Item_func_nullif::update_used_tables()
void
Item_func_nullif::fix_length_and_dec()
{
- if (!args[2]) // Only false if EOM
- return;
+ /*
+ If this is the first invocation of fix_length_and_dec(), create the
+ third argument as a copy of the first. This cannot be done before
+ fix_fields(), because fix_fields() might replace items,
+ for exampe NOT x --> x==0, or (SELECT 1) --> 1.
+ See also class Item_func_nullif declaration.
+ */
+ if (arg_count == 2)
+ args[arg_count++]= args[0];
THD *thd= current_thd;
/*
@@ -2579,7 +2542,8 @@ 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 && !thd->lex->context_analysis_only)
+ if (args[0]->type() == SUM_FUNC_ITEM &&
+ !thd->lex->is_ps_or_view_context_analysis())
{
/*
NULLIF(l_expr, r_expr)
@@ -2700,7 +2664,7 @@ Item_func_nullif::fix_length_and_dec()
m_cache= args[0]->cmp_type() == STRING_RESULT ?
new (thd->mem_root) Item_cache_str_for_nullif(thd, args[0]) :
Item_cache::get_cache(thd, args[0]);
- m_cache->setup(current_thd, args[0]);
+ m_cache->setup(thd, args[0]);
m_cache->store(args[0]);
m_cache->set_used_tables(args[0]->used_tables());
thd->change_item_tree(&args[0], m_cache);
@@ -2712,7 +2676,7 @@ Item_func_nullif::fix_length_and_dec()
unsigned_flag= args[2]->unsigned_flag;
fix_char_length(args[2]->max_char_length());
maybe_null=1;
- setup_args_and_comparator(current_thd, &cmp);
+ setup_args_and_comparator(thd, &cmp);
}
@@ -2731,10 +2695,10 @@ void Item_func_nullif::print(String *str, enum_query_type query_type)
Therefore, after equal field propagation args[0] and args[2] can point
to different items.
*/
- if (!(query_type & QT_ITEM_FUNC_NULLIF_TO_CASE) || args[0] == args[2])
+ if ((query_type & QT_ITEM_ORIGINAL_FUNC_NULLIF) || args[0] == args[2])
{
/*
- If no QT_ITEM_FUNC_NULLIF_TO_CASE is requested,
+ If QT_ITEM_ORIGINAL_FUNC_NULLIF is requested,
that means we want the original NULLIF() representation,
e.g. when we are in:
SHOW CREATE {VIEW|FUNCTION|PROCEDURE}
@@ -2742,15 +2706,12 @@ void Item_func_nullif::print(String *str, enum_query_type query_type)
The original representation is possible only if
args[0] and args[2] still point to the same Item.
- The caller must pass call print() with QT_ITEM_FUNC_NULLIF_TO_CASE
+ The caller must never pass call print() with QT_ITEM_ORIGINAL_FUNC_NULLIF
if an expression has undergone some optimization
(e.g. equal field propagation done in optimize_cond()) already and
NULLIF() potentially has two different representations of "a":
- one "a" for comparison
- another "a" for the returned value!
-
- 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] || current_thd->lex->context_analysis_only);
str->append(func_name());
@@ -2948,7 +2909,7 @@ Item *Item_func_case::find_item(String *str)
return else_expr_num != -1 ? args[else_expr_num] : 0;
value_added_map|= 1U << (uint)cmp_type;
}
- if (!cmp_items[(uint)cmp_type]->cmp(args[i]) && !args[i]->null_value)
+ if (cmp_items[(uint)cmp_type]->cmp(args[i]) == FALSE)
return args[i + 1];
}
}
@@ -3066,24 +3027,6 @@ bool Item_func_case::fix_fields(THD *thd, Item **ref)
}
-void Item_func_case::agg_str_lengths(Item* arg)
-{
- fix_char_length(MY_MAX(max_char_length(), arg->max_char_length()));
- set_if_bigger(decimals, arg->decimals);
- unsigned_flag= unsigned_flag && arg->unsigned_flag;
-}
-
-
-void Item_func_case::agg_num_lengths(Item *arg)
-{
- uint len= my_decimal_length_to_precision(arg->max_length, arg->decimals,
- arg->unsigned_flag) - arg->decimals;
- set_if_bigger(max_length, len);
- set_if_bigger(decimals, arg->decimals);
- unsigned_flag= unsigned_flag && arg->unsigned_flag;
-}
-
-
/**
Check if (*place) and new_value points to different Items and call
THD::change_item_tree() if needed.
@@ -3145,18 +3088,7 @@ void Item_func_case::fix_length_and_dec()
}
else
{
- collation.set_numeric();
- max_length=0;
- decimals=0;
- unsigned_flag= TRUE;
- for (uint i= 0; i < ncases; i+= 2)
- agg_num_lengths(args[i + 1]);
- if (else_expr_num != -1)
- agg_num_lengths(args[else_expr_num]);
- max_length= my_decimal_precision_to_length_no_truncation(max_length +
- decimals,
- decimals,
- unsigned_flag);
+ fix_attributes(agg, nagg);
}
/*
@@ -3458,23 +3390,25 @@ my_decimal *Item_func_coalesce::decimal_op(my_decimal *decimal_value)
}
-void Item_func_coalesce::fix_length_and_dec()
+void Item_hybrid_func::fix_attributes(Item **items, uint nitems)
{
- set_handler_by_field_type(agg_field_type(args, arg_count, true));
- switch (Item_func_coalesce::result_type()) {
+ switch (Item_hybrid_func::result_type()) {
case STRING_RESULT:
- if (count_string_result_length(Item_func_coalesce::field_type(),
- args, arg_count))
+ if (count_string_result_length(Item_hybrid_func::field_type(),
+ items, nitems))
return;
break;
case DECIMAL_RESULT:
- count_decimal_length();
+ collation.set_numeric();
+ count_decimal_length(items, nitems);
break;
case REAL_RESULT:
- count_real_length();
+ collation.set_numeric();
+ count_real_length(items, nitems);
break;
case INT_RESULT:
- count_only_length(args, arg_count);
+ collation.set_numeric();
+ count_only_length(items, nitems);
decimals= 0;
break;
case ROW_RESULT:
@@ -3606,11 +3540,11 @@ static int cmp_decimal(void *cmp_arg, my_decimal *a, my_decimal *b)
}
-int in_vector::find(Item *item)
+bool in_vector::find(Item *item)
{
uchar *result=get_value(item);
if (!result || !used_count)
- return 0; // Null value
+ return false; // Null value
uint start,end;
start=0; end=used_count-1;
@@ -3619,13 +3553,13 @@ int in_vector::find(Item *item)
uint mid=(start+end+1)/2;
int res;
if ((res=(*compare)(collation, base+mid*size, result)) == 0)
- return 1;
+ return true;
if (res < 0)
start=mid;
else
end=mid-1;
}
- return (int) ((*compare)(collation, base+start*size, result) == 0);
+ return ((*compare)(collation, base+start*size, result) == 0);
}
in_string::in_string(THD *thd, uint elements, qsort2_cmp cmp_func,
@@ -3957,14 +3891,20 @@ int cmp_item_row::cmp(Item *arg)
arg->bring_value();
for (uint i=0; i < n; i++)
{
- if (comparators[i]->cmp(arg->element_index(i)))
+ const int rc= comparators[i]->cmp(arg->element_index(i));
+ switch (rc)
{
- if (!arg->element_index(i)->null_value)
- return 1;
- was_null= 1;
+ case UNKNOWN:
+ was_null= true;
+ break;
+ case TRUE:
+ return TRUE;
+ case FALSE:
+ break; // elements #i are equal
}
+ arg->null_value|= arg->element_index(i)->null_value;
}
- return (arg->null_value= was_null);
+ return was_null ? UNKNOWN : FALSE;
}
@@ -3987,15 +3927,15 @@ void cmp_item_decimal::store_value(Item *item)
/* val may be zero if item is nnull */
if (val && val != &value)
my_decimal2decimal(val, &value);
+ m_null_value= item->null_value;
}
int cmp_item_decimal::cmp(Item *arg)
{
my_decimal tmp_buf, *tmp= arg->val_decimal(&tmp_buf);
- if (arg->null_value)
- return 1;
- return my_decimal_cmp(&value, tmp);
+ return (m_null_value || arg->null_value) ?
+ UNKNOWN : (my_decimal_cmp(&value, tmp) != 0);
}
@@ -4019,12 +3959,14 @@ void cmp_item_datetime::store_value(Item *item)
enum_field_types f_type=
tmp_item[0]->field_type_for_temporal_comparison(warn_item);
value= get_datetime_value(thd, &tmp_item, &lval_cache, f_type, &is_null);
+ m_null_value= item->null_value;
}
int cmp_item_datetime::cmp(Item *arg)
{
- return value != arg->val_temporal_packed(warn_item);
+ const bool rc= value != arg->val_temporal_packed(warn_item);
+ return (m_null_value || arg->null_value) ? UNKNOWN : rc;
}
@@ -4048,10 +3990,10 @@ bool Item_func_in::count_sargable_conds(uchar *arg)
}
-bool Item_func_in::nulls_in_row()
+bool Item_func_in::list_contains_null()
{
Item **arg,**arg_end;
- for (arg= args+1, arg_end= args+arg_count; arg != arg_end ; arg++)
+ for (arg= args + 1, arg_end= args+arg_count; arg != arg_end ; arg++)
{
if ((*arg)->null_inside())
return 1;
@@ -4166,6 +4108,32 @@ void Item_func_in::fix_length_and_dec()
}
}
+ /*
+ First conditions for bisection to be possible:
+ 1. All types are similar, and
+ 2. All expressions in <in value list> are const
+ */
+ bool bisection_possible=
+ type_cnt == 1 && // 1
+ const_itm; // 2
+ if (bisection_possible)
+ {
+ /*
+ In the presence of NULLs, the correct result of evaluating this item
+ must be UNKNOWN or FALSE. To achieve that:
+ - If type is scalar, we can use bisection and the "have_null" boolean.
+ - If type is ROW, we will need to scan all of <in value list> when
+ searching, so bisection is impossible. Unless:
+ 3. UNKNOWN and FALSE are equivalent results
+ 4. Neither left expression nor <in value list> contain any NULL value
+ */
+
+ if (m_compare_type == ROW_RESULT &&
+ ((!is_top_level_item() || negated) && // 3
+ (list_contains_null() || args[0]->maybe_null))) // 4
+ bisection_possible= false;
+ }
+
if (type_cnt == 1)
{
if (m_compare_type == STRING_RESULT &&
@@ -4178,7 +4146,7 @@ void Item_func_in::fix_length_and_dec()
uint cols= args[0]->cols();
cmp_item_row *cmp= 0;
- if (const_itm && !nulls_in_row())
+ if (bisection_possible)
{
array= new (thd->mem_root) in_row(thd, arg_count-1, 0);
cmp= &((in_row*)array)->tmp;
@@ -4207,11 +4175,8 @@ void Item_func_in::fix_length_and_dec()
}
}
}
- /*
- Row item with NULLs inside can return NULL or FALSE =>
- they can't be processed as static
- */
- if (type_cnt == 1 && const_itm && !nulls_in_row())
+
+ if (bisection_possible)
{
/*
IN must compare INT columns and constants as int values (the same
@@ -4267,20 +4232,25 @@ void Item_func_in::fix_length_and_dec()
array= new (thd->mem_root) in_datetime(thd, date_arg, arg_count - 1);
break;
}
- if (array && !(thd->is_fatal_error)) // If not EOM
+ if (!array || thd->is_fatal_error) // OOM
+ return;
+ uint j=0;
+ for (uint i=1 ; i < arg_count ; i++)
{
- uint j=0;
- for (uint i=1 ; i < arg_count ; i++)
+ array->set(j,args[i]);
+ if (!args[i]->null_value)
+ j++; // include this cell in the array.
+ else
{
- array->set(j,args[i]);
- if (!args[i]->null_value) // Skip NULL values
- j++;
- else
- have_null= 1;
+ /*
+ We don't put NULL values in array, to avoid erronous matches in
+ bisection.
+ */
+ have_null= 1;
}
- if ((array->used_count= j))
- array->sort();
}
+ if ((array->used_count= j))
+ array->sort();
}
else
{
@@ -4348,7 +4318,14 @@ longlong Item_func_in::val_int()
uint value_added_map= 0;
if (array)
{
- int tmp=array->find(args[0]);
+ bool tmp=array->find(args[0]);
+ /*
+ NULL on left -> UNKNOWN.
+ Found no match, and NULL on right -> UNKNOWN.
+ NULL on right can never give a match, as it is not stored in
+ array.
+ See also the 'bisection_possible' variable in fix_length_and_dec().
+ */
null_value=args[0]->null_value || (!tmp && have_null);
return (longlong) (!null_value && tmp != negated);
}
@@ -4370,13 +4347,12 @@ longlong Item_func_in::val_int()
if (!(value_added_map & (1U << (uint)cmp_type)))
{
in_item->store_value(args[0]);
- if ((null_value= args[0]->null_value))
- return 0;
value_added_map|= 1U << (uint)cmp_type;
}
- if (!in_item->cmp(args[i]) && !args[i]->null_value)
+ const int rc= in_item->cmp(args[i]);
+ if (rc == FALSE)
return (longlong) (!negated);
- have_null|= args[i]->null_value;
+ have_null|= (rc == UNKNOWN);
}
null_value= have_null;
@@ -5786,7 +5762,7 @@ bool Item_func_not::fix_fields(THD *thd, Item **ref)
args[0]->under_not(this);
if (args[0]->type() == FIELD_ITEM)
{
- /* replace "NOT <field>" with "<filed> == 0" */
+ /* replace "NOT <field>" with "<field> == 0" */
Query_arena backup, *arena;
Item *new_item;
bool rc= TRUE;
@@ -6498,7 +6474,8 @@ longlong Item_equal::val_int()
/* Skip fields of tables that has not been read yet */
if (!field->table->status || (field->table->status & STATUS_NULL_ROW))
{
- if (eval_item->cmp(item) || (null_value= item->null_value))
+ const int rc= eval_item->cmp(item);
+ if ((rc == TRUE) || (null_value= (rc == UNKNOWN)))
return 0;
}
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 717e9e59ddf..2d197a86d9b 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -795,6 +795,7 @@ public:
public:
inline void negate() { negated= !negated; }
inline void top_level_item() { pred_level= 1; }
+ bool is_top_level_item() const { return pred_level; }
Item *neg_transformer(THD *thd)
{
negated= !negated;
@@ -901,7 +902,11 @@ public:
String *str_op(String *);
my_decimal *decimal_op(my_decimal *);
bool date_op(MYSQL_TIME *ltime,uint fuzzydate);
- void fix_length_and_dec();
+ void fix_length_and_dec()
+ {
+ set_handler_by_field_type(agg_field_type(args, arg_count, true));
+ fix_attributes(args, arg_count);
+ }
const char *func_name() const { return "coalesce"; }
table_map not_null_tables() const { return 0; }
};
@@ -914,13 +919,18 @@ public:
*/
class Item_func_case_abbreviation2 :public Item_func_hybrid_field_type
{
+protected:
+ void fix_length_and_dec2(Item **items)
+ {
+ set_handler_by_field_type(agg_field_type(items, 2, true));
+ fix_attributes(items, 2);
+ }
+ uint decimal_precision2(Item **args) const;
public:
Item_func_case_abbreviation2(THD *thd, Item *a, Item *b):
Item_func_hybrid_field_type(thd, a, b) { }
Item_func_case_abbreviation2(THD *thd, Item *a, Item *b, Item *c):
Item_func_hybrid_field_type(thd, a, b, c) { }
- void fix_length_and_dec2(Item **args);
- uint decimal_precision2(Item **args) const;
};
@@ -999,11 +1009,18 @@ class Item_func_nullif :public Item_func_hybrid_field_type
Item_cache *m_cache;
int compare();
public:
- // Put "a" to args[0] for comparison and to args[2] for the returned value.
+ /*
+ Here we pass three arguments to the parent constructor, as NULLIF
+ is a three-argument function, it needs two copies of the first argument
+ (see above). But fix_fields() will be confused if we try to prepare the
+ same Item twice (if args[0]==args[2]), so we hide the third argument
+ (decrementing arg_count) and copy args[2]=args[0] again after fix_fields().
+ See also Item_func_nullif::fix_length_and_dec().
+ */
Item_func_nullif(THD *thd, Item *a, Item *b):
Item_func_hybrid_field_type(thd, a, b, a),
m_cache(NULL)
- {}
+ { arg_count--; }
bool date_op(MYSQL_TIME *ltime, uint fuzzydate);
double real_op();
longlong int_op();
@@ -1060,7 +1077,7 @@ public:
{
my_qsort2(base,used_count,size,compare,(void*)collation);
}
- int find(Item *item);
+ bool find(Item *item);
/*
Create an instance of Item_{type} (e.g. Item_decimal) constant object
@@ -1228,6 +1245,10 @@ public:
cmp_item() { cmp_charset= &my_charset_bin; }
virtual ~cmp_item() {}
virtual void store_value(Item *item)= 0;
+ /**
+ @returns result (TRUE, FALSE or UNKNOWN) of
+ "stored argument's value <> item's value"
+ */
virtual int cmp(Item *item)= 0;
// for optimized IN with row
virtual int compare(cmp_item *item)= 0;
@@ -1240,7 +1261,14 @@ public:
}
};
-class cmp_item_string :public cmp_item
+/// cmp_item which stores a scalar (i.e. non-ROW).
+class cmp_item_scalar : public cmp_item
+{
+protected:
+ bool m_null_value; ///< If stored value is NULL
+};
+
+class cmp_item_string : public cmp_item_scalar
{
protected:
String *value_res;
@@ -1266,14 +1294,20 @@ public:
void store_value(Item *item)
{
value_res= item->val_str(&value);
+ m_null_value= item->null_value;
}
int cmp(Item *arg)
{
char buff[STRING_BUFFER_USUAL_SIZE];
- String tmp(buff, sizeof(buff), cmp_charset), *res;
- res= arg->val_str(&tmp);
- return (value_res ? (res ? sortcmp(value_res, res, cmp_charset) : 1) :
- (res ? -1 : 0));
+ String tmp(buff, sizeof(buff), cmp_charset), *res= arg->val_str(&tmp);
+ if (m_null_value || arg->null_value)
+ return UNKNOWN;
+ if (value_res && res)
+ return sortcmp(value_res, res, cmp_charset) != 0;
+ else if (!value_res && !res)
+ return FALSE;
+ else
+ return TRUE;
}
int compare(cmp_item *ci)
{
@@ -1288,7 +1322,7 @@ public:
}
};
-class cmp_item_int :public cmp_item
+class cmp_item_int : public cmp_item_scalar
{
longlong value;
public:
@@ -1296,10 +1330,12 @@ public:
void store_value(Item *item)
{
value= item->val_int();
+ m_null_value= item->null_value;
}
int cmp(Item *arg)
{
- return value != arg->val_int();
+ const bool rc= value != arg->val_int();
+ return (m_null_value || arg->null_value) ? UNKNOWN : rc;
}
int compare(cmp_item *ci)
{
@@ -1315,7 +1351,7 @@ public:
If the left item is a constant one then its value is cached in the
lval_cache variable.
*/
-class cmp_item_datetime :public cmp_item
+class cmp_item_datetime : public cmp_item_scalar
{
longlong value;
public:
@@ -1333,7 +1369,7 @@ public:
cmp_item *make_same();
};
-class cmp_item_real :public cmp_item
+class cmp_item_real : public cmp_item_scalar
{
double value;
public:
@@ -1341,10 +1377,12 @@ public:
void store_value(Item *item)
{
value= item->val_real();
+ m_null_value= item->null_value;
}
int cmp(Item *arg)
{
- return value != arg->val_real();
+ const bool rc= value != arg->val_real();
+ return (m_null_value || arg->null_value) ? UNKNOWN : rc;
}
int compare(cmp_item *ci)
{
@@ -1355,7 +1393,7 @@ public:
};
-class cmp_item_decimal :public cmp_item
+class cmp_item_decimal : public cmp_item_scalar
{
my_decimal value;
public:
@@ -1382,12 +1420,13 @@ public:
void store_value(Item *item)
{
value_res= item->val_str(&value);
+ m_null_value= item->null_value;
}
int cmp(Item *item)
{
// Should never be called
- DBUG_ASSERT(0);
- return 1;
+ DBUG_ASSERT(false);
+ return TRUE;
}
int compare(cmp_item *ci)
{
@@ -1448,39 +1487,47 @@ public:
Item *find_item(String *str);
CHARSET_INFO *compare_collation() const { return cmp_collation.collation; }
void cleanup();
- void agg_str_lengths(Item *arg);
- void agg_num_lengths(Item *arg);
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond);
};
/*
- The Item_func_in class implements the in_expr IN(values_list) function.
+ The Item_func_in class implements
+ in_expr IN (<in value list>)
+ and
+ in_expr NOT IN (<in value list>)
The current implementation distinguishes 2 cases:
- 1) all items in the value_list are constants and have the same
+ 1) all items in <in value list> are constants and have the same
result type. This case is handled by in_vector class.
- 2) items in the value_list have different result types or there is some
- non-constant items.
- In this case Item_func_in employs several cmp_item objects to performs
- comparisons of in_expr and an item from the values_list. One cmp_item
+ 2) otherwise Item_func_in employs several cmp_item objects to perform
+ comparisons of in_expr and an item from <in value list>. One cmp_item
object for each result type. Different result types are collected in the
fix_length_and_dec() member function by means of collect_cmp_types()
function.
*/
class Item_func_in :public Item_func_opt_neg
{
+ /**
+ Usable if <in value list> is made only of constants. Returns true if one
+ of these constants contains a NULL. Example:
+ IN ( (-5, (12,NULL)), ... ).
+ */
+ bool list_contains_null();
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value);
public:
- /*
- an array of values when the right hand arguments of IN
- are all SQL constant and there are no nulls
- */
+ /// An array of values, created when the bisection lookup method is used
in_vector *array;
+ /**
+ If there is some NULL among <in value list>, during a val_int() call; for
+ example
+ IN ( (1,(3,'col')), ... ), where 'col' is a column which evaluates to
+ NULL.
+ */
bool have_null;
- /*
- true when all arguments of the IN clause are of compatible types
+ /**
+ true when all arguments of the IN list are of compatible types
and can be used safely as comparisons for key conditions
*/
bool arg_types_compatible;
@@ -1534,7 +1581,6 @@ public:
virtual void print(String *str, enum_query_type query_type);
enum Functype functype() const { return IN_FUNC; }
const char *func_name() const { return " IN "; }
- bool nulls_in_row();
bool eval_not_null_tables(uchar *opt_arg);
void fix_after_pullout(st_select_lex *new_parent, Item **ref);
bool count_sargable_conds(uchar *arg);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 4b376706500..50b6f4a6b68 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -232,7 +232,7 @@ Item_func::fix_fields(THD *thd, Item **ref)
}
}
fix_length_and_dec();
- if (thd->is_error()) // An error inside fix_length_and_dec occured
+ if (thd->is_error()) // An error inside fix_length_and_dec occurred
return TRUE;
fixed= 1;
return FALSE;
@@ -575,18 +575,19 @@ void Item_udf_func::fix_num_length_and_dec()
@retval False on success, true on error.
*/
-void Item_func::count_datetime_length(Item **item, uint nitems)
+void Item_func::count_datetime_length(enum_field_types field_type_arg,
+ Item **item, uint nitems)
{
unsigned_flag= 0;
decimals= 0;
- if (field_type() != MYSQL_TYPE_DATE)
+ if (field_type_arg != MYSQL_TYPE_DATE)
{
for (uint i= 0; i < nitems; i++)
set_if_bigger(decimals, item[i]->decimals);
}
set_if_smaller(decimals, TIME_SECOND_PART_DIGITS);
uint len= decimals ? (decimals + 1) : 0;
- len+= mysql_temporal_int_part_length(field_type());
+ len+= mysql_temporal_int_part_length(field_type_arg);
fix_char_length(len);
}
@@ -595,16 +596,16 @@ void Item_func::count_datetime_length(Item **item, uint nitems)
result length/precision depends on argument ones.
*/
-void Item_func::count_decimal_length()
+void Item_func::count_decimal_length(Item **item, uint nitems)
{
int max_int_part= 0;
decimals= 0;
unsigned_flag= 1;
- for (uint i=0 ; i < arg_count ; i++)
+ for (uint i=0 ; i < nitems ; i++)
{
- set_if_bigger(decimals, args[i]->decimals);
- set_if_bigger(max_int_part, args[i]->decimal_int_part());
- set_if_smaller(unsigned_flag, args[i]->unsigned_flag);
+ set_if_bigger(decimals, item[i]->decimals);
+ set_if_bigger(max_int_part, item[i]->decimal_int_part());
+ set_if_smaller(unsigned_flag, item[i]->unsigned_flag);
}
int precision= MY_MIN(max_int_part + decimals, DECIMAL_MAX_PRECISION);
fix_char_length(my_decimal_precision_to_length_no_truncation(precision,
@@ -635,19 +636,20 @@ void Item_func::count_only_length(Item **item, uint nitems)
result length/precision depends on argument ones.
*/
-void Item_func::count_real_length()
+void Item_func::count_real_length(Item **items, uint nitems)
{
uint32 length= 0;
decimals= 0;
max_length= 0;
- for (uint i=0 ; i < arg_count ; i++)
+ unsigned_flag= false;
+ for (uint i=0 ; i < nitems ; i++)
{
if (decimals != NOT_FIXED_DEC)
{
- set_if_bigger(decimals, args[i]->decimals);
- set_if_bigger(length, (args[i]->max_length - args[i]->decimals));
+ set_if_bigger(decimals, items[i]->decimals);
+ set_if_bigger(length, (items[i]->max_length - items[i]->decimals));
}
- set_if_bigger(max_length, args[i]->max_length);
+ set_if_bigger(max_length, items[i]->max_length);
}
if (decimals != NOT_FIXED_DEC)
{
@@ -676,11 +678,11 @@ bool Item_func::count_string_result_length(enum_field_types field_type_arg,
if (agg_arg_charsets_for_string_result(collation, items, nitems, 1))
return true;
if (is_temporal_type(field_type_arg))
- count_datetime_length(items, nitems);
+ count_datetime_length(field_type_arg, items, nitems);
else
{
- decimals= NOT_FIXED_DEC;
count_only_length(items, nitems);
+ decimals= max_length ? NOT_FIXED_DEC : 0;
}
return false;
}
@@ -755,7 +757,7 @@ void Item_num_op::fix_length_and_dec(void)
if (r0 == REAL_RESULT || r1 == REAL_RESULT ||
r0 == STRING_RESULT || r1 ==STRING_RESULT)
{
- count_real_length();
+ count_real_length(args, arg_count);
max_length= float_length(decimals);
set_handler_by_result_type(REAL_RESULT);
}
@@ -5613,7 +5615,7 @@ void Item_func_get_user_var::fix_length_and_dec()
/*
If the variable didn't exist it has been created as a STRING-type.
- 'm_var_entry' is NULL only if there occured an error during the call to
+ 'm_var_entry' is NULL only if there occurred an error during the call to
get_var_with_binlog.
*/
if (!error && m_var_entry)
diff --git a/sql/item_func.h b/sql/item_func.h
index 5e1fa753f34..2ce199b3565 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -41,6 +41,14 @@ protected:
*/
uint allowed_arg_cols;
String *val_str_from_val_str_ascii(String *str, String *str2);
+
+ void count_only_length(Item **item, uint nitems);
+ void count_real_length(Item **item, uint nitems);
+ void count_decimal_length(Item **item, uint nitems);
+ void count_datetime_length(enum_field_types field_type,
+ Item **item, uint nitems);
+ bool count_string_result_length(enum_field_types field_type,
+ Item **item, uint nitems);
public:
table_map not_null_tables_cache;
@@ -148,16 +156,10 @@ public:
virtual void print(String *str, enum_query_type query_type);
void print_op(String *str, enum_query_type query_type);
void print_args(String *str, uint from, enum_query_type query_type);
- void count_only_length(Item **item, uint nitems);
- void count_real_length();
- void count_decimal_length();
inline bool get_arg0_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
return (null_value=args[0]->get_date_with_conversion(ltime, fuzzy_date));
}
- void count_datetime_length(Item **item, uint nitems);
- bool count_string_result_length(enum_field_types field_type,
- Item **item, uint nitems);
inline bool get_arg0_time(MYSQL_TIME *ltime)
{
null_value= args[0]->get_time(ltime);
@@ -175,7 +177,7 @@ public:
{
DBUG_ASSERT(thd == table->in_use);
return result_type() != STRING_RESULT ?
- create_tmp_field(false, table, 0, MY_INT32_NUM_DECIMAL_DIGITS) :
+ create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS) :
tmp_table_field_from_field_type(table, false, false);
}
Item *get_tmp_table_item(THD *thd);
@@ -387,6 +389,8 @@ public:
class Item_hybrid_func: public Item_func,
public Type_handler_hybrid_field_type
{
+protected:
+ void fix_attributes(Item **item, uint nitems);
public:
Item_hybrid_func(THD *thd): Item_func(thd) { }
Item_hybrid_func(THD *thd, Item *a): Item_func(thd, a) { }
@@ -1766,7 +1770,7 @@ public:
Field *create_field_for_create_select(THD *thd, TABLE *table)
{
return result_type() != STRING_RESULT ?
- create_tmp_field(false, table, 0, MY_INT32_NUM_DECIMAL_DIGITS) :
+ create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS) :
tmp_table_field_from_field_type(table, false, true);
}
table_map used_tables() const
diff --git a/sql/item_row.h b/sql/item_row.h
index bbb9a7f1f96..153a6f085b3 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -2,7 +2,7 @@
#define ITEM_ROW_INCLUDED
/*
- Copyright (c) 2002, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2002, 2013, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,11 +28,20 @@
@endverbatim
*/
+
+/**
+ Item which stores (x,y,...) and ROW(x,y,...).
+ Note that this can be recursive: ((x,y),(z,t)) is a ROW of ROWs.
+*/
class Item_row: public Item,
private Item_args,
private Used_tables_and_const_cache
{
table_map not_null_tables_cache;
+ /**
+ If elements are made only of constants, of which one or more are
+ NULL. For example, this item is (1,2,NULL), or ( (1,NULL), (2,3) ).
+ */
bool with_null;
public:
Item_row(THD *thd, List<Item> &list):
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 87c9fa696f7..8745baa8c69 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -5921,7 +5921,7 @@ int subselect_partial_match_engine::exec()
/* Search for a complete match. */
if ((lookup_res= lookup_engine->index_lookup()))
{
- /* An error occured during lookup(). */
+ /* An error occurred during lookup(). */
item_in->value= 0;
item_in->null_value= 0;
return lookup_res;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 139eb717748..0c85cf53e18 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1188,8 +1188,7 @@ void Item_sum_hybrid::setup_hybrid(THD *thd, Item *item, Item *value_arg)
}
-Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table,
- uint convert_blob_length)
+Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table)
{
Field *field;
MEM_ROOT *mem_root;
@@ -1197,9 +1196,9 @@ Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table,
if (args[0]->type() == Item::FIELD_ITEM)
{
field= ((Item_field*) args[0])->field;
-
+
if ((field= create_tmp_field_from_field(table->in_use, field, name, table,
- NULL, convert_blob_length)))
+ NULL)))
field->flags&= ~NOT_NULL_FLAG;
return field;
}
@@ -1225,7 +1224,7 @@ Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table,
Field::NONE, name, decimals);
break;
default:
- return Item_sum::create_tmp_field(group, table, convert_blob_length);
+ return Item_sum::create_tmp_field(group, table);
}
if (field)
field->init(table);
@@ -1583,8 +1582,7 @@ Item *Item_sum_avg::copy_or_same(THD* thd)
}
-Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table,
- uint convert_blob_len)
+Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table)
{
Field *field;
MEM_ROOT *mem_root= table->in_use->mem_root;
@@ -1810,8 +1808,7 @@ Item *Item_sum_variance::copy_or_same(THD* thd)
If we're grouping, then we need some space to serialize variables into, to
pass around.
*/
-Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table,
- uint convert_blob_len)
+Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table)
{
Field *field;
if (group)
@@ -2992,6 +2989,11 @@ int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
ER_THD(thd, ER_CUT_VALUE_GROUP_CONCAT),
item->row_count);
+ /**
+ To avoid duplicated warnings in Item_func_group_concat::val_str()
+ */
+ if (table && table->blob_storage)
+ table->blob_storage->set_truncated_value(false);
return 1;
}
return 0;
@@ -3129,6 +3131,8 @@ void Item_func_group_concat::cleanup()
if (table)
{
THD *thd= table->in_use;
+ if (table->blob_storage)
+ delete table->blob_storage;
free_tmp_table(thd, table);
table= 0;
if (tree)
@@ -3196,6 +3200,8 @@ void Item_func_group_concat::clear()
reset_tree(tree);
if (unique_filter)
unique_filter->reset();
+ if (table && table->blob_storage)
+ table->blob_storage->reset();
/* No need to reset the table as we never call write_row */
}
@@ -3322,6 +3328,7 @@ bool Item_func_group_concat::setup(THD *thd)
{
List<Item> list;
SELECT_LEX *select_lex= thd->lex->current_select;
+ const bool order_or_distinct= MY_TEST(arg_count_order > 0 || distinct);
DBUG_ENTER("Item_func_group_concat::setup");
/*
@@ -3334,9 +3341,6 @@ bool Item_func_group_concat::setup(THD *thd)
if (!(tmp_table_param= new TMP_TABLE_PARAM))
DBUG_RETURN(TRUE);
- /* We'll convert all blobs to varchar fields in the temporary table */
- tmp_table_param->convert_blob_length= max_length *
- collation.collation->mbmaxlen;
/* Push all not constant fields to the list and create a temp table */
always_null= 0;
for (uint i= 0; i < arg_count_field; i++)
@@ -3376,18 +3380,9 @@ bool Item_func_group_concat::setup(THD *thd)
count_field_types(select_lex, tmp_table_param, all_fields, 0);
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
- if (arg_count_order > 0 || distinct)
+ if (order_or_distinct)
{
/*
- Currently we have to force conversion of BLOB values to VARCHAR's
- if we are to store them in TREE objects used for ORDER BY and
- DISTINCT. This leads to truncation if the BLOB's size exceeds
- Field_varstring::MAX_SIZE.
- */
- set_if_smaller(tmp_table_param->convert_blob_length,
- Field_varstring::MAX_SIZE);
-
- /*
Force the create_tmp_table() to convert BIT columns to INT
as we cannot compare two table records containg BIT fields
stored in the the tree used for distinct/order by.
@@ -3420,6 +3415,13 @@ bool Item_func_group_concat::setup(THD *thd)
table->file->extra(HA_EXTRA_NO_ROWS);
table->no_rows= 1;
+ /**
+ Initialize blob_storage if GROUP_CONCAT is used
+ with ORDER BY | DISTINCT and BLOB field count > 0.
+ */
+ if (order_or_distinct && table->s->blob_fields)
+ table->blob_storage= new Blob_mem_storage();
+
/*
Need sorting or uniqueness: init tree and choose a function to sort.
Don't reserve space for NULLs: if any of gconcat arguments is NULL,
@@ -3472,6 +3474,16 @@ String* Item_func_group_concat::val_str(String* str)
if (no_appended && tree)
/* Tree is used for sorting as in ORDER BY */
tree_walk(tree, &dump_leaf_key, this, left_root_right);
+
+ if (table && table->blob_storage &&
+ table->blob_storage->is_truncated_value())
+ {
+ warning_for_row= true;
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_CUT_VALUE_GROUP_CONCAT, ER(ER_CUT_VALUE_GROUP_CONCAT),
+ row_count);
+ }
+
return &result;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 68b034c9213..811e9d5c59c 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -481,11 +481,9 @@ public:
}
virtual void make_unique() { force_copy_fields= TRUE; }
Item *get_tmp_table_item(THD *thd);
- Field *create_tmp_field(bool group, TABLE *table,
- uint convert_blob_length)
+ Field *create_tmp_field(bool group, TABLE *table)
{
- return Item::create_tmp_field(group, table, convert_blob_length,
- MY_INT32_NUM_DECIMAL_DIGITS);
+ return Item::create_tmp_field(group, table, MY_INT32_NUM_DECIMAL_DIGITS);
}
virtual bool collect_outer_ref_processor(uchar *param);
bool init_sum_func_check(THD *thd);
@@ -855,7 +853,7 @@ public:
return has_with_distinct() ? "avg(distinct " : "avg(";
}
Item *copy_or_same(THD* thd);
- Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
+ Field *create_tmp_field(bool group, TABLE *table);
void cleanup()
{
count= 0;
@@ -911,7 +909,7 @@ public:
const char *func_name() const
{ return sample ? "var_samp(" : "variance("; }
Item *copy_or_same(THD* thd);
- Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length);
+ Field *create_tmp_field(bool group, TABLE *table);
enum Item_result result_type () const { return REAL_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE;}
void cleanup()
@@ -989,8 +987,7 @@ protected:
bool any_value() { return was_values; }
void no_rows_in_result();
void restore_to_before_no_rows_in_result();
- Field *create_tmp_field(bool group, TABLE *table,
- uint convert_blob_length);
+ Field *create_tmp_field(bool group, TABLE *table);
};
@@ -1096,7 +1093,6 @@ public:
fixed= true;
}
table_map used_tables() const { return (table_map) 1L; }
- Field *get_tmp_table_field() { DBUG_ASSERT(0); return NULL; }
void set_result_field(Field *) { DBUG_ASSERT(0); }
void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); }
};
diff --git a/sql/log.cc b/sql/log.cc
index 33bd48b3c21..dc8c08bfd36 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -632,7 +632,7 @@ void Log_to_csv_event_handler::cleanup()
indicated in the return value.
@retval FALSE OK
- @retval TRUE error occured
+ @retval TRUE error occurred
*/
bool Log_to_csv_event_handler::
@@ -797,7 +797,7 @@ err:
RETURN
FALSE - OK
- TRUE - error occured
+ TRUE - error occurred
*/
bool Log_to_csv_event_handler::
@@ -1108,7 +1108,7 @@ void Log_to_file_event_handler::flush()
RETURN
FALSE - OK
- TRUE - error occured
+ TRUE - error occurred
*/
bool LOGGER::error_log_print(enum loglevel level, const char *format,
@@ -1266,7 +1266,7 @@ bool LOGGER::flush_general_log()
RETURN
FALSE OK
- TRUE error occured
+ TRUE error occurred
*/
bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
@@ -2839,7 +2839,7 @@ void MYSQL_QUERY_LOG::reopen_file()
RETURN
FASE - OK
- TRUE - error occured
+ TRUE - error occurred
*/
bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
@@ -2941,7 +2941,7 @@ err:
RETURN
FALSE - OK
- TRUE - error occured
+ TRUE - error occurred
*/
bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
@@ -6403,7 +6403,7 @@ binlog_checkpoint_callback(void *cookie)
/*
For every supporting engine, we increment the xid_count and issue a
commit_checkpoint_request(). Then we can count when all
- commit_checkpoint_notify() callbacks have occured, and then log a new
+ commit_checkpoint_notify() callbacks have occurred, and then log a new
binlog checkpoint event.
*/
mysql_bin_log.mark_xids_active(entry->binlog_id, 1);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 78a351e1a9e..b56a9e2aee3 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1392,9 +1392,9 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
if (packet->append(file, data_len - LOG_EVENT_MINIMAL_HEADER_LEN))
{
/*
- Fatal error occured when appending rest of the event
+ Fatal error occurred when appending rest of the event
to packet, possible failures:
- 1. EOF occured when reading from file, it's really an error
+ 1. EOF occurred when reading from file, it's really an error
as there's supposed to be more bytes available.
file->error will have been set to number of bytes left to read
2. Read was interrupted, file->error would normally be set to -1
@@ -4428,6 +4428,15 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
if (thd->m_digest != NULL)
thd->m_digest->reset(thd->m_token_array, max_digest_length);
+ if (thd->slave_thread)
+ {
+ /*
+ The opt_log_slow_slave_statements variable can be changed
+ dynamically, so we have to set the sql_log_slow respectively.
+ */
+ thd->variables.sql_log_slow= opt_log_slow_slave_statements;
+ }
+
thd->enable_slow_log= thd->variables.sql_log_slow;
mysql_parse(thd, thd->query(), thd->query_length(), &parser_state,
FALSE);
@@ -7464,6 +7473,7 @@ bool slave_execute_deferred_events(THD *thd)
return res;
res= rgi->deferred_events->execute(rgi);
+ rgi->deferred_events->rewind();
return res;
}
@@ -11476,7 +11486,10 @@ Rows_log_event::write_row(rpl_group_info *rgi,
/* unpack row into table->record[0] */
if ((error= unpack_current_row(rgi)))
+ {
+ table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
+ }
if (m_curr_row == m_rows_buf && !invoke_triggers)
{
@@ -12484,8 +12497,8 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
We need to read the second image in the event of error to be
able to skip to the next pair of updates
*/
- m_curr_row= m_curr_row_end;
- unpack_current_row(rgi, &m_cols_ai);
+ if ((m_curr_row= m_curr_row_end))
+ unpack_current_row(rgi, &m_cols_ai);
thd_proc_info(thd, tmp);
return error;
}
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 387534b1bed..ff2f7b156d5 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -248,7 +248,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi)
}
if (error)
- { /* error has occured during the transaction */
+ { /* error has occurred during the transaction */
rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(), NULL,
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
@@ -1593,7 +1593,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
} // if (table)
if (error)
- { /* error has occured during the transaction */
+ { /* error has occurred during the transaction */
rli->report(ERROR_LEVEL, thd->net.last_errno, NULL,
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
diff --git a/sql/my_apc.cc b/sql/my_apc.cc
index 91f5cd3f39c..dcb8503b880 100644
--- a/sql/my_apc.cc
+++ b/sql/my_apc.cc
@@ -119,7 +119,7 @@ void init_show_explain_psi_keys(void)
@retval FALSE - Ok, the call has been made
@retval TRUE - Call wasnt made (either the target is in disabled state or
- timeout occured)
+ timeout occurred)
*/
bool Apc_target::make_apc_call(THD *caller_thd, Apc_call *call,
diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc
index 9b4f45a9971..c39789f7c97 100644
--- a/sql/mysql_install_db.cc
+++ b/sql/mysql_install_db.cc
@@ -119,10 +119,10 @@ static void die(const char *fmt, ...)
if (verbose_errors)
{
fprintf(stderr,
- "http://kb.askmonty.org/v/installation-issues-on-windows contains some help\n"
+ "https://mariadb.com/kb/en/installation-issues-on-windows contains some help\n"
"for solving the most common problems. If this doesn't help you, please\n"
- "leave a comment in the Knowledgebase or file a bug report at\n"
- "http://mariadb.org/jira");
+ "leave a comment in the Knowledge Base or file a bug report at\n"
+ "https://jira.mariadb.org");
}
fflush(stderr);
va_end(args);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 51ad1ad7058..e7d7f90d44e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -7423,14 +7423,6 @@ struct my_option my_long_options[]=
"Don't log extra information to update and slow-query logs.",
&opt_short_log_format, &opt_short_log_format,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slow-admin-statements", 0,
- "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to "
- "the slow log if it is open.", &opt_log_slow_admin_statements,
- &opt_log_slow_admin_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slow-slave-statements", 0,
- "Log slow statements executed by slave thread to the slow log if it is open.",
- &opt_log_slow_slave_statements, &opt_log_slow_slave_statements,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-tc", 0,
"Path to transaction coordinator log (used for transactions that affect "
"more than one storage engine, when binary log is disabled).",
diff --git a/sql/mysqld.h b/sql/mysqld.h
index f69654660fd..ef4a0d6a47a 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -667,15 +667,16 @@ enum enum_query_type
/// If NULLIF(a,b) should print itself as
/// CASE WHEN a_for_comparison=b THEN NULL ELSE a_for_return_value END
/// when "a" was replaced to two different items
- /// (e.g. by equal fields propagation in optimize_cond()).
- /// The default behaviour is to print as NULLIF(a_for_return, b)
- /// which should be Ok for SHOW CREATE {VIEW|PROCEDURE|FUNCTION}
- /// as they are not affected by WHERE optimization.
- QT_ITEM_FUNC_NULLIF_TO_CASE= (1 <<6),
+ /// (e.g. by equal fields propagation in optimize_cond())
+ /// or always as NULLIF(a, b).
+ /// The default behaviour is to use CASE syntax when
+ /// a_for_return_value is not the same as a_for_comparison.
+ /// SHOW CREATE {VIEW|PROCEDURE|FUNCTION} and other cases where the
+ /// original representation is required, should set this flag.
+ QT_ITEM_ORIGINAL_FUNC_NULLIF= (1 <<6),
/// This value means focus on readability, not on ability to parse back, etc.
QT_EXPLAIN= QT_TO_SYSTEM_CHARSET |
- QT_ITEM_FUNC_NULLIF_TO_CASE |
QT_ITEM_IDENT_SKIP_CURRENT_DATABASE |
QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS |
QT_ITEM_SUBSELECT_ID_ONLY,
@@ -684,7 +685,7 @@ enum enum_query_type
/// Be more detailed than QT_EXPLAIN.
/// Perhaps we should eventually include QT_ITEM_IDENT_SKIP_CURRENT_DATABASE
/// here, as it would give better readable results
- QT_EXPLAIN_EXTENDED= QT_TO_SYSTEM_CHARSET | QT_ITEM_FUNC_NULLIF_TO_CASE
+ QT_EXPLAIN_EXTENDED= QT_TO_SYSTEM_CHARSET
};
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 286162efcb8..acdedd6e0a0 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -705,7 +705,7 @@ do_retry:
thd->clear_error();
/*
- If we retry due to a deadlock kill that occured during the commit step, we
+ If we retry due to a deadlock kill that occurred during the commit step, we
might have already updated (but not committed) an update of table
mysql.gtid_slave_pos, and cleared the gtid_pending flag. Now we have
rolled back any such update, so we must set the gtid_pending flag back to
@@ -1126,7 +1126,7 @@ handle_rpl_parallel_thread(void *arg)
/*
Register ourself to wait for the previous commit, if we need to do
such registration _and_ that previous commit has not already
- occured.
+ occurred.
*/
register_wait_for_prior_event_group_commit(rgi, entry);
@@ -1187,7 +1187,7 @@ handle_rpl_parallel_thread(void *arg)
{
/*
Do an extra check for (deadlock) kill here. This helps prevent a
- lingering deadlock kill that occured during normal DML processing to
+ lingering deadlock kill that occurred during normal DML processing to
propagate past the mark_start_commit(). If we detect a deadlock only
after mark_start_commit(), we have to unmark, which has at least a
theoretical possibility of leaving a window where it looks like all
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 9bb37f77dbd..c6f77b0144c 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -319,7 +319,7 @@ struct rpl_parallel_entry {
group here. Then later event groups (with higher sub_id) can know not to
try to start (event groups that already started will be rolled back when
wait_for_prior_commit() returns error).
- The value is ULONGLONG_MAX when no error occured.
+ The value is ULONGLONG_MAX when no error occurred.
*/
uint64 stop_on_error_sub_id;
/*
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 208b2b61704..f82c5a3982a 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -185,7 +185,7 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
@retval HA_ERR_GENERIC
A generic, internal, error caused the unpacking to fail.
- @retval ER_SLAVE_CORRUPT_EVENT
+ @retval HA_ERR_CORRUPT_EVENT
Found error when trying to unpack fields.
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
@@ -349,7 +349,7 @@ unpack_row(rpl_group_info *rgi,
"Could not read field '%s' of table '%s.%s'",
f->field_name, table->s->db.str,
table->s->table_name.str);
- DBUG_RETURN(ER_SLAVE_CORRUPT_EVENT);
+ DBUG_RETURN(HA_ERR_CORRUPT_EVENT);
}
}
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 18f6cbc41fd..b5430c56865 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -739,7 +739,7 @@ int set_var::check(THD *thd)
if ((!value->fixed &&
value->fix_fields(thd, &value)) || value->check_cols(1))
return -1;
- if (var->check_update_type(value->result_type()))
+ if (var->check_update_type(value))
{
my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name.str);
return -1;
diff --git a/sql/set_var.h b/sql/set_var.h
index b8192e67ca9..cf86ecf18fa 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -137,8 +137,9 @@ public:
bool is_set_stmt_ok() const { return !(flags & NO_SET_STATEMENT); }
bool is_written_to_binlog(enum_var_type type)
{ return type != OPT_GLOBAL && binlog_status == SESSION_VARIABLE_IN_BINLOG; }
- bool check_update_type(Item_result type)
+ bool check_update_type(const Item *item)
{
+ Item_result type= item->result_type();
switch (option.var_type & GET_TYPE_MASK) {
case GET_INT:
case GET_UINT:
@@ -146,7 +147,8 @@ public:
case GET_ULONG:
case GET_LL:
case GET_ULL:
- return type != INT_RESULT;
+ return type != INT_RESULT &&
+ (type != DECIMAL_RESULT || item->decimals != 0);
case GET_STR:
case GET_STR_ALLOC:
return type != STRING_RESULT;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index d23b79a3301..0d168e937a9 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -6034,7 +6034,7 @@ ER_EVENT_CANNOT_ALTER_IN_THE_PAST
eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future."
ger "Execution Zeitpunkt des Ereignisses in der Vergangenheit liegt, und es war NACH ABSCHLUSS Set nicht erhalten. Die Veranstaltung wurde nicht verändert. Geben Sie einen Zeitpunkt in der Zukunft."
ER_SLAVE_INCIDENT
- eng "The incident %s occured on the master. Message: %-.64s"
+ eng "The incident %s occurred on the master. Message: %-.64s"
ger "Der Vorfall %s passierte auf dem Master. Meldung: %-.64s"
ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT
eng "Table has no partition for some existing values"
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 7151d489c1a..bbe714fc5b4 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -100,7 +100,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
"or misconfigured. This error can also be caused by malfunctioning hardware.\n\n");
my_safe_printf_stderr("%s",
- "To report this bug, see http://kb.askmonty.org/en/reporting-bugs\n\n");
+ "To report this bug, see https://mariadb.com/kb/en/reporting-bugs\n\n");
my_safe_printf_stderr("%s",
"We will try our best to scrape up some info that will hopefully help\n"
@@ -226,7 +226,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
if (calling_initgroups)
{
my_safe_printf_stderr("%s", "\n"
- "This crash occured while the server was calling initgroups(). This is\n"
+ "This crash occurred while the server was calling initgroups(). This is\n"
"often due to the use of a mysqld that is statically linked against \n"
"glibc and configured to use LDAP in /etc/nsswitch.conf.\n"
"You will need to either upgrade to a version of glibc that does not\n"
diff --git a/sql/slave.cc b/sql/slave.cc
index 12eac9c1082..93506bc2ccd 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4945,6 +4945,7 @@ err_during_init:
*/
mysql_mutex_lock(&LOCK_active_mi);
if (opt_slave_parallel_threads > 0 &&
+ master_info_index &&// master_info_index is set to NULL on server shutdown
!master_info_index->any_slave_sql_running())
rpl_parallel_inactivate_pool(&global_rpl_thread_pool);
mysql_mutex_unlock(&LOCK_active_mi);
diff --git a/sql/sp.cc b/sql/sp.cc
index 6ec59143720..3cc24089c40 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -34,6 +34,10 @@
#include <my_user.h>
+/* Used in error handling only */
+#define SP_TYPE_STRING(type) \
+ (type == TYPE_ENUM_FUNCTION ? "FUNCTION" : "PROCEDURE")
+
static int
db_load_routine(THD *thd, stored_procedure_type type, sp_name *name,
sp_head **sphp,
@@ -1007,15 +1011,16 @@ sp_drop_routine_internal(THD *thd, stored_procedure_type type,
followed by an implicit grant (sp_grant_privileges())
and this subsequent call opens and closes mysql.procs_priv.
- @return Error code. SP_OK is returned on success. Other
- SP_ constants are used to indicate about errors.
+ @return Error status.
+ @retval FALSE on success
+ @retval TRUE on error
*/
-int
+bool
sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
{
LEX *lex= thd->lex;
- int ret;
+ bool ret= TRUE;
TABLE *table;
char definer_buf[USER_HOST_BUFF_SIZE];
LEX_STRING definer;
@@ -1040,7 +1045,22 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
/* Grab an exclusive MDL lock. */
if (lock_object_name(thd, mdl_type, sp->m_db.str, sp->m_name.str))
- DBUG_RETURN(SP_OPEN_TABLE_FAILED);
+ {
+ my_error(ER_BAD_DB_ERROR, MYF(0), sp->m_db.str);
+ DBUG_RETURN(TRUE);
+ }
+
+ /*
+ Check that a database directory with this name
+ exists. Design note: This won't work on virtual databases
+ like information_schema.
+ */
+ if (check_db_dir_existence(sp->m_db.str))
+ {
+ my_error(ER_BAD_DB_ERROR, MYF(0), sp->m_db.str);
+ DBUG_RETURN(TRUE);
+ }
+
/* Reset sql_mode during data dictionary operations. */
thd->variables.sql_mode= 0;
@@ -1049,7 +1069,9 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
thd->count_cuted_fields= CHECK_FIELD_WARN;
if (!(table= open_proc_table_for_update(thd)))
- ret= SP_OPEN_TABLE_FAILED;
+ {
+ my_error(ER_SP_STORE_FAILED, MYF(0), SP_TYPE_STRING(type),sp->m_name.str);
+ }
else
{
/* Checking if the routine already exists */
@@ -1065,11 +1087,10 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_SP_ALREADY_EXISTS,
ER_THD(thd, ER_SP_ALREADY_EXISTS),
- type == TYPE_ENUM_FUNCTION ?
- "FUNCTION" : "PROCEDURE",
+ SP_TYPE_STRING(type),
lex->spname->m_name.str);
- ret= SP_OK;
+ ret= FALSE;
// Setting retstr as it is used for logging.
if (sp->m_type == TYPE_ENUM_FUNCTION)
@@ -1078,7 +1099,8 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
}
else
{
- ret= SP_WRITE_ROW_FAILED;
+ my_error(ER_SP_ALREADY_EXISTS, MYF(0),
+ SP_TYPE_STRING(type), sp->m_name.str);
goto done;
}
}
@@ -1090,7 +1112,8 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
if (table->s->fields < MYSQL_PROC_FIELD_COUNT)
{
- ret= SP_GET_FIELD_FAILED;
+ my_error(ER_SP_STORE_FAILED, MYF(0),
+ SP_TYPE_STRING(type), sp->m_name.str);
goto done;
}
@@ -1099,12 +1122,12 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
sp->m_name.str+sp->m_name.length) >
table->field[MYSQL_PROC_FIELD_NAME]->char_length())
{
- ret= SP_BAD_IDENTIFIER;
+ my_error(ER_TOO_LONG_IDENT, MYF(0), sp->m_name.str);
goto done;
}
if (sp->m_body.length > table->field[MYSQL_PROC_FIELD_BODY]->field_length)
{
- ret= SP_BODY_TOO_LONG;
+ my_error(ER_TOO_LONG_BODY, MYF(0), sp->m_name.str);
goto done;
}
@@ -1193,17 +1216,13 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
if (access == SP_CONTAINS_SQL ||
access == SP_MODIFIES_SQL_DATA)
{
- my_message(ER_BINLOG_UNSAFE_ROUTINE,
- ER_THD(thd, ER_BINLOG_UNSAFE_ROUTINE), MYF(0));
- ret= SP_INTERNAL_ERROR;
+ my_error(ER_BINLOG_UNSAFE_ROUTINE, MYF(0));
goto done;
}
}
if (!(thd->security_ctx->master_access & SUPER_ACL))
{
- my_message(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER,
- ER_THD(thd, ER_BINLOG_CREATE_ROUTINE_NEED_SUPER), MYF(0));
- ret= SP_INTERNAL_ERROR;
+ my_error(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER,MYF(0));
goto done;
}
}
@@ -1234,22 +1253,24 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
if (store_failed)
{
- ret= SP_FLD_STORE_FAILED;
+ my_error(ER_CANT_CREATE_SROUTINE, MYF(0), sp->m_name.str);
goto done;
}
- ret= SP_OK;
if (table->file->ha_write_row(table->record[0]))
- ret= SP_WRITE_ROW_FAILED;
+ {
+ my_error(ER_SP_ALREADY_EXISTS, MYF(0),
+ SP_TYPE_STRING(type), sp->m_name.str);
+ goto done;
+ }
/* Make change permanent and avoid 'table is marked as crashed' errors */
table->file->extra(HA_EXTRA_FLUSH);
- if (ret == SP_OK)
- sp_cache_invalidate();
+ sp_cache_invalidate();
}
log:
- if (ret == SP_OK && mysql_bin_log.is_open())
+ if (mysql_bin_log.is_open())
{
thd->clear_error();
@@ -1268,7 +1289,7 @@ log:
&(thd->lex->definer->host),
saved_mode))
{
- ret= SP_INTERNAL_ERROR;
+ my_error(ER_OUT_OF_RESOURCES, MYF(0));
goto done;
}
/* restore sql_mode when binloging */
@@ -1277,9 +1298,13 @@ log:
if (thd->binlog_query(THD::STMT_QUERY_TYPE,
log_query.ptr(), log_query.length(),
FALSE, FALSE, FALSE, 0))
- ret= SP_INTERNAL_ERROR;
+ {
+ my_error(ER_ERROR_ON_WRITE, MYF(MY_WME), "binary log", -1);
+ goto done;
+ }
thd->variables.sql_mode= 0;
}
+ ret= FALSE;
done:
thd->count_cuted_fields= saved_count_cuted_fields;
diff --git a/sql/sp.h b/sql/sp.h
index 4bfb0577fcc..df60482f8fd 100644
--- a/sql/sp.h
+++ b/sql/sp.h
@@ -126,7 +126,7 @@ sp_exist_routines(THD *thd, TABLE_LIST *procs, bool is_proc);
bool
sp_show_create_routine(THD *thd, stored_procedure_type type, sp_name *name);
-int
+bool
sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp);
int
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index c8ae0028239..d58b51afc5e 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -3276,7 +3276,8 @@ sp_instr_set::print(String *str)
}
str->qs_append(m_offset);
str->qs_append(' ');
- m_value->print(str, QT_ORDINARY);
+ m_value->print(str, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
}
@@ -3308,9 +3309,11 @@ void
sp_instr_set_trigger_field::print(String *str)
{
str->append(STRING_WITH_LEN("set_trigger_field "));
- trigger_field->print(str, QT_ORDINARY);
+ trigger_field->print(str, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
str->append(STRING_WITH_LEN(":="));
- value->print(str, QT_ORDINARY);
+ value->print(str, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
}
/*
@@ -3436,7 +3439,8 @@ sp_instr_jump_if_not::print(String *str)
str->qs_append('(');
str->qs_append(m_cont_dest);
str->qs_append(STRING_WITH_LEN(") "));
- m_expr->print(str, QT_ORDINARY);
+ m_expr->print(str, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
}
@@ -3532,7 +3536,8 @@ sp_instr_freturn::print(String *str)
str->qs_append(STRING_WITH_LEN("freturn "));
str->qs_append((uint)m_type);
str->qs_append(' ');
- m_value->print(str, QT_ORDINARY);
+ m_value->print(str, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
}
/*
@@ -4004,7 +4009,8 @@ sp_instr_set_case_expr::print(String *str)
str->qs_append(STRING_WITH_LEN(") "));
str->qs_append(m_case_expr_id);
str->qs_append(' ');
- m_case_expr->print(str, QT_ORDINARY);
+ m_case_expr->print(str, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
}
uint
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 9022f954d11..65aad1dd5a1 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -607,7 +607,7 @@ public:
instruction for CONTINUE error handlers.
@retval 0 on success,
- @retval other if some error occured
+ @retval other if some error occurred
*/
virtual int execute(THD *thd, uint *nextp) = 0;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 3650256b5b7..241f19c75a3 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -10268,7 +10268,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
@return
@retval FALSE Success
- @retval TRUE An error occured. Error message not yet sent.
+ @retval TRUE An error occurred. Error message not yet sent.
*/
bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 7da2e4c032a..205621c6f9f 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -369,6 +369,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
char* db = table->db;
bool fatal_error=0;
bool open_error;
+ bool collect_eis= FALSE;
DBUG_PRINT("admin", ("table: '%s'.'%s'", table->db, table->table_name));
strxmov(table_name, db, ".", table->table_name, NullS);
@@ -697,53 +698,64 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
{
compl_result_code= result_code= HA_ADMIN_INVALID;
}
+ collect_eis=
+ (table->table->s->table_category == TABLE_CATEGORY_USER &&
+ (get_use_stat_tables_mode(thd) > NEVER ||
+ lex->with_persistent_for_clause));
- if (!lex->column_list)
+ if (collect_eis)
{
- bitmap_clear_all(tab->read_set);
- for (uint fields= 0; *field_ptr; field_ptr++, fields++)
+ if (!lex->column_list)
{
- enum enum_field_types type= (*field_ptr)->type();
- if (type < MYSQL_TYPE_MEDIUM_BLOB ||
- type > MYSQL_TYPE_BLOB)
- bitmap_set_bit(tab->read_set, fields);
- else
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_NO_EIS_FOR_FIELD,
- ER_THD(thd, ER_NO_EIS_FOR_FIELD),
- (*field_ptr)->field_name);
+ bitmap_clear_all(tab->read_set);
+ for (uint fields= 0; *field_ptr; field_ptr++, fields++)
+ {
+ enum enum_field_types type= (*field_ptr)->type();
+ if (type < MYSQL_TYPE_MEDIUM_BLOB ||
+ type > MYSQL_TYPE_BLOB)
+ bitmap_set_bit(tab->read_set, fields);
+ else if (collect_eis)
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_NO_EIS_FOR_FIELD,
+ ER_THD(thd, ER_NO_EIS_FOR_FIELD),
+ (*field_ptr)->field_name);
+ }
}
- }
- else
- {
- int pos;
- LEX_STRING *column_name;
- List_iterator_fast<LEX_STRING> it(*lex->column_list);
+ else
+ {
+ int pos;
+ LEX_STRING *column_name;
+ List_iterator_fast<LEX_STRING> it(*lex->column_list);
- bitmap_clear_all(tab->read_set);
- while ((column_name= it++))
- {
- if (tab->s->fieldnames.type_names == 0 ||
- (pos= find_type(&tab->s->fieldnames, column_name->str,
- column_name->length, 1)) <= 0)
+ bitmap_clear_all(tab->read_set);
+ while ((column_name= it++))
{
- compl_result_code= result_code= HA_ADMIN_INVALID;
- break;
+ if (tab->s->fieldnames.type_names == 0 ||
+ (pos= find_type(&tab->s->fieldnames, column_name->str,
+ column_name->length, 1)) <= 0)
+ {
+ compl_result_code= result_code= HA_ADMIN_INVALID;
+ break;
+ }
+ pos--;
+ enum enum_field_types type= tab->field[pos]->type();
+ if (type < MYSQL_TYPE_MEDIUM_BLOB ||
+ type > MYSQL_TYPE_BLOB)
+ bitmap_set_bit(tab->read_set, pos);
+ else if (collect_eis)
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_NO_EIS_FOR_FIELD,
+ ER_THD(thd, ER_NO_EIS_FOR_FIELD),
+ column_name->str);
}
- pos--;
- enum enum_field_types type= tab->field[pos]->type();
- if (type < MYSQL_TYPE_MEDIUM_BLOB ||
- type > MYSQL_TYPE_BLOB)
- bitmap_set_bit(tab->read_set, pos);
- else
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_NO_EIS_FOR_FIELD,
- ER_THD(thd, ER_NO_EIS_FOR_FIELD),
- column_name->str);
+ tab->file->column_bitmaps_signal();
}
- tab->file->column_bitmaps_signal();
}
-
+ else
+ {
+ DBUG_ASSERT(!lex->column_list);
+ }
+
if (!lex->index_list)
{
tab->keys_in_use_for_query.init(tab->s->keys);
@@ -778,11 +790,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
DBUG_PRINT("admin", ("operator_func returned: %d", result_code));
}
- if (compl_result_code == HA_ADMIN_OK &&
- operator_func == &handler::ha_analyze &&
- table->table->s->table_category == TABLE_CATEGORY_USER &&
- (get_use_stat_tables_mode(thd) > NEVER ||
- lex->with_persistent_for_clause))
+ if (compl_result_code == HA_ADMIN_OK && collect_eis)
{
if (!(compl_result_code=
alloc_statistics_for_table(thd, table->table)) &&
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3e3c4452d5a..08509a0e2bf 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -8557,7 +8557,7 @@ bool setup_on_expr(THD *thd, TABLE_LIST *table, bool is_update)
TODO
RETURN
- TRUE if some error occured (e.g. out of memory)
+ TRUE if some error occurred (e.g. out of memory)
FALSE if all is OK
*/
@@ -8667,7 +8667,7 @@ err_no_arena:
function.
@return Status
- @retval true An error occured.
+ @retval true An error occurred.
@retval false OK.
*/
@@ -8829,7 +8829,7 @@ static bool not_null_fields_have_null_values(TABLE *table)
record[1] buffers correspond to new and old versions of row respectively.
@return Status
- @retval true An error occured.
+ @retval true An error occurred.
@retval false OK.
*/
@@ -8889,7 +8889,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, List<Item> &fields,
function.
@return Status
- @retval true An error occured.
+ @retval true An error occurred.
@retval false OK.
*/
@@ -8984,7 +8984,7 @@ err:
record[1] buffers correspond to new and old versions of row respectively.
@return Status
- @retval true An error occured.
+ @retval true An error occurred.
@retval false OK.
*/
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 82a56510736..be652e6dd01 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2187,7 +2187,7 @@ public:
int is_current_stmt_binlog_format_row() const {
DBUG_ASSERT(current_stmt_binlog_format == BINLOG_FORMAT_STMT ||
current_stmt_binlog_format == BINLOG_FORMAT_ROW);
- return WSREP_FORMAT(current_stmt_binlog_format) == BINLOG_FORMAT_ROW;
+ return current_stmt_binlog_format == BINLOG_FORMAT_ROW;
}
enum binlog_filter_state
@@ -4572,8 +4572,6 @@ public:
uint group_parts,group_length,group_null_parts;
uint quick_group;
bool using_indirect_summary_function;
- /* If >0 convert all blob fields to varchar(convert_blob_length) */
- uint convert_blob_length;
CHARSET_INFO *table_charset;
bool schema_table;
/* TRUE if the temp table is created for subquery materialization. */
@@ -4602,7 +4600,7 @@ public:
TMP_TABLE_PARAM()
:copy_field(0), group_parts(0),
- group_length(0), group_null_parts(0), convert_blob_length(0),
+ group_length(0), group_null_parts(0),
schema_table(0), materialized_subquery(0), force_not_null_cols(0),
precomputed_group_by(0),
force_copy_fields(0), bit_fields_as_long(0), skip_create_table(0)
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f77d8cb1984..9817b882bdd 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -3897,7 +3897,7 @@ Field *Item::create_field_for_create_select(THD *thd, TABLE *table)
{
Field *def_field, *tmp_field;
return ::create_tmp_field(thd, table, this, type(),
- (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, 0);
+ (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0);
}
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index f84440afa90..818598110ca 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -2206,7 +2206,7 @@ finish:
for a match for any record from join_tab. To iterate over the candidates
for a match the virtual function get_next_candidate_for_match is used,
while the virtual function prepare_look_for_matches is called to prepare
- for such iteration proccess.
+ for such iteration process.
NOTES
The function produces all matching extensions for the records in the
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index f7cc9e87767..65257c9b2ce 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2718,30 +2718,22 @@ void st_select_lex::print_order(String *str,
{
if (order->counter_used)
{
- if (query_type != QT_VIEW_INTERNAL)
+ char buffer[20];
+ size_t length= my_snprintf(buffer, 20, "%d", order->counter);
+ str->append(buffer, (uint) length);
+ }
+ else
+ {
+ /* replace numeric reference with equivalent for ORDER constant */
+ if (order->item[0]->type() == Item::INT_ITEM &&
+ order->item[0]->basic_const_item())
{
- char buffer[20];
- size_t length= my_snprintf(buffer, 20, "%d", order->counter);
- str->append(buffer, (uint) length);
+ /* make it expression instead of integer constant */
+ str->append(STRING_WITH_LEN("''"));
}
else
- {
- /* replace numeric reference with expression */
- if (order->item[0]->type() == Item::INT_ITEM &&
- order->item[0]->basic_const_item())
- {
- char buffer[20];
- size_t length= my_snprintf(buffer, 20, "%d", order->counter);
- str->append(buffer, (uint) length);
- /* make it expression instead of integer constant */
- str->append(STRING_WITH_LEN("+0"));
- }
- else
- (*order->item)->print(str, query_type);
- }
+ (*order->item)->print(str, query_type);
}
- else
- (*order->item)->print(str, query_type);
if (!order->asc)
str->append(STRING_WITH_LEN(" desc"));
if (order->next)
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index c3935130fb3..c64ed6b8d5c 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -632,7 +632,7 @@ public:
return saved_fake_select_lex;
return first_select();
};
- //node on wich we should return current_select pointer after parsing subquery
+ //node on which we should return current_select pointer after parsing subquery
st_select_lex *return_to;
/* LIMIT clause runtime counters */
ha_rows select_limit_cnt, offset_limit_cnt;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 6bd0e793a67..7c50e4ed680 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -119,8 +119,6 @@ static void wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
*/
/* Used in error handling only */
-#define SP_TYPE_STRING(LP) \
- ((LP)->sphead->m_type == TYPE_ENUM_FUNCTION ? "FUNCTION" : "PROCEDURE")
#define SP_COM_STRING(LP) \
((LP)->sql_command == SQLCOM_CREATE_SPFUNCTION || \
(LP)->sql_command == SQLCOM_ALTER_FUNCTION || \
@@ -5495,7 +5493,6 @@ end_with_restore_list:
{
uint namelen;
char *name;
- int sp_result= SP_INTERNAL_ERROR;
DBUG_ASSERT(lex->sphead != 0);
DBUG_ASSERT(lex->sphead->m_db.str); /* Must be initialized in the parser */
@@ -5506,23 +5503,12 @@ end_with_restore_list:
if (check_db_name(&lex->sphead->m_db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), lex->sphead->m_db.str);
- goto create_sp_error;
+ goto error;
}
if (check_access(thd, CREATE_PROC_ACL, lex->sphead->m_db.str,
NULL, NULL, 0, 0))
- goto create_sp_error;
-
- /*
- Check that a database directory with this name
- exists. Design note: This won't work on virtual databases
- like information_schema.
- */
- if (check_db_dir_existence(lex->sphead->m_db.str))
- {
- my_error(ER_BAD_DB_ERROR, MYF(0), lex->sphead->m_db.str);
- goto create_sp_error;
- }
+ goto error;
/* Checking the drop permissions if CREATE OR REPLACE is used */
if (lex->create_info.or_replace())
@@ -5530,7 +5516,7 @@ end_with_restore_list:
if (check_routine_access(thd, ALTER_PROC_ACL, lex->spname->m_db.str,
lex->spname->m_name.str,
lex->sql_command == SQLCOM_DROP_PROCEDURE, 0))
- goto create_sp_error;
+ goto error;
}
name= lex->sphead->name(&namelen);
@@ -5542,18 +5528,17 @@ end_with_restore_list:
if (udf)
{
my_error(ER_UDF_EXISTS, MYF(0), name);
- goto create_sp_error;
+ goto error;
}
}
#endif
if (sp_process_definer(thd))
- goto create_sp_error;
+ goto error;
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
- res= (sp_result= sp_create_routine(thd, lex->sphead->m_type, lex->sphead));
- switch (sp_result) {
- case SP_OK: {
+ if (!sp_create_routine(thd, lex->sphead->m_type, lex->sphead))
+ {
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* only add privileges if really neccessary */
@@ -5618,31 +5603,8 @@ end_with_restore_list:
}
#endif
- break;
}
- case SP_WRITE_ROW_FAILED:
- my_error(ER_SP_ALREADY_EXISTS, MYF(0), SP_TYPE_STRING(lex), name);
- break;
- case SP_BAD_IDENTIFIER:
- my_error(ER_TOO_LONG_IDENT, MYF(0), name);
- break;
- case SP_BODY_TOO_LONG:
- my_error(ER_TOO_LONG_BODY, MYF(0), name);
- break;
- case SP_FLD_STORE_FAILED:
- my_error(ER_CANT_CREATE_SROUTINE, MYF(0), name);
- break;
- default:
- my_error(ER_SP_STORE_FAILED, MYF(0), SP_TYPE_STRING(lex), name);
- break;
- } /* end switch */
-
- /*
- Capture all errors within this CASE and
- clean up the environment.
- */
-create_sp_error:
- if (sp_result != SP_OK )
+ else
goto error;
my_ok(thd);
break; /* break super switch */
@@ -6042,6 +6004,8 @@ create_sp_error:
if (check_global_access(thd, SUPER_ACL))
break;
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+
res= create_server(thd, &lex->server_options);
break;
}
@@ -6053,6 +6017,8 @@ create_sp_error:
if (check_global_access(thd, SUPER_ACL))
break;
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+
if ((error= alter_server(thd, &lex->server_options)))
{
DBUG_PRINT("info", ("problem altering server <%s>",
@@ -6071,6 +6037,8 @@ create_sp_error:
if (check_global_access(thd, SUPER_ACL))
break;
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
+
if ((err_code= drop_server(thd, &lex->server_options)))
{
if (! lex->if_exists() && err_code == ER_FOREIGN_SERVER_DOESNT_EXIST)
@@ -8369,7 +8337,7 @@ bool st_select_lex_unit::add_fake_select_lex(THD *thd_arg)
@retval
FALSE if all is OK
@retval
- TRUE if a memory allocation error occured
+ TRUE if a memory allocation error occurred
*/
bool
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 3e1340d8b3c..8e5ab71288d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2004,7 +2004,7 @@ static int mysql_test_show_create_routine(Prepared_statement *stmt, int type)
@note This function handles create view commands.
@retval FALSE Operation was a success.
- @retval TRUE An error occured.
+ @retval TRUE An error occurred.
*/
static bool mysql_test_create_view(Prepared_statement *stmt)
@@ -2455,10 +2455,14 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case SQLCOM_CREATE_USER:
case SQLCOM_RENAME_USER:
case SQLCOM_DROP_USER:
+ case SQLCOM_CREATE_ROLE:
+ case SQLCOM_DROP_ROLE:
case SQLCOM_ASSIGN_TO_KEYCACHE:
case SQLCOM_PRELOAD_KEYS:
case SQLCOM_GRANT:
+ case SQLCOM_GRANT_ROLE:
case SQLCOM_REVOKE:
+ case SQLCOM_REVOKE_ROLE:
case SQLCOM_KILL:
case SQLCOM_COMPOUND:
case SQLCOM_SHUTDOWN:
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index cc22377b117..c9e2b3a586d 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -3281,7 +3281,7 @@ int reset_slave(THD *thd, Master_info* mi)
char fname[FN_REFLEN];
int thread_mask= 0, error= 0;
uint sql_errno=ER_UNKNOWN_ERROR;
- const char* errmsg= "Unknown error occured while reseting slave";
+ const char* errmsg= "Unknown error occurred while reseting slave";
char master_info_file_tmp[FN_REFLEN];
char relay_log_info_file_tmp[FN_REFLEN];
DBUG_ENTER("reset_slave");
@@ -3884,7 +3884,7 @@ bool mysql_show_binlog_events(THD* thd)
DBUG_ASSERT(thd->lex->sql_command == SQLCOM_SHOW_BINLOG_EVENTS ||
thd->lex->sql_command == SQLCOM_SHOW_RELAYLOG_EVENTS);
- /* select wich binary log to use: binlog or relay */
+ /* select which binary log to use: binlog or relay */
if ( thd->lex->sql_command == SQLCOM_SHOW_BINLOG_EVENTS )
{
binary_log= &mysql_bin_log;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 6ecabc24319..c1916aae58a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -449,7 +449,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
this field from inner subqueries.
@return Status
- @retval true An error occured.
+ @retval true An error occurred.
@retval false OK.
*/
@@ -12866,7 +12866,7 @@ bool Item_func_eq::check_equality(THD *thd, COND_EQUAL *cond_equal,
equality predicates that is equivalent to the conjunction.
Thus, =(a1,a2,a3) can substitute for ((a1=a3) AND (a2=a3) AND (a2=a1)) as
it is equivalent to ((a1=a2) AND (a2=a3)).
- The function always makes a substitution of all equality predicates occured
+ The function always makes a substitution of all equality predicates occurred
in a conjuction for a minimal set of multiple equality predicates.
This set can be considered as a canonical representation of the
sub-conjunction of the equality predicates.
@@ -15641,8 +15641,6 @@ const_expression_in_where(COND *cond, Item *comp_item, Field *comp_field,
the record in the original table.
If item == NULL then fill_record() will update
the temporary table
- @param convert_blob_length If >0 create a varstring(convert_blob_length)
- field instead of blob.
@retval
NULL on error
@@ -15652,23 +15650,12 @@ const_expression_in_where(COND *cond, Item *comp_item, Field *comp_field,
Field *create_tmp_field_from_field(THD *thd, Field *org_field,
const char *name, TABLE *table,
- Item_field *item, uint convert_blob_length)
+ Item_field *item)
{
Field *new_field;
- /*
- Make sure that the blob fits into a Field_varstring which has
- 2-byte lenght.
- */
- if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE &&
- (org_field->flags & BLOB_FLAG))
- new_field= new Field_varstring(convert_blob_length,
- org_field->maybe_null(),
- org_field->field_name, table->s,
- org_field->charset());
- else
- new_field= org_field->make_new_field(thd->mem_root, table,
- table == org_field->table);
+ new_field= org_field->make_new_field(thd->mem_root, table,
+ table == org_field->table);
if (new_field)
{
new_field->init(table);
@@ -15695,9 +15682,7 @@ Field *create_tmp_field_from_field(THD *thd, Field *org_field,
}
-Field *Item::create_tmp_field(bool group, TABLE *table,
- uint convert_blob_length,
- uint convert_int_length)
+Field *Item::create_tmp_field(bool group, TABLE *table, uint convert_int_length)
{
Field *UNINIT_VAR(new_field);
MEM_ROOT *mem_root= table->in_use->mem_root;
@@ -15731,16 +15716,6 @@ Field *Item::create_tmp_field(bool group, TABLE *table,
*/
if (field_type() == MYSQL_TYPE_GEOMETRY)
new_field= tmp_table_field_from_field_type(table, true, false);
- /*
- Make sure that the blob fits into a Field_varstring which has
- 2-byte lenght.
- */
- else if (max_length / collation.collation->mbmaxlen > 255 &&
- convert_blob_length <= Field_varstring::MAX_SIZE &&
- convert_blob_length)
- new_field= new (mem_root)
- Field_varstring(convert_blob_length, maybe_null,
- name, table->s, collation.collation);
else
new_field= make_string_field(table);
new_field->set_derivation(collation.derivation);
@@ -15786,12 +15761,11 @@ Field *Item::create_tmp_field(bool group, TABLE *table,
*/
static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
- Item ***copy_func, bool modify_item,
- uint convert_blob_length)
+ Item ***copy_func, bool modify_item)
{
Field *UNINIT_VAR(new_field);
DBUG_ASSERT(thd == table->in_use);
- new_field= item->Item::create_tmp_field(false, table, convert_blob_length);
+ new_field= item->Item::create_tmp_field(false, table);
if (copy_func && item->real_item()->is_result_field())
*((*copy_func)++) = item; // Save for copy_funcs
@@ -15854,8 +15828,6 @@ Field *Item::create_field_for_schema(THD *thd, TABLE *table)
the record in the original table.
If modify_item is 0 then fill_record() will update
the temporary table
- @param convert_blob_length If >0 create a varstring(convert_blob_length)
- field instead of blob.
@retval
0 on error
@@ -15868,8 +15840,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
Field **default_field,
bool group, bool modify_item,
bool table_cant_handle_bit_fields,
- bool make_copy_field,
- uint convert_blob_length)
+ bool make_copy_field)
{
Field *result;
Item::Type orig_type= type;
@@ -15886,7 +15857,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
switch (type) {
case Item::SUM_FUNC_ITEM:
{
- result= item->create_tmp_field(group, table, convert_blob_length);
+ result= item->create_tmp_field(group, table);
if (!result)
my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
return result;
@@ -15922,7 +15893,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
item->maybe_null= orig_item->maybe_null;
}
result= create_tmp_field_from_item(thd, item, table, NULL,
- modify_item, convert_blob_length);
+ modify_item);
*from_field= field->field;
if (result && modify_item)
field->result_field= result;
@@ -15934,7 +15905,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
{
*from_field= field->field;
result= create_tmp_field_from_item(thd, item, table, copy_func,
- modify_item, convert_blob_length);
+ modify_item);
if (result && modify_item)
field->result_field= result;
}
@@ -15944,8 +15915,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
item->name,
table,
modify_item ? field :
- NULL,
- convert_blob_length);
+ NULL);
if (orig_type == Item::REF_ITEM && orig_modify)
((Item_ref*)orig_item)->set_result_field(result);
/*
@@ -15979,8 +15949,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
sp_result_field,
item_func_sp->name,
table,
- NULL,
- convert_blob_length);
+ NULL);
if (modify_item)
item->set_result_field(result_field);
@@ -16012,7 +15981,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
}
return create_tmp_field_from_item(thd, item, table,
(make_copy_field ? 0 : copy_func),
- modify_item, convert_blob_length);
+ modify_item);
case Item::TYPE_HOLDER:
result= ((Item_type_holder *)item)->make_field_by_type(table);
result->set_derivation(item->collation.derivation);
@@ -16322,8 +16291,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
create_tmp_field(thd, table, arg, arg->type(), &copy_func,
tmp_from_field, &default_field[fieldnr],
group != 0,not_all_columns,
- distinct, 0,
- param->convert_blob_length);
+ distinct, false);
if (!new_field)
goto err; // Should be OOM
tmp_from_field++;
@@ -16393,8 +16361,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
to be usable in this case too.
*/
item->marker == 4 || param->bit_fields_as_long,
- force_copy_fields,
- param->convert_blob_length);
+ force_copy_fields);
if (!new_field)
{
@@ -21775,7 +21742,11 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
*/
if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item())
{ /* Order by position */
- uint count= (uint) order_item->val_int();
+ uint count;
+ if (order->counter_used)
+ count= order->counter; // counter was once resolved
+ else
+ count= (uint) order_item->val_int();
if (!count || count > fields.elements)
{
my_error(ER_BAD_FIELD_ERROR, MYF(0),
@@ -21792,7 +21763,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
select_item= find_item_in_list(order_item, fields, &counter,
REPORT_EXCEPT_NOT_FOUND, &resolution);
if (!select_item)
- return TRUE; /* The item is not unique, or some other error occured. */
+ return TRUE; /* The item is not unique, or some other error occurred. */
/* Check whether the resolved field is not ambiguos. */
@@ -25122,7 +25093,7 @@ void JOIN::restore_query_plan(Join_plan_state *restore_from)
@retval REOPT_NEW_PLAN there is a new plan.
@retval REOPT_OLD_PLAN no new improved plan was produced, use the old one.
- @retval REOPT_ERROR an irrecovarable error occured during reoptimization.
+ @retval REOPT_ERROR an irrecovarable error occurred during reoptimization.
*/
JOIN::enum_reopt_result
diff --git a/sql/sql_select.h b/sql/sql_select.h
index e20cf6b403c..87de9316c3a 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -940,7 +940,7 @@ protected:
enum enum_reopt_result {
REOPT_NEW_PLAN, /* there is a new reoptimized plan */
REOPT_OLD_PLAN, /* no new improved plan can be found, use the old one */
- REOPT_ERROR, /* an irrecovarable error occured during reoptimization */
+ REOPT_ERROR, /* an irrecovarable error occurred during reoptimization */
REOPT_NONE /* not yet reoptimized */
};
@@ -1592,8 +1592,8 @@ bool copy_funcs(Item **func_ptr, const THD *thd);
uint find_shortest_key(TABLE *table, const key_map *usable_keys);
Field* create_tmp_field_from_field(THD *thd, Field* org_field,
const char *name, TABLE *table,
- Item_field *item, uint convert_blob_length);
-
+ Item_field *item);
+
bool is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args);
/* functions from opt_sum.cc */
@@ -1851,8 +1851,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
Field **def_field,
bool group, bool modify_item,
bool table_cant_handle_bit_fields,
- bool make_copy_field,
- uint convert_blob_length);
+ bool make_copy_field);
/*
General routine to change field->ptr of a NULL-terminated array of Field
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 7ca45e79493..00881adff1d 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2351,7 +2351,8 @@ static int show_create_view(THD *thd, TABLE_LIST *table, String *buff)
We can't just use table->query, because our SQL_MODE may trigger
a different syntax, like when ANSI_QUOTES is defined.
*/
- table->view->unit.print(buff, QT_ORDINARY);
+ table->view->unit.print(buff, enum_query_type(QT_ORDINARY |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
if (table->with_check != VIEW_CHECK_NONE)
{
@@ -4342,7 +4343,7 @@ uint get_table_open_method(TABLE_LIST *tables,
@retval FALSE No error, if lock was obtained TABLE_LIST::mdl_request::ticket
is set to non-NULL value.
- @retval TRUE Some error occured (probably thread was killed).
+ @retval TRUE Some error occurred (probably thread was killed).
*/
static bool
@@ -4450,7 +4451,7 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
if (try_acquire_high_prio_shared_mdl_lock(thd, &table_list, can_deadlock))
{
/*
- Some error occured (most probably we have been killed while
+ Some error occurred (most probably we have been killed while
waiting for conflicting locks to go away), let the caller to
handle the situation.
*/
@@ -5061,7 +5062,10 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
HA_STATUS_TIME |
HA_STATUS_VARIABLE_EXTRA |
HA_STATUS_AUTO)) != 0)
+ {
+ file->print_error(info_error, MYF(0));
goto err;
+ }
enum row_type row_type = file->get_row_type();
switch (row_type) {
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 8cf20e71f55..20772adcb22 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -76,9 +76,9 @@ bool String::real_alloc(uint32 length)
@retval false Either the copy operation is complete or, if the size of the
new buffer is smaller than the currently allocated buffer (if one exists),
- no allocation occured.
+ no allocation occurred.
- @retval true An error occured when attempting to allocate memory.
+ @retval true An error occurred when attempting to allocate memory.
*/
bool String::realloc_raw(uint32 alloc_length)
{
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 272e1445273..7a61279fc9c 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1101,6 +1101,7 @@ bool Table_triggers_list::prepare_record_accessors(TABLE *table)
table == (*fld)->table)))
return 1;
+ f->flags= (*fld)->flags;
f->null_ptr= null_ptr;
f->null_bit= null_bit;
if (null_bit == 128)
@@ -2305,7 +2306,7 @@ void Table_triggers_list::mark_fields_used(trg_event_type event)
/**
- Signals to the Table_triggers_list that a parse error has occured when
+ Signals to the Table_triggers_list that a parse error has occurred when
reading a trigger from file. This makes the Table_triggers_list enter an
error state flagged by m_has_unparseable_trigger == true. The error message
will be used whenever a statement invoking or manipulating triggers is
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 6c85840a5d1..5685c90850a 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1160,11 +1160,22 @@ List<Item> *st_select_lex_unit::get_unit_column_types()
return &sl->item_list;
}
+
+static void cleanup_order(ORDER *order)
+{
+ for (; order; order= order->next)
+ order->counter_used= 0;
+}
+
+
bool st_select_lex::cleanup()
{
bool error= FALSE;
DBUG_ENTER("st_select_lex::cleanup()");
+ cleanup_order(order_list.first);
+ cleanup_order(group_list.first);
+
if (join)
{
DBUG_ASSERT((st_select_lex*)join->select_lex == this);
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 47206d75f1b..61c16a905fe 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -2588,7 +2588,7 @@ bool multi_update::send_eof()
if (local_error > 0) // if the above log write did not fail ...
{
/* Safety: If we haven't got an error before (can happen in do_updates) */
- my_message(ER_UNKNOWN_ERROR, "An error occured in multi-table update",
+ my_message(ER_UNKNOWN_ERROR, "An error occurred in multi-table update",
MYF(0));
DBUG_RETURN(TRUE);
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index b063e9200e5..41fd5b78f04 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -244,7 +244,7 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
@param mode VIEW_CREATE_NEW, VIEW_ALTER, VIEW_CREATE_OR_REPLACE
@retval FALSE Operation was a success.
- @retval TRUE An error occured.
+ @retval TRUE An error occurred.
*/
bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
@@ -387,7 +387,7 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
@note This function handles both create and alter view commands.
@retval FALSE Operation was a success.
- @retval TRUE An error occured.
+ @retval TRUE An error occurred.
*/
bool mysql_create_view(THD *thd, TABLE_LIST *views,
@@ -901,9 +901,11 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
ulong sql_mode= thd->variables.sql_mode & MODE_ANSI_QUOTES;
thd->variables.sql_mode&= ~MODE_ANSI_QUOTES;
- lex->unit.print(&view_query, QT_VIEW_INTERNAL);
- lex->unit.print(&is_query,
- enum_query_type(QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS));
+ lex->unit.print(&view_query, enum_query_type(QT_VIEW_INTERNAL |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
+ lex->unit.print(&is_query, enum_query_type(QT_TO_SYSTEM_CHARSET |
+ QT_WITHOUT_INTRODUCERS |
+ QT_ITEM_ORIGINAL_FUNC_NULLIF));
thd->variables.sql_mode|= sql_mode;
}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 86a3822b2ec..9d871703bfe 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1184,6 +1184,19 @@ static Sys_var_mybool Sys_log_queries_not_using_indexes(
GLOBAL_VAR(opt_log_queries_not_using_indexes),
CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+static Sys_var_mybool Sys_log_slow_admin_statements(
+ "log_slow_admin_statements",
+ "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to "
+ "the slow log if it is open.",
+ GLOBAL_VAR(opt_log_slow_admin_statements),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_log_slow_slave_statements(
+ "log_slow_slave_statements",
+ "Log slow statements executed by slave thread to the slow log if it is open.",
+ GLOBAL_VAR(opt_log_slow_slave_statements),
+ CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
static Sys_var_ulong Sys_log_warnings(
"log_warnings",
"Log some not critical warnings to the general log file."
diff --git a/sql/table.h b/sql/table.h
index 46309d43ad6..1c461d96097 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -926,6 +926,57 @@ struct TABLE_SHARE
};
+/**
+ Class is used as a BLOB field value storage for
+ intermediate GROUP_CONCAT results. Used only for
+ GROUP_CONCAT with DISTINCT or ORDER BY options.
+ */
+
+class Blob_mem_storage: public Sql_alloc
+{
+private:
+ MEM_ROOT storage;
+ /**
+ Sign that some values were cut
+ during saving into the storage.
+ */
+ bool truncated_value;
+public:
+ Blob_mem_storage() :truncated_value(false)
+ {
+ init_alloc_root(&storage, MAX_FIELD_VARCHARLENGTH, 0, MYF(0));
+ }
+ ~ Blob_mem_storage()
+ {
+ free_root(&storage, MYF(0));
+ }
+ void reset()
+ {
+ free_root(&storage, MYF(MY_MARK_BLOCKS_FREE));
+ truncated_value= false;
+ }
+ /**
+ Fuction creates duplicate of 'from'
+ string in 'storage' MEM_ROOT.
+
+ @param from string to copy
+ @param length string length
+
+ @retval Pointer to the copied string.
+ @retval 0 if an error occured.
+ */
+ char *store(const char *from, uint length)
+ {
+ return (char*) memdup_root(&storage, from, length);
+ }
+ void set_truncated_value(bool is_truncated_value)
+ {
+ truncated_value= is_truncated_value;
+ }
+ bool is_truncated_value() { return truncated_value; }
+};
+
+
/* Information for one open table */
enum index_hint_type
{
@@ -1196,6 +1247,12 @@ public:
REGINFO reginfo; /* field connections */
MEM_ROOT mem_root;
+ /**
+ Initialized in Item_func_group_concat::setup for appropriate
+ temporary table if GROUP_CONCAT is used with ORDER BY | DISTINCT
+ and BLOB field count > 0.
+ */
+ Blob_mem_storage *blob_storage;
GRANT_INFO grant;
/*
The arena which the items for expressions from the table definition
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc
index 1281756f6bc..2ca815a6062 100644
--- a/sql/threadpool_win.cc
+++ b/sql/threadpool_win.cc
@@ -390,7 +390,7 @@ int start_io(connection_t *connection, PTP_CALLBACK_INSTANCE instance)
return 0;
}
- /* Some error occured */
+ /* Some error occurred */
CancelThreadpoolIo(io);
return -1;
}
@@ -576,7 +576,7 @@ static VOID CALLBACK io_completion_callback(PTP_CALLBACK_INSTANCE instance,
return;
error:
- /* Some error has occured. */
+ /* Some error has occurred. */
destroy_connection(connection, instance);
free(connection);
diff --git a/sql/tztime.cc b/sql/tztime.cc
index f94e10c4877..ce0272d996d 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -309,7 +309,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage)
Note: See description of TIME_to_gmt_sec() function first.
In order to perform MYSQL_TIME -> my_time_t conversion we need to build table
which defines "shifted by tz offset and leap seconds my_time_t" ->
- my_time_t function wich is almost the same (except ranges of ambiguity)
+ my_time_t function which is almost the same (except ranges of ambiguity)
as reverse function to piecewise linear function used for my_time_t ->
"shifted my_time_t" conversion and which is also specified as table in
zoneinfo file or in our db (It is specified as start of time type ranges
@@ -612,7 +612,7 @@ sec_to_TIME(MYSQL_TIME * tmp, my_time_t t, long offset)
/*
- Find time range wich contains given my_time_t value
+ Find time range which contains given my_time_t value
SYNOPSIS
find_time_range()
@@ -708,7 +708,7 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp)
TODO
We can improve this function by creating joined array of transitions and
leap corrections. This will require adding extra field to TRAN_TYPE_INFO
- for storing number of "extra" seconds to minute occured due to correction
+ for storing number of "extra" seconds to minute occurred due to correction
(60th and 61st second, look how we calculate them as "hit" in this
function).
Under realistic assumptions about frequency of transitions the same array
@@ -2769,7 +2769,7 @@ main(int argc, char **argv)
#ifdef TESTTIME
/*
- Some simple brute-force test wich allowed to catch a pair of bugs.
+ Some simple brute-force test which allowed to catch a pair of bugs.
Also can provide interesting facts about system's time zone support
implementation.
*/
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 3bb23cf4601..6d04527cbcb 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -875,7 +875,7 @@ static int sst_donate_mysqldump (const char* addr,
host, port, mysqld_port, mysqld_unix_port,
wsrep_defaults_file, uuid_str,
(long long)seqno, wsrep_gtid_domain_id,
- bypass ? " "WSREP_SST_OPT_BYPASS : "");
+ bypass ? " " WSREP_SST_OPT_BYPASS : "");
if (ret < 0 || ret >= cmd_len)
{
@@ -896,6 +896,56 @@ static int sst_donate_mysqldump (const char* addr,
wsrep_seqno_t wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
+
+/*
+ Create a file under data directory.
+*/
+static int sst_create_file(const char *name, const char *content)
+{
+ int err= 0;
+ char *real_name;
+ char *tmp_name;
+ ssize_t len;
+ FILE *file;
+
+ len= strlen(mysql_real_data_home) + strlen(name) + 2;
+ real_name= (char *) alloca(len);
+
+ snprintf(real_name, (size_t) len, "%s/%s", mysql_real_data_home, name);
+
+ tmp_name= (char *) alloca(len + 4);
+ snprintf(tmp_name, (size_t) len + 4, "%s.tmp", real_name);
+
+ file= fopen(tmp_name, "w+");
+
+ if (0 == file)
+ {
+ err= errno;
+ WSREP_ERROR("Failed to open '%s': %d (%s)", tmp_name, err, strerror(err));
+ }
+ else
+ {
+ // Write the specified content into the file.
+ if (content != NULL)
+ {
+ fprintf(file, "%s\n", content);
+ fsync(fileno(file));
+ }
+
+ fclose(file);
+
+ if (rename(tmp_name, real_name) == -1)
+ {
+ err= errno;
+ WSREP_ERROR("Failed to rename '%s' to '%s': %d (%s)", tmp_name,
+ real_name, err, strerror(err));
+ }
+ }
+
+ return err;
+}
+
+
static int run_sql_command(THD *thd, const char *query)
{
thd->set_query((char *)query, strlen(query));
@@ -911,7 +961,7 @@ static int run_sql_command(THD *thd, const char *query)
if (thd->is_error())
{
int const err= thd->get_stmt_da()->sql_errno();
- WSREP_WARN ("error executing '%s': %d (%s)%s",
+ WSREP_WARN ("Error executing '%s': %d (%s)%s",
query, err, thd->get_stmt_da()->message(),
err == ER_UNKNOWN_SYSTEM_VARIABLE ?
". Was mysqld built with --with-innodb-disallow-writes ?" : "");
@@ -921,15 +971,21 @@ static int run_sql_command(THD *thd, const char *query)
return 0;
}
+
static int sst_flush_tables(THD* thd)
{
WSREP_INFO("Flushing tables for SST...");
- int err;
+ int err= 0;
int not_used;
- CHARSET_INFO *current_charset;
+ /*
+ Files created to notify the SST script about the outcome of table flush
+ operation.
+ */
+ const char *flush_success= "tables_flushed";
+ const char *flush_error= "sst_error";
- current_charset = thd->variables.character_set_client;
+ CHARSET_INFO *current_charset= thd->variables.character_set_client;
if (!is_supported_parser_charset(current_charset))
{
@@ -942,61 +998,55 @@ static int sst_flush_tables(THD* thd)
if (run_sql_command(thd, "FLUSH TABLES WITH READ LOCK"))
{
- WSREP_ERROR("Failed to flush and lock tables");
- err = -1;
+ err= -1;
}
else
{
- /* make sure logs are flushed after global read lock acquired */
- err= reload_acl_and_cache(thd, REFRESH_ENGINE_LOG | REFRESH_BINARY_LOG,
- (TABLE_LIST*) 0, &not_used);
+ /*
+ Make sure logs are flushed after global read lock acquired. In case
+ reload fails, we must also release the acquired FTWRL.
+ */
+ if (reload_acl_and_cache(thd, REFRESH_ENGINE_LOG | REFRESH_BINARY_LOG,
+ (TABLE_LIST*) 0, &not_used))
+ {
+ thd->global_read_lock.unlock_global_read_lock(thd);
+ err= -1;
+ }
}
thd->variables.character_set_client = current_charset;
-
if (err)
{
- WSREP_ERROR("Failed to flush tables: %d (%s)", err, strerror(err));
+ WSREP_ERROR("Failed to flush and lock tables");
+
+ /*
+ The SST must be aborted as the flush tables failed. Notify this to SST
+ script by creating the error file.
+ */
+ int tmp;
+ if ((tmp= sst_create_file(flush_error, NULL))) {
+ err= tmp;
+ }
}
else
{
WSREP_INFO("Tables flushed.");
- const char base_name[]= "tables_flushed";
-
- ssize_t const full_len= strlen(mysql_real_data_home) + strlen(base_name)+2;
- char *real_name= (char *) alloca(full_len);
- snprintf(real_name, (size_t) full_len, "%s/%s", mysql_real_data_home,
- base_name);
- char *tmp_name= (char *) alloca(full_len + 4);
- snprintf(tmp_name, (size_t) full_len + 4, "%s.tmp", real_name);
- FILE* file= fopen(tmp_name, "w+");
- if (0 == file)
- {
- err= errno;
- WSREP_ERROR("Failed to open '%s': %d (%s)", tmp_name, err,strerror(err));
- }
- else
- {
- // Write cluster state ID and wsrep_gtid_domain_id.
- fprintf(file, "%s:%lld %d\n",
- wsrep_cluster_state_uuid, (long long)wsrep_locked_seqno,
- wsrep_gtid_domain_id);
- fsync(fileno(file));
- fclose(file);
- if (rename(tmp_name, real_name) == -1)
- {
- err= errno;
- WSREP_ERROR("Failed to rename '%s' to '%s': %d (%s)",
- tmp_name, real_name, err,strerror(err));
- }
- }
+ /*
+ Tables have been flushed. Create a file with cluster state ID and
+ wsrep_gtid_domain_id.
+ */
+ char content[100];
+ snprintf(content, sizeof(content), "%s:%lld %d\n", wsrep_cluster_state_uuid,
+ (long long)wsrep_locked_seqno, wsrep_gtid_domain_id);
+ err= sst_create_file(flush_success, content);
}
return err;
}
+
static void sst_disallow_writes (THD* thd, bool yes)
{
char query_str[64] = { 0, };
@@ -1170,7 +1220,7 @@ static int sst_donate_other (const char* method,
wsrep_defaults_file,
binlog_opt, binlog_opt_val,
uuid, (long long) seqno, wsrep_gtid_domain_id,
- bypass ? " "WSREP_SST_OPT_BYPASS : "");
+ bypass ? " " WSREP_SST_OPT_BYPASS : "");
my_free(binlog_opt_val);
if (ret < 0 || ret >= cmd_len)
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index bbce62e0641..c322c8eee54 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -56,7 +56,7 @@
meta file is first opened it is marked as dirty. It is opened when the table
itself is opened for writing. When the table is closed the new count for rows
is written to the meta file and the file is marked as clean. If the meta file
- is opened and it is marked as dirty, it is assumed that a crash occured. At
+ is opened and it is marked as dirty, it is assumed that a crash occurred. At
this point an error occurs and the user is told to rebuild the file.
A rebuild scans the rows and rewrites the meta file. If corruption is found
in the data file then the meta file is not repaired.
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 03364ccd01e..d96d7455d8b 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -169,9 +169,9 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
- char version[]= "Version 1.04.0005 January 24, 2016";
+ char version[]= "Version 1.04.0006 March 12, 2016";
#if defined(__WIN__)
- char compver[]= "Version 1.04.0005 " __DATE__ " " __TIME__;
+ char compver[]= "Version 1.04.0006 " __DATE__ " " __TIME__;
char slash= '\\';
#else // !__WIN__
char slash= '/';
@@ -5159,7 +5159,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
fncn= topt->catfunc;
fnc= GetFuncID(fncn);
sep= topt->separator;
- spc= (!sep) ? ',' : (!strcmp(sep, "\\t")) ? '\t' : *sep;
+ spc= (!sep) ? ',' : *sep;
qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0;
hdr= (int)topt->header;
tbl= topt->tablist;
@@ -5226,7 +5226,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
goto err;
} // endif rc
-
if (!tab) {
if (ttp == TAB_TBL) {
// Make tab the first table of the list
@@ -5295,8 +5294,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
case TAB_CSV:
if (!fn && fnc != FNC_NO)
sprintf(g->Message, "Missing %s file name", topt->type);
- else
- ok= true;
+ else if (sep && strlen(sep) > 1)
+ sprintf(g->Message, "Invalid separator %s", sep);
+ else
+ ok= true;
break;
case TAB_MYSQL:
@@ -5977,7 +5978,19 @@ int ha_connect::create(const char *name, TABLE *table_arg,
DBUG_RETURN(rc);
} // endif lrecl
- } // endif type
+ } // endif type JSON
+
+ if (type == TAB_CSV) {
+ const char *sep = options->separator;
+
+ if (sep && strlen(sep) > 1) {
+ sprintf(g->Message, "Invalid separator %s", sep);
+ my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
+ rc= HA_ERR_INTERNAL_ERROR;
+ DBUG_RETURN(rc);
+ } // endif sep
+
+ } // endif type CSV
// Check column types
for (field= table_arg->field; *field; field++) {
@@ -6765,7 +6778,7 @@ maria_declare_plugin(connect)
0x0104, /* version number (1.04) */
NULL, /* status variables */
connect_system_variables, /* system variables */
- "1.04.0005", /* string version */
- MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+ "1.04.0006", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
}
maria_declare_plugin_end;
diff --git a/storage/connect/mysql-test/connect/r/infoschema-9739.result b/storage/connect/mysql-test/connect/r/infoschema-9739.result
new file mode 100644
index 00000000000..bcebec1d0e0
--- /dev/null
+++ b/storage/connect/mysql-test/connect/r/infoschema-9739.result
@@ -0,0 +1,12 @@
+Warnings:
+Warning 1105 No file name. Table will use t1.xml
+create table t1 (i int) engine=Connect table_type=XML;
+Warnings:
+Warning 1105 No file name. Table will use t1.xml
+select * from information_schema.tables where create_options like '%table_type=XML%';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1296 Got error 174 'File t1.xml not found' from CONNECT
+drop table t1;
diff --git a/storage/connect/mysql-test/connect/r/tbl.result b/storage/connect/mysql-test/connect/r/tbl.result
index bc77516c22d..f51b4dfa57f 100644
--- a/storage/connect/mysql-test/connect/r/tbl.result
+++ b/storage/connect/mysql-test/connect/r/tbl.result
@@ -44,8 +44,8 @@ ta message
1 Testing
2 myisam table
3 t4
-CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) engine=CONNECT table_type=TBL table_list='t1,t2,t3,t4' option_list='port=PORT';
-select * from total;
+CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3,t4' OPTION_LIST='port=PORT';
+SELECT * FROM total;
tabname ta message
t1 1 Testing
t1 2 dos table
@@ -59,15 +59,15 @@ t3 3 t3
t4 1 Testing
t4 2 myisam table
t4 3 t4
-select * from total where tabname = 't2';
+SELECT * FROM total WHERE tabname = 't2';
tabname ta message
t2 1 Testing
t2 2 NULL
t2 3 t2
-select * from total where tabname = 't2' and ta = 3;
+SELECT * FROM total WHERE tabname = 't2' AND ta = 3;
tabname ta message
t2 3 t2
-select * from total where tabname in ('t1','t4');
+SELECT * FROM total WHERE tabname IN ('t1','t4');
tabname ta message
t1 1 Testing
t1 2 dos table
@@ -75,11 +75,11 @@ t1 3 t1
t4 1 Testing
t4 2 myisam table
t4 3 t4
-select * from total where ta = 3 and tabname in ('t1','t2');
+SELECT * FROM total WHERE ta = 3 AND tabname IN ('t1','t2');
tabname ta message
t1 3 t1
t2 3 t2
-select * from total where tabname <> 't2';
+SELECT * FROM total WHERE tabname <> 't2';
tabname ta message
t1 1 Testing
t1 2 dos table
@@ -90,12 +90,12 @@ t3 3 t3
t4 1 Testing
t4 2 myisam table
t4 3 t4
-select * from total where tabname != 't2' and ta = 3;
+SELECT * FROM total WHERE tabname != 't2' AND ta = 3;
tabname ta message
t1 3 t1
t3 3 t3
t4 3 t4
-select * from total where tabname not in ('t2','t3');
+SELECT * FROM total WHERE tabname NOT IN ('t2','t3');
tabname ta message
t1 1 Testing
t1 2 dos table
@@ -103,11 +103,11 @@ t1 3 t1
t4 1 Testing
t4 2 myisam table
t4 3 t4
-select * from total where ta = 3 and tabname in ('t2','t3');
+SELECT * FROM total WHERE ta = 3 AND tabname IN ('t2','t3');
tabname ta message
t2 3 t2
t3 3 t3
-select * from total where ta = 3 or tabname in ('t2','t4');
+SELECT * FROM total WHERE ta = 3 OR tabname IN ('t2','t4');
tabname ta message
t1 3 t1
t2 1 Testing
@@ -117,7 +117,7 @@ t3 3 t3
t4 1 Testing
t4 2 myisam table
t4 3 t4
-select * from total where not tabname = 't2';
+SELECT * FROM total WHERE NOT tabname = 't2';
tabname ta message
t1 1 Testing
t1 2 dos table
@@ -128,7 +128,7 @@ t3 3 t3
t4 1 Testing
t4 2 myisam table
t4 3 t4
-select * from total where tabname = 't2' or tabname = 't1';
+SELECT * FROM total WHERE tabname = 't2' OR tabname = 't1';
tabname ta message
t1 1 Testing
t1 2 dos table
@@ -141,3 +141,22 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
+#
+# Checking thread TBL tables
+#
+CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v';
+SELECT * FROM t1;
+v
+11
+CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v';
+SELECT * FROM t2;
+v
+22
+CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=PORT';;
+SELECT * FROM total order by v desc;
+v
+22
+11
+DROP TABLE total;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/storage/connect/mysql-test/connect/t/infoschema-9739.test b/storage/connect/mysql-test/connect/t/infoschema-9739.test
new file mode 100644
index 00000000000..e9eb7fb796e
--- /dev/null
+++ b/storage/connect/mysql-test/connect/t/infoschema-9739.test
@@ -0,0 +1,9 @@
+#
+# MDEV-9739 Assertion `m_status == DA_ERROR || m_status == DA_OK' failed in Diagnostics_area::message() ; connect.xml* tests fail in buildbot
+#
+
+--source have_libxml2.inc
+
+create table t1 (i int) engine=Connect table_type=XML;
+select * from information_schema.tables where create_options like '%table_type=XML%';
+drop table t1;
diff --git a/storage/connect/mysql-test/connect/t/tbl.test b/storage/connect/mysql-test/connect/t/tbl.test
index 43c506c9403..3dc4b2e64b0 100644
--- a/storage/connect/mysql-test/connect/t/tbl.test
+++ b/storage/connect/mysql-test/connect/t/tbl.test
@@ -31,23 +31,40 @@ INSERT INTO t4 (message) VALUES ('Testing'),('myisam table'),('t4');
SELECT * FROM t4;
--replace_result $PORT PORT
---eval CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) engine=CONNECT table_type=TBL table_list='t1,t2,t3,t4' option_list='port=$PORT'
-
-select * from total;
-select * from total where tabname = 't2';
-select * from total where tabname = 't2' and ta = 3;
-select * from total where tabname in ('t1','t4');
-select * from total where ta = 3 and tabname in ('t1','t2');
-select * from total where tabname <> 't2';
-select * from total where tabname != 't2' and ta = 3;
-select * from total where tabname not in ('t2','t3');
-select * from total where ta = 3 and tabname in ('t2','t3');
-select * from total where ta = 3 or tabname in ('t2','t4');
-select * from total where not tabname = 't2';
-select * from total where tabname = 't2' or tabname = 't1';
+--eval CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3,t4' OPTION_LIST='port=$PORT'
+
+SELECT * FROM total;
+SELECT * FROM total WHERE tabname = 't2';
+SELECT * FROM total WHERE tabname = 't2' AND ta = 3;
+SELECT * FROM total WHERE tabname IN ('t1','t4');
+SELECT * FROM total WHERE ta = 3 AND tabname IN ('t1','t2');
+SELECT * FROM total WHERE tabname <> 't2';
+SELECT * FROM total WHERE tabname != 't2' AND ta = 3;
+SELECT * FROM total WHERE tabname NOT IN ('t2','t3');
+SELECT * FROM total WHERE ta = 3 AND tabname IN ('t2','t3');
+SELECT * FROM total WHERE ta = 3 OR tabname IN ('t2','t4');
+SELECT * FROM total WHERE NOT tabname = 't2';
+SELECT * FROM total WHERE tabname = 't2' OR tabname = 't1';
DROP TABLE total;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
+
+--echo #
+--echo # Checking thread TBL tables
+--echo #
+CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v';
+SELECT * FROM t1;
+
+CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v';
+SELECT * FROM t2;
+
+--replace_result $PORT PORT
+--eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT';
+SELECT * FROM total order by v desc;
+
+DROP TABLE total;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index cb21a8bda15..55ccbdbada1 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -1758,7 +1758,9 @@ bool ODBConn::BindParam(ODBCCOL *colp)
SQLLEN *strlen = colp->GetStrLen();
SQLRETURN rc;
+#if 0
try {
+ // This function is often not or badly implemented by data sources
rc = SQLDescribeParam(m_hstmt, n, &sqlt, &colsize, &dec, &nul);
if (!Check(rc))
@@ -1766,11 +1768,12 @@ bool ODBConn::BindParam(ODBCCOL *colp)
} catch(DBX *x) {
sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0));
+#endif // 0
colsize = colp->GetPrecision();
sqlt = GetSQLType(buftype);
- dec = IsTypeChar(buftype) ? 0 : colp->GetScale();
- nul = SQL_NULLABLE_UNKNOWN;
- } // end try/catch
+ dec = IsTypeNum(buftype) ? colp->GetScale() : 0;
+ nul = colp->IsNullable() ? SQL_NULLABLE : SQL_NO_NULLS;
+//} // end try/catch
buf = colp->GetBuffer(0);
len = IsTypeChar(buftype) ? colp->GetBuflen() : 0;
diff --git a/storage/connect/plgcnx.h b/storage/connect/plgcnx.h
index a1208f9b885..1b341bc5275 100644
--- a/storage/connect/plgcnx.h
+++ b/storage/connect/plgcnx.h
@@ -25,7 +25,7 @@ enum FNRC {RC_LICENSE = 7, /* PLGConnect prompt for license key */
RC_SUCCESS = 0, /* Successful function (must be 0) */
RC_MEMORY = -1, /* Storage allocation error */
RC_TRUNCATED = -2, /* Result has been truncated */
- RC_TIMEOUT = -3, /* Connection timeout occured */
+ RC_TIMEOUT = -3, /* Connection timeout occurred */
RC_TOOBIG = -4, /* Data is too big for connection */
RC_KEY = -5, /* Null ptr to key in Connect */
/* or bad key in other functions */
diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp
index 7906f6c9219..98633f49d23 100644
--- a/storage/connect/tabdos.cpp
+++ b/storage/connect/tabdos.cpp
@@ -184,7 +184,7 @@ bool DOSDEF::GetOptFileName(PGLOBAL g, char *filename)
} // end of GetOptFileName
/***********************************************************************/
-/* After an optimize error occured, remove all set optimize values. */
+/* After an optimize error occurred, remove all set optimize values. */
/***********************************************************************/
void DOSDEF::RemoveOptValues(PGLOBAL g)
{
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp
index 5a8bb17bd50..47497f465e3 100644
--- a/storage/connect/tabmysql.cpp
+++ b/storage/connect/tabmysql.cpp
@@ -334,7 +334,7 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
Delayed = !!GetIntCatInfo("Delayed", 0);
} else {
// MYSQL access from a PROXY table
- Database = GetStringCatInfo(g, "Database", Schema ? Schema : (char*)"*");
+ Database = GetStringCatInfo(g, "Database", Schema ? Schema : PlugDup(g, "*"));
Isview = GetBoolCatInfo("View", false);
// We must get other connection parms from the calling table
@@ -806,7 +806,7 @@ int TDBMYSQL::GetMaxSize(PGLOBAL g)
else if (!Cardinality(NULL))
MaxSize = 10; // To make MySQL happy
else if ((MaxSize = Cardinality(g)) < 0)
- MaxSize = 12; // So we can see an error occured
+ MaxSize = 12; // So we can see an error occurred
} // endif MaxSize
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index 501a814721d..c555f2a5abb 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
-/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */
+/* (C) Copyright to the author Olivier BERTRAND 2000-2016 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
@@ -818,7 +818,7 @@ int TDBODBC::GetMaxSize(PGLOBAL g)
else if (!Cardinality(NULL))
MaxSize = 10; // To make MySQL happy
else if ((MaxSize = Cardinality(g)) < 0)
- MaxSize = 12; // So we can see an error occured
+ MaxSize = 12; // So we can see an error occurred
} // endif MaxSize
diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp
index 6b72c715517..36849146746 100644
--- a/storage/connect/tabtbl.cpp
+++ b/storage/connect/tabtbl.cpp
@@ -607,7 +607,7 @@ void TDBTBM::ResetDB(void)
for (PTABLE tabp = Tablist; tabp; tabp = tabp->GetNext())
((PTDBASE)tabp->GetTo_Tdb())->ResetDB();
- Tdbp = (PTDBASE)Tablist->GetTo_Tdb();
+ Tdbp = (Tablist) ? (PTDBASE)Tablist->GetTo_Tdb() : NULL;
Crp = 0;
} // end of ResetDB
@@ -679,7 +679,7 @@ bool TDBTBM::OpenDB(PGLOBAL g)
/* Table already open, replace it at its beginning. */
/*******************************************************************/
ResetDB();
- return Tdbp->OpenDB(g); // Re-open fist table
+ return (Tdbp) ? Tdbp->OpenDB(g) : false; // Re-open fist table
} // endif use
#if 0
diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h
index 9d3f297f9e7..3a5ec45d025 100644
--- a/storage/connect/tabtbl.h
+++ b/storage/connect/tabtbl.h
@@ -138,7 +138,8 @@ class DllExport TDBTBM : public TDBTBL {
virtual void ResetDB(void);
// Database routines
- virtual int GetMaxSize(PGLOBAL g) {return 10;} // Temporary
+ virtual int Cardinality(PGLOBAL g) { return 10; }
+ virtual int GetMaxSize(PGLOBAL g) { return 10; } // Temporary
virtual int RowNumber(PGLOBAL g, bool b = FALSE);
virtual bool OpenDB(PGLOBAL g);
virtual int ReadDB(PGLOBAL g);
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index f9597cb842b..64d0e13e8c4 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -989,7 +989,7 @@ uchar TYPVAL<uchar>::MinMaxVal(bool b)
{return (b) ? UINT_MAX8 : 0;}
/***********************************************************************/
-/* SafeAdd: adds a value and test whether overflow/underflow occured. */
+/* SafeAdd: adds a value and test whether overflow/underflow occurred. */
/***********************************************************************/
template <class TYPE>
TYPE TYPVAL<TYPE>::SafeAdd(TYPE n1, TYPE n2)
@@ -1017,7 +1017,7 @@ inline double TYPVAL<double>::SafeAdd(double n1, double n2)
} // end of SafeAdd
/***********************************************************************/
-/* SafeMult: multiply values and test whether overflow occured. */
+/* SafeMult: multiply values and test whether overflow occurred. */
/***********************************************************************/
template <class TYPE>
TYPE TYPVAL<TYPE>::SafeMult(TYPE n1, TYPE n2)
@@ -1344,10 +1344,13 @@ bool TYPVAL<PSZ>::SetValue_pval(PVAL valp, bool chktype)
/***********************************************************************/
bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
{
- bool rc;
+ bool rc = false;
- if (p && n > 0) {
- rc = n > Len;
+ if (!p || n == 0) {
+ Reset();
+ Null = Nullable;
+ } else if (p != Strp) {
+ rc = n > Len;
if ((n = MY_MIN(n, Len))) {
strncpy(Strp, p, n);
@@ -1366,10 +1369,6 @@ bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
Reset();
Null = false;
- } else {
- rc = false;
- Reset();
- Null = Nullable;
} // endif p
return rc;
@@ -1380,12 +1379,12 @@ bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
/***********************************************************************/
void TYPVAL<PSZ>::SetValue_psz(PSZ s)
{
- if (s) {
- strncpy(Strp, s, Len);
+ if (!s) {
+ Reset();
+ Null = Nullable;
+ } else if (s != Strp) {
+ strncpy(Strp, s, Len);
Null = false;
- } else {
- Reset();
- Null = Nullable;
} // endif s
} // end of SetValue_psz
@@ -1643,7 +1642,7 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
assert(np == 1 || np == 2);
if (np == 2)
- strncpy(Strp, p[0], Len);
+ SetValue_psz(p[0]);
if ((i = Len - (signed)strlen(Strp)) > 0)
strncat(Strp, p[np - 1], i);
@@ -1651,11 +1650,11 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
break;
case OP_MIN:
assert(np == 2);
- strcpy(Strp, (strcmp(p[0], p[1]) < 0) ? p[0] : p[1]);
+ SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]);
break;
case OP_MAX:
assert(np == 2);
- strcpy(Strp, (strcmp(p[0], p[1]) > 0) ? p[0] : p[1]);
+ SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]);
break;
default:
// sprintf(g->Message, MSG(BAD_EXP_OPER), op);
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 000b46b2bb2..127c6053a53 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -71,7 +71,7 @@ class ha_tina: public handler
File update_temp_file;
String buffer;
/*
- The chain contains "holes" in the file, occured because of
+ The chain contains "holes" in the file, occurred because of
deletes/updates. It is used in rnd_end() to get rid of them
in the end of the query.
*/
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 0bf4d766d64..478a8f1cfaa 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2016,7 +2016,7 @@ void ha_federated::start_bulk_insert(ha_rows rows, uint flags)
@return Operation status
@retval 0 No error
- @retval != 0 Error occured at remote server. Also sets my_errno.
+ @retval != 0 Error occurred at remote server. Also sets my_errno.
*/
int ha_federated::end_bulk_insert()
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 5834e70c2e5..890d1bff292 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -2157,7 +2157,7 @@ void ha_federatedx::start_bulk_insert(ha_rows rows, uint flags)
@return Operation status
@retval 0 No error
- @retval != 0 Error occured at remote server. Also sets my_errno.
+ @retval != 0 Error occurred at remote server. Also sets my_errno.
*/
int ha_federatedx::end_bulk_insert()
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 03020896542..ceffa950739 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (C) 2014, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (C) 2014, 2016, MariaDB Corporation. 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
@@ -662,7 +662,7 @@ fil_space_encrypt(
return src_frame;
}
- ut_ad(crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+ ut_a(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
byte* tmp = fil_encrypt_buf(crypt_data, space, offset, lsn, src_frame, zip_size, dst_frame);
@@ -712,21 +712,37 @@ fil_space_decrypt(
ulint page_type = mach_read_from_2(src_frame+FIL_PAGE_TYPE);
uint key_version = mach_read_from_4(src_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
bool page_compressed = (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
-
+ ulint offset = mach_read_from_4(src_frame + FIL_PAGE_OFFSET);
+ ulint space = mach_read_from_4(src_frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
+ ib_uint64_t lsn = mach_read_from_8(src_frame + FIL_PAGE_LSN);
*err = DB_SUCCESS;
if (key_version == ENCRYPTION_KEY_NOT_ENCRYPTED) {
return false;
}
- ut_ad(crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+ if (crypt_data == NULL) {
+ if (!(space == 0 && offset == 0) && key_version != 0) {
+ /* FIL_PAGE_FILE_FLUSH_LSN field i.e.
+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+ should be only defined for the
+ first page in a system tablespace
+ data file (ibdata*, not *.ibd), if not
+ clear it. */
+#ifdef UNIV_DEBUG
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "Page on space %lu offset %lu has key_version %u"
+ " when it shoud be undefined.",
+ space, offset, key_version);
+#endif
+ mach_write_to_4(src_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0);
+ }
+ return false;
+ }
- /* read space & offset & lsn */
- ulint space = mach_read_from_4(
- src_frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
- ulint offset = mach_read_from_4(
- src_frame + FIL_PAGE_OFFSET);
- ib_uint64_t lsn = mach_read_from_8(src_frame + FIL_PAGE_LSN);
+ ut_a(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+
+ /* read space & lsn */
ulint header_len = FIL_PAGE_DATA;
if (page_compressed) {
@@ -2506,6 +2522,7 @@ fil_space_crypt_get_status(
mutex_enter(&crypt_data->mutex);
status->keyserver_requests = crypt_data->keyserver_requests;
status->min_key_version = crypt_data->min_key_version;
+ status->key_id = crypt_data->key_id;
if (crypt_data->rotate_state.active_threads > 0 ||
crypt_data->rotate_state.flushing) {
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 928c72cf546..d918b21d779 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2015, Oracle and/or its affiliates.
-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
@@ -3207,10 +3207,12 @@ fil_create_link_file(
}
link_filepath = fil_make_isl_name(tablename);
-
+ /* Note that OS_FILE_READ_WRITE_CACHED used here to avoid
+ unnecessary errors on O_DIRECT, link files are not really
+ a data files. */
file = os_file_create_simple_no_error_handling(
innodb_file_data_key, link_filepath,
- OS_FILE_CREATE, OS_FILE_READ_WRITE, &success, 0);
+ OS_FILE_CREATE, OS_FILE_READ_WRITE_CACHED, &success, 0);
if (!success) {
/* The following call will print an error message */
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index cc4a4f9f1a8..ee06f9432b8 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -6274,7 +6274,7 @@ fts_fake_hex_to_dec(
#ifdef _WIN32
ret = sscanf(tmp_id, "%016llu", &dec_id);
#else
- ret = sscanf(tmp_id, "%016"PRIu64, &dec_id);
+ ret = sscanf(tmp_id, "%016" PRIu64, &dec_id);
#endif /* _WIN32 */
ut_ad(ret == 1);
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index 2a0aa4daf12..00b3b4682c3 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -598,7 +598,7 @@ fts_zip_read_word(
/* Finished decompressing block. */
if (zip->zp->avail_in == 0) {
- /* Free the block thats been decompressed. */
+ /* Free the block that's been decompressed. */
if (zip->pos > 0) {
ulint prev = zip->pos - 1;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 9b70c4127f9..5edb6dc5190 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -19927,7 +19927,7 @@ maria_declare_plugin(innobase)
innodb_status_variables_export,/* status variables */
innobase_system_variables, /* system variables */
INNODB_VERSION_STR, /* string version */
- MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
},
i_s_innodb_trx,
i_s_innodb_locks,
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index ef69e7df29d..0bb10f435af 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates.
-Copyrigth (c) 2014, 2015, MariaDB Corporation
+Copyrigth (c) 2014, 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
@@ -783,7 +783,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_trx =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
@@ -1043,7 +1043,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_locks =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
@@ -1226,7 +1226,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/*******************************************************************//**
@@ -1562,7 +1562,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset =
@@ -1612,7 +1612,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic tables
@@ -1912,7 +1912,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index_reset =
@@ -1962,7 +1962,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_per_index_reset =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
@@ -2205,7 +2205,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset =
@@ -2255,7 +2255,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_metrics */
@@ -2779,7 +2779,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_metrics =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_ft_default_stopword */
static ST_FIELD_INFO i_s_stopword_fields_info[] =
@@ -2892,7 +2892,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_default_stopword =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED
@@ -3060,7 +3060,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_deleted =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/*******************************************************************//**
@@ -3143,7 +3143,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_being_deleted =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHED and
@@ -3432,7 +3432,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_cache =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/*******************************************************************//**
@@ -3867,7 +3867,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_index_table =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_CONFIG */
@@ -4065,7 +4065,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_ft_config =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INNODB_BUFFER_POOL_STATS. */
@@ -4614,7 +4614,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_stats =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INNODB_BUFFER_POOL_PAGE. */
@@ -5326,7 +5326,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
@@ -5873,7 +5873,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page_lru =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/*******************************************************************//**
@@ -6167,7 +6167,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tables =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_TABLESTATS ***********************************************/
@@ -6457,7 +6457,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablestats =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_INDEXES **************************************************/
@@ -6709,7 +6709,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_indexes =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_COLUMNS **************************************************/
@@ -6946,7 +6946,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_columns =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_FIELDS ***************************************************/
@@ -7156,7 +7156,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_fields =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_FOREIGN ********************************************/
@@ -7381,7 +7381,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_FOREIGN_COLS ********************************************/
@@ -7598,7 +7598,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign_cols =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_TABLESPACES ********************************************/
@@ -7866,7 +7866,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablespaces =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_DATAFILES ************************************************/
@@ -8055,7 +8055,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_datafiles =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** TABLESPACES_ENCRYPTION ********************************************/
@@ -8134,6 +8134,15 @@ static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] =
STRUCT_FLD(old_name, ""),
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+#define TABLESPACES_ENCRYPTION_CURRENT_KEY_ID 8
+ {STRUCT_FLD(field_name, "CURRENT_KEY_ID"),
+ STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
+ STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
+ STRUCT_FLD(value, 0),
+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
+ STRUCT_FLD(old_name, ""),
+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+
END_OF_ST_FIELD_INFO
};
@@ -8172,6 +8181,8 @@ i_s_dict_fill_tablespaces_encryption(
status.min_key_version));
OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_VERSION]->store(
status.current_key_version));
+ OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_ID]->store(
+ status.key_id));
if (status.rotating) {
fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->set_notnull();
OK(fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->store(
@@ -8338,7 +8349,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_encryption =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA)
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA)
};
/** TABLESPACES_SCRUBBING ********************************************/
@@ -8637,7 +8648,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_scrubbing =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA)
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA)
};
/** INNODB_MUTEXES *********************************************/
@@ -8851,7 +8862,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_mutexes =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_SEMAPHORE_WAITS ************************************************/
@@ -9128,5 +9139,5 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_semaphore_waits =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h
index aa601f28e25..fdc413e7520 100644
--- a/storage/innobase/include/fil0crypt.h
+++ b/storage/innobase/include/fil0crypt.h
@@ -333,6 +333,7 @@ struct fil_space_crypt_status_t {
uint min_key_version; /*!< min key version */
uint current_key_version;/*!< current key version */
uint keyserver_requests;/*!< no of key requests to key server */
+ ulint key_id; /*!< current key_id */
bool rotating; /*!< is key rotation ongoing */
bool flushing; /*!< is flush at end of rotation ongoing */
ulint rotate_next_page_number; /*!< next page if key rotating */
diff --git a/storage/innobase/include/fts0priv.ic b/storage/innobase/include/fts0priv.ic
index 2d07c60f980..ec61691870b 100644
--- a/storage/innobase/include/fts0priv.ic
+++ b/storage/innobase/include/fts0priv.ic
@@ -53,7 +53,7 @@ fts_write_object_id(
/* Use this to construct old(5.6.14 and 5.7.3) windows
ambiguous aux table names */
DBUG_EXECUTE_IF("innodb_test_wrong_windows_fts_aux_table_name",
- return(sprintf(str, "%016"PRIu64, id)););
+ return(sprintf(str, "%016" PRIu64, id)););
DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
return(sprintf(str, UINT64PFx, id)););
@@ -66,7 +66,7 @@ fts_write_object_id(
// FIXME: Use ut_snprintf(), so does following one.
return(sprintf(str, "%016llu", id));
#else /* _WIN32 */
- return(sprintf(str, "%016"PRIu64, id));
+ return(sprintf(str, "%016" PRIu64, id));
#endif /* _WIN32 */
}
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index e4a06fcc532..292953854f7 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -498,6 +498,18 @@ use these free frames to read in pages when we start applying the
log records to the database. */
extern ulint recv_n_pool_free_frames;
+/******************************************************//**
+Checks the 4-byte checksum to the trailer checksum field of a log
+block. We also accept a log block in the old format before
+InnoDB-3.23.52 where the checksum field contains the log block number.
+@return TRUE if ok, or if the log block may be in the format of InnoDB
+version predating 3.23.52 */
+ibool
+log_block_checksum_is_ok_or_old_format(
+/*===================================*/
+ const byte* block, /*!< in: pointer to a log block */
+ bool print_err); /*!< in print error ? */
+
#ifndef UNIV_NONINL
#include "log0recv.ic"
#endif
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index c610e1790eb..dff5ebd524c 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -128,7 +128,10 @@ enum os_file_create_t {
#define OS_FILE_READ_ONLY 333
#define OS_FILE_READ_WRITE 444
#define OS_FILE_READ_ALLOW_DELETE 555 /* for mysqlbackup */
-
+#define OS_FILE_READ_WRITE_CACHED 666 /* OS_FILE_READ_WRITE but never
+ O_DIRECT. Only for
+ os_file_create_simple_no_error_handling
+ currently. */
/* Options for file_create */
#define OS_FILE_AIO 61
#define OS_FILE_NORMAL 62
@@ -542,7 +545,7 @@ UNIV_INTERN
void
os_file_set_nocache(
/*================*/
- int fd, /*!< in: file descriptor to alter */
+ os_file_t fd, /*!< in: file descriptor to alter */
const char* file_name, /*!< in: file name, used in the
diagnostic message */
const char* operation_name);/*!< in: "open" or "create"; used in the
diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc
index e90533c2e76..852148899e9 100644
--- a/storage/innobase/log/log0crypt.cc
+++ b/storage/innobase/log/log0crypt.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (C) 2014, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (C) 2014, 2016, MariaDB Corporation. 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
@@ -36,6 +36,8 @@ Modified Jan Lindström jan.lindstrom@mariadb.com
#include "my_crypt.h"
+/* Used for debugging */
+// #define DEBUG_CRYPT 1
#define UNENCRYPTED_KEY_VER 0
/* If true, enable redo log encryption. */
@@ -97,16 +99,24 @@ get_crypt_info(
{
/* so that no one is modifying array while we search */
ut_ad(mutex_own(&(log_sys->mutex)));
+ size_t items = crypt_info.size();
/* a log block only stores 4-bytes of checkpoint no */
checkpoint_no &= 0xFFFFFFFF;
- for (size_t i = 0; i < crypt_info.size(); i++) {
+ for (size_t i = 0; i < items; i++) {
struct crypt_info_t* it = &crypt_info[i];
if (it->checkpoint_no == checkpoint_no) {
return it;
}
}
+
+ /* If checkpoint contains more than one key and we did not
+ find the correct one use the first one. */
+ if (items) {
+ return (&crypt_info[0]);
+ }
+
return NULL;
}
@@ -131,7 +141,8 @@ log_blocks_crypt(
const byte* block, /*!< in: blocks before encrypt/decrypt*/
ulint size, /*!< in: size of block */
byte* dst_block, /*!< out: blocks after encrypt/decrypt */
- int what) /*!< in: encrypt or decrypt*/
+ int what, /*!< in: encrypt or decrypt*/
+ const crypt_info_t* crypt_info) /*!< in: crypt info or NULL */
{
byte *log_block = (byte*)block;
Crypt_result rc = MY_AES_OK;
@@ -146,7 +157,8 @@ log_blocks_crypt(
lsn_t log_block_start_lsn = log_block_get_start_lsn(
lsn, log_block_no);
- const crypt_info_t* info = get_crypt_info(log_block);
+ const crypt_info_t* info = crypt_info == NULL ? get_crypt_info(log_block) :
+ crypt_info;
#ifdef DEBUG_CRYPT
fprintf(stderr,
"%s %lu chkpt: %lu key: %u lsn: %lu\n",
@@ -156,12 +168,21 @@ log_blocks_crypt(
info ? info->key_version : 0,
log_block_start_lsn);
#endif
+ /* If no key is found from checkpoint assume the log_block
+ to be unencrypted. If checkpoint contains the encryption key
+ compare log_block current checksum, if checksum matches,
+ block can't be encrypted. */
if (info == NULL ||
- info->key_version == UNENCRYPTED_KEY_VER) {
+ info->key_version == UNENCRYPTED_KEY_VER ||
+ (log_block_checksum_is_ok_or_old_format(log_block, false) &&
+ what == ENCRYPTION_FLAG_DECRYPT)) {
memcpy(dst_block, log_block, OS_FILE_LOG_BLOCK_SIZE);
goto next;
}
+ ut_ad(what == ENCRYPTION_FLAG_DECRYPT ? !log_block_checksum_is_ok_or_old_format(log_block, false) :
+ log_block_checksum_is_ok_or_old_format(log_block, false));
+
// Assume log block header is not encrypted
memcpy(dst_block, log_block, LOG_BLOCK_HDR_SIZE);
@@ -292,7 +313,7 @@ log_blocks_encrypt(
const ulint size, /*!< in: size of blocks, must be multiple of a log block */
byte* dst_block) /*!< out: blocks after encryption */
{
- return log_blocks_crypt(block, size, dst_block, ENCRYPTION_FLAG_ENCRYPT);
+ return log_blocks_crypt(block, size, dst_block, ENCRYPTION_FLAG_ENCRYPT, NULL);
}
/*********************************************************************//**
@@ -355,14 +376,16 @@ log_encrypt_before_write(
return;
}
- if (info->key_version == UNENCRYPTED_KEY_VER) {
+ /* If the key is not encrypted or user has requested not to
+ encrypt, do not change log block. */
+ if (info->key_version == UNENCRYPTED_KEY_VER || !srv_encrypt_log) {
return;
}
byte* dst_frame = (byte*)malloc(size);
//encrypt log blocks content
- Crypt_result result = log_blocks_crypt(block, size, dst_frame, ENCRYPTION_FLAG_ENCRYPT);
+ Crypt_result result = log_blocks_crypt(block, size, dst_frame, ENCRYPTION_FLAG_ENCRYPT, NULL);
if (result == MY_AES_OK) {
ut_ad(block[0] == dst_frame[0]);
@@ -388,7 +411,7 @@ log_decrypt_after_read(
byte* dst_frame = (byte*)malloc(size);
// decrypt log blocks content
- Crypt_result result = log_blocks_crypt(frame, size, dst_frame, ENCRYPTION_FLAG_DECRYPT);
+ Crypt_result result = log_blocks_crypt(frame, size, dst_frame, ENCRYPTION_FLAG_DECRYPT, NULL);
if (result == MY_AES_OK) {
memcpy(frame, dst_frame, size);
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index fd3646a1691..31104b395c1 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
-Copyright (c) 2013, SkySQL Ab. All Rights Reserved.
+Copyright (C) 2014, 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
@@ -52,6 +52,9 @@ Created 12/9/1995 Heikki Tuuri
#include "trx0roll.h"
#include "srv0mon.h"
+/* Used for debugging */
+// #define DEBUG_CRYPT 1
+
/*
General philosophy of InnoDB redo-logs:
@@ -2358,8 +2361,24 @@ loop:
(ulint) (source_offset % UNIV_PAGE_SIZE),
len, buf, NULL, 0);
+#ifdef DEBUG_CRYPT
+ fprintf(stderr, "BEFORE DECRYPT: block: %lu checkpoint: %lu %.8lx %.8lx offset %lu\n",
+ log_block_get_hdr_no(buf),
+ log_block_get_checkpoint_no(buf),
+ log_block_calc_checksum(buf),
+ log_block_get_checksum(buf), source_offset);
+#endif
+
log_decrypt_after_read(buf, len);
+#ifdef DEBUG_CRYPT
+ fprintf(stderr, "AFTER DECRYPT: block: %lu checkpoint: %lu %.8lx %.8lx\n",
+ log_block_get_hdr_no(buf),
+ log_block_get_checkpoint_no(buf),
+ log_block_calc_checksum(buf),
+ log_block_get_checksum(buf));
+#endif
+
start_lsn += len;
buf += len;
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index c84e8277f07..2304f4885c2 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -2,7 +2,7 @@
Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. 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
@@ -923,11 +923,11 @@ block. We also accept a log block in the old format before
InnoDB-3.23.52 where the checksum field contains the log block number.
@return TRUE if ok, or if the log block may be in the format of InnoDB
version predating 3.23.52 */
-static
ibool
log_block_checksum_is_ok_or_old_format(
/*===================================*/
- const byte* block) /*!< in: pointer to a log block */
+ const byte* block, /*!< in: pointer to a log block */
+ bool print_err) /*!< in print error ? */
{
#ifdef UNIV_LOG_DEBUG
return(TRUE);
@@ -950,11 +950,13 @@ log_block_checksum_is_ok_or_old_format(
return(TRUE);
}
- fprintf(stderr, "BROKEN: block: %lu checkpoint: %lu %.8lx %.8lx\n",
- log_block_get_hdr_no(block),
- log_block_get_checkpoint_no(block),
- log_block_calc_checksum(block),
- log_block_get_checksum(block));
+ if (print_err) {
+ fprintf(stderr, "BROKEN: block: %lu checkpoint: %lu %.8lx %.8lx\n",
+ log_block_get_hdr_no(block),
+ log_block_get_checkpoint_no(block),
+ log_block_calc_checksum(block),
+ log_block_get_checksum(block));
+ }
return(FALSE);
}
@@ -2664,6 +2666,7 @@ recv_scan_log_recs(
ibool finished;
ulint data_len;
ibool more_data;
+ bool maybe_encrypted=false;
ut_ad(start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
@@ -2678,6 +2681,8 @@ recv_scan_log_recs(
*err = DB_SUCCESS;
do {
+ log_crypt_err_t log_crypt_err;
+
no = log_block_get_hdr_no(log_block);
/*
fprintf(stderr, "Log block header no %lu\n", no);
@@ -2686,12 +2691,11 @@ recv_scan_log_recs(
log_block_convert_lsn_to_no(scanned_lsn));
*/
if (no != log_block_convert_lsn_to_no(scanned_lsn)
- || !log_block_checksum_is_ok_or_old_format(log_block)) {
- log_crypt_err_t log_crypt_err;
+ || !log_block_checksum_is_ok_or_old_format(log_block, true)) {
if (no == log_block_convert_lsn_to_no(scanned_lsn)
&& !log_block_checksum_is_ok_or_old_format(
- log_block)) {
+ log_block, true)) {
fprintf(stderr,
"InnoDB: Log block no %lu at"
" lsn " LSN_PF " has\n"
@@ -2705,12 +2709,14 @@ recv_scan_log_recs(
log_block));
}
+ maybe_encrypted = log_crypt_block_maybe_encrypted(log_block,
+ &log_crypt_err);
+
/* Garbage or an incompletely written log block */
finished = TRUE;
- if (log_crypt_block_maybe_encrypted(log_block,
- &log_crypt_err)) {
+ if (maybe_encrypted) {
/* Log block maybe encrypted finish processing*/
log_crypt_print_error(log_crypt_err);
*err = DB_ERROR;
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index dd6b066c647..3a0bd1fc328 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
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 Percona Inc.. Those modifications are
@@ -1350,7 +1350,8 @@ os_file_create_simple_func(
access = GENERIC_READ;
- } else if (access_type == OS_FILE_READ_WRITE) {
+ } else if (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED) {
access = GENERIC_READ | GENERIC_WRITE;
} else {
ib_logf(IB_LOG_LEVEL_ERROR,
@@ -1454,7 +1455,8 @@ os_file_create_simple_func(
#ifdef USE_FILE_LOCK
if (!srv_read_only_mode
&& *success
- && access_type == OS_FILE_READ_WRITE
+ && (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED)
&& os_file_lock(file, name)) {
*success = FALSE;
@@ -1468,6 +1470,31 @@ os_file_create_simple_func(
return(file);
}
+/** Disable OS I/O caching on the file if the file type and server
+configuration requires it.
+@param file handle to the file
+@param name name of the file, for diagnostics
+@param mode_str operation on the file, for diagnostics
+@param type OS_LOG_FILE or OS_DATA_FILE
+@param access_type if OS_FILE_READ_WRITE_CACHED, then caching will be disabled
+unconditionally, ignored otherwise */
+static
+void
+os_file_set_nocache_if_needed(os_file_t file, const char* name,
+ const char *mode_str, ulint type,
+ ulint access_type)
+{
+ if (srv_read_only_mode || access_type == OS_FILE_READ_WRITE_CACHED) {
+ return;
+ }
+
+ if (type == OS_DATA_FILE
+ && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
+ || (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC))) {
+ os_file_set_nocache(file, name, mode_str);
+ }
+}
+
/****************************************************************//**
NOTE! Use the corresponding macro
os_file_create_simple_no_error_handling(), not directly this function!
@@ -1523,7 +1550,8 @@ os_file_create_simple_no_error_handling_func(
access = GENERIC_READ;
} else if (srv_read_only_mode) {
access = GENERIC_READ;
- } else if (access_type == OS_FILE_READ_WRITE) {
+ } else if (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED) {
access = GENERIC_READ | GENERIC_WRITE;
} else if (access_type == OS_FILE_READ_ALLOW_DELETE) {
@@ -1595,7 +1623,8 @@ os_file_create_simple_no_error_handling_func(
} else {
ut_a(access_type == OS_FILE_READ_WRITE
- || access_type == OS_FILE_READ_ALLOW_DELETE);
+ || access_type == OS_FILE_READ_ALLOW_DELETE
+ || access_type == OS_FILE_READ_WRITE_CACHED);
create_flag = O_RDWR;
}
@@ -1627,18 +1656,16 @@ os_file_create_simple_no_error_handling_func(
/* This function is always called for data files, we should disable
OS caching (O_DIRECT) here as we do in os_file_create_func(), so
we open the same file in the same mode, see man page of open(2). */
- if (!srv_read_only_mode
- && *success
- && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
- || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {
-
- os_file_set_nocache(file, name, mode_str);
+ if (*success) {
+ os_file_set_nocache_if_needed(file, name, mode_str,
+ OS_DATA_FILE, access_type);
}
#ifdef USE_FILE_LOCK
if (!srv_read_only_mode
&& *success
- && access_type == OS_FILE_READ_WRITE
+ && (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED)
&& os_file_lock(file, name)) {
*success = FALSE;
@@ -1677,7 +1704,7 @@ UNIV_INTERN
void
os_file_set_nocache(
/*================*/
- int fd /*!< in: file descriptor to alter */
+ os_file_t fd /*!< in: file descriptor to alter */
__attribute__((unused)),
const char* file_name /*!< in: used in the diagnostic
message */
@@ -2007,13 +2034,8 @@ os_file_create_func(
/* We disable OS caching (O_DIRECT) only on data files */
- if (!srv_read_only_mode
- && *success
- && type != OS_LOG_FILE
- && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
- || srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)) {
-
- os_file_set_nocache(file, name, mode_str);
+ if (*success) {
+ os_file_set_nocache_if_needed(file, name, mode_str, type, 0);
}
#ifdef USE_FILE_LOCK
@@ -2926,7 +2948,7 @@ try_again:
"Error in system call pread(). The operating"
" system error number is %lu.",(ulint) errno);
} else {
- /* Partial read occured */
+ /* Partial read occurred */
ib_logf(IB_LOG_LEVEL_ERROR,
"Tried to read " ULINTPF " bytes at offset "
UINT64PF ". Was only able to read %ld.",
@@ -3057,7 +3079,7 @@ try_again:
"Error in system call pread(). The operating"
" system error number is %lu.",(ulint) errno);
} else {
- /* Partial read occured */
+ /* Partial read occurred */
ib_logf(IB_LOG_LEVEL_ERROR,
"Tried to read " ULINTPF " bytes at offset "
UINT64PF ". Was only able to read %ld.",
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 94cf20b79f6..294facf9723 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -3454,7 +3454,7 @@ row_merge_file_create(
if (merge_file->fd >= 0) {
if (srv_disable_sort_file_cache) {
- os_file_set_nocache(merge_file->fd,
+ os_file_set_nocache((os_file_t)merge_file->fd,
"row0merge.cc", "sort");
}
}
diff --git a/storage/innobase/ut/crc32_power8/crc32.S b/storage/innobase/ut/crc32_power8/crc32.S
index 52046bb9002..b064ce3dc96 100644
--- a/storage/innobase/ut/crc32_power8/crc32.S
+++ b/storage/innobase/ut/crc32_power8/crc32.S
@@ -67,14 +67,13 @@
#define off96 r30
#define off112 r31
-#define const1 v25
-#define const2 v26
+#define const1 v24
+#define const2 v25
-#define byteswap v27
-#define mask_32bit v28
-#define mask_64bit v29
-#define zeroes v30
-#define ones v31
+#define byteswap v26
+#define mask_32bit v27
+#define mask_64bit v28
+#define zeroes v29
#ifdef BYTESWAP_DATA
#define VPERM(A, B, C, D) vperm A, B, C, D
@@ -101,13 +100,28 @@ FUNC_START(__crc32_vpmsum)
li off112,112
li r0,0
+ /* Enough room for saving 10 non volatile VMX registers */
+ subi r6,r1,56+10*16
+ subi r7,r1,56+2*16
+
+ stvx v20,0,r6
+ stvx v21,off16,r6
+ stvx v22,off32,r6
+ stvx v23,off48,r6
+ stvx v24,off64,r6
+ stvx v25,off80,r6
+ stvx v26,off96,r6
+ stvx v27,off112,r6
+ stvx v28,0,r7
+ stvx v29,off16,r7
+
mr r10,r3
vxor zeroes,zeroes,zeroes
- vspltisw ones,-1
+ vspltisw v0,-1
- vsldoi mask_32bit,zeroes,ones,4
- vsldoi mask_64bit,zeroes,ones,8
+ vsldoi mask_32bit,zeroes,v0,4
+ vsldoi mask_64bit,zeroes,v0,8
/* Get the initial value into v8 */
vxor v8,v8,v8
@@ -570,6 +584,21 @@ FUNC_START(__crc32_vpmsum)
vsldoi v0,v0,zeroes,4 /* shift result into top 64 bits of */
#endif
+.Lout:
+ subi r6,r1,56+10*16
+ subi r7,r1,56+2*16
+
+ lvx v20,0,r6
+ lvx v21,off16,r6
+ lvx v22,off32,r6
+ lvx v23,off48,r6
+ lvx v24,off64,r6
+ lvx v25,off80,r6
+ lvx v26,off96,r6
+ lvx v27,off112,r6
+ lvx v28,0,r7
+ lvx v29,off16,r7
+
/* Get it into r3 */
MFVRD(r3, v0)
@@ -739,6 +768,8 @@ FUNC_START(__crc32_vpmsum)
.Lzero:
mr r3,r10
blr
+ b .Lout
+
FUNC_END(__crc32_vpmsum)
#endif /* __powerpc__ */
diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c
index a541a657ed2..6a4e7ea99cf 100644
--- a/storage/maria/ma_packrec.c
+++ b/storage/maria/ma_packrec.c
@@ -1204,7 +1204,7 @@ static void decode_bytes(MARIA_COLUMNDEF *rec,MARIA_BIT_BUFF *bit_buff,
/* This means that the Huffman code must be longer than table_bits. */
pos=decode_tree->table+low_byte;
bits-=table_bits;
- /* NOTE: decode_bytes_test_bit() is a macro wich contains a break !!! */
+ /* NOTE: decode_bytes_test_bit() is a macro which contains a break !!! */
for (;;)
{
low_byte=(uint) (bit_buff->current_byte >> (bits-8));
diff --git a/storage/mroonga/mrn_table.cpp b/storage/mroonga/mrn_table.cpp
index 23abecf71e5..144dbe0c530 100644
--- a/storage/mroonga/mrn_table.cpp
+++ b/storage/mroonga/mrn_table.cpp
@@ -278,7 +278,7 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length,
#define MRN_PARAM_STR(title_name, param_name) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info", ("mroonga "title_name" start")); \
+ DBUG_PRINT("info", ("mroonga " title_name " start")); \
if (!share->param_name) \
{ \
if ((share->param_name = mrn_get_string_between_quote( \
@@ -290,7 +290,7 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length,
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info", ("mroonga "title_name"=%s", share->param_name)); \
+ DBUG_PRINT("info", ("mroonga " title_name "=%s", share->param_name)); \
} \
break; \
}
@@ -298,7 +298,7 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length,
#define MRN_PARAM_STR_LIST(title_name, param_name, param_pos) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info", ("mroonga "title_name" start")); \
+ DBUG_PRINT("info", ("mroonga " title_name " start")); \
if (share->param_name && !share->param_name[param_pos]) \
{ \
if ((share->param_name[param_pos] = mrn_get_string_between_quote( \
@@ -311,7 +311,7 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length,
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info", ("mroonga "title_name"[%d]=%s", param_pos, \
+ DBUG_PRINT("info", ("mroonga " title_name "[%d]=%s", param_pos, \
share->param_name[param_pos])); \
} \
break; \
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 257dbafd695..812166ce1cc 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -2409,7 +2409,7 @@ maria_declare_plugin_end;
@return The error code. The engine_data and engine_callback will be set to 0.
@retval TRUE Success
- @retval FALSE An error occured
+ @retval FALSE An error occurred
*/
my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index 3687cfc2179..fc32bb7e518 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1158,7 +1158,7 @@ static void decode_bytes(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff,uchar *to,
/* This means that the Huffman code must be longer than table_bits. */
pos=decode_tree->table+low_byte;
bits-=table_bits;
- /* NOTE: decode_bytes_test_bit() is a macro wich contains a break !!! */
+ /* NOTE: decode_bytes_test_bit() is a macro which contains a break !!! */
for (;;)
{
low_byte=(uint) (bit_buff->current_byte >> (bits-8));
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index d549dd76037..7ce03ca9485 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -266,7 +266,7 @@ static void get_options(register int *argc, register char ***argv)
puts(" -u \"update\" -v \"verbose\" -w \"write file\"");
puts(" -D \"myisam compiled with DBUG\" -P \"processes\"");
puts("\nOne can give a second and a third '-v' for more verbose.");
- puts("Normaly one does a update (-u).");
+ puts("Normally one does a update (-u).");
puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted.");
puts("If one gives table names as arguments only these tables will be updated\n");
help=1;
diff --git a/storage/oqgraph/graphcore.cc b/storage/oqgraph/graphcore.cc
index 73433fc8219..4346b94805c 100644
--- a/storage/oqgraph/graphcore.cc
+++ b/storage/oqgraph/graphcore.cc
@@ -1036,11 +1036,11 @@ int stack_cursor::fetch_row(const row &row_info, row &result,
optional<EdgeWeight> w;
optional<Vertex> v;
result= row_info;
- if ((result.seq_indicator= seq= last.sequence()))
+ if ((result.seq_indicator= static_cast<bool>(seq= last.sequence())))
result.seq= *seq;
- if ((result.link_indicator= v= last.vertex()))
+ if ((result.link_indicator= static_cast<bool>(v= last.vertex())))
result.link= get(boost::vertex_index, share->g, *v);
- if ((result.weight_indicator= w= last.weight()))
+ if ((result.weight_indicator= static_cast<bool>(w= last.weight())))
result.weight= *w;
return oqgraph::OK;
}
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 6f142a213b7..78a0079a5ab 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -753,6 +753,10 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
int ha_oqgraph::close(void)
{
DBUG_PRINT( "oq-debug", ("close()"));
+ if (graph->get_thd() != current_thd) {
+ DBUG_PRINT( "oq-debug", ("index_next_same g->table->in_use: 0x%lx <-- current_thd 0x%lx", (long) graph->get_thd(), (long) current_thd));
+ graph->set_thd(current_thd);
+ }
oqgraph::free(graph); graph= 0;
oqgraph::free(graph_share); graph_share= 0;
@@ -1372,6 +1376,6 @@ maria_declare_plugin(oqgraph)
oqgraph_status, /* status variables */
oqgraph_sysvars, /* system variables */
"3.0",
- MariaDB_PLUGIN_MATURITY_BETA
+ MariaDB_PLUGIN_MATURITY_GAMMA
}
maria_declare_plugin_end;
diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc
index c01549f8e99..7e7845635af 100644
--- a/storage/spider/spd_copy_tables.cc
+++ b/storage/spider/spd_copy_tables.cc
@@ -81,7 +81,7 @@ int spider_udf_set_copy_tables_param_default(
#define SPIDER_PARAM_STR(title_name, param_name) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (!copy_tables->param_name) \
{ \
if ((copy_tables->param_name = spider_get_string_between_quote( \
@@ -94,14 +94,14 @@ int spider_udf_set_copy_tables_param_default(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%s", copy_tables->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%s", copy_tables->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_HINT_WITH_MAX(title_name, param_name, check_length, max_size, min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, check_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
DBUG_PRINT("info",("spider max_size=%d", max_size)); \
int hint_num = atoi(tmp_ptr + check_length) - 1; \
DBUG_PRINT("info",("spider hint_num=%d", hint_num)); \
@@ -131,7 +131,7 @@ int spider_udf_set_copy_tables_param_default(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"[%d]=%d", hint_num, \
+ DBUG_PRINT("info",("spider " title_name "[%d]=%d", hint_num, \
copy_tables->param_name[hint_num])); \
} else { \
error_num = ER_SPIDER_INVALID_UDF_PARAM_NUM; \
@@ -144,7 +144,7 @@ int spider_udf_set_copy_tables_param_default(
#define SPIDER_PARAM_INT_WITH_MAX(title_name, param_name, min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (copy_tables->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -161,14 +161,14 @@ int spider_udf_set_copy_tables_param_default(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%d", copy_tables->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%d", copy_tables->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_INT(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (copy_tables->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -183,14 +183,14 @@ int spider_udf_set_copy_tables_param_default(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%d", copy_tables->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%d", copy_tables->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_LONGLONG(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (copy_tables->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -206,7 +206,7 @@ int spider_udf_set_copy_tables_param_default(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%lld", \
+ DBUG_PRINT("info",("spider " title_name "=%lld", \
copy_tables->param_name)); \
} \
break; \
diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc
index 7de31e34e94..c0eb7806bb0 100644
--- a/storage/spider/spd_direct_sql.cc
+++ b/storage/spider/spd_direct_sql.cc
@@ -896,7 +896,7 @@ error:
#define SPIDER_PARAM_STR(title_name, param_name) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (!direct_sql->param_name) \
{ \
if ((direct_sql->param_name = spider_get_string_between_quote( \
@@ -909,14 +909,14 @@ error:
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%s", direct_sql->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%s", direct_sql->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_HINT_WITH_MAX(title_name, param_name, check_length, max_size, min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, check_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
DBUG_PRINT("info",("spider max_size=%d", max_size)); \
int hint_num = atoi(tmp_ptr + check_length) - 1; \
DBUG_PRINT("info",("spider hint_num=%d", hint_num)); \
@@ -946,7 +946,7 @@ error:
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"[%d]=%d", hint_num, \
+ DBUG_PRINT("info",("spider " title_name "[%d]=%d", hint_num, \
direct_sql->param_name[hint_num])); \
} else { \
error_num = ER_SPIDER_INVALID_CONNECT_INFO_NUM; \
@@ -959,7 +959,7 @@ error:
#define SPIDER_PARAM_INT_WITH_MAX(title_name, param_name, min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (direct_sql->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -976,7 +976,7 @@ error:
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%d", \
+ DBUG_PRINT("info",("spider " title_name "=%d", \
(int) direct_sql->param_name)); \
} \
break; \
@@ -984,7 +984,7 @@ error:
#define SPIDER_PARAM_INT(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (direct_sql->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -999,14 +999,14 @@ error:
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%d", direct_sql->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%d", direct_sql->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_LONGLONG(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (direct_sql->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1022,7 +1022,7 @@ error:
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%lld", \
+ DBUG_PRINT("info",("spider " title_name "=%lld", \
direct_sql->param_name)); \
} \
break; \
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 64579bcee6c..d981dc6002b 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -1499,7 +1499,7 @@ static int spider_set_ll_value(
#define SPIDER_PARAM_STR(title_name, param_name) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (!share->param_name) \
{ \
if ((share->param_name = spider_get_string_between_quote( \
@@ -1511,7 +1511,7 @@ static int spider_set_ll_value(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%s", share->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%s", share->param_name)); \
} \
break; \
}
@@ -1520,7 +1520,7 @@ static int spider_set_ll_value(
#define SPIDER_PARAM_STR_LIST(title_name, param_name) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (!share->param_name) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1546,7 +1546,7 @@ static int spider_set_ll_value(
#define SPIDER_PARAM_HINT(title_name, param_name, check_length, max_size, append_method) \
if (!strncasecmp(tmp_ptr, title_name, check_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
DBUG_PRINT("info",("spider max_size=%d", max_size)); \
int hint_num = atoi(tmp_ptr + check_length); \
DBUG_PRINT("info",("spider hint_num=%d", hint_num)); \
@@ -1565,7 +1565,7 @@ static int spider_set_ll_value(
if ((error_num = \
append_method(&share->param_name[hint_num], hint_str))) \
goto error; \
- DBUG_PRINT("info",("spider "title_name"[%d]=%s", hint_num, \
+ DBUG_PRINT("info",("spider " title_name "[%d]=%s", hint_num, \
share->param_name[hint_num].ptr())); \
} else { \
error_num = ER_SPIDER_INVALID_CONNECT_INFO_NUM; \
@@ -1578,7 +1578,7 @@ static int spider_set_ll_value(
#define SPIDER_PARAM_NUMHINT(title_name, param_name, check_length, max_size, append_method) \
if (!strncasecmp(tmp_ptr, title_name, check_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
DBUG_PRINT("info",("spider max_size=%d", max_size)); \
int hint_num = atoi(tmp_ptr + check_length); \
DBUG_PRINT("info",("spider hint_num=%d", hint_num)); \
@@ -1597,7 +1597,7 @@ static int spider_set_ll_value(
if ((error_num = \
append_method(&share->param_name[hint_num], hint_str))) \
goto error; \
- DBUG_PRINT("info",("spider "title_name"[%d]=%lld", hint_num, \
+ DBUG_PRINT("info",("spider " title_name "[%d]=%lld", hint_num, \
share->param_name[hint_num])); \
} else { \
error_num = ER_SPIDER_INVALID_CONNECT_INFO_NUM; \
@@ -1612,7 +1612,7 @@ static int spider_set_ll_value(
min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (!share->param_name) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1639,7 +1639,7 @@ static int spider_set_ll_value(
min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (!share->param_name) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1664,7 +1664,7 @@ static int spider_set_ll_value(
#define SPIDER_PARAM_INT_WITH_MAX(title_name, param_name, min_val, max_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (share->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1681,14 +1681,14 @@ static int spider_set_ll_value(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%d", share->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%d", share->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_INT(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (share->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1703,14 +1703,14 @@ static int spider_set_ll_value(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%d", share->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%d", share->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_DOUBLE(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (share->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1725,14 +1725,14 @@ static int spider_set_ll_value(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%f", share->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%f", share->param_name)); \
} \
break; \
}
#define SPIDER_PARAM_LONGLONG(title_name, param_name, min_val) \
if (!strncasecmp(tmp_ptr, title_name, title_length)) \
{ \
- DBUG_PRINT("info",("spider "title_name" start")); \
+ DBUG_PRINT("info",("spider " title_name " start")); \
if (share->param_name == -1) \
{ \
if ((tmp_ptr2 = spider_get_string_between_quote( \
@@ -1747,7 +1747,7 @@ static int spider_set_ll_value(
MYF(0), tmp_ptr); \
goto error; \
} \
- DBUG_PRINT("info",("spider "title_name"=%lld", share->param_name)); \
+ DBUG_PRINT("info",("spider " title_name "=%lld", share->param_name)); \
} \
break; \
}
diff --git a/storage/tokudb/PerconaFT/buildheader/CMakeLists.txt b/storage/tokudb/PerconaFT/buildheader/CMakeLists.txt
index 5da3c98ff48..6d5cbb94358 100644
--- a/storage/tokudb/PerconaFT/buildheader/CMakeLists.txt
+++ b/storage/tokudb/PerconaFT/buildheader/CMakeLists.txt
@@ -1,6 +1,6 @@
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/sh
out=$1; shift
exec \"$@\" >$out")
@@ -8,7 +8,7 @@ add_executable(make_tdb make_tdb.cc)
set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h"
- COMMAND bash runcat.sh "${CMAKE_CURRENT_BINARY_DIR}/db.h" $<TARGET_FILE:make_tdb>
+ COMMAND sh runcat.sh "${CMAKE_CURRENT_BINARY_DIR}/db.h" $<TARGET_FILE:make_tdb>
DEPENDS make_tdb)
add_custom_target(install_tdb_h DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/db.h")
diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result
index 640c7badc71..6269b8f2d71 100644
--- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result
+++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result
@@ -182,14 +182,14 @@ a b c d e f
3 30 200 2000 20000 200000
explain select * from t1 where b > "0";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 <type> b b NULL NULL NULL; Using where; Using index
select * from t1 where b > "0";
a b c d e f
2 20 100 1000 10000 100000
3 30 200 2000 20000 200000
explain select * from t1 where d > "0";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index
+1 SIMPLE t1 <type> d d NULL NULL NULL; Using where; Using index
select * from t1 where d > "0";
a b c d e f
2 20 100 1000 10000 100000
diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar_hidden.test b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar_hidden.test
index d1be871c7d2..e9bb18a586e 100644
--- a/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar_hidden.test
+++ b/storage/tokudb/mysql-test/tokudb/t/cluster_filter_unpack_varchar_hidden.test
@@ -82,11 +82,11 @@ alter table t1 add key d(d,a) clustering=yes, add key b(b) clustering=yes;
explain select * from t1;
select * from t1;
---replace_column 7 NULL 9 NULL;
+--replace_column 4 <type> 7 NULL 9 NULL;
explain select * from t1 where b > "0";
select * from t1 where b > "0";
---replace_column 7 NULL 9 NULL;
+--replace_column 4 <type> 7 NULL 9 NULL;
explain select * from t1 where d > "0";
select * from t1 where d > "0";
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 03020896542..ceffa950739 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (C) 2014, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (C) 2014, 2016, MariaDB Corporation. 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
@@ -662,7 +662,7 @@ fil_space_encrypt(
return src_frame;
}
- ut_ad(crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+ ut_a(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
byte* tmp = fil_encrypt_buf(crypt_data, space, offset, lsn, src_frame, zip_size, dst_frame);
@@ -712,21 +712,37 @@ fil_space_decrypt(
ulint page_type = mach_read_from_2(src_frame+FIL_PAGE_TYPE);
uint key_version = mach_read_from_4(src_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
bool page_compressed = (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
-
+ ulint offset = mach_read_from_4(src_frame + FIL_PAGE_OFFSET);
+ ulint space = mach_read_from_4(src_frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
+ ib_uint64_t lsn = mach_read_from_8(src_frame + FIL_PAGE_LSN);
*err = DB_SUCCESS;
if (key_version == ENCRYPTION_KEY_NOT_ENCRYPTED) {
return false;
}
- ut_ad(crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+ if (crypt_data == NULL) {
+ if (!(space == 0 && offset == 0) && key_version != 0) {
+ /* FIL_PAGE_FILE_FLUSH_LSN field i.e.
+ FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+ should be only defined for the
+ first page in a system tablespace
+ data file (ibdata*, not *.ibd), if not
+ clear it. */
+#ifdef UNIV_DEBUG
+ ib_logf(IB_LOG_LEVEL_WARN,
+ "Page on space %lu offset %lu has key_version %u"
+ " when it shoud be undefined.",
+ space, offset, key_version);
+#endif
+ mach_write_to_4(src_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0);
+ }
+ return false;
+ }
- /* read space & offset & lsn */
- ulint space = mach_read_from_4(
- src_frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
- ulint offset = mach_read_from_4(
- src_frame + FIL_PAGE_OFFSET);
- ib_uint64_t lsn = mach_read_from_8(src_frame + FIL_PAGE_LSN);
+ ut_a(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+
+ /* read space & lsn */
ulint header_len = FIL_PAGE_DATA;
if (page_compressed) {
@@ -2506,6 +2522,7 @@ fil_space_crypt_get_status(
mutex_enter(&crypt_data->mutex);
status->keyserver_requests = crypt_data->keyserver_requests;
status->min_key_version = crypt_data->min_key_version;
+ status->key_id = crypt_data->key_id;
if (crypt_data->rotate_state.active_threads > 0 ||
crypt_data->rotate_state.flushing) {
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 5f0c52b5cc8..b60a0e9ddaf 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -3240,9 +3240,12 @@ fil_create_link_file(
link_filepath = fil_make_isl_name(tablename);
+ /* Note that OS_FILE_READ_WRITE_CACHED used here to avoid
+ unnecessary errors on O_DIRECT, link files are not really
+ a data files. */
file = os_file_create_simple_no_error_handling(
innodb_file_data_key, link_filepath,
- OS_FILE_CREATE, OS_FILE_READ_WRITE, &success, 0);
+ OS_FILE_CREATE, OS_FILE_READ_WRITE_CACHED, &success, 0);
if (!success) {
/* The following call will print an error message */
diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc
index 7a381f4ca05..712dfa264d4 100644
--- a/storage/xtradb/fts/fts0fts.cc
+++ b/storage/xtradb/fts/fts0fts.cc
@@ -6274,7 +6274,7 @@ fts_fake_hex_to_dec(
#ifdef _WIN32
ret = sscanf(tmp_id, "%016llu", &dec_id);
#else
- ret = sscanf(tmp_id, "%016"PRIu64, &dec_id);
+ ret = sscanf(tmp_id, "%016" PRIu64, &dec_id);
#endif /* _WIN32 */
ut_ad(ret == 1);
diff --git a/storage/xtradb/fts/fts0opt.cc b/storage/xtradb/fts/fts0opt.cc
index e096b8bf6d6..0703b050848 100644
--- a/storage/xtradb/fts/fts0opt.cc
+++ b/storage/xtradb/fts/fts0opt.cc
@@ -598,7 +598,7 @@ fts_zip_read_word(
/* Finished decompressing block. */
if (zip->zp->avail_in == 0) {
- /* Free the block thats been decompressed. */
+ /* Free the block that's been decompressed. */
if (zip->pos > 0) {
ulint prev = zip->pos - 1;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 29b02ee5e55..b6d259c8bda 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -1,11 +1,10 @@
/*****************************************************************************
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
-Copyright (c) 2013, 2015, MariaDB Corporation.
+Copyright (c) 2013, 2016, MariaDB Corporation.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc.
-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
@@ -8317,8 +8316,8 @@ ha_innobase::write_row(
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -8670,8 +8669,8 @@ func_exit:
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -9090,8 +9089,8 @@ ha_innobase::update_row(
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -9211,8 +9210,8 @@ wsrep_error:
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -12739,8 +12738,8 @@ ha_innobase::truncate()
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -12760,8 +12759,8 @@ ha_innobase::truncate()
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -14156,8 +14155,8 @@ ha_innobase::analyze(
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -14172,8 +14171,8 @@ ha_innobase::analyze(
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -15387,8 +15386,8 @@ ha_innobase::transactional_table_lock(
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, (int) prebuilt->table->is_corrupt);
+ "InnoDB: Warning: share->ib_table %p prebuilt->table %p table %s is_corrupt %lu.",
+ share->ib_table, prebuilt->table, prebuilt->table->name, prebuilt->table->is_corrupt);
}
if (UNIV_UNLIKELY(share->ib_table && share->ib_table->is_corrupt)) {
@@ -21124,7 +21123,7 @@ maria_declare_plugin(xtradb)
innodb_status_variables_export,/* status variables */
innobase_system_variables, /* system variables */
INNODB_VERSION_STR, /* string version */
- MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
},
i_s_xtradb_read_view,
i_s_xtradb_internal_hash_tables,
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index e124cb98f99..a131a50458a 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyrigth (c) 2014, 2015, MariaDB Corporation
+Copyrigth (c) 2014, 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
@@ -792,7 +792,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_trx =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
@@ -1050,7 +1050,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_locks =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
@@ -1231,7 +1231,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/*******************************************************************//**
@@ -1565,7 +1565,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset =
@@ -1613,7 +1613,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/* Fields of the dynamic tables
@@ -1912,7 +1912,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_per_index =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_per_index_reset =
@@ -1961,7 +1961,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_per_index_reset =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
@@ -2203,7 +2203,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset =
@@ -2251,7 +2251,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_metrics */
@@ -2774,7 +2774,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_metrics =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_ft_default_stopword */
static ST_FIELD_INFO i_s_stopword_fields_info[] =
@@ -2886,7 +2886,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_ft_default_stopword =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_DELETED
@@ -3053,7 +3053,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_ft_deleted =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/*******************************************************************//**
@@ -3135,7 +3135,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_ft_being_deleted =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHED and
@@ -3423,7 +3423,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_ft_index_cache =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/*******************************************************************//**
@@ -3857,7 +3857,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_ft_index_table =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_FT_CONFIG */
@@ -4054,7 +4054,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_ft_config =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/* Fields of the dynamic table INNODB_BUFFER_POOL_STATS. */
@@ -4601,7 +4601,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_stats =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/* Fields of the dynamic table INNODB_BUFFER_POOL_PAGE. */
@@ -5310,7 +5310,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
@@ -5855,7 +5855,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_page_lru =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/*******************************************************************//**
@@ -6147,7 +6147,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tables =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_TABLESTATS ***********************************************/
@@ -6435,7 +6435,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablestats =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_INDEXES **************************************************/
@@ -6685,7 +6685,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_indexes =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_COLUMNS **************************************************/
@@ -6920,7 +6920,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_columns =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_FIELDS ***************************************************/
@@ -7128,7 +7128,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_fields =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_FOREIGN ********************************************/
@@ -7351,7 +7351,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_FOREIGN_COLS ********************************************/
@@ -7566,7 +7566,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_foreign_cols =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** SYS_TABLESPACES ********************************************/
@@ -7833,7 +7833,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tablespaces =
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_DATAFILES ************************************************/
@@ -8020,7 +8020,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_datafiles =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
static ST_FIELD_INFO i_s_innodb_changed_pages_info[] =
@@ -8389,7 +8389,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_changed_pages =
STRUCT_FLD(version, 0x0100 /* 1.0 */),
STRUCT_FLD(status_vars, NULL),
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** TABLESPACES_ENCRYPTION ********************************************/
@@ -8468,6 +8468,15 @@ static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] =
STRUCT_FLD(old_name, ""),
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+#define TABLESPACES_ENCRYPTION_CURRENT_KEY_ID 8
+ {STRUCT_FLD(field_name, "CURRENT_KEY_ID"),
+ STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
+ STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
+ STRUCT_FLD(value, 0),
+ STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
+ STRUCT_FLD(old_name, ""),
+ STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
+
END_OF_ST_FIELD_INFO
};
@@ -8506,6 +8515,8 @@ i_s_dict_fill_tablespaces_encryption(
status.min_key_version));
OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_VERSION]->store(
status.current_key_version));
+ OK(fields[TABLESPACES_ENCRYPTION_CURRENT_KEY_ID]->store(
+ status.key_id));
if (status.rotating) {
fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->set_notnull();
OK(fields[TABLESPACES_ENCRYPTION_KEY_ROTATION_PAGE_NUMBER]->store(
@@ -8670,7 +8681,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_encryption =
/* struct st_mysql_sys_var** */
STRUCT_FLD(system_vars, NULL),
- INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_BETA
+ INNODB_VERSION_STR, MariaDB_PLUGIN_MATURITY_GAMMA
};
/** TABLESPACES_SCRUBBING ********************************************/
@@ -8969,7 +8980,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_tablespaces_scrubbing =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA)
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA)
};
/** INNODB_MUTEXES *********************************************/
@@ -9183,7 +9194,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_mutexes =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
/** SYS_SEMAPHORE_WAITS ************************************************/
@@ -9460,7 +9471,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_semaphore_waits =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
static ST_FIELD_INFO innodb_changed_page_bitmaps_fields_info[] =
@@ -9584,6 +9595,6 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_changed_page_bitmaps =
/* Maria extension */
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
diff --git a/storage/xtradb/handler/xtradb_i_s.cc b/storage/xtradb/handler/xtradb_i_s.cc
index 207682e3154..a0ff959013a 100644
--- a/storage/xtradb/handler/xtradb_i_s.cc
+++ b/storage/xtradb/handler/xtradb_i_s.cc
@@ -176,7 +176,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_xtradb_read_view =
STRUCT_FLD(status_vars, NULL),
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
static ST_FIELD_INFO xtradb_internal_hash_tables_fields_info[] =
@@ -381,7 +381,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_xtradb_internal_hash_tables =
STRUCT_FLD(status_vars, NULL),
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
@@ -514,5 +514,5 @@ UNIV_INTERN struct st_mysql_plugin i_s_xtradb_rseg =
STRUCT_FLD(status_vars, NULL),
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(version_info, INNODB_VERSION_STR),
- STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_BETA),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_GAMMA),
};
diff --git a/storage/xtradb/include/fil0crypt.h b/storage/xtradb/include/fil0crypt.h
index 32462661cd6..5deed1f001c 100644
--- a/storage/xtradb/include/fil0crypt.h
+++ b/storage/xtradb/include/fil0crypt.h
@@ -333,6 +333,7 @@ struct fil_space_crypt_status_t {
uint min_key_version; /*!< min key version */
uint current_key_version;/*!< current key version */
uint keyserver_requests;/*!< no of key requests to key server */
+ ulint key_id; /*!< current key_id */
bool rotating; /*!< is key rotation ongoing */
bool flushing; /*!< is flush at end of rotation ongoing */
ulint rotate_next_page_number; /*!< next page if key rotating */
diff --git a/storage/xtradb/include/fts0priv.ic b/storage/xtradb/include/fts0priv.ic
index 2d07c60f980..ec61691870b 100644
--- a/storage/xtradb/include/fts0priv.ic
+++ b/storage/xtradb/include/fts0priv.ic
@@ -53,7 +53,7 @@ fts_write_object_id(
/* Use this to construct old(5.6.14 and 5.7.3) windows
ambiguous aux table names */
DBUG_EXECUTE_IF("innodb_test_wrong_windows_fts_aux_table_name",
- return(sprintf(str, "%016"PRIu64, id)););
+ return(sprintf(str, "%016" PRIu64, id)););
DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
return(sprintf(str, UINT64PFx, id)););
@@ -66,7 +66,7 @@ fts_write_object_id(
// FIXME: Use ut_snprintf(), so does following one.
return(sprintf(str, "%016llu", id));
#else /* _WIN32 */
- return(sprintf(str, "%016"PRIu64, id));
+ return(sprintf(str, "%016" PRIu64, id));
#endif /* _WIN32 */
}
diff --git a/storage/xtradb/include/log0recv.h b/storage/xtradb/include/log0recv.h
index b23a140aac2..8fc5daaef1d 100644
--- a/storage/xtradb/include/log0recv.h
+++ b/storage/xtradb/include/log0recv.h
@@ -43,7 +43,8 @@ UNIV_INTERN
ibool
log_block_checksum_is_ok_or_old_format(
/*===================================*/
- const byte* block); /*!< in: pointer to a log block */
+ const byte* block, /*!< in: pointer to a log block */
+ bool print_err); /*!< in print error ? */
/*******************************************************//**
Calculates the new value for lsn when more data is added to the log. */
diff --git a/storage/xtradb/log/log0crypt.cc b/storage/xtradb/log/log0crypt.cc
index e90533c2e76..852148899e9 100644
--- a/storage/xtradb/log/log0crypt.cc
+++ b/storage/xtradb/log/log0crypt.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (C) 2014, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (C) 2014, 2016, MariaDB Corporation. 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
@@ -36,6 +36,8 @@ Modified Jan Lindström jan.lindstrom@mariadb.com
#include "my_crypt.h"
+/* Used for debugging */
+// #define DEBUG_CRYPT 1
#define UNENCRYPTED_KEY_VER 0
/* If true, enable redo log encryption. */
@@ -97,16 +99,24 @@ get_crypt_info(
{
/* so that no one is modifying array while we search */
ut_ad(mutex_own(&(log_sys->mutex)));
+ size_t items = crypt_info.size();
/* a log block only stores 4-bytes of checkpoint no */
checkpoint_no &= 0xFFFFFFFF;
- for (size_t i = 0; i < crypt_info.size(); i++) {
+ for (size_t i = 0; i < items; i++) {
struct crypt_info_t* it = &crypt_info[i];
if (it->checkpoint_no == checkpoint_no) {
return it;
}
}
+
+ /* If checkpoint contains more than one key and we did not
+ find the correct one use the first one. */
+ if (items) {
+ return (&crypt_info[0]);
+ }
+
return NULL;
}
@@ -131,7 +141,8 @@ log_blocks_crypt(
const byte* block, /*!< in: blocks before encrypt/decrypt*/
ulint size, /*!< in: size of block */
byte* dst_block, /*!< out: blocks after encrypt/decrypt */
- int what) /*!< in: encrypt or decrypt*/
+ int what, /*!< in: encrypt or decrypt*/
+ const crypt_info_t* crypt_info) /*!< in: crypt info or NULL */
{
byte *log_block = (byte*)block;
Crypt_result rc = MY_AES_OK;
@@ -146,7 +157,8 @@ log_blocks_crypt(
lsn_t log_block_start_lsn = log_block_get_start_lsn(
lsn, log_block_no);
- const crypt_info_t* info = get_crypt_info(log_block);
+ const crypt_info_t* info = crypt_info == NULL ? get_crypt_info(log_block) :
+ crypt_info;
#ifdef DEBUG_CRYPT
fprintf(stderr,
"%s %lu chkpt: %lu key: %u lsn: %lu\n",
@@ -156,12 +168,21 @@ log_blocks_crypt(
info ? info->key_version : 0,
log_block_start_lsn);
#endif
+ /* If no key is found from checkpoint assume the log_block
+ to be unencrypted. If checkpoint contains the encryption key
+ compare log_block current checksum, if checksum matches,
+ block can't be encrypted. */
if (info == NULL ||
- info->key_version == UNENCRYPTED_KEY_VER) {
+ info->key_version == UNENCRYPTED_KEY_VER ||
+ (log_block_checksum_is_ok_or_old_format(log_block, false) &&
+ what == ENCRYPTION_FLAG_DECRYPT)) {
memcpy(dst_block, log_block, OS_FILE_LOG_BLOCK_SIZE);
goto next;
}
+ ut_ad(what == ENCRYPTION_FLAG_DECRYPT ? !log_block_checksum_is_ok_or_old_format(log_block, false) :
+ log_block_checksum_is_ok_or_old_format(log_block, false));
+
// Assume log block header is not encrypted
memcpy(dst_block, log_block, LOG_BLOCK_HDR_SIZE);
@@ -292,7 +313,7 @@ log_blocks_encrypt(
const ulint size, /*!< in: size of blocks, must be multiple of a log block */
byte* dst_block) /*!< out: blocks after encryption */
{
- return log_blocks_crypt(block, size, dst_block, ENCRYPTION_FLAG_ENCRYPT);
+ return log_blocks_crypt(block, size, dst_block, ENCRYPTION_FLAG_ENCRYPT, NULL);
}
/*********************************************************************//**
@@ -355,14 +376,16 @@ log_encrypt_before_write(
return;
}
- if (info->key_version == UNENCRYPTED_KEY_VER) {
+ /* If the key is not encrypted or user has requested not to
+ encrypt, do not change log block. */
+ if (info->key_version == UNENCRYPTED_KEY_VER || !srv_encrypt_log) {
return;
}
byte* dst_frame = (byte*)malloc(size);
//encrypt log blocks content
- Crypt_result result = log_blocks_crypt(block, size, dst_frame, ENCRYPTION_FLAG_ENCRYPT);
+ Crypt_result result = log_blocks_crypt(block, size, dst_frame, ENCRYPTION_FLAG_ENCRYPT, NULL);
if (result == MY_AES_OK) {
ut_ad(block[0] == dst_frame[0]);
@@ -388,7 +411,7 @@ log_decrypt_after_read(
byte* dst_frame = (byte*)malloc(size);
// decrypt log blocks content
- Crypt_result result = log_blocks_crypt(frame, size, dst_frame, ENCRYPTION_FLAG_DECRYPT);
+ Crypt_result result = log_blocks_crypt(frame, size, dst_frame, ENCRYPTION_FLAG_DECRYPT, NULL);
if (result == MY_AES_OK) {
memcpy(frame, dst_frame, size);
diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc
index 853afe70100..36531f3c6f4 100644
--- a/storage/xtradb/log/log0log.cc
+++ b/storage/xtradb/log/log0log.cc
@@ -2,6 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
+Copyright (C) 2014, 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
@@ -33,10 +34,13 @@ Created 12/9/1995 Heikki Tuuri
#include "config.h"
#ifdef HAVE_ALLOCA_H
#include "alloca.h"
-#elif defined(HAVE_MALLOC_H)
+#elif defined(HAVE_MALLOC_H)
#include "malloc.h"
#endif
+/* Used for debugging */
+// #define DEBUG_CRYPT 1
+
#include "log0log.h"
#ifdef UNIV_NONINL
@@ -1394,7 +1398,6 @@ log_group_file_header_flush(
Stores a 4-byte checksum to the trailer checksum field of a log block
before writing it to a log file. This checksum is used in recovery to
check the consistency of a log block. */
-static
void
log_block_store_checksum(
/*=====================*/
@@ -1512,6 +1515,14 @@ loop:
log_encrypt_before_write(log_sys->next_checkpoint_no,
buf, write_len);
+#ifdef DEBUG_CRYPT
+ fprintf(stderr, "WRITE: block: %lu checkpoint: %lu %.8lx %.8lx\n",
+ log_block_get_hdr_no(buf),
+ log_block_get_checkpoint_no(buf),
+ log_block_calc_checksum(buf),
+ log_block_get_checksum(buf));
+#endif
+
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->space_id, 0,
(ulint) (next_offset / UNIV_PAGE_SIZE),
(ulint) (next_offset % UNIV_PAGE_SIZE), write_len, buf,
@@ -2320,7 +2331,10 @@ log_checkpoint(
* the checkpoint info has been written and THEN blocks will be encrypted
* with new key
*/
- log_crypt_set_ver_and_key(log_sys->next_checkpoint_no + 1);
+ if (srv_encrypt_log) {
+ log_crypt_set_ver_and_key(log_sys->next_checkpoint_no + 1);
+ }
+
log_groups_write_checkpoint_info();
MONITOR_INC(MONITOR_NUM_CHECKPOINT);
@@ -2585,8 +2599,24 @@ loop:
mutex_enter(&log_sys->mutex);
}
+#ifdef DEBUG_CRYPT
+ fprintf(stderr, "BEFORE DECRYPT: block: %lu checkpoint: %lu %.8lx %.8lx offset %lu\n",
+ log_block_get_hdr_no(buf),
+ log_block_get_checkpoint_no(buf),
+ log_block_calc_checksum(buf),
+ log_block_get_checksum(buf), source_offset);
+#endif
+
log_decrypt_after_read(buf, len);
+#ifdef DEBUG_CRYPT
+ fprintf(stderr, "AFTER DECRYPT: block: %lu checkpoint: %lu %.8lx %.8lx\n",
+ log_block_get_hdr_no(buf),
+ log_block_get_checkpoint_no(buf),
+ log_block_calc_checksum(buf),
+ log_block_get_checksum(buf));
+#endif
+
if (release_mutex) {
mutex_exit(&log_sys->mutex);
}
diff --git a/storage/xtradb/log/log0online.cc b/storage/xtradb/log/log0online.cc
index 92f03f0e6a9..51a9fa8f6c5 100644
--- a/storage/xtradb/log/log0online.cc
+++ b/storage/xtradb/log/log0online.cc
@@ -905,7 +905,7 @@ log_online_is_valid_log_seg(
const byte* log_block) /*!< in: read log data */
{
ibool checksum_is_ok
- = log_block_checksum_is_ok_or_old_format(log_block);
+ = log_block_checksum_is_ok_or_old_format(log_block, true);
if (!checksum_is_ok) {
diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc
index c9bf5cf3f9e..f98adbbca08 100644
--- a/storage/xtradb/log/log0recv.cc
+++ b/storage/xtradb/log/log0recv.cc
@@ -2,7 +2,7 @@
Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. 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
@@ -43,7 +43,7 @@ Created 9/20/1997 Heikki Tuuri
#include "config.h"
#ifdef HAVE_ALLOCA_H
#include "alloca.h"
-#elif defined(HAVE_MALLOC_H)
+#elif defined(HAVE_MALLOC_H)
#include "malloc.h"
#endif
@@ -932,7 +932,8 @@ UNIV_INTERN
ibool
log_block_checksum_is_ok_or_old_format(
/*===================================*/
- const byte* block) /*!< in: pointer to a log block */
+ const byte* block, /*!< in: pointer to a log block */
+ bool print_err) /*!< in print if error found */
{
#ifdef UNIV_LOG_DEBUG
return(TRUE);
@@ -1015,11 +1016,13 @@ log_block_checksum_is_ok_or_old_format(
return(TRUE);
}
- fprintf(stderr, "BROKEN: block: %lu checkpoint: %lu %.8lx %.8lx\n",
- log_block_get_hdr_no(block),
- log_block_get_checkpoint_no(block),
- log_block_calc_checksum(block),
- log_block_get_checksum(block));
+ if (print_err) {
+ fprintf(stderr, "BROKEN: block: %lu checkpoint: %lu %.8lx %.8lx\n",
+ log_block_get_hdr_no(block),
+ log_block_get_checkpoint_no(block),
+ log_block_calc_checksum(block),
+ log_block_get_checksum(block));
+ }
return(FALSE);
}
@@ -2734,6 +2737,7 @@ recv_scan_log_recs(
ibool finished;
ulint data_len;
ibool more_data;
+ bool maybe_encrypted=false;
ut_ad(start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
@@ -2748,6 +2752,8 @@ recv_scan_log_recs(
*err = DB_SUCCESS;
do {
+ log_crypt_err_t log_crypt_err;
+
no = log_block_get_hdr_no(log_block);
/*
fprintf(stderr, "Log block header no %lu\n", no);
@@ -2755,13 +2761,13 @@ recv_scan_log_recs(
fprintf(stderr, "Scanned lsn no %lu\n",
log_block_convert_lsn_to_no(scanned_lsn));
*/
+
if (no != log_block_convert_lsn_to_no(scanned_lsn)
- || !log_block_checksum_is_ok_or_old_format(log_block)) {
- log_crypt_err_t log_crypt_err;
+ || !log_block_checksum_is_ok_or_old_format(log_block, true)) {
if (no == log_block_convert_lsn_to_no(scanned_lsn)
&& !log_block_checksum_is_ok_or_old_format(
- log_block)) {
+ log_block, true)) {
fprintf(stderr,
"InnoDB: Log block no %lu at"
" lsn " LSN_PF " has\n"
@@ -2775,12 +2781,14 @@ recv_scan_log_recs(
log_block));
}
+ maybe_encrypted = log_crypt_block_maybe_encrypted(log_block,
+ &log_crypt_err);
+
/* Garbage or an incompletely written log block */
finished = TRUE;
- if (log_crypt_block_maybe_encrypted(log_block,
- &log_crypt_err)) {
+ if (maybe_encrypted) {
/* Log block maybe encrypted finish processing*/
log_crypt_print_error(log_crypt_err);
*err = DB_ERROR;
@@ -2790,12 +2798,13 @@ recv_scan_log_recs(
/* Stop if we encounter a garbage log block */
if (!srv_force_recovery) {
fputs("InnoDB: Set innodb_force_recovery"
- " to ignore this error.\n", stderr);
+ " to ignore this error.\n", stderr);
*err = DB_ERROR;
return (TRUE);
}
break;
+
}
if (log_block_get_flush_bit(log_block)) {
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index 7f13c1656ee..b2b3e256211 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
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 Percona Inc.. Those modifications are
@@ -1422,7 +1422,8 @@ os_file_create_simple_func(
access = GENERIC_READ;
- } else if (access_type == OS_FILE_READ_WRITE) {
+ } else if (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED) {
access = GENERIC_READ | GENERIC_WRITE;
} else {
ib_logf(IB_LOG_LEVEL_ERROR,
@@ -1526,7 +1527,8 @@ os_file_create_simple_func(
#ifdef USE_FILE_LOCK
if (!srv_read_only_mode
&& *success
- && access_type == OS_FILE_READ_WRITE
+ && (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED)
&& os_file_lock(file, name)) {
*success = FALSE;
@@ -1554,15 +1556,16 @@ os_file_set_nocache_if_needed(os_file_t file, const char* name,
const char *mode_str, ulint type,
ulint access_type)
{
- if (srv_read_only_mode || access_type == OS_FILE_READ_WRITE_CACHED)
+ if (srv_read_only_mode || access_type == OS_FILE_READ_WRITE_CACHED) {
return;
+ }
if (srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT
- || (type != OS_LOG_FILE
+ || (type == OS_LOG_FILE
&& (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
- || (srv_unix_file_flush_method
- == SRV_UNIX_O_DIRECT_NO_FSYNC))))
+ || (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)))) {
os_file_set_nocache(file, name, mode_str);
+ }
}
/****************************************************************//**
@@ -2154,8 +2157,9 @@ os_file_create_func(
} while (retry);
- if (*success) {
+ /* We disable OS caching (O_DIRECT) only on data files */
+ if (*success) {
os_file_set_nocache_if_needed(file, name, mode_str, type, 0);
}
@@ -3144,7 +3148,7 @@ try_again:
"Error in system call pread(). The operating"
" system error number is %lu.",(ulint) errno);
} else {
- /* Partial read occured */
+ /* Partial read occurred */
ib_logf(IB_LOG_LEVEL_ERROR,
"Tried to read " ULINTPF " bytes at offset "
UINT64PF ". Was only able to read %ld.",
@@ -3248,7 +3252,7 @@ try_again:
"Error in system call pread(). The operating"
" system error number is %lu.",(ulint) errno);
} else {
- /* Partial read occured */
+ /* Partial read occurred */
ib_logf(IB_LOG_LEVEL_ERROR,
"Tried to read " ULINTPF " bytes at offset "
UINT64PF ". Was only able to read %ld.",
diff --git a/storage/xtradb/row/row0sel.cc b/storage/xtradb/row/row0sel.cc
index 35719391fae..2bebfb7a0f1 100644
--- a/storage/xtradb/row/row0sel.cc
+++ b/storage/xtradb/row/row0sel.cc
@@ -3751,12 +3751,6 @@ row_search_for_mysql(
ut_error;
}
- /* init null bytes with default values as they might be
- left uninitialized in some cases and these uninited bytes
- might be copied into mysql record buffer that leads to
- valgrind warnings */
- memcpy(buf, prebuilt->default_rec, prebuilt->null_bitmap_len);
-
#if 0
/* August 19, 2005 by Heikki: temporarily disable this error
print until the cursor lock count is done correctly.
diff --git a/storage/xtradb/ut/crc32_power8/crc32.S b/storage/xtradb/ut/crc32_power8/crc32.S
index 52046bb9002..b064ce3dc96 100644
--- a/storage/xtradb/ut/crc32_power8/crc32.S
+++ b/storage/xtradb/ut/crc32_power8/crc32.S
@@ -67,14 +67,13 @@
#define off96 r30
#define off112 r31
-#define const1 v25
-#define const2 v26
+#define const1 v24
+#define const2 v25
-#define byteswap v27
-#define mask_32bit v28
-#define mask_64bit v29
-#define zeroes v30
-#define ones v31
+#define byteswap v26
+#define mask_32bit v27
+#define mask_64bit v28
+#define zeroes v29
#ifdef BYTESWAP_DATA
#define VPERM(A, B, C, D) vperm A, B, C, D
@@ -101,13 +100,28 @@ FUNC_START(__crc32_vpmsum)
li off112,112
li r0,0
+ /* Enough room for saving 10 non volatile VMX registers */
+ subi r6,r1,56+10*16
+ subi r7,r1,56+2*16
+
+ stvx v20,0,r6
+ stvx v21,off16,r6
+ stvx v22,off32,r6
+ stvx v23,off48,r6
+ stvx v24,off64,r6
+ stvx v25,off80,r6
+ stvx v26,off96,r6
+ stvx v27,off112,r6
+ stvx v28,0,r7
+ stvx v29,off16,r7
+
mr r10,r3
vxor zeroes,zeroes,zeroes
- vspltisw ones,-1
+ vspltisw v0,-1
- vsldoi mask_32bit,zeroes,ones,4
- vsldoi mask_64bit,zeroes,ones,8
+ vsldoi mask_32bit,zeroes,v0,4
+ vsldoi mask_64bit,zeroes,v0,8
/* Get the initial value into v8 */
vxor v8,v8,v8
@@ -570,6 +584,21 @@ FUNC_START(__crc32_vpmsum)
vsldoi v0,v0,zeroes,4 /* shift result into top 64 bits of */
#endif
+.Lout:
+ subi r6,r1,56+10*16
+ subi r7,r1,56+2*16
+
+ lvx v20,0,r6
+ lvx v21,off16,r6
+ lvx v22,off32,r6
+ lvx v23,off48,r6
+ lvx v24,off64,r6
+ lvx v25,off80,r6
+ lvx v26,off96,r6
+ lvx v27,off112,r6
+ lvx v28,0,r7
+ lvx v29,off16,r7
+
/* Get it into r3 */
MFVRD(r3, v0)
@@ -739,6 +768,8 @@ FUNC_START(__crc32_vpmsum)
.Lzero:
mr r3,r10
blr
+ b .Lout
+
FUNC_END(__crc32_vpmsum)
#endif /* __powerpc__ */
diff --git a/strings/str2int.c b/strings/str2int.c
index ec89503af5e..fe6cd6b793e 100644
--- a/strings/str2int.c
+++ b/strings/str2int.c
@@ -45,7 +45,7 @@
easy task. Coping with integer overflow and the asymmetric range of
twos complement machines is anything but easy.
- So that users of atoi and atol can check whether an error occured,
+ So that users of atoi and atol can check whether an error occurred,
I have taken a wholly unprecedented step: errno is CLEARED if this
call has no problems.
*/
diff --git a/tests/async_queries.c b/tests/async_queries.c
index 75229eec4b4..76e884e6a69 100644
--- a/tests/async_queries.c
+++ b/tests/async_queries.c
@@ -265,7 +265,7 @@ again:
{
if (mysql_errno(&sd->mysql))
{
- /* An error occured. */
+ /* An error occurred. */
printf("%d | Error: %s\n", sd->index, mysql_error(&sd->mysql));
}
else
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 9f62666f97a..7cc59f6aca5 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -11781,10 +11781,10 @@ static void test_bug5315()
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
DIE_UNLESS(rc == 0);
if (!opt_silent)
- printf("Excuting mysql_change_user\n");
+ printf("Executing mysql_change_user\n");
mysql_change_user(mysql, opt_user, opt_password, current_db);
if (!opt_silent)
- printf("Excuting mysql_stmt_execute\n");
+ printf("Executing mysql_stmt_execute\n");
rc= mysql_stmt_execute(stmt);
DIE_UNLESS(rc != 0);
if (rc)
@@ -11794,10 +11794,10 @@ static void test_bug5315()
}
/* check that connection is OK */
if (!opt_silent)
- printf("Excuting mysql_stmt_close\n");
+ printf("Executing mysql_stmt_close\n");
mysql_stmt_close(stmt);
if (!opt_silent)
- printf("Excuting mysql_stmt_init\n");
+ printf("Executing mysql_stmt_init\n");
stmt= mysql_stmt_init(mysql);
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
DIE_UNLESS(rc == 0);
diff --git a/tests/nonblock-wrappers.h b/tests/nonblock-wrappers.h
index 3ed470b3400..d6f42511f3a 100644
--- a/tests/nonblock-wrappers.h
+++ b/tests/nonblock-wrappers.h
@@ -30,7 +30,7 @@
/*
Run the appropriate poll() syscall to wait for the event that libmysql
- requested. Return which event(s) occured.
+ requested. Return which event(s) occurred.
*/
static int
wait_for_mysql(MYSQL *mysql, int status)
diff --git a/win/packaging/CPackWixConfig.cmake b/win/packaging/CPackWixConfig.cmake
index af2cb1af802..6df49678d52 100644
--- a/win/packaging/CPackWixConfig.cmake
+++ b/win/packaging/CPackWixConfig.cmake
@@ -9,7 +9,7 @@ IF(ESSENTIALS)
ENDIF()
ELSE()
SET(CPACK_COMPONENTS_USED
- "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common;connect-engine;ClientPlugins;gssapi-server;gssapi-client")
+ "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common;connect-engine;ClientPlugins;gssapi-server;gssapi-client;aws-key-management")
ENDIF()
SET( WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents")
@@ -57,7 +57,7 @@ SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install server")
#Miscellaneous (hidden) components, part of server / or client programs
- FOREACH(comp connect-engine ClientPlugins gssapi-server gssapi-client)
+ FOREACH(comp connect-engine ClientPlugins gssapi-server gssapi-client aws-key-management)
STRING(TOUPPER "${comp}" comp)
SET(CPACK_COMPONENT_${comp}_GROUP "MySQLServer")
SET(CPACK_COMPONENT_${comp}_HIDDEN 1)