summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.travis.compiler.sh46
-rw-r--r--.travis.yml129
-rw-r--r--cmake/plugin.cmake10
-rw-r--r--man/comp_err.12
-rw-r--r--man/galera_new_cluster.12
-rw-r--r--man/galera_recovery.12
-rw-r--r--man/innochecksum.12
-rw-r--r--man/make_win_bin_dist.12
-rw-r--r--man/mariadb-service-convert.12
-rw-r--r--man/msql2mysql.12
-rw-r--r--man/my_print_defaults.12
-rw-r--r--man/myisam_ftdump.12
-rw-r--r--man/myisamchk.12
-rw-r--r--man/myisamlog.12
-rw-r--r--man/myisampack.12
-rw-r--r--man/mysql-stress-test.pl.12
-rw-r--r--man/mysql-test-run.pl.12
-rw-r--r--man/mysql.12
-rw-r--r--man/mysql.server.12
-rw-r--r--man/mysql_client_test.12
-rw-r--r--man/mysql_config.12
-rw-r--r--man/mysql_convert_table_format.12
-rw-r--r--man/mysql_find_rows.12
-rw-r--r--man/mysql_fix_extensions.12
-rw-r--r--man/mysql_install_db.12
-rw-r--r--man/mysql_plugin.12
-rw-r--r--man/mysql_secure_installation.12
-rw-r--r--man/mysql_setpermission.12
-rw-r--r--man/mysql_tzinfo_to_sql.12
-rw-r--r--man/mysql_upgrade.12
-rw-r--r--man/mysql_waitpid.12
-rw-r--r--man/mysqlaccess.12
-rw-r--r--man/mysqladmin.12
-rw-r--r--man/mysqlbinlog.12
-rw-r--r--man/mysqlcheck.12
-rw-r--r--man/mysqld.82
-rw-r--r--man/mysqld_multi.12
-rw-r--r--man/mysqld_safe.12
-rw-r--r--man/mysqld_safe_helper.12
-rw-r--r--man/mysqldump.118
-rw-r--r--man/mysqldumpslow.12
-rw-r--r--man/mysqlhotcopy.12
-rw-r--r--man/mysqlimport.12
-rw-r--r--man/mysqlshow.12
-rw-r--r--man/mysqlslap.12
-rw-r--r--man/mysqltest.12
-rw-r--r--man/perror.12
-rw-r--r--man/replace.12
-rw-r--r--man/resolve_stack_dump.12
-rw-r--r--man/resolveip.12
-rw-r--r--man/tokuftdump.12
-rw-r--r--man/wsrep_sst_common.12
-rw-r--r--man/wsrep_sst_mysqldump.12
-rw-r--r--man/wsrep_sst_rsync.12
-rw-r--r--man/wsrep_sst_xtrabackup-v2.12
-rw-r--r--man/wsrep_sst_xtrabackup.12
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm4
-rwxr-xr-xmysql-test/mysql-test-run.pl12
-rw-r--r--mysql-test/r/cte_nonrecursive.result23
-rw-r--r--mysql-test/r/ctype_utf8mb4.result2
-rw-r--r--mysql-test/r/ctype_utf8mb4_innodb.result2
-rw-r--r--mysql-test/r/ctype_utf8mb4_myisam.result2
-rw-r--r--mysql-test/r/gis-debug.result53
-rw-r--r--mysql-test/r/gis.result65
-rw-r--r--mysql-test/r/partition_default.result48
-rw-r--r--mysql-test/r/type_blob.result2
-rw-r--r--mysql-test/r/view.result50
-rw-r--r--mysql-test/suite/innodb/r/alter_table.result13
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k-crash.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-64k-crash.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-debug.result61
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-nullable.result59
-rw-r--r--mysql-test/suite/innodb/r/innodb.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment_small.result29
-rw-r--r--mysql-test/suite/innodb/t/alter_table.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-crash.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-crash.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-debug.test79
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-nullable.test76
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.test19
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment_small.test32
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix.result34
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result34
-rw-r--r--mysql-test/suite/sys_vars/r/log_error_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_error_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result4
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_func.cnf5
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_func2.cnf5
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_func2.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/log_error_func3.opt1
-rw-r--r--mysql-test/t/cte_nonrecursive.test24
-rw-r--r--mysql-test/t/gis-debug.test65
-rw-r--r--mysql-test/t/gis.test75
-rw-r--r--mysql-test/t/partition_default.test32
-rw-r--r--mysql-test/t/plugin_loaderr.test2
-rw-r--r--mysql-test/t/view.test50
-rw-r--r--plugin/aws_key_management/CMakeLists.txt8
-rw-r--r--sql/CMakeLists.txt83
-rw-r--r--sql/item.cc12
-rw-r--r--sql/item_func.cc189
-rw-r--r--sql/item_func.h62
-rw-r--r--sql/log.cc17
-rw-r--r--sql/log.h1
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/log_event.h1
-rw-r--r--sql/rpl_rli.h2
-rw-r--r--sql/sql_cte.cc1
-rw-r--r--sql/sql_partition.cc3
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_type.cc313
-rw-r--r--sql/sql_type.h92
-rw-r--r--sql/wsrep_binlog.cc6
-rw-r--r--storage/innobase/buf/buf0dblwr.cc26
-rw-r--r--storage/innobase/fil/fil0crypt.cc2
-rw-r--r--storage/innobase/handler/ha_innodb.cc19
-rw-r--r--storage/innobase/handler/handler0alter.cc1
-rw-r--r--storage/rocksdb/CMakeLists.txt4
-rw-r--r--storage/rocksdb/build_rocksdb.cmake6
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/disabled.def6
-rw-r--r--storage/rocksdb/rdb_buff.h10
-rw-r--r--storage/rocksdb/ut0counter.h2
-rw-r--r--storage/xtradb/btr/btr0cur.cc10
-rw-r--r--storage/xtradb/fil/fil0crypt.cc2
-rw-r--r--storage/xtradb/handler/ha_innodb.cc11
-rw-r--r--storage/xtradb/handler/handler0alter.cc1
-rw-r--r--win/create_def_file.js46
132 files changed, 1874 insertions, 418 deletions
diff --git a/.travis.compiler.sh b/.travis.compiler.sh
new file mode 100755
index 00000000000..35e79e177ef
--- /dev/null
+++ b/.travis.compiler.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+set -v -x
+if [[ "${TRAVIS_OS_NAME}" == 'linux' ]]; then
+ if [[ "${CXX}" == 'clang++' ]]; then
+ CMAKE_OPT="-DWITHOUT_TOKUDB_STORAGE_ENGINE=ON -DWITHOUT_MROONGA_STORAGE_ENGINE=ON"
+ #CMAKE_OPT="${CMAKE_OPT} -DWITH_ASAN=ON"
+ if which ccache ; then
+ CMAKE_OPT="${CMAKE_OPT} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
+ fi
+ case ${GCC_VERSION} in
+ 5) CXX=clang++-3.9 ;;
+ 6) CXX=clang++-4.0 ;;
+ esac
+ export CXX CC=${CXX/++/}
+ elif [[ "${CXX}" == 'g++' ]]; then
+ CMAKE_OPT=""
+ export CXX=g++-${GCC_VERSION}
+ export CC=gcc-${GCC_VERSION}
+ fi
+ if [[ ${GCC_VERSION} == 6 ]]; then
+ wget http://mirrors.kernel.org/ubuntu/pool/universe/p/percona-xtradb-cluster-galera-2.x/percona-xtradb-cluster-galera-2.x_165-0ubuntu1_amd64.deb ;
+ ar vx percona-xtradb-cluster-galera-2.x_165-0ubuntu1_amd64.deb
+ tar -xJvf data.tar.xz
+ export WSREP_PROVIDER=$PWD/usr/lib/libgalera_smm.so
+ MYSQL_TEST_SUITES="${MYSQL_TEST_SUITES},wsrep"
+ #elif [[ ${GCC_VERSION} != 5 ]]; then
+ #CMAKE_OPT="${CMAKE_OPT} -DWITH_ASAN=ON"
+ fi
+else
+ # osx_image based tests
+ CMAKE_OPT="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
+ #CMAKE_OPT="${CMAKE_OPT} -DWITH_ASAN=ON"
+ if which ccache ; then
+ CMAKE_OPT="${CMAKE_OPT} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
+ fi
+ CMAKE_OPT="${CMAKE_OPT} -DWITHOUT_MROONGA_STORAGE_ENGINE=ON"
+ if [[ "${TYPE}" == "Debug" ]]; then
+ CMAKE_OPT="${CMAKE_OPT} -DWITHOUT_TOKUDB_STORAGE_ENGINE=ON"
+ fi
+fi
+
+# main.mysqlhotcopy_myisam consitently failed in travis containers
+# https://travis-ci.org/grooverdan/mariadb-server/builds/217661580
+echo 'main.mysqlhotcopy_myisam : unstable in containers' >> ${TRAVIS_BUILD_DIR}/mysql-test/unstable-tests
+echo 'archive.mysqlhotcopy_archive : unstable in containers' >> ${TRAVIS_BUILD_DIR}/mysql-test/unstable-tests
+set +v +x
diff --git a/.travis.yml b/.travis.yml
index c2fa7283e9a..f33de076289 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,37 +1,103 @@
# vim ft=yaml
# travis-ci.org definition
-# non-container builds don't have enough RAM to reliably compile
-sudo: required
+sudo: false
dist: trusty
+git:
+ depth: 2
+
language: cpp
+os:
+ - linux
+ - osx
+osx_image: xcode8.3
compiler:
- gcc
+ - clang
+
cache:
- - apt
- - ccache
+ apt: true
+ ccache: true
+ directories:
+ - /usr/local/Cellar
env:
matrix:
- - GCC_VERSION=4.8
- - GCC_VERSION=5
- - GCC_VERSION=6
+# - GCC_VERSION=4.8 TYPE=Debug MYSQL_TEST_SUITES=rpl
+# - GCC_VERSION=5 TYPE=Debug MYSQL_TEST_SUITES=main,archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
+# - GCC_VERSION=6 TYPE=Debug MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption,rocksdb
+# - GCC_VERSION=6 TYPE=Debug MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,percona,perfschema,plugins,multi_source,roles
+ - GCC_VERSION=4.8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=rpl
+ - GCC_VERSION=5 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main,archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
+ - GCC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption,rocksdb
+ - GCC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,percona,perfschema,plugins,multi_source,roles
+
+matrix:
+ exclude:
+ - os: osx
+ compiler: gcc
+ include:
+ - os: linux
+ compiler: gcc
+ script:
+ - ${CC} --version ; ${CXX} --version
+ # Just for disabling hotcopy tests for now
+ - source .travis.compiler.sh
+ # https://github.com/travis-ci/travis-ci/issues/7062 - /run/shm isn't writable or executable
+ # in trusty containers
+ - export MTR_MEM=/tmp
+ - env DEB_BUILD_OPTIONS="parallel=6" debian/autobake-deb.sh;
+ - ccache --show-stats
+
+# Matrix include for coverity
+# - env:
+# - GCC_VERSION=6
+# addon:
+# coverity_scan:
+# # ref: https://scan.coverity.com/travis_ci
+# # GitHub project metadata
+# project:
+# - name: MariaDB/server
+# - description: MariaDB Server
+#
+# # Where email notification of build analysis results will be sent
+# notification_email: security@mariadb.org
+#
+# # Commands to prepare for build_command
+# build_command_prepend:
+# - source .travis.compiler.sh
+# - ${MYSQL_BUILD_CC} --version ; ${MYSQL_BUILD_CXX} --version
+# - cmake .
+# -DCMAKE_BUILD_TYPE=Debug
+# -DWITH_SSL=system -DWITH_ZLIB=system
+# -DWITHOUT_TOKUDB_STORAGE_ENGINE=ON -DWITHOUT_MROONGA_STORAGE_ENGINE=ON
+#
+# # The command that will be added as an argument to "cov-build" to compile your project for analysis,
+# build_command: make -j 4
+#
+# # Pattern to match selecting branches that will run analysis.
+# # Take care in resource usage, and consider the build frequency allowances per
+# # https://scan.coverity.com/faq#frequency - 7 per week is the current limit.
+# branch_pattern: .*coverity.*
+
addons:
apt:
sources:
- ubuntu-toolchain-r-test
-# below requires https://github.com/travis-ci/apt-source-whitelist/pull/309
-# - llvm-toolchain-trusty-3.8
-# - llvm-toolchain-trusty-3.9
-# llvm urls awaiting fix
-# https://github.com/travis-ci/apt-source-whitelist/pull/288
-# https://github.com/travis-ci/apt-source-whitelist/pull/309
+ - llvm-toolchain-trusty
+ - llvm-toolchain-trusty-3.9
+ - llvm-toolchain-trusty-4.0
packages: # make sure these match debian/control contents
- gcc-5
- g++-5
- gcc-6
- g++-6
+ - clang-3.9
+ - llvm-3.9-dev
+ - clang-4.0
+ - llvm-4.0-dev
+ - libasan0
- bison
- chrpath
- cmake
@@ -41,6 +107,7 @@ addons:
- gdb
- libaio-dev
- libboost-dev
+ - libcurl3-dev
- libjudy-dev
- libncurses5-dev
- libpam0g-dev
@@ -57,18 +124,40 @@ addons:
- zlib1g-dev
- libcrack2-dev
- libjemalloc-dev
+ - libsnappy-dev
+ - liblzma-dev
+ - libzmq-dev
+ - libdistro-info-perl
- devscripts # implicit for any build on Ubuntu
-# libsnappy-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3880
-# liblzma-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3879
-# libzmq-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3881
# libsystemd-daemon-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3882
+before_install:
+ - if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then
+ brew update;
+ brew install gnutls lz4 lzo xz snappy ccache jemalloc curl ossp-uuid pcre;
+ brew link ccache;
+ fi
+
script:
- - export MYSQL_BUILD_CC=/usr/bin/gcc-${GCC_VERSION} MYSQL_BUILD_CXX=/usr/bin/g++-${GCC_VERSION}
- - ${MYSQL_BUILD_CC} --version ; ${MYSQL_BUILD_CXX} --version
- - cd "${TRAVIS_BUILD_DIR}"
- - env DEB_BUILD_OPTIONS="parallel=3" debian/autobake-deb.sh;
+ - ccache --version
+# Clang:
+# mroonga just generates too many warnings with clang and travis stops the job
+# tokudb has fatal warnings
+ - source .travis.compiler.sh
+ - cmake .
+ -DCMAKE_BUILD_TYPE=${TYPE}
+ ${CMAKE_OPT}
+ -DWITH_SSL=system -DWITH_ZLIB=system -DPLUGIN_AWS_KEY_MANAGEMENT=DYNAMIC -DAWS_SDK_EXTERNAL_PROJECT=ON
+ - make -j 6
+ - cd mysql-test
+# With ASAN --thread-stack=400K to account for overhead
+# Test timeout needs to be 10(minutes) or less due to travis out timeout
+ - ./mtr --force --max-test-fail=20 --parallel=6 --testcase-timeout=2
+ --suite=${MYSQL_TEST_SUITES}
+ --skip-test-list=unstable-tests
+ --skip-test=binlog.binlog_unsafe
+ - ccache --show-stats
notifications:
irc:
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index edbd2065f82..354ee53c7bb 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -201,9 +201,15 @@ MACRO(MYSQL_ADD_PLUGIN)
# executable to the linker command line (it would result into link error).
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
# an additional dependency.
- IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ARG_CLIENT)
- TARGET_LINK_LIBRARIES (${target} mysqld)
+ IF(NOT ARG_CLIENT)
+ IF(MSVC)
+ ADD_DEPENDENCIES(${target} gen_mysqld_lib)
+ TARGET_LINK_LIBRARIES(${target} mysqld_import_lib)
+ ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ TARGET_LINK_LIBRARIES (${target} mysqld)
+ ENDIF()
ENDIF()
+
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
SET_TARGET_PROPERTIES(${target} PROPERTIES
diff --git a/man/comp_err.1 b/man/comp_err.1
index c566e2d11e0..4ff91aac2e6 100644
--- a/man/comp_err.1
+++ b/man/comp_err.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBCOMP_ERR\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBCOMP_ERR\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/galera_new_cluster.1 b/man/galera_new_cluster.1
index c351a5e0c5f..72c46edc54a 100644
--- a/man/galera_new_cluster.1
+++ b/man/galera_new_cluster.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBGALERA_NEW_CLUSTER\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBGALERA_NEW_CLUSTER\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/galera_recovery.1 b/man/galera_recovery.1
index 12cb450da46..6856d0a1c7d 100644
--- a/man/galera_recovery.1
+++ b/man/galera_recovery.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBGALERA_RECOVERY\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBGALERA_RECOVERY\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/innochecksum.1 b/man/innochecksum.1
index 72614ad1617..70eb9875ac7 100644
--- a/man/innochecksum.1
+++ b/man/innochecksum.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBINNOCHECKSUM\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBINNOCHECKSUM\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/make_win_bin_dist.1 b/man/make_win_bin_dist.1
index 32043390059..7f041ce26b3 100644
--- a/man/make_win_bin_dist.1
+++ b/man/make_win_bin_dist.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMAKE_WIN_BIN_DIST" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMAKE_WIN_BIN_DIST" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mariadb-service-convert.1 b/man/mariadb-service-convert.1
index 6301087208b..35c9b001599 100644
--- a/man/mariadb-service-convert.1
+++ b/man/mariadb-service-convert.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SERVICE-CONVERT\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBMARIADB-SERVICE-CONVERT\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/msql2mysql.1 b/man/msql2mysql.1
index dfe5ebf4d89..87cedc5e80b 100644
--- a/man/msql2mysql.1
+++ b/man/msql2mysql.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMSQL2MYSQL\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMSQL2MYSQL\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/my_print_defaults.1 b/man/my_print_defaults.1
index 857566133e3..87e82f91023 100644
--- a/man/my_print_defaults.1
+++ b/man/my_print_defaults.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMY_PRINT_DEFAULTS" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMY_PRINT_DEFAULTS" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/myisam_ftdump.1 b/man/myisam_ftdump.1
index eb383605084..889031c7e34 100644
--- a/man/myisam_ftdump.1
+++ b/man/myisam_ftdump.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYISAM_FTDUMP\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYISAM_FTDUMP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/myisamchk.1 b/man/myisamchk.1
index e13df134882..557ab1d6b33 100644
--- a/man/myisamchk.1
+++ b/man/myisamchk.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYISAMCHK\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYISAMCHK\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/myisamlog.1 b/man/myisamlog.1
index 25e4b5d8640..bd318bedd91 100644
--- a/man/myisamlog.1
+++ b/man/myisamlog.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYISAMLOG\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYISAMLOG\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/myisampack.1 b/man/myisampack.1
index e3f301df156..8baeb26285b 100644
--- a/man/myisampack.1
+++ b/man/myisampack.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYISAMPACK\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYISAMPACK\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql-stress-test.pl.1 b/man/mysql-stress-test.pl.1
index 0e47538efbe..ccd1a187fd1 100644
--- a/man/mysql-stress-test.pl.1
+++ b/man/mysql-stress-test.pl.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL\-STRESS\-TE" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1
index 784e62a3c66..b99815778ee 100644
--- a/man/mysql-test-run.pl.1
+++ b/man/mysql-test-run.pl.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL\-TEST\-RUN\" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql.1 b/man/mysql.1
index e4c0727d1ae..624e69a0d54 100644
--- a/man/mysql.1
+++ b/man/mysql.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql.server.1 b/man/mysql.server.1
index 252d8002ca2..ed6fb517820 100644
--- a/man/mysql.server.1
+++ b/man/mysql.server.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_client_test.1 b/man/mysql_client_test.1
index 21da6397b2b..a1652d7b2dc 100644
--- a/man/mysql_client_test.1
+++ b/man/mysql_client_test.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_CLIENT_TEST" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_CLIENT_TEST" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_config.1 b/man/mysql_config.1
index 91b04b65f75..f321ae937b6 100644
--- a/man/mysql_config.1
+++ b/man/mysql_config.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_convert_table_format.1 b/man/mysql_convert_table_format.1
index 0d46fa44151..3956609d547 100644
--- a/man/mysql_convert_table_format.1
+++ b/man/mysql_convert_table_format.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_CONVERT_TAB" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_CONVERT_TAB" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_find_rows.1 b/man/mysql_find_rows.1
index 0c38b91f523..9e3aca17191 100644
--- a/man/mysql_find_rows.1
+++ b/man/mysql_find_rows.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_FIND_ROWS\F" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_FIND_ROWS\F" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_fix_extensions.1 b/man/mysql_fix_extensions.1
index 04d96fd9058..6bb7f637595 100644
--- a/man/mysql_fix_extensions.1
+++ b/man/mysql_fix_extensions.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_FIX_EXTENSI" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_FIX_EXTENSI" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_install_db.1 b/man/mysql_install_db.1
index 716fb56956d..ea54477f516 100644
--- a/man/mysql_install_db.1
+++ b/man/mysql_install_db.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_INSTALL_DB\" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_INSTALL_DB\" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1
index 0326a7ddb09..33530235afb 100644
--- a/man/mysql_plugin.1
+++ b/man/mysql_plugin.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_PLUGIN\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_PLUGIN\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff --git a/man/mysql_secure_installation.1 b/man/mysql_secure_installation.1
index 71e9d67dee4..5c1fd70f956 100644
--- a/man/mysql_secure_installation.1
+++ b/man/mysql_secure_installation.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_SECURE_INST" "1" "3 January 2017" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_SECURE_INST" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_setpermission.1 b/man/mysql_setpermission.1
index 0ca22ca27dd..5a3c6f1b811 100644
--- a/man/mysql_setpermission.1
+++ b/man/mysql_setpermission.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_SETPERMISSI" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_SETPERMISSI" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_tzinfo_to_sql.1 b/man/mysql_tzinfo_to_sql.1
index ece013dd40f..2063523ddc0 100644
--- a/man/mysql_tzinfo_to_sql.1
+++ b/man/mysql_tzinfo_to_sql.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_TZINFO_TO_S" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_TZINFO_TO_S" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1
index 62e39393240..876e224aa83 100644
--- a/man/mysql_upgrade.1
+++ b/man/mysql_upgrade.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_UPGRADE\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_UPGRADE\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_waitpid.1 b/man/mysql_waitpid.1
index ae645be872f..91acfec604d 100644
--- a/man/mysql_waitpid.1
+++ b/man/mysql_waitpid.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_WAITPID\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQL_WAITPID\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1
index 02b5169b50d..2d482141043 100644
--- a/man/mysqlaccess.1
+++ b/man/mysqlaccess.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLACCESS\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLACCESS\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1
index 786b288f101..85ab1e0e7dc 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLADMIN\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1
index 34cf246ff1b..9a00c64292a 100644
--- a/man/mysqlbinlog.1
+++ b/man/mysqlbinlog.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1
index abc8d64c2af..d0a512711a4 100644
--- a/man/mysqlcheck.1
+++ b/man/mysqlcheck.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLCHECK\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLCHECK\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld.8 b/man/mysqld.8
index b77b551bd48..04e631e72d0 100644
--- a/man/mysqld.8
+++ b/man/mysqld.8
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLD\FR" "8" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLD\FR" "8" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1
index 6a52116fffe..b82dd218239 100644
--- a/man/mysqld_multi.1
+++ b/man/mysqld_multi.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLD_MULTI\FR" "1" "7 December 2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLD_MULTI\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1
index eb31d05d4ef..7b9387f0a5f 100644
--- a/man/mysqld_safe.1
+++ b/man/mysqld_safe.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLD_SAFE\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLD_SAFE\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld_safe_helper.1 b/man/mysqld_safe_helper.1
index 63770a49d28..93b4fc35c53 100644
--- a/man/mysqld_safe_helper.1
+++ b/man/mysqld_safe_helper.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLD_SAFE_HELPER\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBMYSQLD_SAFE_HELPER\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqldump.1 b/man/mysqldump.1
index ebd3b1fc896..7e7e455e020 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLDUMP\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLDUMP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -858,6 +858,22 @@ instead\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: flashback option
+.\" flashback option: mysqldump
+\fB\-\-flashback\fR,
+\fB\-B\fR
+.sp
+Support flashback mode\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: flush-logs option
.\" flush-logs option: mysqldump
\fB\-\-flush\-logs\fR,
diff --git a/man/mysqldumpslow.1 b/man/mysqldumpslow.1
index 47dffef7edd..78a85264627 100644
--- a/man/mysqldumpslow.1
+++ b/man/mysqldumpslow.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLDUMPSLOW\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLDUMPSLOW\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlhotcopy.1 b/man/mysqlhotcopy.1
index bb6f83ac810..480b2d43a61 100644
--- a/man/mysqlhotcopy.1
+++ b/man/mysqlhotcopy.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLHOTCOPY\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLHOTCOPY\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlimport.1 b/man/mysqlimport.1
index 4c4ed342d7a..3478865c83f 100644
--- a/man/mysqlimport.1
+++ b/man/mysqlimport.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLIMPORT\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLIMPORT\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlshow.1 b/man/mysqlshow.1
index 1790978144a..d387f9dfdb5 100644
--- a/man/mysqlshow.1
+++ b/man/mysqlshow.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLSHOW\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLSHOW\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlslap.1 b/man/mysqlslap.1
index e3246e811bf..07ec3a4a042 100644
--- a/man/mysqlslap.1
+++ b/man/mysqlslap.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLSLAP\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLSLAP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqltest.1 b/man/mysqltest.1
index 772702e4091..4dce3d54db3 100644
--- a/man/mysqltest.1
+++ b/man/mysqltest.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLTEST\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBMYSQLTEST\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/perror.1 b/man/perror.1
index 3a680c96201..6a929828201 100644
--- a/man/perror.1
+++ b/man/perror.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBPERROR\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBPERROR\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/replace.1 b/man/replace.1
index 5c63027535e..e17ecedbcb8 100644
--- a/man/replace.1
+++ b/man/replace.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBREPLACE\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBREPLACE\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/resolve_stack_dump.1 b/man/resolve_stack_dump.1
index 693c84e8da0..d2f6e53d864 100644
--- a/man/resolve_stack_dump.1
+++ b/man/resolve_stack_dump.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBRESOLVE_STACK_DUM" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBRESOLVE_STACK_DUM" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/resolveip.1 b/man/resolveip.1
index 2f1c4a1a290..2a0155b1721 100644
--- a/man/resolveip.1
+++ b/man/resolveip.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBRESOLVEIP\FR" "1" "22/3/2016" "MariaDB 10\&.2" "MariaDB Database System"
+.TH "\FBRESOLVEIP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/tokuftdump.1 b/man/tokuftdump.1
index d0a11a840a5..d88a1f07676 100644
--- a/man/tokuftdump.1
+++ b/man/tokuftdump.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBTOKUFTDUMP\FR" "1" "9 March 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBTOKUFTDUMP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/wsrep_sst_common.1 b/man/wsrep_sst_common.1
index 05242e66c00..6a73e69cbe6 100644
--- a/man/wsrep_sst_common.1
+++ b/man/wsrep_sst_common.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBWSREP_SST_COMMON\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBWSREP_SST_COMMON\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/wsrep_sst_mysqldump.1 b/man/wsrep_sst_mysqldump.1
index 17ad5b2cdf1..da70ace00ac 100644
--- a/man/wsrep_sst_mysqldump.1
+++ b/man/wsrep_sst_mysqldump.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBWSREP_SST_MYSQLDUMP\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBWSREP_SST_MYSQLDUMP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/wsrep_sst_rsync.1 b/man/wsrep_sst_rsync.1
index 95a80b20821..aa0a492d7c3 100644
--- a/man/wsrep_sst_rsync.1
+++ b/man/wsrep_sst_rsync.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBWSREP_SST_RSYNC\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBWSREP_SST_RSYNC\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/wsrep_sst_xtrabackup-v2.1 b/man/wsrep_sst_xtrabackup-v2.1
index d61ce803b93..10352be2c1b 100644
--- a/man/wsrep_sst_xtrabackup-v2.1
+++ b/man/wsrep_sst_xtrabackup-v2.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBWSREP_SST_XTRABACKUP-V2\FR" "1" "26 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBWSREP_SST_XTRABACKUP-V2\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/wsrep_sst_xtrabackup.1 b/man/wsrep_sst_xtrabackup.1
index 9644a29c4ca..ddbd8c7f6ec 100644
--- a/man/wsrep_sst_xtrabackup.1
+++ b/man/wsrep_sst_xtrabackup.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBWSREP_SST_XTRABACKUP\FR" "1" "24 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
+.TH "\FBWSREP_SST_XTRABACKUP\FR" "1" "3 April 2017" "MariaDB 10\&.2" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index 8b997e8b096..12c0095e80e 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -246,7 +246,7 @@ my @mysqld_rules=
{ '#host' => \&fix_host },
{ 'port' => \&fix_port },
{ 'socket' => \&fix_socket },
- { '#log-error' => \&fix_log_error },
+ { 'log-error' => \&fix_log_error },
{ 'general-log' => 1 },
{ 'plugin-dir' => sub { $::plugindir } },
{ 'general-log-file' => \&fix_log },
@@ -394,7 +394,7 @@ sub post_check_embedded_group {
my %no_copy = map { $_ => 1 }
(
- '#log-error', # Embedded server writes stderr to mysqltest's log file
+ 'log-error', # Embedded server writes stderr to mysqltest's log file
'slave-net-timeout', # Embedded server are not build with replication
'shared-memory-base-name', # No shared memory for embedded
);
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 05169b23531..0b61bfc9b78 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2759,7 +2759,7 @@ sub mysql_server_start($) {
# Already started
# Write start of testcase to log file
- mark_log($mysqld->value('#log-error'), $tinfo);
+ mark_log($mysqld->value('log-error'), $tinfo);
return;
}
@@ -2816,7 +2816,7 @@ sub mysql_server_start($) {
mkpath($tmpdir) unless -d $tmpdir;
# Write start of testcase to log file
- mark_log($mysqld->value('#log-error'), $tinfo);
+ mark_log($mysqld->value('log-error'), $tinfo);
# Run <tname>-master.sh
if ($mysqld->option('#!run-master-sh') and
@@ -4261,7 +4261,7 @@ sub get_log_from_proc ($$) {
foreach my $mysqld (all_servers()) {
if ($mysqld->{proc} eq $proc) {
- my @srv_lines= extract_server_log($mysqld->if_exist('#log-error'), $name);
+ my @srv_lines= extract_server_log($mysqld->if_exist('log-error'), $name);
$srv_log= "\nServer log from this test:\n" .
"----------SERVER LOG START-----------\n". join ("", @srv_lines) .
"----------SERVER LOG END-------------\n";
@@ -4468,7 +4468,7 @@ sub start_check_warnings ($$) {
my $name= "warnings-".$mysqld->name();
- my $log_error= $mysqld->value('#log-error');
+ my $log_error= $mysqld->value('log-error');
# To be communicated to the test
$ENV{MTR_LOG_ERROR}= $log_error;
extract_warning_lines($log_error, 0);
@@ -4626,7 +4626,7 @@ sub check_warnings_post_shutdown {
foreach my $mysqld ( mysqlds())
{
my ($testlist, $match_lines)=
- extract_warning_lines($mysqld->value('#log-error'), 1);
+ extract_warning_lines($mysqld->value('log-error'), 1);
$testname_hash->{$_}= 1 for @$testlist;
$report.= join('', @$match_lines);
}
@@ -5075,7 +5075,7 @@ sub mysqld_start ($$) {
# Remove the old pidfile if any
unlink($mysqld->value('pid-file'));
- my $output= $mysqld->value('#log-error');
+ my $output= $mysqld->value('log-error');
if ( $opt_valgrind and $opt_debug )
{
diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index 54184f8aba1..207df07f083 100644
--- a/mysql-test/r/cte_nonrecursive.result
+++ b/mysql-test/r/cte_nonrecursive.result
@@ -961,3 +961,26 @@ 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 with alias1 as (select 1 AS `one`), alias2 as (select 2 AS `two`)select `alias1`.`one` AS `one`,`alias2`.`two` AS `two` from (`alias1` join `alias2`) latin1 latin1_swedish_ci
drop view v1;
+#
+# MDEV-12440: the same CTE table is used in twice
+#
+create table t1 (a int, b varchar(32));
+insert into t1 values
+(4,'aaaa' ), (7,'bb'), (1,'ccc'), (4,'dd');
+# cte2 is used in the main query and in the spec for ct3
+with
+cte1 as (select * from t1 where b >= 'c'),
+cte2 as (select * from cte1 where a < 7),
+cte3 as (select * from cte2 where a > 1)
+select * from cte2, cte3 where cte2.a = cte3.a;
+a b a b
+4 dd 4 dd
+# cte2 is used twice in the spec for ct3
+with
+cte1 as (select * from t1 where b >= 'b'),
+cte2 as (select * from cte1 where b > 'c'),
+cte3 as (select * from cte2 where a > 1 union select * from cte2 where a > 1)
+select * from cte3;
+a b
+4 dd
+drop table t1;
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index cb2f93dec30..d74cfd4dd3f 100644
--- a/mysql-test/r/ctype_utf8mb4.result
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -2387,7 +2387,7 @@ PRIMARY KEY (clipid),
KEY tape(Tape(255))
) CHARACTER SET=utf8mb4;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Note 1071 Specified key was too long; max key length is 1000 bytes
ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result
index 28ed7ed313d..11d89154269 100644
--- a/mysql-test/r/ctype_utf8mb4_innodb.result
+++ b/mysql-test/r/ctype_utf8mb4_innodb.result
@@ -2347,7 +2347,7 @@ PRIMARY KEY (clipid),
KEY tape(Tape(255))
) CHARACTER SET=utf8mb4 ENGINE InnoDB;
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result
index 2c798102e50..ef7bda0a79b 100644
--- a/mysql-test/r/ctype_utf8mb4_myisam.result
+++ b/mysql-test/r/ctype_utf8mb4_myisam.result
@@ -2347,7 +2347,7 @@ PRIMARY KEY (clipid),
KEY tape(Tape(255))
) CHARACTER SET=utf8mb4 ENGINE MyISAM;
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Note 1071 Specified key was too long; max key length is 1000 bytes
ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/r/gis-debug.result b/mysql-test/r/gis-debug.result
index 0f63509bb99..889ee5c9513 100644
--- a/mysql-test/r/gis-debug.result
+++ b/mysql-test/r/gis-debug.result
@@ -352,3 +352,56 @@ Note 1105 DBUG: types_compatible=yes bisect=yes
DROP TABLE t1;
SET SESSION debug_dbug="-d,Predicant_to_list_comparator";
SET SESSION debug_dbug="-d,Item_func_in";
+#
+# MDEV-12238 Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
+#
+SET debug_dbug='+d,num_op';
+CREATE TABLE t1 AS SELECT
+POINT(0,0)+POINT(0,0),
+POINT(0,0)-POINT(0,0),
+POINT(0,0)*POINT(0,0),
+POINT(0,0)/POINT(0,0),
+POINT(0,0) MOD POINT(0,0) LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `POINT(0,0)+POINT(0,0)` geometry DEFAULT NULL,
+ `POINT(0,0)-POINT(0,0)` geometry DEFAULT NULL,
+ `POINT(0,0)*POINT(0,0)` geometry DEFAULT NULL,
+ `POINT(0,0)/POINT(0,0)` geometry DEFAULT NULL,
+ `POINT(0,0) MOD POINT(0,0)` geometry DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+POINT(0,0)+'0',
+POINT(0,0)-'0',
+POINT(0,0)*'0',
+POINT(0,0)/'0',
+POINT(0,0) MOD '0' LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `POINT(0,0)+'0'` longtext DEFAULT NULL,
+ `POINT(0,0)-'0'` longtext DEFAULT NULL,
+ `POINT(0,0)*'0'` longtext DEFAULT NULL,
+ `POINT(0,0)/'0'` longtext DEFAULT NULL,
+ `POINT(0,0) MOD '0'` longtext DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT
+'0'+POINT(0,0),
+'0'*POINT(0,0) LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `'0'+POINT(0,0)` longtext DEFAULT NULL,
+ `'0'*POINT(0,0)` longtext DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT '0'-POINT(0,0) LIMIT 0;
+ERROR HY000: Illegal parameter data types varchar and geometry for operation '-'
+CREATE TABLE t1 AS SELECT '0'/POINT(0,0) LIMIT 0;
+ERROR HY000: Illegal parameter data types varchar and geometry for operation '/'
+CREATE TABLE t1 AS SELECT '0' MOD POINT(0,0) LIMIT 0;
+ERROR HY000: Illegal parameter data types varchar and geometry for operation '%'
+SET debug_dbug='-d,num_op';
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index ea1736d7aa3..e7132331806 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -3837,5 +3837,70 @@ SELECT LENGTH(CAST(COALESCE(a) AS BINARY)) FROM t1;
LENGTH(CAST(COALESCE(a) AS BINARY))
DROP TABLE t1;
#
+# MDEV-12238 Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
+#
+CREATE TABLE t1 (a GEOMETRY);
+SELECT POINT(1,1) + 1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '+'
+SELECT POINT(1,1) - 1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '-'
+SELECT POINT(1,1) * 1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '*'
+SELECT POINT(1,1) / 1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '/'
+SELECT POINT(1,1) MOD 1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '%'
+SELECT 1 + POINT(1,1);
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '+'
+SELECT 1 - POINT(1,1);
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '-'
+SELECT 1 * POINT(1,1);
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '*'
+SELECT 1 / POINT(1,1);
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '/'
+SELECT 1 MOD POINT(1,1);
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '%'
+SELECT a + 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '+'
+SELECT a - 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '-'
+SELECT a * 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '*'
+SELECT a / 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '/'
+SELECT a MOD 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '%'
+SELECT 1 + a FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '+'
+SELECT 1 - a FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '-'
+SELECT 1 * a FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '*'
+SELECT 1 / a FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '/'
+SELECT 1 MOD a FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '%'
+SELECT COALESCE(a) + 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '+'
+SELECT COALESCE(a) - 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '-'
+SELECT COALESCE(a) * 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '*'
+SELECT COALESCE(a) / 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '/'
+SELECT COALESCE(a) MOD 1 FROM t1;
+ERROR HY000: Illegal parameter data types geometry and bigint for operation '%'
+SELECT 1 + COALESCE(a) FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '+'
+SELECT 1 - COALESCE(a) FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '-'
+SELECT 1 * COALESCE(a) FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '*'
+SELECT 1 / COALESCE(a) FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '/'
+SELECT 1 MOD COALESCE(a) FROM t1;
+ERROR HY000: Illegal parameter data types bigint and geometry for operation '%'
+DROP TABLE t1;
+#
# End of 10.3 tests
#
diff --git a/mysql-test/r/partition_default.result b/mysql-test/r/partition_default.result
index 2833d92de32..bb0a5d4061b 100644
--- a/mysql-test/r/partition_default.result
+++ b/mysql-test/r/partition_default.result
@@ -921,9 +921,6 @@ explain partitions select * from t1 where a=10 and b=10;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
alter table t1 drop partition p2;
-ERROR HY000: Table has no partition for value 2
-delete from t1 where a=2;
-alter table t1 drop partition p2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -1069,9 +1066,6 @@ explain partitions select * from t1 where a=10 and b=10;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
alter table t1 drop partition p2;
-ERROR HY000: Table has no partition for value from column_list
-delete from t1 where a=2;
-alter table t1 drop partition p2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -1125,10 +1119,10 @@ alter table t1 add partition
(partition p0 VALUES IN (2,3));
select partition_name, table_rows from INFORMATION_SCHEMA.PARTITIONS where table_name='t1';
partition_name table_rows
-p0 2
+p0 0
p1 1
p2 1
-pd 0
+pd 2
drop table t1;
create table t1 (a int, b int)
PARTITION BY LIST COLUMNS(a,b)
@@ -1233,3 +1227,41 @@ select * from t1 where i is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
drop table t1;
+#
+# MDEV-12395: DROP PARTITION does not work as expected when
+# table has DEFAULT LIST partition
+#
+CREATE TABLE t1 (i INT)
+PARTITION BY LIST (i)
+(PARTITION p VALUES IN (1,2,3,4),
+PARTITION pdef DEFAULT);
+INSERT INTO t1 VALUES (1),(10);
+ALTER TABLE t1 DROP PARTITION p;
+SELECT * FROM t1;
+i
+10
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY LIST (i)
+(PARTITION pdef DEFAULT ENGINE = MyISAM)
+DROP TABLE t1;
+CREATE TABLE t1 (i INT)
+PARTITION BY LIST (i)
+(PARTITION p VALUES IN (1,2,3,4),
+PARTITION pdef DEFAULT);
+INSERT INTO t1 VALUES (1),(10);
+ALTER TABLE t1 DROP PARTITION pdef;
+SELECT * FROM t1;
+i
+1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY LIST (i)
+(PARTITION p VALUES IN (1,2,3,4) ENGINE = MyISAM)
+DROP TABLE t1;
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index b2fe974acdb..569ba65df3f 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -373,7 +373,7 @@ create table t1 (a text, unique (a(2100)));
ERROR 42000: Specified key was too long; max key length is 1000 bytes
create table t1 (a text, key (a(2100)));
Warnings:
-Warning 1071 Specified key was too long; max key length is 1000 bytes
+Note 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 9c0732a81b0..f11ac3183fc 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -5954,6 +5954,43 @@ a
2
DROP VIEW v1;
DROP TABLE t1;
+#
+# MDEV-8642: WHERE Clause not applied on View - Empty result set returned
+#
+CREATE TABLE `t1` (
+`id` int(20) NOT NULL AUTO_INCREMENT,
+`use_case` int(11) DEFAULT NULL,
+`current_deadline` date DEFAULT NULL,
+`ts_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+UNIQUE KEY `id_UNIQUE` (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=13976 DEFAULT CHARSET=latin1;
+INSERT INTO `t1` VALUES (1,10,'2015-12-18','2015-08-18 08:38:16');
+INSERT INTO `t1` VALUES (2,20,'2015-10-18','2015-08-18 08:43:30');
+CREATE VIEW v1 AS SELECT
+use_case as use_case_id,
+(
+SELECT
+deadline_sub.current_deadline
+FROM
+t1 deadline_sub
+WHERE
+deadline_sub.use_case = use_case_id
+AND ts_create = (SELECT
+MIN(ts_create)
+FROM
+t1 startdate_sub
+WHERE
+startdate_sub.use_case = use_case_id
+)
+) AS InitialDeadline
+FROM
+t1;
+SELECT * FROM v1 where use_case_id = 10;
+use_case_id InitialDeadline
+10 2015-12-18
+drop view v1;
+drop table t1;
# -----------------------------------------------------------------
# -- End of 10.0 tests.
# -----------------------------------------------------------------
@@ -6429,5 +6466,18 @@ ERROR HY000: Can not modify more than one base table through a join view 'test.v
drop view v;
drop table t1,t2,t3;
#
+# MDEV-12379: Server crashes in TABLE_LIST::is_with_table on
+# SHOW CREATE VIEW
+#
+CREATE TABLE t (i INT);
+CREATE VIEW v AS SELECT * FROM ( SELECT * FROM t ) sq;
+DROP TABLE IF EXISTS t;
+SHOW CREATE VIEW v;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `sq`.`i` AS `i` from (select `test`.`t`.`i` AS `i` from `test`.`t`) `sq` latin1 latin1_swedish_ci
+Warnings:
+Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+DROP VIEW v;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result
new file mode 100644
index 00000000000..304bc865f75
--- /dev/null
+++ b/mysql-test/suite/innodb/r/alter_table.result
@@ -0,0 +1,13 @@
+set @@sql_mode=strict_trans_tables;
+create table t1(a text not null) row_format=dynamic engine=innodb;
+create index idx1 on t1(a(3073));
+Warnings:
+Note 1071 Specified key was too long; max key length is 3072 bytes
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text NOT NULL,
+ KEY `idx1` (`a`(3072))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+drop table t1;
+set @@sql_mode=default;
diff --git a/mysql-test/suite/innodb/r/innodb-32k-crash.result b/mysql-test/suite/innodb/r/innodb-32k-crash.result
index d0bc25968c6..83b8054831a 100644
--- a/mysql-test/suite/innodb/r/innodb-32k-crash.result
+++ b/mysql-test/suite/innodb/r/innodb-32k-crash.result
@@ -119,7 +119,6 @@ BEGIN;
INSERT INTO t1 SELECT * from t2;
BEGIN;
UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
-# Kill and restart
UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f,f=@f,g=@f,h=@f,i=@f,j=@f,
k=@f,l=@f,m=@f,n=@f,o=@f,p=@f,q=@f,r=@f,s=@f,t=@f,u=@f,
v=@f,w=@f,x=@b,y=@f,z=@f,
diff --git a/mysql-test/suite/innodb/r/innodb-64k-crash.result b/mysql-test/suite/innodb/r/innodb-64k-crash.result
index bfeec58bda9..138ad5345ed 100644
--- a/mysql-test/suite/innodb/r/innodb-64k-crash.result
+++ b/mysql-test/suite/innodb/r/innodb-64k-crash.result
@@ -271,7 +271,6 @@ vb=@c,wb=@c,xb=@c,yb=@c,zb=@c,
ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c,
kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
-# Kill and restart
UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e,
k=@e,l=@e,m=@e,n=@e,o=@e,p=@e,q=@e,r=@e,s=@e,t=@e,u=@e,
v=@e,w=@e,x=@e,y=@e,z=@e,
diff --git a/mysql-test/suite/innodb/r/innodb-alter-debug.result b/mysql-test/suite/innodb/r/innodb-alter-debug.result
new file mode 100644
index 00000000000..d580a641d81
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-debug.result
@@ -0,0 +1,61 @@
+SET NAMES utf8;
+CREATE TABLE â‘  (
+c1 INT PRIMARY KEY, c2 INT DEFAULT 1, ct TEXT, INDEX(c2))
+ENGINE = InnoDB;
+CREATE TABLE t1ć (c1 INT PRIMARY KEY, c2 INT, INDEX(c2),
+CONSTRAINT t1c2 FOREIGN KEY (c2) REFERENCES â‘ (c2))
+ENGINE=InnoDB;
+INSERT INTO â‘  SET c1 = 1;
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
+SET DEBUG_DBUG = '+d,ib_drop_foreign_error';
+ALTER TABLE t1ć DROP FOREIGN KEY t1c2, RENAME TO ②;
+ERROR HY000: The table 't1ć' is full
+SET DEBUG_DBUG = @saved_debug_dbug;
+SET DEBUG_DBUG = '+d,ib_rename_column_error';
+ALTER TABLE â‘  CHANGE c2 Å¡ INT;
+ERROR HY000: The table 'â‘ ' is full
+SET DEBUG_DBUG = @saved_debug_dbug;
+SHOW CREATE TABLE t1ć;
+Table Create Table
+t1ć CREATE TABLE `t1ć` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ KEY `c2` (`c2`),
+ CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `â‘ ` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1ć, ①;
+#
+# Bug #21364096 THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL
+# WITH INCORRECT KEY NAME
+create table t1 (id int auto_increment primary key, a int, unique key uk(a))
+engine = innodb;
+insert into t1 select 1, 1;
+insert into t1 select 2, 2;
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+alter table t1 add b int, ALGORITHM=inplace;
+/* connection con1 */
+connect con1,localhost,root,,;
+SET DEBUG_SYNC = 'now WAIT_FOR s1';
+insert into t1 select NULL, 1;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'now SIGNAL s2';
+/* connection default */
+connection default;
+/* reap */ alter table t1 add b int, ALGORITHM=inplace;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+alter table t1 add b int, ALGORITHM=inplace;;
+/* connection con1 */
+connection con1;
+set DEBUG_SYNC = 'now WAIT_FOR s1';
+update t1 set a=1 where id=2;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'now SIGNAL s2';
+disconnect con1;
+/* connection default */
+connection default;
+/* reap */ alter table t1 add b int, ALGORITHM=inplace;
+ERROR 23000: Duplicate entry '1' for key 'uk'
+SET DEBUG_SYNC = 'RESET';
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-nullable.result b/mysql-test/suite/innodb/r/innodb-alter-nullable.result
new file mode 100644
index 00000000000..7048f49f4a2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-nullable.result
@@ -0,0 +1,59 @@
+CREATE TABLE t (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9);
+ALTER TABLE t CHANGE c1 c1 INT NULL FIRST, ALGORITHM=INPLACE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+set @old_sql_mode = @@sql_mode;
+set @@sql_mode = 'STRICT_TRANS_TABLES';
+ALTER TABLE t MODIFY c3 INT NOT NULL, ALGORITHM=INPLACE;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+set @@sql_mode = @old_sql_mode;
+ALTER TABLE t CHANGE c2 c2 INT, CHANGE c2 c2 INT NOT NULL;
+ERROR 42S22: Unknown column 'c2' in 't'
+ALTER TABLE t MODIFY c2 INT, MODIFY c2 INT NOT NULL;
+ERROR 42S22: Unknown column 'c2' in 't'
+ALTER TABLE t MODIFY c2 INT UNSIGNED, MODIFY c2 INT;
+ERROR 42S22: Unknown column 'c2' in 't'
+ALTER TABLE t MODIFY c2 CHAR(1) NOT NULL, MODIFY c2 INT NOT NULL;
+ERROR 42S22: Unknown column 'c2' in 't'
+ALTER TABLE t CHANGE c2 c2 INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t MODIFY c2 INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+connect con1,localhost,root,,;
+connection con1;
+SET SQL_MODE='STRICT_ALL_TABLES';
+UPDATE t SET c2=NULL;
+ERROR 23000: Column 'c2' cannot be null
+SELECT * FROM t;
+c1 c2 c3
+1 2 3
+4 5 6
+7 8 9
+connection default;
+ALTER TABLE t MODIFY c2 INT, ALGORITHM=INPLACE;
+connection con1;
+BEGIN;
+UPDATE t SET c2=NULL;
+SELECT * FROM t;
+c1 c2 c3
+1 NULL 3
+4 NULL 6
+7 NULL 9
+ROLLBACK;
+SELECT * FROM t;
+c1 c2 c3
+1 2 3
+4 5 6
+7 8 9
+disconnect con1;
+connection default;
+ALTER TABLE t MODIFY c2 INT NULL, ALGORITHM=INPLACE;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
+WHERE NAME='test/t';
+TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
+# test/t 33 6 # Barracuda Dynamic 0 Single
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 1b62854efef..2ce73304281 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -2543,11 +2543,11 @@ Warning 1071 Specified key was too long; max key length is 767 bytes
create table t3 (col1 text, index(col1(768)))
character set = latin1 engine = innodb;
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
create table t4 (col1 blob, index(col1(768)))
character set = latin1 engine = innodb;
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
SET GLOBAL innodb_large_prefix=default;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb_defragment.result b/mysql-test/suite/innodb/r/innodb_defragment.result
index c42cbd972f8..989d3ef3397 100644
--- a/mysql-test/suite/innodb/r/innodb_defragment.result
+++ b/mysql-test/suite/innodb/r/innodb_defragment.result
@@ -1,4 +1,3 @@
-DROP TABLE if exists t1;
set global innodb_defragment_stats_accuracy = 80;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
optimize table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defragment_small.result b/mysql-test/suite/innodb/r/innodb_defragment_small.result
new file mode 100644
index 00000000000..7471c84bb44
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defragment_small.result
@@ -0,0 +1,29 @@
+SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
+SET GLOBAL innodb_defragment = 1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
+#
+# MDEV-12198 innodb_defragment=1 crashes server on
+# OPTIMIZE TABLE when FULLTEXT index exists
+#
+CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
+CREATE TABLE t1 (c POINT PRIMARY KEY, SPATIAL INDEX(c)) ENGINE=InnoDB;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+DROP TABLE t1;
+SET GLOBAL innodb_defragment = @innodb_defragment_orig;
diff --git a/mysql-test/suite/innodb/t/alter_table.test b/mysql-test/suite/innodb/t/alter_table.test
new file mode 100644
index 00000000000..13fb574972a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/alter_table.test
@@ -0,0 +1,10 @@
+--source include/have_innodb.inc
+#
+# MDEV-11995 ALTER TABLE proceeds despite reporting ER_TOO_LONG_KEY error
+#
+set @@sql_mode=strict_trans_tables;
+create table t1(a text not null) row_format=dynamic engine=innodb;
+create index idx1 on t1(a(3073));
+show create table t1;
+drop table t1;
+set @@sql_mode=default;
diff --git a/mysql-test/suite/innodb/t/innodb-32k-crash.test b/mysql-test/suite/innodb/t/innodb-32k-crash.test
index c77e44ce9d6..b510c115dab 100644
--- a/mysql-test/suite/innodb/t/innodb-32k-crash.test
+++ b/mysql-test/suite/innodb/t/innodb-32k-crash.test
@@ -144,7 +144,9 @@ INSERT INTO t1 SELECT * from t2;
BEGIN;
UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
---source include/kill_and_restart_mysqld.inc
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+--let $shutdown_timeout=
UPDATE t1 SET a=@f,b=@f,c=@f,d=@f,e=@f,f=@f,g=@f,h=@f,i=@f,j=@f,
k=@f,l=@f,m=@f,n=@f,o=@f,p=@f,q=@f,r=@f,s=@f,t=@f,u=@f,
diff --git a/mysql-test/suite/innodb/t/innodb-64k-crash.test b/mysql-test/suite/innodb/t/innodb-64k-crash.test
index 78f14d539a5..8139b7ce4e4 100644
--- a/mysql-test/suite/innodb/t/innodb-64k-crash.test
+++ b/mysql-test/suite/innodb/t/innodb-64k-crash.test
@@ -300,7 +300,9 @@ UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c,
vc=@c,wc=@c,xc=@c,yc=@c,zc=@c;
---source include/kill_and_restart_mysqld.inc
+--let $shutdown_timeout=0
+--source include/restart_mysqld.inc
+--let $shutdown_timeout=
UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e,
k=@e,l=@e,m=@e,n=@e,o=@e,p=@e,q=@e,r=@e,s=@e,t=@e,u=@e,
diff --git a/mysql-test/suite/innodb/t/innodb-alter-debug.test b/mysql-test/suite/innodb/t/innodb-alter-debug.test
new file mode 100644
index 00000000000..70017ffba35
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-alter-debug.test
@@ -0,0 +1,79 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+
+--source include/count_sessions.inc
+
+SET NAMES utf8;
+
+CREATE TABLE â‘  (
+ c1 INT PRIMARY KEY, c2 INT DEFAULT 1, ct TEXT, INDEX(c2))
+ENGINE = InnoDB;
+
+CREATE TABLE t1ć (c1 INT PRIMARY KEY, c2 INT, INDEX(c2),
+ CONSTRAINT t1c2 FOREIGN KEY (c2) REFERENCES â‘ (c2))
+ENGINE=InnoDB;
+
+INSERT INTO â‘  SET c1 = 1;
+
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
+SET DEBUG_DBUG = '+d,ib_drop_foreign_error';
+--error ER_RECORD_FILE_FULL
+ALTER TABLE t1ć DROP FOREIGN KEY t1c2, RENAME TO ②;
+SET DEBUG_DBUG = @saved_debug_dbug;
+
+SET DEBUG_DBUG = '+d,ib_rename_column_error';
+--error ER_RECORD_FILE_FULL
+ALTER TABLE â‘  CHANGE c2 Å¡ INT;
+SET DEBUG_DBUG = @saved_debug_dbug;
+
+SHOW CREATE TABLE t1ć;
+
+DROP TABLE t1ć, ①;
+
+--echo #
+--echo # Bug #21364096 THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL
+--echo # WITH INCORRECT KEY NAME
+
+create table t1 (id int auto_increment primary key, a int, unique key uk(a))
+engine = innodb;
+insert into t1 select 1, 1;
+insert into t1 select 2, 2;
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+--send alter table t1 add b int, ALGORITHM=inplace
+
+--echo /* connection con1 */
+connect (con1,localhost,root,,);
+SET DEBUG_SYNC = 'now WAIT_FOR s1';
+--error ER_DUP_ENTRY
+insert into t1 select NULL, 1;
+SET DEBUG_SYNC = 'now SIGNAL s2';
+
+--echo /* connection default */
+connection default;
+--echo /* reap */ alter table t1 add b int, ALGORITHM=inplace;
+--error ER_DUP_ENTRY
+--reap
+
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
+--send alter table t1 add b int, ALGORITHM=inplace;
+
+--echo /* connection con1 */
+connection con1;
+set DEBUG_SYNC = 'now WAIT_FOR s1';
+--error ER_DUP_ENTRY
+update t1 set a=1 where id=2;
+SET DEBUG_SYNC = 'now SIGNAL s2';
+disconnect con1;
+
+--echo /* connection default */
+connection default;
+--echo /* reap */ alter table t1 add b int, ALGORITHM=inplace;
+--error ER_DUP_ENTRY
+--reap
+SET DEBUG_SYNC = 'RESET';
+
+drop table t1;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb-alter-nullable.test b/mysql-test/suite/innodb/t/innodb-alter-nullable.test
new file mode 100644
index 00000000000..3f1e82b3183
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-alter-nullable.test
@@ -0,0 +1,76 @@
+--source include/have_innodb.inc
+
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+CREATE TABLE t (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9);
+
+--enable_info
+# This one will be a no-op.
+# MySQL should perhaps issue an error, because it refuses to modify
+# the PRIMARY KEY column c1 from NOT NULL to NULL.
+ALTER TABLE t CHANGE c1 c1 INT NULL FIRST, ALGORITHM=INPLACE;
+
+# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on.
+--disable_info
+set @old_sql_mode = @@sql_mode;
+set @@sql_mode = 'STRICT_TRANS_TABLES';
+--enable_info
+ALTER TABLE t MODIFY c3 INT NOT NULL, ALGORITHM=INPLACE;
+--disable_info
+set @@sql_mode = @old_sql_mode;
+--enable_info
+
+# Request some conflicting changes for a single column.
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t CHANGE c2 c2 INT, CHANGE c2 c2 INT NOT NULL;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t MODIFY c2 INT, MODIFY c2 INT NOT NULL;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t MODIFY c2 INT UNSIGNED, MODIFY c2 INT;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t MODIFY c2 CHAR(1) NOT NULL, MODIFY c2 INT NOT NULL;
+
+# No-ops.
+ALTER TABLE t CHANGE c2 c2 INT NOT NULL;
+ALTER TABLE t MODIFY c2 INT NOT NULL;
+--disable_info
+
+connect (con1,localhost,root,,);
+connection con1;
+
+SET SQL_MODE='STRICT_ALL_TABLES';
+
+--error ER_BAD_NULL_ERROR
+UPDATE t SET c2=NULL;
+
+SELECT * FROM t;
+
+connection default;
+
+# This should change the column to NULL.
+ALTER TABLE t MODIFY c2 INT, ALGORITHM=INPLACE;
+
+connection con1;
+BEGIN;
+UPDATE t SET c2=NULL;
+SELECT * FROM t;
+ROLLBACK;
+SELECT * FROM t;
+
+disconnect con1;
+connection default;
+
+# This should be no-op.
+ALTER TABLE t MODIFY c2 INT NULL, ALGORITHM=INPLACE;
+
+--replace_column 1 # 5 #
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
+WHERE NAME='test/t';
+
+DROP TABLE t;
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb_defragment-master.opt b/mysql-test/suite/innodb/t/innodb_defragment-master.opt
deleted file mode 100644
index 6fc7f343b24..00000000000
--- a/mysql-test/suite/innodb/t/innodb_defragment-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---innodb_file_per_table
---innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defragment.opt b/mysql-test/suite/innodb/t/innodb_defragment.opt
index 6426bac41a0..aea3d480c24 100644
--- a/mysql-test/suite/innodb/t/innodb_defragment.opt
+++ b/mysql-test/suite/innodb/t/innodb_defragment.opt
@@ -1,4 +1,5 @@
--loose-innodb-buffer-pool-stats
--loose-innodb-buffer-page
--loose-innodb-buffer-page-lru
+--innodb-file-per-table
--innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defragment.test b/mysql-test/suite/innodb/t/innodb_defragment.test
index 22b72a4aa6b..d9f5f56316e 100644
--- a/mysql-test/suite/innodb/t/innodb_defragment.test
+++ b/mysql-test/suite/innodb/t/innodb_defragment.test
@@ -1,17 +1,7 @@
--source include/have_innodb.inc
--source include/big_test.inc
---source include/not_valgrind.inc
--source include/not_embedded.inc
---disable_warnings
-DROP TABLE if exists t1;
---enable_warnings
-
---disable_query_log
-let $innodb_defragment_n_pages_orig=`select @@innodb_defragment_n_pages`;
-let $innodb_defragment_stats_accuracy_orig=`select @@innodb_defragment_stats_accuracy`;
---enable_query_log
-
set global innodb_defragment_stats_accuracy = 80;
# Create table.
@@ -47,12 +37,14 @@ delimiter ;//
# Populate table.
let $i = $data_size;
--disable_query_log
+BEGIN;
while ($i)
{
eval
INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256));
dec $i;
}
+COMMIT;
--enable_query_log
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
@@ -161,10 +153,3 @@ select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like
DROP PROCEDURE defragment;
DROP TABLE t1;
-
-# reset system
---disable_query_log
-EVAL SET GLOBAL innodb_defragment_n_pages = $innodb_defragment_n_pages_orig;
-EVAL SET GLOBAL innodb_defragment_stats_accuracy = $innodb_defragment_stats_accuracy_orig;
---enable_query_log
-
diff --git a/mysql-test/suite/innodb/t/innodb_defragment_small.test b/mysql-test/suite/innodb/t/innodb_defragment_small.test
new file mode 100644
index 00000000000..8500c173af7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment_small.test
@@ -0,0 +1,32 @@
+--source include/have_innodb.inc
+
+SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
+SET GLOBAL innodb_defragment = 1;
+
+# Small tests copied from innodb.innodb_defragment
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256), KEY(a, b)) ENGINE=INNODB;
+OPTIMIZE TABLE t1;
+
+INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
+
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-12198 innodb_defragment=1 crashes server on
+--echo # OPTIMIZE TABLE when FULLTEXT index exists
+--echo #
+
+CREATE TABLE t1 (c TEXT, FULLTEXT KEY (c)) ENGINE=InnoDB;
+
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c POINT PRIMARY KEY, SPATIAL INDEX(c)) ENGINE=InnoDB;
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+SET GLOBAL innodb_defragment = @innodb_defragment_orig;
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix.result b/mysql-test/suite/innodb_zip/r/index_large_prefix.result
index 4e57b27dec8..df177e8ea2a 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix.result
@@ -101,7 +101,7 @@ create index idx1 on worklog5743_1(a2(4000));
Got one of the listed errors
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
set global innodb_large_prefix=1;
Warnings:
@@ -110,7 +110,7 @@ create index idx2 on worklog5743_1(a2(4000));
Got one of the listed errors
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_1(a2(436));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -134,10 +134,10 @@ Warning 131 Using innodb_large_prefix is deprecated and the parameter may be rem
SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
@@ -145,7 +145,7 @@ create index idx2 on worklog5743_2(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_2(a2(948));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -168,10 +168,10 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_4(a2(4000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
@@ -179,7 +179,7 @@ create index idx2 on worklog5743_4(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_4(a2(1972));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -202,19 +202,19 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_8(a2(1000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx2 on worklog5743_8(a2(3073));
Warnings:
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743_8(a2(3072));
Warnings:
Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release
@@ -242,19 +242,19 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_16(a2(1000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx2 on worklog5743_16(a2(3073));
Warnings:
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743_16(a2(3072));
Warnings:
Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release
@@ -508,7 +508,7 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC;
SET sql_mode='';
create index idx1 on worklog5743(a(3073));
Warnings:
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx2 on worklog5743(a(3072));
Warnings:
Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release
diff --git a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
index 20deee57d46..5be18b84065 100644
--- a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
@@ -106,7 +106,7 @@ create index idx1 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
set global innodb_large_prefix=1;
Warnings:
@@ -115,7 +115,7 @@ create index idx2 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_1(a2(436));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -138,10 +138,10 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_2(a2(4000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
@@ -149,7 +149,7 @@ create index idx2 on worklog5743_2(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_2(a2(948));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -172,10 +172,10 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_4(a2(4000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
@@ -183,7 +183,7 @@ create index idx2 on worklog5743_4(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_4(a2(1972));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -206,19 +206,19 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_8(a2(1000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx2 on worklog5743_8(a2(3073));
Warnings:
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743_8(a2(3072));
Warnings:
Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release
@@ -246,19 +246,19 @@ Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx1 on worklog5743_16(a2(1000));
Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 767 bytes
+Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1;
Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create index idx2 on worklog5743_16(a2(3073));
Warnings:
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
show warnings;
Level Code Message
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743_16(a2(3072));
Warnings:
Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release
@@ -510,7 +510,7 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC;
set statement sql_mode = '' for
create index idx1 on worklog5743(a(3073));
Warnings:
-Warning 1071 Specified key was too long; max key length is 3072 bytes
+Note 1071 Specified key was too long; max key length is 3072 bytes
create index idx2 on worklog5743(a(3072));
Warnings:
Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release
diff --git a/mysql-test/suite/sys_vars/r/log_error_basic.result b/mysql-test/suite/sys_vars/r/log_error_basic.result
deleted file mode 100644
index c18d43762bf..00000000000
--- a/mysql-test/suite/sys_vars/r/log_error_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.log_error;
-@@global.log_error
-
-select @@session.log_error;
-ERROR HY000: Variable 'log_error' is a GLOBAL variable
-show global variables like 'log_error';
-Variable_name Value
-log_error
-show session variables like 'log_error';
-Variable_name Value
-log_error
-select * from information_schema.global_variables where variable_name='log_error';
-VARIABLE_NAME VARIABLE_VALUE
-LOG_ERROR
-select * from information_schema.session_variables where variable_name='log_error';
-VARIABLE_NAME VARIABLE_VALUE
-LOG_ERROR
-set global log_error=1;
-ERROR HY000: Variable 'log_error' is a read only variable
-set session log_error=1;
-ERROR HY000: Variable 'log_error' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_error_func.result b/mysql-test/suite/sys_vars/r/log_error_func.result
index c787c5ceb4f..39127951789 100644
--- a/mysql-test/suite/sys_vars/r/log_error_func.result
+++ b/mysql-test/suite/sys_vars/r/log_error_func.result
@@ -1,6 +1,6 @@
select (@err_log:=variable_value)*0 from information_schema.global_variables where variable_name="log_error";
(@err_log:=variable_value)*0
0
-select instr(@err_log, "some_random_name5435413.err")>0;
-instr(@err_log, "some_random_name5435413.err")>0
+select instr(@err_log, "mysqld.1.err")>0;
+instr(@err_log, "mysqld.1.err")>0
1
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 26f539685df..4f369b32dd5 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -1859,8 +1859,8 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_ERROR
SESSION_VALUE NULL
-GLOBAL_VALUE
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
diff --git a/mysql-test/suite/sys_vars/t/log_error_basic.test b/mysql-test/suite/sys_vars/t/log_error_basic.test
deleted file mode 100644
index 67bd33cb31b..00000000000
--- a/mysql-test/suite/sys_vars/t/log_error_basic.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# only global
-#
-select @@global.log_error;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.log_error;
-show global variables like 'log_error';
-show session variables like 'log_error';
-select * from information_schema.global_variables where variable_name='log_error';
-select * from information_schema.session_variables where variable_name='log_error';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global log_error=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session log_error=1;
diff --git a/mysql-test/suite/sys_vars/t/log_error_func.cnf b/mysql-test/suite/sys_vars/t/log_error_func.cnf
deleted file mode 100644
index 7a030b5518d..00000000000
--- a/mysql-test/suite/sys_vars/t/log_error_func.cnf
+++ /dev/null
@@ -1,5 +0,0 @@
-# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-
-[mysqld.1]
-log-error=some_random_name5435413
diff --git a/mysql-test/suite/sys_vars/t/log_error_func.test b/mysql-test/suite/sys_vars/t/log_error_func.test
index 1cd45a54ff7..926398a7d05 100644
--- a/mysql-test/suite/sys_vars/t/log_error_func.test
+++ b/mysql-test/suite/sys_vars/t/log_error_func.test
@@ -1,10 +1,13 @@
+# embedded .cnf doesn't have log-error option
+source include/not_embedded.inc;
+
# Test for BUG#51215 "log-error partially works with version 5.5"
# when --log-error is used without argument
# check displayed value. We can check only the base name, the rest
# depends on paths, symbolic links, --vardir, etc...
select (@err_log:=variable_value)*0 from information_schema.global_variables where variable_name="log_error";
-select instr(@err_log, "some_random_name5435413.err")>0;
+select instr(@err_log, "mysqld.1.err")>0;
# Check file's existence. The displayed value may be relative or not.
let $err_log=`select @err_log`;
diff --git a/mysql-test/suite/sys_vars/t/log_error_func2.cnf b/mysql-test/suite/sys_vars/t/log_error_func2.cnf
deleted file mode 100644
index ff7e8f7a101..00000000000
--- a/mysql-test/suite/sys_vars/t/log_error_func2.cnf
+++ /dev/null
@@ -1,5 +0,0 @@
-# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-
-[mysqld.1]
-log-error
diff --git a/mysql-test/suite/sys_vars/t/log_error_func2.opt b/mysql-test/suite/sys_vars/t/log_error_func2.opt
new file mode 100644
index 00000000000..4658d62af60
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_error_func2.opt
@@ -0,0 +1 @@
+--log-error
diff --git a/mysql-test/suite/sys_vars/t/log_error_func3.opt b/mysql-test/suite/sys_vars/t/log_error_func3.opt
new file mode 100644
index 00000000000..a236474f947
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_error_func3.opt
@@ -0,0 +1 @@
+--disable-log-error
diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test
index 700111d5507..bcdc06afbad 100644
--- a/mysql-test/t/cte_nonrecursive.test
+++ b/mysql-test/t/cte_nonrecursive.test
@@ -642,3 +642,27 @@ select * from v1;
show create view v1;
drop view v1;
+
+--echo #
+--echo # MDEV-12440: the same CTE table is used in twice
+--echo #
+
+create table t1 (a int, b varchar(32));
+insert into t1 values
+ (4,'aaaa' ), (7,'bb'), (1,'ccc'), (4,'dd');
+
+--echo # cte2 is used in the main query and in the spec for ct3
+with
+cte1 as (select * from t1 where b >= 'c'),
+cte2 as (select * from cte1 where a < 7),
+cte3 as (select * from cte2 where a > 1)
+select * from cte2, cte3 where cte2.a = cte3.a;
+
+--echo # cte2 is used twice in the spec for ct3
+with
+cte1 as (select * from t1 where b >= 'b'),
+cte2 as (select * from cte1 where b > 'c'),
+cte3 as (select * from cte2 where a > 1 union select * from cte2 where a > 1)
+select * from cte3;
+
+drop table t1; \ No newline at end of file
diff --git a/mysql-test/t/gis-debug.test b/mysql-test/t/gis-debug.test
index a34dd622312..588bc706370 100644
--- a/mysql-test/t/gis-debug.test
+++ b/mysql-test/t/gis-debug.test
@@ -46,3 +46,68 @@ DROP TABLE t1;
SET SESSION debug_dbug="-d,Predicant_to_list_comparator";
SET SESSION debug_dbug="-d,Item_func_in";
+
+
+--echo #
+--echo # MDEV-12238 Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
+--echo #
+
+# This tests is to check that operators '+' and '*' are commutative,
+# while operators '/', '-' and 'MOD' are not commutative.
+#
+# It forces substitution of type_aggregator_for_{plus|minus|mul|div|mod} to
+# type_aggregator_for_result / type_aggregator_non_commutative_test,
+# which have pairs:
+# (GEOMETRY,GEOMETRY)->GEOMETRY
+# (GEOMETRY,VARCHAR)->GEOMETRY
+# Note, they don't not have a pair:
+# (VARCHAR,GEOMETRY)->GEOMETRY
+#
+# Commutative operators should work for all these argument type combinations:
+# (GEOMETRY,GEOMETRY), (GEOMETRY,VARCHAR), (VARCHAR,GEOMETRY).
+# Non-commutative operators should work for:
+# (GEOMETRY,GEOMETRY), (GEOMETRY,VARCHAR),
+# but should fail for (VARCHAR,GEOMETRY).
+#
+# Note, LIMIT 0 is needed to avoid calling str_op(), which does DBUG_ASSERT(0).
+
+SET debug_dbug='+d,num_op';
+
+# (GEOMETRY,GEOMETRY) gives GEOMETRY for all operators
+CREATE TABLE t1 AS SELECT
+ POINT(0,0)+POINT(0,0),
+ POINT(0,0)-POINT(0,0),
+ POINT(0,0)*POINT(0,0),
+ POINT(0,0)/POINT(0,0),
+ POINT(0,0) MOD POINT(0,0) LIMIT 0;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# (GEOMETRY,VARCHAR) gives GEOMETRY for all operators
+CREATE TABLE t1 AS SELECT
+ POINT(0,0)+'0',
+ POINT(0,0)-'0',
+ POINT(0,0)*'0',
+ POINT(0,0)/'0',
+ POINT(0,0) MOD '0' LIMIT 0;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# (VARCHAR,GEOMETRY) gives GEOMETRY for commutative operators
+CREATE TABLE t1 AS SELECT
+ '0'+POINT(0,0),
+ '0'*POINT(0,0) LIMIT 0;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# (VARCHAR,GEOMETRY) gives an error for non-commutative operators
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CREATE TABLE t1 AS SELECT '0'-POINT(0,0) LIMIT 0;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CREATE TABLE t1 AS SELECT '0'/POINT(0,0) LIMIT 0;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CREATE TABLE t1 AS SELECT '0' MOD POINT(0,0) LIMIT 0;
+
+SET debug_dbug='-d,num_op';
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index ee074c87215..a19de83f046 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -2017,5 +2017,80 @@ SELECT LENGTH(CAST(COALESCE(a) AS BINARY)) FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-12238 Add Type_handler::Item_func_{plus|minus|mul|div|mod}_fix_length_and_dec()
+--echo #
+
+CREATE TABLE t1 (a GEOMETRY);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT POINT(1,1) + 1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT POINT(1,1) - 1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT POINT(1,1) * 1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT POINT(1,1) / 1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT POINT(1,1) MOD 1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 + POINT(1,1);
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 - POINT(1,1);
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 * POINT(1,1);
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 / POINT(1,1);
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 MOD POINT(1,1);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT a + 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT a - 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT a * 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT a / 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT a MOD 1 FROM t1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 + a FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 - a FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 * a FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 / a FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 MOD a FROM t1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT COALESCE(a) + 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT COALESCE(a) - 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT COALESCE(a) * 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT COALESCE(a) / 1 FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT COALESCE(a) MOD 1 FROM t1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 + COALESCE(a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 - COALESCE(a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 * COALESCE(a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 / COALESCE(a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT 1 MOD COALESCE(a) FROM t1;
+
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 10.3 tests
--echo #
diff --git a/mysql-test/t/partition_default.test b/mysql-test/t/partition_default.test
index 1110b311c29..b0424f567e4 100644
--- a/mysql-test/t/partition_default.test
+++ b/mysql-test/t/partition_default.test
@@ -326,9 +326,6 @@ select partition_name, table_rows from INFORMATION_SCHEMA.PARTITIONS where table
explain partitions select * from t1 where a=2 and b=5;
explain partitions select * from t1 where a=10 and b=10;
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-alter table t1 drop partition p2;
-delete from t1 where a=2;
alter table t1 drop partition p2;
show create table t1;
select * from t1;
@@ -395,9 +392,6 @@ select partition_name, table_rows from INFORMATION_SCHEMA.PARTITIONS where table
explain partitions select * from t1 where a=2 and b=5;
explain partitions select * from t1 where a=10 and b=10;
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-alter table t1 drop partition p2;
-delete from t1 where a=2;
alter table t1 drop partition p2;
show create table t1;
select * from t1;
@@ -520,3 +514,29 @@ explain partitions
select * from t1 where i is null;
drop table t1;
+
+
+--echo #
+--echo # MDEV-12395: DROP PARTITION does not work as expected when
+--echo # table has DEFAULT LIST partition
+--echo #
+
+CREATE TABLE t1 (i INT)
+ PARTITION BY LIST (i)
+ (PARTITION p VALUES IN (1,2,3,4),
+ PARTITION pdef DEFAULT);
+INSERT INTO t1 VALUES (1),(10);
+ALTER TABLE t1 DROP PARTITION p;
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (i INT)
+ PARTITION BY LIST (i)
+ (PARTITION p VALUES IN (1,2,3,4),
+ PARTITION pdef DEFAULT);
+INSERT INTO t1 VALUES (1),(10);
+ALTER TABLE t1 DROP PARTITION pdef;
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/plugin_loaderr.test b/mysql-test/t/plugin_loaderr.test
index 7b98a94afd4..85621ad047d 100644
--- a/mysql-test/t/plugin_loaderr.test
+++ b/mysql-test/t/plugin_loaderr.test
@@ -18,7 +18,7 @@ FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name = 'innodb';
--source include/wait_until_disconnected.inc
--error 1
---exec $MYSQLD_CMD --innodb=force --innodb-page-size=6000
+--exec $MYSQLD_CMD --innodb=force --innodb-page-size=6000 --disable-log-error
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 137902c54f2..cd6ca108661 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5779,6 +5779,44 @@ DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-8642: WHERE Clause not applied on View - Empty result set returned
+--echo #
+
+CREATE TABLE `t1` (
+ `id` int(20) NOT NULL AUTO_INCREMENT,
+ `use_case` int(11) DEFAULT NULL,
+ `current_deadline` date DEFAULT NULL,
+ `ts_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `id_UNIQUE` (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=13976 DEFAULT CHARSET=latin1;
+INSERT INTO `t1` VALUES (1,10,'2015-12-18','2015-08-18 08:38:16');
+INSERT INTO `t1` VALUES (2,20,'2015-10-18','2015-08-18 08:43:30');
+CREATE VIEW v1 AS SELECT
+ use_case as use_case_id,
+ (
+ SELECT
+ deadline_sub.current_deadline
+ FROM
+ t1 deadline_sub
+ WHERE
+ deadline_sub.use_case = use_case_id
+ AND ts_create = (SELECT
+ MIN(ts_create)
+ FROM
+ t1 startdate_sub
+ WHERE
+ startdate_sub.use_case = use_case_id
+ )
+ ) AS InitialDeadline
+FROM
+ t1;
+
+SELECT * FROM v1 where use_case_id = 10;
+
+drop view v1;
+drop table t1;
--echo # -----------------------------------------------------------------
--echo # -- End of 10.0 tests.
@@ -6148,6 +6186,18 @@ REPLACE INTO v (f1,f2) VALUES (1,1);
drop view v;
drop table t1,t2,t3;
+
+--echo #
+--echo # MDEV-12379: Server crashes in TABLE_LIST::is_with_table on
+--echo # SHOW CREATE VIEW
+--echo #
+
+CREATE TABLE t (i INT);
+CREATE VIEW v AS SELECT * FROM ( SELECT * FROM t ) sq;
+DROP TABLE IF EXISTS t;
+SHOW CREATE VIEW v;
+DROP VIEW v;
+
--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/plugin/aws_key_management/CMakeLists.txt b/plugin/aws_key_management/CMakeLists.txt
index 66b8074406f..59fdd1684f2 100644
--- a/plugin/aws_key_management/CMakeLists.txt
+++ b/plugin/aws_key_management/CMakeLists.txt
@@ -50,7 +50,6 @@ 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-kms PATH_SUFFIXES "${SDK_INSTALL_BINARY_PREFIX}")
-SET(CMAKE_REQUIRED_FLAGS ${CXX11_FLAGS})
FIND_PATH(AWS_CPP_SDK_INCLUDE_DIR NAMES aws/kms/KMSClient.h)
IF(AWS_CPP_SDK_CORE AND AWS_CPP_SDK_KMS AND AWS_CPP_SDK_INCLUDE_DIR)
@@ -121,6 +120,7 @@ ELSE()
-DBUILD_ONLY=kms
-DBUILD_SHARED_LIBS=OFF
-DFORCE_SHARED_CRT=OFF
+ -DENABLE_TESTING=OFF
"-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}"
@@ -140,7 +140,11 @@ ELSE()
ENDIF()
ADD_DEFINITIONS(${SSL_DEFINES}) # Need to know whether openssl should be initialized
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
+IF(CMAKE_VERSION GREATER "3.0")
+ SET(CMAKE_CXX_STANDARD 11)
+ELSE()
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
+ENDIF()
IF(WIN32)
SET(AWS_CPP_SDK_DEPENDENCIES bcrypt winhttp wininet userenv version)
ELSE()
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 1dfa313a70c..c84867e1c4f 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -70,7 +70,6 @@ ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
COMMAND gen_lex_token > lex_token.h
- DEPENDS gen_lex_token
)
ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER)
@@ -188,6 +187,63 @@ ELSE()
SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
ENDIF()
+
+IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
+
+ # mysqld.exe must to export symbols from some specific libs.
+ # These symbols are used by dynamic plugins, that "link" to mysqld.
+ #
+ # To do that, we
+ #
+ # 1. Generate mysqld_lib.def text file with all symbols from static
+ # libraries mysys, dbug, strings, sql.
+ # 2. Then we call
+ # lib.exe /DEF:mysqld_lib.def ...
+ # to create import library mysqld_lib.lib and export library mysqld_lib.exp
+ # 3. mysqld.exe links with mysqld_lib.exp (exporting symbols)
+ # 4. plugins link with mysqld_lib.lib (importing symbols)
+ #
+ # We do not not regenerate .def, .lib and .exp
+ # without necessity.E.g source modifications, that do not
+ # change list of exported symbols, will not result in a relink for plugins.
+
+ SET(MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.def)
+ SET(MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.exp)
+ SET(MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.lib)
+ SET(MYSQLD_CORELIBS sql mysys mysys_ssl dbug strings)
+ FOREACH (CORELIB ${MYSQLD_CORELIBS})
+ GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
+ FILE(TO_NATIVE_PATH ${LOC} LOC)
+ SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
+ ENDFOREACH (CORELIB)
+
+ SET(_PLATFORM x86)
+ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(_PLATFORM x64)
+ ENDIF()
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${MYSQLD_DEF}
+ COMMAND cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
+ ${_PLATFORM} /forLib ${LIB_LOCATIONS} > mysqld_lib.def.tmp
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different mysqld_lib.def.tmp mysqld_lib.def
+ COMMAND ${CMAKE_COMMAND} -E remove mysqld_lib.def.tmp
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${MYSQLD_CORELIBS}
+ )
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${MYSQLD_LIB}
+ COMMAND lib
+ ARGS /NAME:mysqld.exe "/DEF:${MYSQLD_DEF}" "/MACHINE:${_PLATFORM}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${MYSQLD_DEF}
+ )
+ ADD_CUSTOM_TARGET(gen_mysqld_lib DEPENDS ${MYSQLD_LIB})
+ ADD_LIBRARY(mysqld_import_lib UNKNOWN IMPORTED GLOBAL)
+ SET_TARGET_PROPERTIES(mysqld_import_lib PROPERTIES IMPORTED_LOCATION ${MYSQLD_LIB})
+ENDIF()
+
MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
IF(APPLE)
@@ -208,25 +264,9 @@ IF(NOT WITHOUT_DYNAMIC_PLUGINS)
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} -Wl,--export-all-symbols")
ENDIF()
IF(MSVC)
- # Set module definition file. Also use non-incremental linker,
- # incremental appears to crash from time to time,if used with /DEF option
- SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} /DEF:mysqld.def /INCREMENTAL:NO")
-
- FOREACH (CORELIB sql mysys mysys_ssl dbug strings)
- GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
- FILE(TO_NATIVE_PATH ${LOC} LOC)
- SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
- ENDFOREACH (CORELIB ${MYSQLD_CORE_LIBS})
- SET(_PLATFORM x86)
- IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(_PLATFORM x64)
- ENDIF()
- ADD_CUSTOM_COMMAND(TARGET mysqld PRE_LINK
- COMMAND echo ${_PLATFORM} && cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
- ${_PLATFORM} ${LIB_LOCATIONS} > mysqld.def
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- ADD_DEPENDENCIES(sql GenError)
- ENDIF(MSVC)
+ SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} \"${MYSQLD_EXP}\"")
+ ADD_DEPENDENCIES(mysqld gen_mysqld_lib)
+ ENDIF()
ENDIF(NOT WITHOUT_DYNAMIC_PLUGINS)
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
@@ -300,7 +340,6 @@ ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
COMMAND gen_lex_hash > lex_hash.h
- DEPENDS gen_lex_hash
)
MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc COMPONENT Server)
@@ -419,7 +458,7 @@ IF(WIN32)
${CMAKE_CURRENT_BINARY_DIR}/my_bootstrap.sql
mysql_bootstrap_sql.c
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS comp_sql ${my_bootstrap_sql}
+ DEPENDS ${my_bootstrap_sql}
)
MYSQL_ADD_EXECUTABLE(mysql_install_db
diff --git a/sql/item.cc b/sql/item.cc
index fe51b2966ad..6ebea475af4 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -7806,18 +7806,6 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
last_checked_context->select_lex->nest_level);
}
}
- else if (ref_type() != VIEW_REF)
- {
- /*
- It could be that we're referring to something that's in ancestor selects.
- We must make an appropriate mark_as_dependent() call for each such
- outside reference.
- */
- Dependency_marker dep_marker;
- dep_marker.current_select= current_sel;
- dep_marker.thd= thd;
- (*ref)->walk(&Item::enumerate_field_refs_processor, FALSE, &dep_marker);
- }
DBUG_ASSERT(*ref);
/*
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 5b2626069b6..8f60cfbd7cb 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -729,47 +729,31 @@ bool Item_func_connection_id::fix_fields(THD *thd, Item **ref)
}
-/**
- Check arguments here to determine result's type for a numeric
- function of two arguments.
-*/
-
-void Item_num_op::fix_length_and_dec(void)
+bool Item_num_op::fix_type_handler(const Type_aggregator *aggregator)
{
- DBUG_ENTER("Item_num_op::fix_length_and_dec");
- DBUG_PRINT("info", ("name %s", func_name()));
DBUG_ASSERT(arg_count == 2);
- Item_result r0= args[0]->cast_to_int_type_handler()->cmp_type();
- Item_result r1= args[1]->cast_to_int_type_handler()->cmp_type();
+ const Type_handler *h0= args[0]->cast_to_int_type_handler();
+ const Type_handler *h1= args[1]->cast_to_int_type_handler();
+ if (!aggregate_for_num_op(aggregator, h0, h1))
+ return false;
+ my_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION, MYF(0),
+ h0->name().ptr(), h1->name().ptr(), func_name());
+ return true;
+}
- if (r0 == REAL_RESULT || r1 == REAL_RESULT ||
- r0 == STRING_RESULT || r1 ==STRING_RESULT)
- {
- count_real_length(args, arg_count);
- max_length= float_length(decimals);
- set_handler_by_result_type(REAL_RESULT);
- }
- else if (r0 == DECIMAL_RESULT || r1 == DECIMAL_RESULT ||
- r0 == TIME_RESULT || r1 == TIME_RESULT)
- {
- set_handler_by_result_type(DECIMAL_RESULT);
- result_precision();
- fix_decimals();
- if ((r0 == TIME_RESULT || r1 == TIME_RESULT) && decimals == 0)
- set_handler_by_result_type(INT_RESULT);
- }
- else
+
+void Item_func_plus::fix_length_and_dec(void)
+{
+ DBUG_ENTER("Item_func_plus::fix_length_and_dec");
+ DBUG_PRINT("info", ("name %s", func_name()));
+ const Type_aggregator *aggregator= &type_handler_data->m_type_aggregator_for_plus;
+ DBUG_EXECUTE_IF("num_op", aggregator= &type_handler_data->m_type_aggregator_for_result;);
+ DBUG_ASSERT(aggregator->is_commutative());
+ if (!fix_type_handler(aggregator))
{
- DBUG_ASSERT(r0 == INT_RESULT && r1 == INT_RESULT);
- set_handler_by_result_type(INT_RESULT);
- result_precision();
- decimals= 0;
+ Item_func_plus::type_handler()->Item_func_plus_fix_length_and_dec(this);
+ DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
}
- DBUG_PRINT("info", ("Type: %s",
- (result_type() == REAL_RESULT ? "REAL_RESULT" :
- result_type() == DECIMAL_RESULT ? "DECIMAL_RESULT" :
- result_type() == INT_RESULT ? "INT_RESULT" :
- "--ILLEGAL!!!--")));
DBUG_VOID_RETURN;
}
@@ -1300,11 +1284,6 @@ void Item_func_additive_op::result_precision()
DBUG_ASSERT(arg1_int >= 0);
DBUG_ASSERT(arg2_int >= 0);
- /* Integer operations keep unsigned_flag if one of arguments is unsigned */
- if (result_type() == INT_RESULT)
- unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
- else
- unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
max_length= my_decimal_precision_to_length_no_truncation(precision, decimals,
unsigned_flag);
}
@@ -1314,16 +1293,30 @@ void Item_func_additive_op::result_precision()
The following function is here to allow the user to force
subtraction of UNSIGNED BIGINT to return negative values.
*/
-
-void Item_func_minus::fix_length_and_dec()
+void Item_func_minus::fix_unsigned_flag()
{
- Item_num_op::fix_length_and_dec();
if (unsigned_flag &&
(current_thd->variables.sql_mode & MODE_NO_UNSIGNED_SUBTRACTION))
unsigned_flag=0;
}
+void Item_func_minus::fix_length_and_dec()
+{
+ DBUG_ENTER("Item_func_minus::fix_length_and_dec");
+ DBUG_PRINT("info", ("name %s", func_name()));
+ const Type_aggregator *aggregator= &type_handler_data->m_type_aggregator_for_minus;
+ DBUG_EXECUTE_IF("num_op", aggregator= &type_handler_data->m_type_aggregator_non_commutative_test;);
+ DBUG_ASSERT(!aggregator->is_commutative());
+ if (!fix_type_handler(aggregator))
+ {
+ Item_func_minus::type_handler()->Item_func_minus_fix_length_and_dec(this);
+ DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
+ }
+ DBUG_VOID_RETURN;
+}
+
+
double Item_func_minus::real_op()
{
double value= args[0]->val_real() - args[1]->val_real();
@@ -1531,13 +1524,8 @@ my_decimal *Item_func_mul::decimal_op(my_decimal *decimal_value)
void Item_func_mul::result_precision()
{
- /* Integer operations keep unsigned_flag if one of arguments is unsigned */
- if (result_type() == INT_RESULT)
- unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
- else
- unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
decimals= MY_MIN(args[0]->decimal_scale() + args[1]->decimal_scale(),
- DECIMAL_MAX_SCALE);
+ DECIMAL_MAX_SCALE);
uint est_prec = args[0]->decimal_precision() + args[1]->decimal_precision();
uint precision= MY_MIN(est_prec, DECIMAL_MAX_PRECISION);
max_length= my_decimal_precision_to_length_no_truncation(precision, decimals,
@@ -1545,6 +1533,22 @@ void Item_func_mul::result_precision()
}
+void Item_func_mul::fix_length_and_dec(void)
+{
+ DBUG_ENTER("Item_func_mul::fix_length_and_dec");
+ DBUG_PRINT("info", ("name %s", func_name()));
+ const Type_aggregator *aggregator= &type_handler_data->m_type_aggregator_for_mul;
+ DBUG_EXECUTE_IF("num_op", aggregator= &type_handler_data->m_type_aggregator_for_result;);
+ DBUG_ASSERT(aggregator->is_commutative());
+ if (!fix_type_handler(aggregator))
+ {
+ Item_func_mul::type_handler()->Item_func_mul_fix_length_and_dec(this);
+ DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
+ }
+ DBUG_VOID_RETURN;
+}
+
+
double Item_func_div::real_op()
{
DBUG_ASSERT(fixed == 1);
@@ -1606,53 +1610,51 @@ void Item_func_div::result_precision()
uint precision=MY_MIN(args[0]->decimal_precision() +
args[1]->divisor_precision_increment() + prec_increment,
DECIMAL_MAX_PRECISION);
-
- /* Integer operations keep unsigned_flag if one of arguments is unsigned */
- if (result_type() == INT_RESULT)
- unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
- else
- unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
decimals= MY_MIN(args[0]->decimal_scale() + prec_increment, DECIMAL_MAX_SCALE);
max_length= my_decimal_precision_to_length_no_truncation(precision, decimals,
unsigned_flag);
}
-void Item_func_div::fix_length_and_dec()
+void Item_func_div::fix_length_and_dec_double(void)
+{
+ Item_num_op::fix_length_and_dec_double();
+ decimals= MY_MAX(args[0]->decimals, args[1]->decimals) + prec_increment;
+ set_if_smaller(decimals, NOT_FIXED_DEC);
+ uint tmp= float_length(decimals);
+ if (decimals == NOT_FIXED_DEC)
+ max_length= tmp;
+ else
+ {
+ max_length=args[0]->max_length - args[0]->decimals + decimals;
+ set_if_smaller(max_length, tmp);
+ }
+}
+
+
+void Item_func_div::fix_length_and_dec_int(void)
+{
+ set_handler(&type_handler_newdecimal);
+ DBUG_PRINT("info", ("Type changed: %s", type_handler()->name().ptr()));
+ Item_num_op::fix_length_and_dec_decimal();
+}
+
+
+void Item_func_div::fix_length_and_dec(void)
{
DBUG_ENTER("Item_func_div::fix_length_and_dec");
+ DBUG_PRINT("info", ("name %s", func_name()));
prec_increment= current_thd->variables.div_precincrement;
- Item_num_op::fix_length_and_dec();
- switch (Item_func_div::result_type()) {
- case REAL_RESULT:
+ maybe_null= 1; // devision by zero
+
+ const Type_aggregator *aggregator= &type_handler_data->m_type_aggregator_for_div;
+ DBUG_EXECUTE_IF("num_op", aggregator= &type_handler_data->m_type_aggregator_non_commutative_test;);
+ DBUG_ASSERT(!aggregator->is_commutative());
+ if (!fix_type_handler(aggregator))
{
- decimals=MY_MAX(args[0]->decimals,args[1]->decimals)+prec_increment;
- set_if_smaller(decimals, NOT_FIXED_DEC);
- uint tmp=float_length(decimals);
- if (decimals == NOT_FIXED_DEC)
- max_length= tmp;
- else
- {
- max_length=args[0]->max_length - args[0]->decimals + decimals;
- set_if_smaller(max_length,tmp);
- }
- break;
- }
- case INT_RESULT:
- set_handler_by_result_type(DECIMAL_RESULT);
- DBUG_PRINT("info", ("Type changed: DECIMAL_RESULT"));
- result_precision();
- break;
- case DECIMAL_RESULT:
- result_precision();
- fix_decimals();
- break;
- case STRING_RESULT:
- case ROW_RESULT:
- case TIME_RESULT:
- DBUG_ASSERT(0);
+ Item_func_div::type_handler()->Item_func_div_fix_length_and_dec(this);
+ DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
}
- maybe_null= 1; // devision by zero
DBUG_VOID_RETURN;
}
@@ -1824,9 +1826,18 @@ void Item_func_mod::result_precision()
void Item_func_mod::fix_length_and_dec()
{
- Item_num_op::fix_length_and_dec();
- maybe_null= 1;
- unsigned_flag= args[0]->unsigned_flag;
+ DBUG_ENTER("Item_func_mod::fix_length_and_dec");
+ DBUG_PRINT("info", ("name %s", func_name()));
+ maybe_null= true; // division by zero
+ const Type_aggregator *aggregator= &type_handler_data->m_type_aggregator_for_mod;
+ DBUG_EXECUTE_IF("num_op", aggregator= &type_handler_data->m_type_aggregator_non_commutative_test;);
+ DBUG_ASSERT(!aggregator->is_commutative());
+ if (!fix_type_handler(aggregator))
+ {
+ Item_func_mod::type_handler()->Item_func_mod_fix_length_and_dec(this);
+ DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
+ }
+ DBUG_VOID_RETURN;
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 0b398adb937..7f9321f017d 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -695,7 +695,31 @@ class Item_num_op :public Item_func_numhybrid
{
print_op(str, query_type);
}
- void fix_length_and_dec();
+ bool fix_type_handler(const Type_aggregator *aggregator);
+ void fix_length_and_dec_double()
+ {
+ count_real_length(args, arg_count);
+ max_length= float_length(decimals);
+ }
+ void fix_length_and_dec_decimal()
+ {
+ unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
+ result_precision();
+ fix_decimals();
+ }
+ void fix_length_and_dec_int()
+ {
+ unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;
+ result_precision();
+ decimals= 0;
+ }
+ void fix_length_and_dec_temporal()
+ {
+ set_handler(&type_handler_newdecimal);
+ fix_length_and_dec_decimal();
+ if (decimals == 0)
+ set_handler(&type_handler_longlong);
+ }
bool need_parentheses_in_default() { return true; }
};
@@ -949,6 +973,7 @@ public:
Item_func_additive_op(thd, a, b) {}
const char *func_name() const { return "+"; }
enum precedence precedence() const { return ADD_PRECEDENCE; }
+ void fix_length_and_dec();
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
@@ -967,6 +992,22 @@ public:
double real_op();
my_decimal *decimal_op(my_decimal *);
void fix_length_and_dec();
+ void fix_unsigned_flag();
+ void fix_length_and_dec_double()
+ {
+ Item_func_additive_op::fix_length_and_dec_double();
+ fix_unsigned_flag();
+ }
+ void fix_length_and_dec_decimal()
+ {
+ Item_func_additive_op::fix_length_and_dec_decimal();
+ fix_unsigned_flag();
+ }
+ void fix_length_and_dec_int()
+ {
+ Item_func_additive_op::fix_length_and_dec_int();
+ fix_unsigned_flag();
+ }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_minus>(thd, mem_root, this); }
};
@@ -983,6 +1024,7 @@ public:
double real_op();
my_decimal *decimal_op(my_decimal *);
void result_precision();
+ void fix_length_and_dec();
bool check_partition_func_processor(void *int_arg) {return FALSE;}
bool check_vcol_func_processor(void *arg) { return FALSE;}
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
@@ -1001,6 +1043,8 @@ public:
const char *func_name() const { return "/"; }
enum precedence precedence() const { return MUL_PRECEDENCE; }
void fix_length_and_dec();
+ void fix_length_and_dec_double();
+ void fix_length_and_dec_int();
void result_precision();
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_div>(thd, mem_root, this); }
@@ -1040,6 +1084,22 @@ public:
enum precedence precedence() const { return MUL_PRECEDENCE; }
void result_precision();
void fix_length_and_dec();
+ void fix_length_and_dec_double()
+ {
+ Item_num_op::fix_length_and_dec_double();
+ unsigned_flag= args[0]->unsigned_flag;
+ }
+ void fix_length_and_dec_decimal()
+ {
+ Item_num_op::fix_length_and_dec_decimal();
+ unsigned_flag= args[0]->unsigned_flag;
+ }
+ void fix_length_and_dec_int()
+ {
+ max_length= MY_MAX(args[0]->max_length, args[1]->max_length);
+ decimals= 0;
+ unsigned_flag= args[0]->unsigned_flag;
+ }
bool check_partition_func_processor(void *int_arg) {return FALSE;}
bool check_vcol_func_processor(void *arg) { return FALSE;}
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
diff --git a/sql/log.cc b/sql/log.cc
index 1f55b283a13..ab6d9031004 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1233,23 +1233,6 @@ void LOGGER::init_log_tables()
}
-bool LOGGER::flush_logs(THD *thd)
-{
- /*
- Now we lock logger, as nobody should be able to use logging routines while
- log tables are closed
- */
- logger.lock_exclusive();
-
- /* reopen log files */
- file_log_handler->flush();
-
- /* end of log flush */
- logger.unlock();
- return 0;
-}
-
-
/**
Close and reopen the slow log (with locks).
diff --git a/sql/log.h b/sql/log.h
index ae8f8170a98..eaa63d4072d 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -1018,7 +1018,6 @@ public:
*/
void init_base();
void init_log_tables();
- bool flush_logs(THD *thd);
bool flush_slow_log();
bool flush_general_log();
/* Perform basic logger cleanup. this will leave e.g. error log open. */
diff --git a/sql/log_event.cc b/sql/log_event.cc
index c7cbff9c615..f1f9e65098d 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -11326,6 +11326,7 @@ Annotate_rows_log_event::Annotate_rows_log_event(THD *thd,
: Log_event(thd, 0, using_trans),
m_save_thd_query_txt(0),
m_save_thd_query_len(0),
+ m_saved_thd_query(false),
m_used_query_txt(0)
{
m_query_txt= thd->query();
@@ -11341,6 +11342,7 @@ Annotate_rows_log_event::Annotate_rows_log_event(const char *buf,
: Log_event(buf, desc),
m_save_thd_query_txt(0),
m_save_thd_query_len(0),
+ m_saved_thd_query(false),
m_used_query_txt(0)
{
m_query_len= event_len - desc->common_header_len;
@@ -11351,7 +11353,7 @@ Annotate_rows_log_event::~Annotate_rows_log_event()
{
DBUG_ENTER("Annotate_rows_log_event::~Annotate_rows_log_event");
#ifndef MYSQL_CLIENT
- if (m_save_thd_query_txt)
+ if (m_saved_thd_query)
thd->set_query(m_save_thd_query_txt, m_save_thd_query_len);
else if (m_used_query_txt)
thd->reset_query();
@@ -11438,8 +11440,10 @@ void Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int Annotate_rows_log_event::do_apply_event(rpl_group_info *rgi)
{
+ rgi->free_annotate_event();
m_save_thd_query_txt= thd->query();
m_save_thd_query_len= thd->query_length();
+ m_saved_thd_query= true;
m_used_query_txt= 1;
thd->set_query(m_query_txt, m_query_len);
return 0;
diff --git a/sql/log_event.h b/sql/log_event.h
index e45151c8564..ccbc0527bd2 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -3908,6 +3908,7 @@ private:
uint m_query_len;
char *m_save_thd_query_txt;
uint m_save_thd_query_len;
+ bool m_saved_thd_query;
bool m_used_query_txt;
};
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index 93e7b869be0..448fc231b2b 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -835,7 +835,7 @@ struct rpl_group_info
*/
inline void set_annotate_event(Annotate_rows_log_event *event)
{
- free_annotate_event();
+ DBUG_ASSERT(m_annotate_event == NULL);
m_annotate_event= event;
this->thd->variables.binlog_annotate_row_events= 1;
}
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index 1dded86c824..d76ee13a010 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -780,6 +780,7 @@ st_select_lex_unit *With_element::clone_parsed_spec(THD *thd,
with_table->next_global= spec_tables;
}
res= &lex->unit;
+ res->set_with_clause(owner);
lex->unit.include_down(with_table->select_lex);
lex->unit.set_slave(with_select);
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 4e71e792a08..0a146aeb12b 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4842,8 +4842,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
my_error(ER_PARTITION_FUNCTION_FAILURE, MYF(0));
goto err;
}
- if ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0 &&
- !tab_part_info->has_default_partititon())
+ if ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0)
{
/*
"Fast" change of partitioning is supported in this case.
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a2e3d68e5dd..2cdc8d19733 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -25048,7 +25048,7 @@ void TABLE_LIST::print(THD *thd, table_map eliminated_tables, String *str,
}
else if (derived)
{
- if (!derived->derived->is_with_table())
+ if (!is_with_table())
{
// A derived table
str->append('(');
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index bfc198a1a68..954a6281c18 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3856,7 +3856,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::MULTIPLE)
{
/* not a critical problem */
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_TOO_LONG_KEY,
ER_THD(thd, ER_TOO_LONG_KEY),
key_part_length);
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 055a8969787..337111f6e53 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -60,6 +60,17 @@ Type_handler_geometry type_handler_geometry;
bool Type_handler_data::init()
{
#ifdef HAVE_SPATIAL
+
+#ifndef DBUG_OFF
+ if (m_type_aggregator_non_commutative_test.add(&type_handler_geometry,
+ &type_handler_geometry,
+ &type_handler_geometry) ||
+ m_type_aggregator_non_commutative_test.add(&type_handler_geometry,
+ &type_handler_varchar,
+ &type_handler_long_blob))
+ return true;
+#endif
+
return
m_type_aggregator_for_result.add(&type_handler_geometry,
&type_handler_null,
@@ -466,6 +477,63 @@ Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h)
}
+const Type_handler *
+Type_handler::aggregate_for_num_op_traditional(const Type_handler *h0,
+ const Type_handler *h1)
+{
+ Item_result r0= h0->cmp_type();
+ Item_result r1= h1->cmp_type();
+
+ if (r0 == REAL_RESULT || r1 == REAL_RESULT ||
+ r0 == STRING_RESULT || r1 ==STRING_RESULT)
+ return &type_handler_double;
+
+ if (r0 == TIME_RESULT || r1 == TIME_RESULT)
+ return &type_handler_datetime;
+
+ if (r0 == DECIMAL_RESULT || r1 == DECIMAL_RESULT)
+ return &type_handler_newdecimal;
+
+ DBUG_ASSERT(r0 == INT_RESULT && r1 == INT_RESULT);
+ return &type_handler_longlong;
+}
+
+
+const Type_aggregator::Pair*
+Type_aggregator::find_pair(const Type_handler *handler1,
+ const Type_handler *handler2) const
+{
+ for (uint i= 0; i < m_array.elements(); i++)
+ {
+ const Pair& el= m_array.at(i);
+ if (el.eq(handler1, handler2) ||
+ (m_is_commutative && el.eq(handler2, handler1)))
+ return &el;
+ }
+ return NULL;
+}
+
+
+bool
+Type_handler_hybrid_field_type::aggregate_for_num_op(const Type_aggregator *agg,
+ const Type_handler *h0,
+ const Type_handler *h1)
+{
+ const Type_handler *hres;
+ if (h0->is_traditional_type() && h1->is_traditional_type())
+ {
+ set_handler(Type_handler::aggregate_for_num_op_traditional(h0, h1));
+ return false;
+ }
+ if ((hres= agg->find_handler(h0, h1)))
+ {
+ set_handler(hres);
+ return false;
+ }
+ return true;
+}
+
+
/***************************************************************************/
const Type_handler *
@@ -2709,3 +2777,248 @@ bool Type_handler_geometry::
#endif /* HAVE_SPATIAL */
/***************************************************************************/
+
+bool Type_handler_row::
+ Item_func_plus_fix_length_and_dec(Item_func_plus *item) const
+{
+ DBUG_ASSERT(0);
+ return true;
+}
+
+
+bool Type_handler_int_result::
+ Item_func_plus_fix_length_and_dec(Item_func_plus *item) const
+{
+ item->fix_length_and_dec_int();
+ return false;
+}
+
+
+bool Type_handler_real_result::
+ Item_func_plus_fix_length_and_dec(Item_func_plus *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+
+bool Type_handler_decimal_result::
+ Item_func_plus_fix_length_and_dec(Item_func_plus *item) const
+{
+ item->fix_length_and_dec_decimal();
+ return false;
+}
+
+
+bool Type_handler_temporal_result::
+ Item_func_plus_fix_length_and_dec(Item_func_plus *item) const
+{
+ item->fix_length_and_dec_temporal();
+ return false;
+}
+
+
+bool Type_handler_string_result::
+ Item_func_plus_fix_length_and_dec(Item_func_plus *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+/***************************************************************************/
+
+bool Type_handler_row::
+ Item_func_minus_fix_length_and_dec(Item_func_minus *item) const
+{
+ DBUG_ASSERT(0);
+ return true;
+}
+
+
+bool Type_handler_int_result::
+ Item_func_minus_fix_length_and_dec(Item_func_minus *item) const
+{
+ item->fix_length_and_dec_int();
+ return false;
+}
+
+
+bool Type_handler_real_result::
+ Item_func_minus_fix_length_and_dec(Item_func_minus *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+
+bool Type_handler_decimal_result::
+ Item_func_minus_fix_length_and_dec(Item_func_minus *item) const
+{
+ item->fix_length_and_dec_decimal();
+ return false;
+}
+
+
+bool Type_handler_temporal_result::
+ Item_func_minus_fix_length_and_dec(Item_func_minus *item) const
+{
+ item->fix_length_and_dec_temporal();
+ return false;
+}
+
+
+bool Type_handler_string_result::
+ Item_func_minus_fix_length_and_dec(Item_func_minus *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+/***************************************************************************/
+
+bool Type_handler_row::
+ Item_func_mul_fix_length_and_dec(Item_func_mul *item) const
+{
+ DBUG_ASSERT(0);
+ return true;
+}
+
+
+bool Type_handler_int_result::
+ Item_func_mul_fix_length_and_dec(Item_func_mul *item) const
+{
+ item->fix_length_and_dec_int();
+ return false;
+}
+
+
+bool Type_handler_real_result::
+ Item_func_mul_fix_length_and_dec(Item_func_mul *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+
+bool Type_handler_decimal_result::
+ Item_func_mul_fix_length_and_dec(Item_func_mul *item) const
+{
+ item->fix_length_and_dec_decimal();
+ return false;
+}
+
+
+bool Type_handler_temporal_result::
+ Item_func_mul_fix_length_and_dec(Item_func_mul *item) const
+{
+ item->fix_length_and_dec_temporal();
+ return false;
+}
+
+
+bool Type_handler_string_result::
+ Item_func_mul_fix_length_and_dec(Item_func_mul *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+/***************************************************************************/
+
+bool Type_handler_row::
+ Item_func_div_fix_length_and_dec(Item_func_div *item) const
+{
+ DBUG_ASSERT(0);
+ return true;
+}
+
+
+bool Type_handler_int_result::
+ Item_func_div_fix_length_and_dec(Item_func_div *item) const
+{
+ item->fix_length_and_dec_int();
+ return false;
+}
+
+
+bool Type_handler_real_result::
+ Item_func_div_fix_length_and_dec(Item_func_div *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+
+bool Type_handler_decimal_result::
+ Item_func_div_fix_length_and_dec(Item_func_div *item) const
+{
+ item->fix_length_and_dec_decimal();
+ return false;
+}
+
+
+bool Type_handler_temporal_result::
+ Item_func_div_fix_length_and_dec(Item_func_div *item) const
+{
+ item->fix_length_and_dec_temporal();
+ return false;
+}
+
+
+bool Type_handler_string_result::
+ Item_func_div_fix_length_and_dec(Item_func_div *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+/***************************************************************************/
+
+bool Type_handler_row::
+ Item_func_mod_fix_length_and_dec(Item_func_mod *item) const
+{
+ DBUG_ASSERT(0);
+ return true;
+}
+
+
+bool Type_handler_int_result::
+ Item_func_mod_fix_length_and_dec(Item_func_mod *item) const
+{
+ item->fix_length_and_dec_int();
+ return false;
+}
+
+
+bool Type_handler_real_result::
+ Item_func_mod_fix_length_and_dec(Item_func_mod *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+
+bool Type_handler_decimal_result::
+ Item_func_mod_fix_length_and_dec(Item_func_mod *item) const
+{
+ item->fix_length_and_dec_decimal();
+ return false;
+}
+
+
+bool Type_handler_temporal_result::
+ Item_func_mod_fix_length_and_dec(Item_func_mod *item) const
+{
+ item->fix_length_and_dec_temporal();
+ return false;
+}
+
+
+bool Type_handler_string_result::
+ Item_func_mod_fix_length_and_dec(Item_func_mod *item) const
+{
+ item->fix_length_and_dec_double();
+ return false;
+}
+
+/***************************************************************************/
diff --git a/sql/sql_type.h b/sql/sql_type.h
index 053132626a3..891c785fef2 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -51,6 +51,11 @@ class Item_char_typecast;
class Item_time_typecast;
class Item_date_typecast;
class Item_datetime_typecast;
+class Item_func_plus;
+class Item_func_minus;
+class Item_func_mul;
+class Item_func_div;
+class Item_func_mod;
class cmp_item;
class in_vector;
class Type_std_attributes;
@@ -303,6 +308,9 @@ public:
static const
Type_handler *aggregate_for_result_traditional(const Type_handler *h1,
const Type_handler *h2);
+ static const
+ Type_handler *aggregate_for_num_op_traditional(const Type_handler *h1,
+ const Type_handler *h2);
virtual const Name name() const= 0;
virtual enum_field_types field_type() const= 0;
@@ -497,6 +505,17 @@ public:
Item_date_typecast_fix_length_and_dec(Item_date_typecast *item) const;
virtual bool
Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *item) const;
+
+ virtual bool
+ Item_func_plus_fix_length_and_dec(Item_func_plus *func) const= 0;
+ virtual bool
+ Item_func_minus_fix_length_and_dec(Item_func_minus *func) const= 0;
+ virtual bool
+ Item_func_mul_fix_length_and_dec(Item_func_mul *func) const= 0;
+ virtual bool
+ Item_func_div_fix_length_and_dec(Item_func_div *func) const= 0;
+ virtual bool
+ Item_func_mod_fix_length_and_dec(Item_func_mod *func) const= 0;
};
@@ -708,6 +727,12 @@ public:
DBUG_ASSERT(0);
return true;
}
+
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
+ bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;
};
@@ -784,6 +809,11 @@ public:
bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const;
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
+ bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;
};
@@ -833,6 +863,11 @@ public:
bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const;
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
+ bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;
};
@@ -881,6 +916,11 @@ public:
bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const;
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
+ bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;
};
@@ -933,6 +973,11 @@ public:
bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const;
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
+ bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;
};
@@ -999,6 +1044,11 @@ public:
bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *) const;
bool Item_func_abs_fix_length_and_dec(Item_func_abs *) const;
bool Item_func_neg_fix_length_and_dec(Item_func_neg *) const;
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *) const;
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *) const;
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const;
+ bool Item_func_div_fix_length_and_dec(Item_func_div *) const;
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const;
};
@@ -1528,6 +1578,8 @@ public:
bool aggregate_for_result(const Type_handler *other);
bool aggregate_for_result(const char *funcname,
Item **item, uint nitems, bool treat_bit_as_number);
+ bool aggregate_for_num_op(const class Type_aggregator *aggregator,
+ const Type_handler *h0, const Type_handler *h1);
};
@@ -1547,6 +1599,7 @@ extern Type_handler_set type_handler_set;
class Type_aggregator
{
+ bool m_is_commutative;
class Pair
{
public:
@@ -1566,18 +1619,10 @@ class Type_aggregator
};
Dynamic_array<Pair> m_array;
const Pair* find_pair(const Type_handler *handler1,
- const Type_handler *handler2) const
- {
- for (uint i= 0; i < m_array.elements(); i++)
- {
- const Pair& el= m_array.at(i);
- if (el.eq(handler1, handler2) || el.eq(handler2, handler1))
- return &el;
- }
- return NULL;
- }
+ const Type_handler *handler2) const;
public:
- Type_aggregator()
+ Type_aggregator(bool is_commutative= false)
+ :m_is_commutative(is_commutative)
{ }
bool add(const Type_handler *handler1,
const Type_handler *handler2,
@@ -1591,14 +1636,35 @@ public:
const Pair* el= find_pair(handler1, handler2);
return el ? el->m_result : NULL;
}
+ bool is_commutative() const { return m_is_commutative; }
+};
+
+
+class Type_aggregator_commutative: public Type_aggregator
+{
+public:
+ Type_aggregator_commutative()
+ :Type_aggregator(true)
+ { }
};
class Type_handler_data
{
public:
- Type_aggregator m_type_aggregator_for_result;
- Type_aggregator m_type_aggregator_for_comparison;
+ Type_aggregator_commutative m_type_aggregator_for_result;
+ Type_aggregator_commutative m_type_aggregator_for_comparison;
+
+ Type_aggregator_commutative m_type_aggregator_for_plus;
+ Type_aggregator_commutative m_type_aggregator_for_mul;
+
+ Type_aggregator m_type_aggregator_for_minus;
+ Type_aggregator m_type_aggregator_for_div;
+ Type_aggregator m_type_aggregator_for_mod;
+#ifndef DBUG_OFF
+ // This is used for mtr purposes in debug builds
+ Type_aggregator m_type_aggregator_non_commutative_test;
+#endif
bool init();
};
diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc
index 9820bf983ca..42b7bc81261 100644
--- a/sql/wsrep_binlog.cc
+++ b/sql/wsrep_binlog.cc
@@ -329,9 +329,13 @@ void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len)
}
FILE *of= fopen(filename, "wb");
+
if (of)
{
- fwrite (rbr_buf, buf_len, 1, of);
+ if (fwrite(rbr_buf, buf_len, 1, of) == 0)
+ WSREP_ERROR("Failed to write buffer of length %llu to '%s'",
+ (unsigned long long)buf_len, filename);
+
fclose(of);
}
else
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index c0cf26b869c..fcf6d55f660 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -206,19 +206,6 @@ start_again:
ib::info() << "Doublewrite buffer not found: creating new";
- ulint min_doublewrite_size =
- ( ( 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
- + FSP_EXTENT_SIZE / 2
- + 100)
- * UNIV_PAGE_SIZE);
- if (buf_pool_get_curr_size() < min_doublewrite_size) {
- ib::error() << "Cannot create doublewrite buffer: you must"
- " increase your buffer pool size. Cannot continue"
- " operation.";
-
- return(false);
- }
-
block2 = fseg_create(TRX_SYS_SPACE, TRX_SYS_PAGE_NO,
TRX_SYS_DOUBLEWRITE
+ TRX_SYS_DOUBLEWRITE_FSEG, &mtr);
@@ -233,9 +220,9 @@ start_again:
" increase your tablespace size."
" Cannot continue operation.";
- /* We exit without committing the mtr to prevent
- its modifications to the database getting to disk */
-
+ /* The mini-transaction did not write anything yet;
+ we merely failed to allocate a page. */
+ mtr.commit();
return(false);
}
@@ -250,7 +237,12 @@ start_again:
ib::error() << "Cannot create doublewrite buffer: "
" you must increase your tablespace size."
" Cannot continue operation.";
-
+ /* This may essentially corrupt the doublewrite
+ buffer. However, usually the doublewrite buffer
+ is created at database initialization, and it
+ should not matter (just remove all newly created
+ InnoDB files and restart). */
+ mtr.commit();
return(false);
}
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index a61d7439e2c..db7efe89d37 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1767,7 +1767,7 @@ fil_crypt_rotate_page(
return;
}
- if (space == TRX_SYS_SPACE && offset == TRX_SYS_PAGE_NO) {
+ if (space_id == TRX_SYS_SPACE && offset == TRX_SYS_PAGE_NO) {
/* don't encrypt this as it contains address to dblwr buffer */
return;
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 88282c698eb..2c44077c541 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -15213,6 +15213,25 @@ ha_innobase::defragment_table(
for (index = dict_table_get_first_index(table); index;
index = dict_table_get_next_index(index)) {
+ if (dict_index_is_corrupted(index)) {
+ continue;
+ }
+
+ if (dict_index_is_spatial(index)) {
+ /* Do not try to defragment spatial indexes,
+ because doing it properly would require
+ appropriate logic around the SSN (split
+ sequence number). */
+ continue;
+ }
+
+ if (index->page == FIL_NULL) {
+ /* Do not defragment auxiliary tables related
+ to FULLTEXT INDEX. */
+ ut_ad(index->type & DICT_FTS);
+ continue;
+ }
+
if (one_index && strcasecmp(index_name, index->name) != 0) {
continue;
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 27fa7e84aa3..a5b919b424d 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -300,7 +300,6 @@ my_error_innodb(
break;
case DB_OUT_OF_FILE_SPACE:
my_error(ER_RECORD_FILE_FULL, MYF(0), table);
- ut_error;
break;
case DB_TEMP_FILE_WRITE_FAIL:
my_error(ER_TEMP_FILE_WRITE_FAILURE, MYF(0));
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 308bd26592e..3223e084709 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -54,7 +54,9 @@ ELSE()
SKIP_ROCKSDB_PLUGIN("Compiler not supported")
ENDIF()
-IF(CXX11_FLAGS)
+IF(CMAKE_VERSION GREATER 3.0)
+ SET(CMAKE_CXX_STANDARD 11)
+ELSEIF(CXX11_FLAGS)
ADD_DEFINITIONS(${CXX11_FLAGS})
ENDIF()
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index 4b830bbdf32..8b7e64a8e08 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -29,10 +29,6 @@ else()
endif()
endif()
-include (CheckTypeSize)
-check_type_size(size_t SIZEOF_SIZE_T)
-set_property(SOURCE ha_rocksdb.cc APPEND PROPERTY COMPILE_DEFINITIONS
- SIZEOF_SIZE_T=${SIZEOF_SIZE_T} SIZEOF_UINT64_T=8)
# Optional compression libraries.
@@ -136,7 +132,7 @@ find_package(Threads REQUIRED)
if(WIN32)
set(SYSTEM_LIBS ${SYSTEM_LIBS} Shlwapi.lib Rpcrt4.lib)
else()
- set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT})
+ set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
endif()
set(ROCKSDB_LIBS rocksdblib})
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/disabled.def b/storage/rocksdb/mysql-test/rocksdb/t/disabled.def
index 8d3fc090273..cff53e6370e 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/disabled.def
+++ b/storage/rocksdb/mysql-test/rocksdb/t/disabled.def
@@ -57,3 +57,9 @@ unique_sec : Intermittent failures in BB
allow_no_pk_concurrent_insert: stress test
rocksdb_deadlock_stress_rc: stress test
rocksdb_deadlock_stress_rr: stress test
+
+# MDEV-12474 Regularly failing tests on Buildbot
+autoinc_vars_thread : MDEV-12474 Regularly fails on buildbot
+validate_datadic : MDEV-12474 Regularly fails on buildbot
+unique_check : MDEV-12474 Regularly fails on buildbot
+bloomfilter : MDEV-12474 Regularly fails on buildbot
diff --git a/storage/rocksdb/rdb_buff.h b/storage/rocksdb/rdb_buff.h
index c2d039b46c5..4b5850137f6 100644
--- a/storage/rocksdb/rdb_buff.h
+++ b/storage/rocksdb/rdb_buff.h
@@ -30,6 +30,16 @@
#define be16toh _byteswap_ushort
#endif
+#if __APPLE__
+#include <libkern/OSByteOrder.h>
+#define htobe64(x) OSSwapHostToBigInt64(x)
+#define be64toh(x) OSSwapBigToHostInt64(x)
+#define htobe32(x) OSSwapHostToBigInt32(x)
+#define be32toh(x) OSSwapBigToHostInt32(x)
+#define htobe16(x) OSSwapHostToBigInt16(x)
+#define be16toh(x) OSSwapBigToHostInt16(x)
+#endif
+
namespace myrocks {
/*
diff --git a/storage/rocksdb/ut0counter.h b/storage/rocksdb/ut0counter.h
index af2e023af27..cfa474e7a99 100644
--- a/storage/rocksdb/ut0counter.h
+++ b/storage/rocksdb/ut0counter.h
@@ -78,7 +78,7 @@ struct thread_id_indexer_t : public generic_indexer_t<Type, N> {
thread id is represented as a pointer, it may not work as
effectively. */
size_t get_rnd_index() const {
- return get_curr_thread_id();
+ return (size_t)get_curr_thread_id();
}
};
diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc
index 454b085862c..78683f35028 100644
--- a/storage/xtradb/btr/btr0cur.cc
+++ b/storage/xtradb/btr/btr0cur.cc
@@ -3948,7 +3948,7 @@ static const unsigned rows_in_range_max_retries = 4;
/** We pretend that a range has that many records if the tree keeps changing
for rows_in_range_max_retries retries while we try to estimate the records
in a given range. */
-static const int64_t rows_in_range_arbitrary_ret_val = 10;
+static const ib_int64_t rows_in_range_arbitrary_ret_val = 10;
/** Estimates the number of rows in a given index range.
@param[in] index index
@@ -3966,7 +3966,7 @@ rows_in_range_arbitrary_ret_val as a result (if
nth_attempt >= rows_in_range_max_retries and the tree is modified between
the two dives). */
static
-int64_t
+ib_int64_t
btr_estimate_n_rows_in_range_low(
dict_index_t* index,
const dtuple_t* tuple1,
@@ -4102,7 +4102,7 @@ btr_estimate_n_rows_in_range_low(
return(rows_in_range_arbitrary_ret_val);
}
- const int64_t ret =
+ const ib_int64_t ret =
btr_estimate_n_rows_in_range_low(
index, tuple1, mode1,
tuple2, mode2, trx,
@@ -4168,7 +4168,7 @@ btr_estimate_n_rows_in_range_low(
@param[in] mode2 search mode for range end
@param[in] trx trx
@return estimated number of rows */
-int64_t
+ib_int64_t
btr_estimate_n_rows_in_range(
dict_index_t* index,
const dtuple_t* tuple1,
@@ -4177,7 +4177,7 @@ btr_estimate_n_rows_in_range(
ulint mode2,
trx_t* trx)
{
- const int64_t ret = btr_estimate_n_rows_in_range_low(
+ const ib_int64_t ret = btr_estimate_n_rows_in_range_low(
index, tuple1, mode1, tuple2, mode2, trx,
1 /* first attempt */);
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 60ab067d105..aa95de7efea 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -1951,7 +1951,7 @@ fil_crypt_rotate_page(
return;
}
- if (space == TRX_SYS_SPACE && offset == TRX_SYS_PAGE_NO) {
+ if (space_id == TRX_SYS_SPACE && offset == TRX_SYS_PAGE_NO) {
/* don't encrypt this as it contains address to dblwr buffer */
return;
}
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 742c03b5404..11779a66e7c 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -13277,6 +13277,17 @@ ha_innobase::defragment_table(
for (index = dict_table_get_first_index(table); index;
index = dict_table_get_next_index(index)) {
+ if (dict_index_is_corrupted(index)) {
+ continue;
+ }
+
+ if (index->page == FIL_NULL) {
+ /* Do not defragment auxiliary tables related
+ to FULLTEXT INDEX. */
+ ut_ad(index->type & DICT_FTS);
+ continue;
+ }
+
if (one_index && strcasecmp(index_name, index->name) != 0) {
continue;
}
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 8aaf5cd83bc..a521db3ce25 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -134,7 +134,6 @@ my_error_innodb(
break;
case DB_OUT_OF_FILE_SPACE:
my_error(ER_RECORD_FILE_FULL, MYF(0), table);
- ut_error;
break;
case DB_TEMP_FILE_WRITE_FAILURE:
my_error(ER_GET_ERRMSG, MYF(0),
diff --git a/win/create_def_file.js b/win/create_def_file.js
index 5fb28ef0bee..25bbbb4eb3d 100644
--- a/win/create_def_file.js
+++ b/win/create_def_file.js
@@ -54,6 +54,22 @@ var is64 = args.Item(0).toLowerCase() == "x64";
var shell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
+/*
+ If .def file is used with together with lib.exe
+ the name mangling for stdcall is slightly different.
+
+ Undescore prefix for stdcall function name must be removed for
+ lib.exe but not link.exe (see ScrubSymbol())
+
+ This difference is not documented anywhere and could
+ be a bug in compiler tools.
+
+ We use a parameter /forLib, if the resulting .def file is used
+ with lib.exe .
+*/
+var forLib = false;
+
+
OutputSymbols(CollectSymbols());
@@ -62,8 +78,8 @@ function OutputSymbols(symbols)
{
var out = WScript.StdOut;
out.WriteLine("EXPORTS");
- for (var sym in symbols)
- out.WriteLine(sym);
+ for (var i= 0; i < symbols.length; i++)
+ out.WriteLine(symbols[i]);
}
function echo(message)
@@ -72,9 +88,10 @@ function echo(message)
}
// Extract global symbol names and type from objects
+// Returns string array with symbol names
function CollectSymbols()
{
- var uniqueSymbols = new Array();
+ var uniqueSymbols = new Object();
try
{
@@ -146,7 +163,19 @@ function CollectSymbols()
uniqueSymbols[symbol] = 1;
}
fso.DeleteFile(rspfilename);
- return uniqueSymbols;
+ // Sort symbols names
+ var keys=[];
+ var sorted = {};
+ for (key in uniqueSymbols)
+ {
+ if (uniqueSymbols.hasOwnProperty(key))
+ {
+ keys.push(key);
+ }
+ }
+ keys.sort();
+
+ return keys;
}
// performs necessary cleanup on the symbol name
@@ -156,6 +185,9 @@ function ScrubSymbol(symbol)
if (symbol.charAt(0) != "_")
return symbol;
+ if (forLib)
+ return symbol.substring(1, symbol.length);
+
var atSign = symbol.indexOf("@");
if (atSign != -1)
{
@@ -189,7 +221,11 @@ function CreateResponseFile(filename)
var index = 1;
for (; index < args.length; index++)
{
- addToResponseFile(args.Item(index),responseFile);
+ var param = args.Item(index);
+ if (param == "/forLib")
+ forLib = true;
+ else
+ addToResponseFile(args.Item(index),responseFile);
}
responseFile.Close();
}