[Commits] 560799ebd8e: Merge branch '10.0-galera' into 10.1

Oleksandr Byelkin sanja at mariadb.com
Thu Jan 31 10:34:49 EET 2019


revision-id: 560799ebd8efe11f4c4ae1bb9ed4d39185e03800 (mariadb-10.1.37-81-g560799ebd8e)
parent(s): 6e2af7d084ca1bba79e60f05616aaefb6028ee9d c2caca02ac39454e18db8de563e7e7c8eaf8b1c7
author: Oleksandr Byelkin
committer: Oleksandr Byelkin
timestamp: 2019-01-31 09:34:34 +0100
message:

Merge branch '10.0-galera' into 10.1


 cmake/wsrep.cmake                                |    2 +-
 mysql-test/mysql-test-run.pl                     |   21 +-
 mysql-test/r/alter_table.test                    | 1908 ++++++++++++++++++
 mysql-test/r/grant.test                          | 2291 ++++++++++++++++++++++
 mysql-test/r/lowercase_fs_off.test               |  124 ++
 mysql-test/r/sp-security.test                    | 1069 ++++++++++
 mysql-test/r/type_float.test                     |  417 ++++
 mysql-test/suite/sys_vars/r/all_vars.result      |    1 +
 mysql-test/suite/sys_vars/r/sysvars_wsrep.result |   14 +
 sql/log_event.cc                                 |   21 +
 sql/sys_vars.cc                                  |   13 +
 sql/wsrep_mysqld.cc                              |    1 +
 sql/wsrep_mysqld.h                               |    1 +
 sql/wsrep_mysqld_c.h                             |   26 +
 storage/innobase/handler/ha_innodb.cc            |   64 +-
 storage/innobase/handler/ha_innodb.h             |    6 +-
 storage/innobase/row/row0ins.cc                  |   39 +-
 storage/xtradb/handler/ha_innodb.cc              |   62 +-
 storage/xtradb/handler/ha_innodb.h               |    6 +-
 storage/xtradb/row/row0ins.cc                    |   39 +-
 zlib/CMakeLists.txt                              |    3 +-
 21 files changed, 6053 insertions(+), 75 deletions(-)

diff --cc cmake/wsrep.cmake
index 9fa127380a4,0529f89b61c..b272df51adb
--- a/cmake/wsrep.cmake
+++ b/cmake/wsrep.cmake
@@@ -14,30 -14,51 +14,30 @@@
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
  
 -# We need to generate a proper spec file even without --with-wsrep flag,
 -# so WSREP_VERSION is produced regardless
 +#
 +# Galera library does not compile with windows
 +#
 +IF(UNIX)
 +  SET(with_wsrep_default ON)
 +ELSE()
 +  SET(with_wsrep_default OFF)
 +ENDIF()
 +
 +OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
  
  # Set the patch version
- SET(WSREP_PATCH_VERSION "23")
+ SET(WSREP_PATCH_VERSION "24")
  
 -# MariaDB addition: Revision number of the last revision merged from
 -# codership branch visible in @@visible_comment.
 -# Branch : https://github.com/codership/mysql-wsrep/tree/5.6
 -SET(WSREP_PATCH_REVNO "c3fc46e") # Should be updated on every merge.
 -
 -# MariaDB: Obtain patch revision number:
 -# Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.
 -IF (DEFINED ENV{WSREP_REV})
 -  SET(WSREP_PATCH_REVNO $ENV{WSREP_REV})
 -ENDIF()
 -
  # Obtain wsrep API version
 -EXECUTE_PROCESS(
 -  COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2"
 -  OUTPUT_VARIABLE WSREP_API_VERSION
 -  RESULT_VARIABLE RESULT
 -)
 -#FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n")
 -STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}")
 +FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
 +     LIMIT_COUNT 1 REGEX "WSREP_INTERFACE_VERSION")
 +STRING(REGEX MATCH "([0-9]+)" WSREP_API_VERSION "${WSREP_API_VERSION}")
  
 -IF(NOT WSREP_PATCH_REVNO)
 -  MESSAGE(WARNING "Could not determine bzr revision number, WSREP_VERSION will "
 -          "not contain the revision number.")
 -  SET(WSREP_VERSION
 -      "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}"
 -  )
 -ELSE()
 -  SET(WSREP_VERSION
 -      "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}"
 -  )
 -ENDIF()
 +SET(WSREP_VERSION "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}"
 +    CACHE INTERNAL "WSREP version")
  
 -OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON)
 -IF (WITH_WSREP)
 -  SET(WSREP_C_FLAGS   "-DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048")
 -  SET(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} ${WSREP_C_FLAGS}")
 -  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WSREP_C_FLAGS}")
 -  SET(COMPILATION_COMMENT "${COMPILATION_COMMENT}, wsrep_${WSREP_VERSION}")
 -  SET(WITH_EMBEDDED_SERVER OFF CACHE INTERNAL "" FORCE)
 -ENDIF()
 +SET(WSREP_PROC_INFO ${WITH_WSREP})
  
 -#
 +IF(WITH_WSREP)
 +  SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
 +ENDIF()
diff --cc mysql-test/mysql-test-run.pl
index 5fe616c67ae,0ea628f75e0..da72e7e1a9a
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@@ -137,10 -136,7 +137,8 @@@ my $opt_start
  my $opt_start_dirty;
  my $opt_start_exit;
  my $start_only;
 +my $file_wsrep_provider;
  
- our @global_suppressions;
- 
  END {
    if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
    {
@@@ -4407,8 -4815,8 +4401,7 @@@ sub extract_warning_lines ($$) 
    # Perl code.
    my @antipatterns =
      (
-      @global_suppressions,
       qr/error .*connecting to master/,
 -     qr/Plugin 'ndbcluster' will be forced to shutdown/,
       qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
       qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/,
       qr/InnoDB: Warning: Setting innodb_use_sys_malloc/,
diff --cc mysql-test/suite/sys_vars/r/sysvars_wsrep.result
index db932ae8223,00000000000..e54afd2d64a
mode 100644,000000..100644
--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
@@@ -1,619 -1,0 +1,633 @@@
 +select * from information_schema.system_variables
 +where variable_name like 'wsrep%'
 +  order by variable_name;
 +VARIABLE_NAME	WSREP_AUTO_INCREMENT_CONTROL
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	ON
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	ON
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To automatically control the assignment of autoincrement variables
 +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	WSREP_CAUSAL_READS
 +SESSION_VALUE	OFF
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	SESSION
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Setting this variable is equivalent to setting wsrep_sync_wait READ flag
 +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	WSREP_CERTIFICATION_RULES
++SESSION_VALUE	NULL
++GLOBAL_VALUE	strict
++GLOBAL_VALUE_ORIGIN	COMPILE-TIME
++DEFAULT_VALUE	strict
++VARIABLE_SCOPE	GLOBAL
++VARIABLE_TYPE	ENUM
++VARIABLE_COMMENT	Certification rules to use in the cluster. Possible values are: "strict": stricter rules that could result in more certification failures. "optimized": relaxed rules that allow more concurrency and cause less certification failures.
++NUMERIC_MIN_VALUE	NULL
++NUMERIC_MAX_VALUE	NULL
++NUMERIC_BLOCK_SIZE	NULL
++ENUM_VALUE_LIST	strict,optimized
++READ_ONLY	NO
++COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_CERTIFY_NONPK
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	ON
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	ON
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Certify tables with no primary key
 +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	WSREP_CLUSTER_ADDRESS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Address to initially connect to cluster
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_CLUSTER_NAME
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	my_wsrep_cluster
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	my_wsrep_cluster
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Name for the cluster
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_CONVERT_LOCK_TO_TRX
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To convert locking sessions into transactions
 +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	WSREP_DATA_HOME_DIR
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	DATADIR
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	DATADIR
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	home directory for wsrep provider
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	YES
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_DBUG_OPTION
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	DBUG options to provider library
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_DEBUG
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To enable debug level logging
 +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	WSREP_DESYNC
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To desynchronize the node from the cluster
 +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	WSREP_DIRTY_READS
 +SESSION_VALUE	OFF
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	SESSION
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Allow reads even when the node is not in the primary component.
 +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	WSREP_DRUPAL_282555_WORKAROUND
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Enable a workaround to handle the cases where inserting a DEFAULT value into an auto-increment column could fail with duplicate key error
 +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	WSREP_FORCED_BINLOG_FORMAT
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	NONE
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	NONE
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	ENUM
 +VARIABLE_COMMENT	binlog format to take effect over user's choice
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	MIXED,STATEMENT,ROW,NONE
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_GTID_DOMAIN_ID
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	0
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	0
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	INT UNSIGNED
 +VARIABLE_COMMENT	When wsrep_gtid_mode is set, this value is used as gtid_domain_id for galera transactions and also copied to the joiner nodes during state transfer. It is ignored, otherwise.
 +NUMERIC_MIN_VALUE	0
 +NUMERIC_MAX_VALUE	4294967295
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_GTID_MODE
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Automatically update the (joiner) node's wsrep_gtid_domain_id value with that of donor's (received during state transfer) and use it in place of gtid_domain_id for all galera transactions. When OFF (default), wsrep_gtid_domain_id is simply ignored (backward compatibility).
 +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	WSREP_LOAD_DATA_SPLITTING
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	ON
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	ON
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To commit LOAD DATA transaction after every 10K rows inserted
 +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	WSREP_LOG_CONFLICTS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To log multi-master conflicts
 +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	WSREP_MAX_WS_ROWS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	0
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	0
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BIGINT UNSIGNED
 +VARIABLE_COMMENT	Max number of rows in write set
 +NUMERIC_MIN_VALUE	0
 +NUMERIC_MAX_VALUE	1048576
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_MAX_WS_SIZE
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	2147483647
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	2147483647
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BIGINT UNSIGNED
 +VARIABLE_COMMENT	Max write set size (bytes)
 +NUMERIC_MIN_VALUE	1024
 +NUMERIC_MAX_VALUE	2147483647
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_MYSQL_REPLICATION_BUNDLE
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	0
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	0
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BIGINT UNSIGNED
 +VARIABLE_COMMENT	mysql replication group commit 
 +NUMERIC_MIN_VALUE	0
 +NUMERIC_MAX_VALUE	1000
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_NODE_ADDRESS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Specifies the node's network address, in the format ip address[:port]. Used in situations where autoguessing is not reliable. As of MariaDB 10.1.8, supports IPv6.
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_NODE_INCOMING_ADDRESS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	AUTO
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	AUTO
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Client connection address
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_NODE_NAME
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	HOSTNAME
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	HOSTNAME
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Name of this node. This name can be used in wsrep_sst_donor as a preferred donor. Note that multiple nodes in a cluster can have the same name.
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_NOTIFY_CMD
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_ON
 +SESSION_VALUE	OFF
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	SESSION
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To enable wsrep replication 
 +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	WSREP_OSU_METHOD
 +SESSION_VALUE	TOI
 +GLOBAL_VALUE	TOI
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	TOI
 +VARIABLE_SCOPE	SESSION
 +VARIABLE_TYPE	ENUM
 +VARIABLE_COMMENT	Method for Online Schema Upgrade
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	TOI,RSU
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	OPTIONAL
 +VARIABLE_NAME	WSREP_PATCH_VERSION
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	wsrep_MAJVER.MINVER
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	NULL
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Wsrep patch version, for example wsrep_MAJVER.MINVER.
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	YES
 +COMMAND_LINE_ARGUMENT	NULL
 +VARIABLE_NAME	WSREP_PROVIDER
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	none
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	none
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Path to replication provider library
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_PROVIDER_OPTIONS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Semicolon (;) separated list of wsrep options (see wsrep_provider_options documentation).
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_RECOVER
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Recover database state after crash and exit
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	OFF,ON
 +READ_ONLY	YES
 +COMMAND_LINE_ARGUMENT	OPTIONAL
 +VARIABLE_NAME	WSREP_REJECT_QUERIES
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	NONE
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	NONE
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	ENUM
 +VARIABLE_COMMENT	Variable to set to reject queries
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NONE,ALL,ALL_KILL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	OPTIONAL
 +VARIABLE_NAME	WSREP_REPLICATE_MYISAM
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	To enable myisam replication
 +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	WSREP_RESTART_SLAVE
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Should MariaDB slave be restarted automatically, when node joins back to cluster
 +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	WSREP_RETRY_AUTOCOMMIT
 +SESSION_VALUE	1
 +GLOBAL_VALUE	1
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	1
 +VARIABLE_SCOPE	SESSION
 +VARIABLE_TYPE	BIGINT UNSIGNED
 +VARIABLE_COMMENT	Max number of times to retry a failed autocommit statement
 +NUMERIC_MIN_VALUE	0
 +NUMERIC_MAX_VALUE	10000
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_SLAVE_FK_CHECKS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	ON
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	ON
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Should slave thread do foreign key constraint checks
 +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	WSREP_SLAVE_THREADS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	1
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	1
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BIGINT UNSIGNED
 +VARIABLE_COMMENT	Number of slave appliers to launch
 +NUMERIC_MIN_VALUE	1
 +NUMERIC_MAX_VALUE	512
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_SLAVE_UK_CHECKS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Should slave thread do secondary index uniqueness checks
 +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	WSREP_SST_AUTH
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Authentication for SST connection
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_SST_DONOR
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	preferred donor node for the SST
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_SST_DONOR_REJECTS_QUERIES
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	OFF
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	OFF
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	BOOLEAN
 +VARIABLE_COMMENT	Reject client queries when donating state snapshot transfer
 +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	WSREP_SST_METHOD
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	rsync
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	rsync
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	State snapshot transfer method
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_SST_RECEIVE_ADDRESS
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	AUTO
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	AUTO
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	Address where node is waiting for SST contact
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_START_POSITION
 +SESSION_VALUE	NULL
 +GLOBAL_VALUE	00000000-0000-0000-0000-000000000000:-1
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	00000000-0000-0000-0000-000000000000:-1
 +VARIABLE_SCOPE	GLOBAL
 +VARIABLE_TYPE	VARCHAR
 +VARIABLE_COMMENT	global transaction position to start from 
 +NUMERIC_MIN_VALUE	NULL
 +NUMERIC_MAX_VALUE	NULL
 +NUMERIC_BLOCK_SIZE	NULL
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	REQUIRED
 +VARIABLE_NAME	WSREP_SYNC_WAIT
 +SESSION_VALUE	0
 +GLOBAL_VALUE	0
 +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 +DEFAULT_VALUE	0
 +VARIABLE_SCOPE	SESSION
 +VARIABLE_TYPE	INT UNSIGNED
 +VARIABLE_COMMENT	Ensure "synchronous" read view before executing an operation of the type specified by bitmask: 1 - READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); 2 - UPDATE and DELETE; 4 - INSERT and REPLACE
 +NUMERIC_MIN_VALUE	0
 +NUMERIC_MAX_VALUE	15
 +NUMERIC_BLOCK_SIZE	1
 +ENUM_VALUE_LIST	NULL
 +READ_ONLY	NO
 +COMMAND_LINE_ARGUMENT	OPTIONAL
diff --cc sql/sys_vars.cc
index 16126c471c0,75b1f809d73..d1db14d7b35
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@@ -4940,14 -4680,25 +4940,27 @@@ static Sys_var_mybool Sys_wsrep_certify
         GLOBAL_VAR(wsrep_certify_nonPK), 
         CMD_LINE(OPT_ARG), DEFAULT(TRUE));
  
+ static const char *wsrep_certification_rules_names[]= { "strict", "optimized", NullS };
+ static Sys_var_enum Sys_wsrep_certification_rules(
+        "wsrep_certification_rules",
+        "Certification rules to use in the cluster. Possible values are: "
+        "\"strict\": stricter rules that could result in more certification "
+        "failures. "
+        "\"optimized\": relaxed rules that allow more concurrency and "
+        "cause less certification failures.",
+        GLOBAL_VAR(wsrep_certification_rules), CMD_LINE(REQUIRED_ARG),
+        wsrep_certification_rules_names, DEFAULT(WSREP_CERTIFICATION_RULES_STRICT),
+        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+        ON_UPDATE(0));
+ 
  static Sys_var_mybool Sys_wsrep_causal_reads(
 -       "wsrep_causal_reads", "(DEPRECATED) Setting this variable is equivalent "
 +       "wsrep_causal_reads", "Setting this variable is equivalent "
         "to setting wsrep_sync_wait READ flag",
 -       SESSION_VAR(wsrep_causal_reads), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
 +       SESSION_VAR(wsrep_causal_reads),
 +       CMD_LINE(OPT_ARG, OPT_WSREP_CAUSAL_READS), DEFAULT(FALSE),
         NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
 -       ON_UPDATE(wsrep_causal_reads_update));
 +       ON_UPDATE(wsrep_causal_reads_update),
 +       DEPRECATED("'@@wsrep_sync_wait=1'"));
  
  static Sys_var_uint Sys_wsrep_sync_wait(
         "wsrep_sync_wait", "Ensure \"synchronous\" read view before executing "
diff --cc sql/wsrep_mysqld.h
index 2814f4013d8,4c98b9a624b..2b55fbe42ee
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@@ -27,9 -21,7 +27,10 @@@ typedef struct st_mysql_show_var SHOW_V
  #include <sql_priv.h>
  //#include "rpl_gtid.h"
  #include "../wsrep/wsrep_api.h"
 +#include "mdl.h"
 +#include "mysqld.h"
 +#include "sql_table.h"
+ #include "wsrep_mysqld_c.h"
  
  #define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX
  
diff --cc storage/innobase/handler/ha_innodb.cc
index 702f84a52d1,2244cd1101a..472fb86288f
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@@ -111,7 -108,7 +111,8 @@@ MYSQL_PLUGIN_IMPORT extern char mysql_u
  #endif /* UNIV_DEBUG */
  #include "fts0priv.h"
  #include "page0zip.h"
 +#include "fil0pagecompress.h"
+ #include "dict0priv.h"
  
  #define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X))
  
@@@ -134,10 -128,12 +135,10 @@@
  # endif /* MYSQL_PLUGIN_IMPORT */
  
  #ifdef WITH_WSREP
- #include "dict0priv.h"
+ #include "../../../wsrep/wsrep_api.h"
  #include "../storage/innobase/include/ut0byte.h"
 -#include <wsrep_mysqld.h>
 -#include <wsrep_md5.h>
 +#include <mysql/service_md5.h>
  
 -extern my_bool wsrep_certify_nonPK;
  class  binlog_trx_data;
  extern handlerton *binlog_hton;
  
@@@ -8448,8 -8015,9 +8449,9 @@@ report_error
  	    && wsrep_on(user_thd)
  	    && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE
  	    && !wsrep_consistency_check(user_thd)
 -	    && !wsrep_thd_skip_append_keys(user_thd)) {
 +	    && !wsrep_thd_ignore_table(user_thd)) {
- 		if (wsrep_append_keys(user_thd, false, record, NULL)) {
+ 		if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, record,
+ 				      NULL)) {
  			DBUG_PRINT("wsrep", ("row key failed"));
  			error_result = HA_ERR_INTERNAL_ERROR;
  			goto wsrep_error;
@@@ -9034,11 -8602,12 +9037,12 @@@ ha_innobase::delete_row
  	if (error == DB_SUCCESS                          &&
              wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
              wsrep_on(user_thd)                           &&
 -            !wsrep_thd_skip_append_keys(user_thd))
 +            !wsrep_thd_ignore_table(user_thd))
          {
- 		if (wsrep_append_keys(user_thd, false, record, NULL)) {
+ 		if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, record,
+ 			              NULL)) {
  			DBUG_PRINT("wsrep", ("delete fail"));
 -			error = (dberr_t)HA_ERR_INTERNAL_ERROR;
 +			error = (dberr_t) HA_ERR_INTERNAL_ERROR;
  			goto wsrep_error;
  		}
  	}
@@@ -10444,10 -10024,10 +10465,10 @@@ wsrep_append_foreign_key
  		wsrep_ws_handle(thd, trx),
  		&wkey,
  		1,
- 		shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE,
+ 		key_type,
                  copy);
  	if (rcode) {
 -		DBUG_PRINT("wsrep", ("row key failed: %lu", rcode));
 +		DBUG_PRINT("wsrep", ("row key failed: %zu", rcode));
  		WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu",
  			    (wsrep_thd_query(thd)) ?
  			    wsrep_thd_query(thd) : "void", rcode);
diff --cc storage/innobase/row/row0ins.cc
index c50eaa2a653,271e93c6e80..c031c38163e
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@@ -1638,16 -1643,34 +1643,34 @@@ run_again
  				}
  
  				if (check_ref) {
+ #ifdef WITH_WSREP
+ 					enum wsrep_key_type key_type = WSREP_KEY_EXCLUSIVE;
+ #endif WITH_WSREP
  					err = DB_SUCCESS;
+ 
  #ifdef WITH_WSREP
+ 					if (upd_node != NULL) {
+ 						key_type = WSREP_KEY_SHARED;
+ 					} else {
+ 						switch (wsrep_certification_rules) {
+ 						case WSREP_CERTIFICATION_RULES_STRICT:
+ 							key_type = WSREP_KEY_EXCLUSIVE;
+ 							break;
+ 						case WSREP_CERTIFICATION_RULES_OPTIMIZED:
+ 							key_type = WSREP_KEY_SEMI;
+ 							break;
+ 						}
+ 					}
+ 
  					err = wsrep_append_foreign_key(
 - 						thr_get_trx(thr),
 - 						foreign,
 - 						rec,
 - 						check_index,
 - 						check_ref,
 +						thr_get_trx(thr),
 +						foreign,
 +						rec,
 +						check_index,
 +						check_ref,
- 						(upd_node) ? TRUE : FALSE);
- #endif /* WITH_WSREP */
+ 						key_type);
+  #endif /* WITH_WSREP */
+ 
  					goto end_scan;
  				} else if (foreign->type != 0) {
  					/* There is an ON UPDATE or ON DELETE
diff --cc storage/xtradb/handler/ha_innodb.cc
index d3be5155d27,89539bfeed2..c9db941b4bf
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@@ -109,7 -104,7 +109,8 @@@ this program; if not, write to the Fre
  #endif /* UNIV_DEBUG */
  #include "fts0priv.h"
  #include "page0zip.h"
 +#include "fil0pagecompress.h"
+ #include "dict0priv.h"
  
  #define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X))
  
@@@ -133,10 -125,12 +134,10 @@@
  # endif /* MYSQL_PLUGIN_IMPORT */
  
  #ifdef WITH_WSREP
- #include "dict0priv.h"
+ #include "../../../wsrep/wsrep_api.h"
  #include "../storage/innobase/include/ut0byte.h"
 -#include <wsrep_mysqld.h>
 -#include <wsrep_md5.h>
 +#include <mysql/service_md5.h>
  
 -extern my_bool wsrep_certify_nonPK;
  class  binlog_trx_data;
  extern handlerton *binlog_hton;
  
@@@ -9034,8 -8736,8 +9036,8 @@@ report_error
  	    && wsrep_on(user_thd)
   	    && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE
  	    && !wsrep_consistency_check(user_thd)
 -	    && !wsrep_thd_skip_append_keys(user_thd)) {
 +	    && !wsrep_thd_ignore_table(user_thd)) {
- 		if (wsrep_append_keys(user_thd, false, record, NULL)) {
+ 		if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, record, NULL)) {
  			DBUG_PRINT("wsrep", ("row key failed"));
  			error_result = HA_ERR_INTERNAL_ERROR;
  			goto wsrep_error;
@@@ -9617,11 -9354,12 +9620,12 @@@ ha_innobase::delete_row
  	if (error == DB_SUCCESS                          &&
              wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
              wsrep_on(user_thd)                           &&
 -            !wsrep_thd_skip_append_keys(user_thd))
 +            !wsrep_thd_ignore_table(user_thd))
          {
- 		if (wsrep_append_keys(user_thd, false, record, NULL)) {
+ 		if (wsrep_append_keys(user_thd, WSREP_KEY_EXCLUSIVE, record,
+ 				      NULL)) {
  			DBUG_PRINT("wsrep", ("delete fail"));
 -			error = DB_ERROR;
 +			error = (dberr_t) HA_ERR_INTERNAL_ERROR;
  			goto wsrep_error;
  		}
  	}
@@@ -11012,10 -10790,10 +11033,10 @@@ wsrep_append_foreign_key
  		wsrep_ws_handle(thd, trx),
  		&wkey,
  		1,
- 		shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE,
+ 		key_type,
                  copy);
  	if (rcode) {
 -		DBUG_PRINT("wsrep", ("row key failed: %lu", rcode));
 +		DBUG_PRINT("wsrep", ("row key failed: %zu", rcode));
  		WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu",
  			    (wsrep_thd_query(thd)) ?
  			    wsrep_thd_query(thd) : "void", rcode);
@@@ -11041,8 -10820,8 +11063,8 @@@ wsrep_append_key
  	bool const copy = true;
  #ifdef WSREP_DEBUG_PRINT
  	fprintf(stderr, "%s conn %ld, trx %llu, keylen %d, table %s\n Query: %s ",
- 		(shared) ? "Shared" : "Exclusive",
+ 		wsrep_key_type_to_str(key_type),
 -		wsrep_thd_thread_id(thd), trx->id, key_len,
 +		thd_get_thread_id(thd), (long long)trx->id, key_len,
  		table_share->table_name.str, wsrep_thd_query(thd));
  	for (int i=0; i<key_len; i++) {
  		fprintf(stderr, "%hhX, ", key[i]);
diff --cc storage/xtradb/row/row0ins.cc
index 472be8ad848,b8ac976bea8..f146d1f68b1
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@@ -1650,16 -1655,34 +1655,34 @@@ run_again
  				}
  
  				if (check_ref) {
+ #ifdef WITH_WSREP
+ 					enum wsrep_key_type key_type = WSREP_KEY_EXCLUSIVE;
+ #endif /* WITH_WSREP */
  					err = DB_SUCCESS;
+ 
  #ifdef WITH_WSREP
+ 					if (upd_node != NULL) {
+ 						key_type = WSREP_KEY_SHARED;
+ 					} else {
+ 						switch (wsrep_certification_rules) {
+ 						case WSREP_CERTIFICATION_RULES_STRICT:
+ 							key_type = WSREP_KEY_EXCLUSIVE;
+ 							break;
+ 						case WSREP_CERTIFICATION_RULES_OPTIMIZED:
+ 							key_type = WSREP_KEY_SEMI;
+ 							break;
+ 						}
+ 					}
+ 
  					err = wsrep_append_foreign_key(
 - 						thr_get_trx(thr),
 - 						foreign,
 - 						rec,
 - 						check_index,
 - 						check_ref,
 +						thr_get_trx(thr),
 +						foreign,
 +						rec,
 +						check_index,
 +						check_ref,
- 						(upd_node) ? TRUE : FALSE);
- #endif /* WITH_WSREP */
+ 						key_type);
+  #endif /* WITH_WSREP */
+ 
  					goto end_scan;
  				} else if (foreign->type != 0) {
  					/* There is an ON UPDATE or ON DELETE


More information about the commits mailing list