1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 10.9 into 10.10

This commit is contained in:
Marko Mäkelä
2022-05-25 09:15:08 +03:00
457 changed files with 14601 additions and 3153 deletions

View File

@@ -1,55 +0,0 @@
#!/bin/sh
set -v -x
# Exclude modules from build not directly affecting the current
# test suites found in $MYSQL_TEST_SUITES, to conserve job time
# as well as disk usage
function exclude_modules() {
# excludes for all
CMAKE_OPT="${CMAKE_OPT} -DPLUGIN_MROONGA=NO -DPLUGIN_SPIDER=NO -DPLUGIN_OQGRAPH=NO -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_SPHINX=NO"
# exclude storage engines not being tested in current job
if [[ ! "${MYSQL_TEST_SUITES}" =~ "archive" ]]; then
CMAKE_OPT="${CMAKE_OPT} -DPLUGIN_ARCHIVE=NO"
fi
if [[ ! "${MYSQL_TEST_SUITES}" =~ "rocksdb" ]]; then
CMAKE_OPT="${CMAKE_OPT} -DPLUGIN_ROCKSDB=NO"
fi
}
if [[ "${TRAVIS_OS_NAME}" == 'linux' ]]; then
TEST_CASE_TIMEOUT=2
exclude_modules;
if which ccache ; then
CMAKE_OPT="${CMAKE_OPT} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
fi
if [[ "${CXX}" == 'clang++' ]]; then
if [[ "${CC_VERSION}" == '6' ]]; then
export CXX=${CXX}-${CC_VERSION}.0
else
export CXX=${CXX}-${CC_VERSION}
fi
export CC=${CXX/++/}
# excess warnings about unused include path
export CFLAGS='-Wno-unused-command-line-argument'
export CXXFLAGS='-Wno-unused-command-line-argument'
elif [[ "${CXX}" == 'g++' ]]; then
export CXX=g++-${CC_VERSION}
export CC=gcc-${CC_VERSION}
fi
if [[ ${CC_VERSION} == 7 ]]; then
export WSREP_PROVIDER=/usr/lib/galera/libgalera_smm.so
MYSQL_TEST_SUITES="${MYSQL_TEST_SUITES},wsrep"
fi
fi
if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then
TEST_CASE_TIMEOUT=20
exclude_modules;
CMAKE_OPT="${CMAKE_OPT} -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl"
if which ccache ; then
CMAKE_OPT="${CMAKE_OPT} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
fi
fi
set +v +x

View File

@@ -1,240 +0,0 @@
# vim ft=yaml
# travis-ci.org definition
# NOTE TO MERGERS: Most of the contents in the Travis-CI configuration has been
# tailored for a specific release or MariaDB. As a general rule, do not merge
# changes in this file across MariaDB branches to avoid breaking the CI. Updates
# the the Travis-CI pipeline are most of the time better done manually.
dist: focal
git:
depth: 2
language: cpp
cache:
timeout: 500
apt: true
ccache: true
addons:
apt:
sources: &add-sources
# Remember to document well what packages each extra repository is used for
- ubuntu-toolchain-r-test
# => gcc-9 and gcc-10 for Ubuntu Bionic
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages?field.name_filter=&field.status_filter=published&field.series_filter=bionic
- sourceline: 'ppa:maria-captains/travis-ci-helper-repo'
# => galera-4 for Ubuntu Bionic
# https://launchpad.net/~maria-captains/+archive/ubuntu/travis-ci-helper-repo/+packages?field.name_filter=&field.status_filter=published&field.series_filter=bionic
packages: &common-packages
# Remember to update this list if the Debian build dependencies are updated
- bison
- chrpath
- clang-7 # In suites: focal, bionic-updates
- clang-10 # In suites: focal, bionic
- cmake
- cracklib-runtime
- galera-4 # In suites: focal, bionic (via ppa:maria-captains/travis-ci-helper-repo)
- g++-7 # In suites: focal, bionic
- g++-10 # In suites: focal, bionic (via ppa:ubuntu-toolchain-r/test)
- gdb
- libaio-dev
- libarchive-dev
- libboost-atomic-dev
- libboost-chrono-dev
- libboost-date-time-dev
- libboost-dev
- libboost-filesystem-dev
- libboost-regex-dev
- libboost-system-dev
- libboost-thread-dev
- libcrack2-dev
- libcurl4-openssl-dev
- libdbd-mysql
- libedit-dev
- libjemalloc-dev
- libjudy-dev
- libkrb5-dev
- liblz4-dev
- libncurses5-dev
- libnuma-dev
- libpam0g-dev
- libpcre2-dev
- libpmem-dev
- libreadline-gplv2-dev
- libsnappy-dev
- libssl-dev
- libxml2-dev
- lsb-release
- perl
- psmisc
- uuid-dev
- zlib1g-dev
# libsystemd-daemon-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3882
homebrew:
# OSX builds are not properly maintained on Travis-CI nor buildbot and
# thus this list of dependencies is likely to be inaccurate.
packages:
- bison
- boost
- ccache
- cmake
- cracklib
- curl
- gnutls
- groonga
- jemalloc
- libxml2
- lz4
- lzo
- ncurses
- openssl@1.1
- ossp-uuid
- pcre2
- perl
- pkg-config
- readline
- snappy
- xz
- zlib
- zstd
## Build jobs matrix
# The jobs matrix consists of all the combinations of 'arch', 'os', 'compiler'
# and 'env'. Ensure there is a good variation of architectures and at least the
# main suite is run on all architectures, as the main test suite needs to pass
# on all architectures (amd64, arm64, ppc64le, s390x) before a release is made.
#
# In gcc and clang use a fairly old version and one very recent and assume that
# if both of them built successfully all the intermediate version work as well.
arch: amd64
os: linux
compiler:
- gcc
- clang
env:
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,rocksdb,versioning,rpl
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles,encryption
- CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
jobs:
# Define extra jobs that are run in addition to the main jobs matrix
include:
- os: linux
compiler: gcc
env: DebPackages=focal
addons: &deb-addons
apt:
sources: *add-sources
# make sure these match debian/control contents
packages:
- *common-packages
- debhelper
- devscripts
- dh-apparmor
- dh-exec
- dh-systemd
- fakeroot
- libsystemd-dev
- libzstd-dev
- po-debconf
- unixodbc-dev
script: &deb-script
- ${CC} --version ; ${CXX} --version
- apt-cache policy
- env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh;
- os: linux
dist: bionic
arch: s390x
compiler: gcc
env: DebPackages=bionic
addons: *deb-addons
script: *deb-script
# Just one OS X build is enough
- os: osx
osx_image: xcode12u
compiler: clang
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
# Some chosen ones with s390x and gcc
- os: linux
arch: s390x
compiler: gcc
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
- os: linux
arch: s390x
compiler: gcc
env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption,rocksdb,versioning,rpl
# Some chosen ones with s390x and clang
- os: linux
arch: s390x
compiler: clang
env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
- os: linux
arch: s390x
compiler: clang
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
# Extra tests to ensure IBM Power and ARM 64 work
- os: linux
arch: ppc64le
compiler: gcc
env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
- os: linux
arch: arm64
compiler: gcc
env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
allow_failures:
# Permanently fails on main.column_compression 'innodb' test (MDEV-23954)
- os: linux
arch: s390x
compiler: gcc
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
# Until OSX becomes a bit more stable
- os: osx
# ppc64el builder frequently runs out of memory
- arch: ppc64le
before_install:
- if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then
brew update;
brew install gnutls lz4 lzo xz snappy ccache jemalloc curl ossp-uuid pcre zstd;
brew link ccache;
export PATH="/usr/local/opt/ccache/libexec:$PATH";
fi
before_script:
- df -h
- ccache --version
- ccache --show-stats
- ccache --max-size=5G
script:
# following modules are disabled after sourcing .travis.compiler.sh:
# clang disabled: mroonga just generates too many warnings with clang and travis stops the job
# gcc/rpl: mroonga
- source .travis.compiler.sh
- cmake .
-DCMAKE_BUILD_TYPE=${TYPE}
${CMAKE_OPT}
-DWITH_SSL=system -DWITH_ZLIB=system
- make -j 4
- cd mysql-test
- travis_wait 30 ./mtr --force --max-test-fail=20 --parallel=4 --testcase-timeout=${TEST_CASE_TIMEOUT}
--suite=${MYSQL_TEST_SUITES}
--skip-test=binlog.binlog_unsafe
after_script:
- ccache --show-stats
- df -h
notifications:
irc:
channels:
- "chat.freenode.net#maria"
on_success: never # [always|never|change]
on_failure: never
template:
- "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}"

View File

@@ -2883,6 +2883,9 @@ static uint dump_routines_for_db(char *db)
create_caption_xml[i]);
continue;
}
switch_sql_mode(sql_file, ";", row[1]);
if (opt_drop)
fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
routine_type[i], routine_name);
@@ -2922,9 +2925,6 @@ static uint dump_routines_for_db(char *db)
"--\n");
}
switch_sql_mode(sql_file, ";", row[1]);
fprintf(sql_file,
"DELIMITER ;;\n"
"%s ;;\n"
@@ -5441,6 +5441,55 @@ int init_dumping_views(char *qdatabase __attribute__((unused)))
} /* init_dumping_views */
/*
mysql specific database initialization.
SYNOPSIS
init_dumping_mysql_tables
protections around dumping general/slow query log
qdatabase quoted name of the "mysql" database
RETURN VALUES
0 Success.
1 Failure.
*/
static int init_dumping_mysql_tables(char *qdatabase)
{
DBUG_ENTER("init_dumping_mysql_tables");
if (opt_drop_database)
fprintf(md_result_file,
"\n/*!50106 SET @save_log_output=@@LOG_OUTPUT*/;\n"
"/*M!100203 EXECUTE IMMEDIATE IF(@@LOG_OUTPUT='TABLE' AND (@@SLOW_QUERY_LOG=1 OR @@GENERAL_LOG=1),"
"\"SET GLOBAL LOG_OUTPUT='NONE'\", \"DO 0\") */;\n");
DBUG_RETURN(init_dumping_tables(qdatabase));
}
static void dump_first_mysql_tables(char *database)
{
char table_type[NAME_LEN];
char ignore_flag;
DBUG_ENTER("dump_first_mysql_tables");
if (!get_table_structure((char *) "general_log",
database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'general_log' table\n");
if (!get_table_structure((char *) "slow_log",
database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'slow_log' table\n");
/* general and slow query logs exist now */
if (opt_drop_database)
fprintf(md_result_file,
"\n/*!50106 SET GLOBAL LOG_OUTPUT=@save_log_output*/;\n\n");
DBUG_VOID_RETURN;
}
/*
Table Specific database initialization.
@@ -5547,7 +5596,6 @@ static int dump_all_tables_in_db(char *database)
char table_buff[NAME_LEN*2+3];
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
char *afterdot;
my_bool general_log_table_exists= 0, slow_log_table_exists=0;
my_bool transaction_registry_table_exists= 0;
int using_mysql_db= !my_strcasecmp(charset_info, database, "mysql");
DBUG_ENTER("dump_all_tables_in_db");
@@ -5555,11 +5603,15 @@ static int dump_all_tables_in_db(char *database)
afterdot= strmov(hash_key, database);
*afterdot++= '.';
if (init_dumping(database, init_dumping_tables))
if (init_dumping(database, using_mysql_db ? init_dumping_mysql_tables
: init_dumping_tables))
DBUG_RETURN(1);
if (opt_xml)
print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS);
if (using_mysql_db)
dump_first_mysql_tables(database);
if (lock_tables)
{
DYNAMIC_STRING query;
@@ -5648,26 +5700,18 @@ static int dump_all_tables_in_db(char *database)
else
{
/*
If general_log and slow_log exists in the 'mysql' database,
If transaction_registry exists in the 'mysql' database,
we should dump the table structure. But we cannot
call get_table_structure() here as 'LOCK TABLES' query got executed
above on the session and that 'LOCK TABLES' query does not contain
'general_log' and 'slow_log' tables. (you cannot acquire lock
on log tables). Hence mark the existence of these log tables here and
'transaction_registry'. Hence mark the existence of the table here and
after 'UNLOCK TABLES' query is executed on the session, get the table
structure from server and dump it in the file.
*/
if (using_mysql_db)
{
if (!my_strcasecmp(charset_info, table, "general_log"))
general_log_table_exists= 1;
else if (!my_strcasecmp(charset_info, table, "slow_log"))
slow_log_table_exists= 1;
else if (!my_strcasecmp(charset_info, table, "transaction_registry"))
if (using_mysql_db && !my_strcasecmp(charset_info, table, "transaction_registry"))
transaction_registry_table_exists= 1;
}
}
}
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
@@ -5686,39 +5730,25 @@ static int dump_all_tables_in_db(char *database)
DBUG_PRINT("info", ("Dumping routines for database %s", database));
dump_routines_for_db(database);
}
if (opt_xml)
{
fputs("</database>\n", md_result_file);
check_io(md_result_file);
}
if (lock_tables)
(void) mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES");
if (using_mysql_db)
{
char table_type[NAME_LEN];
char ignore_flag;
if (general_log_table_exists)
{
if (!get_table_structure((char *) "general_log",
database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'general_log' table\n");
}
if (slow_log_table_exists)
{
if (!get_table_structure((char *) "slow_log",
database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'slow_log' table\n");
}
if (transaction_registry_table_exists)
{
char table_type[NAME_LEN];
char ignore_flag;
if (!get_table_structure((char *) "transaction_registry",
database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'transaction_registry' table\n");
}
}
if (opt_xml)
{
fputs("</database>\n", md_result_file);
check_io(md_result_file);
}
if (flush_privileges && using_mysql_db)
{
fprintf(md_result_file,"\n--\n-- Flush Grant Tables \n--\n");

View File

@@ -23,6 +23,8 @@ ENDIF()
SET(MY_WARNING_FLAGS
-Wall
-Wdeclaration-after-statement
-Wenum-compare
-Wenum-conversion
-Wextra
-Wformat-security
-Wno-format-truncation

View File

@@ -43,6 +43,7 @@ MACRO(BUNDLE_PCRE2)
ENDFOREACH()
FOREACH(v "" "_DEBUG" "_RELWITHDEBINFO" "_RELEASE" "_MINSIZEREL")
STRING(REPLACE "/WX" "" pcre2_flags${v} "${CMAKE_C_FLAGS${v}}")
SET(pcre2_flags${v} "${pcre2_flags${v}} -std=c99 ")
IF(MSVC)
# Suppress a warning
STRING(APPEND pcre2_flags${v} " /wd4244 " )
@@ -53,8 +54,8 @@ MACRO(BUNDLE_PCRE2)
ExternalProject_Add(
pcre2
PREFIX "${dir}"
URL "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/pcre2-10.39.zip"
URL_MD5 e101c0ca9edb4b0af103bebe78ba52b0
URL "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.40/pcre2-10.40.zip"
URL_MD5 798698846982ce171d881ed0d7535c2a
INSTALL_COMMAND ""
CMAKE_ARGS
"-DCMAKE_WARN_DEPRECATED=FALSE"

View File

@@ -561,3 +561,5 @@
#endif // !defined(__STDC_FORMAT_MACROS)
#endif
#cmakedefine HAVE_VFORK 1

View File

@@ -983,3 +983,19 @@ IF(NOT MSVC)
HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE
)
ENDIF()
MY_CHECK_C_COMPILER_FLAG("-Werror")
IF(have_C__Werror)
SET(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
CHECK_C_SOURCE_COMPILES("
#include <unistd.h>
int main()
{
pid_t pid=vfork();
return (int)pid;
}"
HAVE_VFORK
)
SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS})
ENDIF()

View File

@@ -20,7 +20,7 @@ fi
MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
# Don't run full mysql_upgrade on every server restart, use --version-check to do it only once
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf --version-check"
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf --version-check --silent"
MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
MYCHECK_PARAMS="--all-databases --fast --silent"

View File

@@ -241,24 +241,54 @@ sub connect_to_MySQL
{
print "connect_to_MySQL\n" if $op{debug};
if(my @driverList = grep {/mariadb|mysql/i} DBI->available_drivers()) {
my $dsn;
my $driver = undef;
if(grep {/mariadb/i} @driverList)
{
$driver = "DBI:MariaDB";
}
elsif(grep {/mysql/i} @driverList)
{
$driver = "DBI:mysql";
}
if($mycnf{'socket'} && -S $mycnf{'socket'})
{
$dsn = "DBI:MariaDB:mariadb_socket=$mycnf{socket}";
if(grep {/mariadb/i} @driverList)
{
$dsn = $driver . ":mariadb_socket=$mycnf{socket}";
}
elsif(grep {/mysql/i} @driverList)
{
$dsn = $driver . ":mysql_socket=$mycnf{socket}";
}
}
elsif($mycnf{'host'})
{
$dsn = "DBI:MariaDB:host=$mycnf{host}" . ($mycnf{port} ? ";port=$mycnf{port}" : "");
$dsn = $driver . ":host=$mycnf{host}" . ($mycnf{port} ? ";port=$mycnf{port}" : "");
}
else
{
$dsn = "DBI:MariaDB:host=localhost";
$dsn = $driver . ":host=localhost";
}
print "connect_to_MySQL: DBI DSN: $dsn\n" if $op{debug};
print "connect_to_MySQL: DBI DSN: " . $dsn . "\n" if $op{debug};
$dbh = DBI->connect($dsn, $mycnf{'user'}, $mycnf{'pass'}) or die;
}
else
{
print STDERR "Install Perl 5.x driver: DBD:mysql or DBD:MariaDB\n";
print STDERR "currently installed Perl DBD drivers:\n";
foreach my $driver (DBI->available_drivers())
{
print STDERR " * " . $driver . "\n";
}
print STDERR "\n";
die("Exit as no MariaDB DBI driver found!\n");
}
}
sub collect_reports

View File

@@ -14,6 +14,8 @@ usr/share/man/man1/mysql_upgrade.1
usr/share/man/man1/resolveip.1
usr/share/man/man8/mariadbd.8
usr/share/man/man8/mysqld.8
usr/share/mysql/bulgarian
usr/share/mysql/chinese
usr/share/mysql/charsets
usr/share/mysql/czech
usr/share/mysql/danish

View File

@@ -12,11 +12,9 @@ MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
# do it himself. No database directories should be removed while the server
# is running! Another mariadbd in e.g. a different chroot is fine for us.
stop_server() {
# Return immediately if there are no mysql processes running
# Return immediately if there are no mysqld processes running
# as there is no point in trying to shutdown in that case.
if ! pgrep -x mariadbd > /dev/null; then return; fi
# Compatibility with versions that ran 'mysqld'
if ! pgrep -x mysqld > /dev/null; then return; fi
if ! pgrep -x --nslist pid --ns $$ "mysqld|mariadbd" > /dev/null; then return; fi
set +e
invoke-rc.d mariadb stop

View File

@@ -25,11 +25,10 @@ mysql_upgradedir=/var/lib/mysql-upgrade
# do it himself. No database directories should be removed while the server
# is running! Another mariadbd in e.g. a different chroot is fine for us.
stop_server() {
# Return immediately if there are no mysql processes running
# Return immediately if there are no mysqld processes running on a host
# (leave containerized processes with the same name in other namespaces)
# as there is no point in trying to shutdown in that case.
if ! pgrep -x --ns $$ mariadbd > /dev/null; then return; fi
# Compatibility with versions that ran 'mysqld'
if ! pgrep -x --ns $$ mysqld > /dev/null; then return; fi
if ! pgrep -x --nslist pid --ns $$ "mysqld|mariadbd" > /dev/null; then return; fi
set +e
invoke-rc.d mariadb stop

View File

@@ -1,3 +1,25 @@
# These should be moved, see https://jira.mariadb.org/browse/MDEV-21654
arch-dependent-file-in-usr-share usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so
arch-independent-package-contains-binary-or-object usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so
# Intentional for test files
national-encoding usr/share/mysql/mysql-test/*
# Extra test documentation files that really need to be kept in context in test directory
package-contains-documentation-outside-usr-share-doc usr/share/mysql/mysql-test/*
# Intentional directory structure
repeated-path-segment auth_gssapi usr/share/mysql/mysql-test/plugin/auth_gssapi/auth_gssapi/
repeated-path-segment connect usr/share/mysql/mysql-test/plugin/connect/connect/
repeated-path-segment disks usr/share/mysql/mysql-test/plugin/disks/disks/
repeated-path-segment func_test usr/share/mysql/mysql-test/plugin/func_test/func_test/
repeated-path-segment metadata_lock_info usr/share/mysql/mysql-test/plugin/metadata_lock_info/metadata_lock_info/
repeated-path-segment mroonga usr/share/mysql/mysql-test/plugin/mroonga/mroonga/
repeated-path-segment mroonga usr/share/mysql/mysql-test/plugin/mroonga/mroonga/include/mroonga/
repeated-path-segment oqgraph usr/share/mysql/mysql-test/plugin/oqgraph/oqgraph/
repeated-path-segment query_response_time usr/share/mysql/mysql-test/plugin/query_response_time/query_response_time/
repeated-path-segment rocksdb usr/share/mysql/mysql-test/plugin/rocksdb/rocksdb/
repeated-path-segment sequence usr/share/mysql/mysql-test/plugin/sequence/sequence/
repeated-path-segment sphinx usr/share/mysql/mysql-test/plugin/sphinx/sphinx/
repeated-path-segment spider usr/share/mysql/mysql-test/plugin/spider/spider/
repeated-path-segment type_inet usr/share/mysql/mysql-test/plugin/type_inet/type_inet/
repeated-path-segment type_test usr/share/mysql/mysql-test/plugin/type_test/type_test/
repeated-path-segment user_variables usr/share/mysql/mysql-test/plugin/user_variables/user_variables/
repeated-path-segment wsrep_info usr/share/mysql/mysql-test/plugin/wsrep_info/wsrep_info/

View File

@@ -266,7 +266,8 @@ free_mysql_variables(mysql_variable *vars)
static
char *
read_mysql_one_value(MYSQL *connection, const char *query)
read_mysql_one_value(MYSQL *connection, const char *query,
uint column, uint expect_columns)
{
MYSQL_RES *mysql_result;
MYSQL_ROW row;
@@ -274,10 +275,10 @@ read_mysql_one_value(MYSQL *connection, const char *query)
mysql_result = xb_mysql_query(connection, query, true);
ut_ad(mysql_num_fields(mysql_result) == 1);
ut_ad(mysql_num_fields(mysql_result) == expect_columns);
if ((row = mysql_fetch_row(mysql_result))) {
result = strdup(row[0]);
result = strdup(row[column]);
}
mysql_free_result(mysql_result);
@@ -285,6 +286,15 @@ read_mysql_one_value(MYSQL *connection, const char *query)
return(result);
}
static
char *
read_mysql_one_value(MYSQL *mysql, const char *query)
{
return read_mysql_one_value(mysql, query, 0/*offset*/, 1/*total columns*/);
}
static
bool
check_server_version(unsigned long version_number,
@@ -1078,92 +1088,327 @@ cleanup:
}
/*********************************************************************//**
Retrieves MySQL binlog position of the master server in a replication
setup and saves it in a file. It also saves it in mysql_slave_position
variable. */
bool
write_slave_info(MYSQL *connection)
class Var
{
char *master = NULL;
char *filename = NULL;
char *gtid_executed = NULL;
char *using_gtid = NULL;
char *position = NULL;
char *gtid_slave_pos = NULL;
char *ptr;
bool result = false;
const char *m_name;
char *m_value;
/*
Disable copying constructors for safety, as the default binary copying
which would be wrong. If we ever want them, the m_value
member should be copied using an strdup()-alike function.
*/
Var(const Var &); // Disabled
Var(Var &); // Disabled
public:
~Var()
{
free(m_value);
}
Var(const char *name)
:m_name(name),
m_value(NULL)
{ }
// Init using a SHOW VARIABLES LIKE 'name' query
Var(const char *name, MYSQL *mysql)
:m_name(name)
{
char buf[128];
my_snprintf(buf, sizeof(buf), "SHOW VARIABLES LIKE '%s'", m_name);
m_value= read_mysql_one_value(mysql, buf, 1/*offset*/, 2/*total columns*/);
}
/*
Init by name from a result set.
If the variable name is not found in the result set metadata field names,
it's value stays untouched.
*/
bool init(MYSQL_RES *mysql_result, MYSQL_ROW row)
{
MYSQL_FIELD *field= mysql_fetch_fields(mysql_result);
for (uint i= 0; i < mysql_num_fields(mysql_result); i++)
{
if (!strcmp(field[i].name, m_name))
{
free(m_value); // In case it was initialized earlier
m_value= row[i] ? strdup(row[i]) : NULL;
return false;
}
}
return true;
}
void replace(char from, char to)
{
ut_ad(m_value);
for (char *ptr= strchr(m_value, from); ptr; ptr= strchr(ptr, from))
*ptr= to;
}
mysql_variable status[] = {
{"Master_Host", &master},
{"Relay_Master_Log_File", &filename},
{"Exec_Master_Log_Pos", &position},
{"Executed_Gtid_Set", &gtid_executed},
{"Using_Gtid", &using_gtid},
{NULL, NULL}
};
const char *value() const { return m_value; }
bool eq_value(const char *str, size_t length) const
{
return m_value && !strncmp(m_value, str, length) && m_value[length] == '\0';
}
bool is_null_or_empty() const { return !m_value || !m_value[0]; }
bool print(String *to) const
{
ut_ad(m_value);
return to->append(m_value, strlen(m_value));
}
bool print_quoted(String *to) const
{
ut_ad(m_value);
return to->append('\'') || to->append(m_value, strlen(m_value)) ||
to->append('\'');
}
bool print_set_global(String *to) const
{
ut_ad(m_value);
return
to->append(STRING_WITH_LEN("SET GLOBAL ")) ||
to->append(m_name, strlen(m_name)) ||
to->append(STRING_WITH_LEN(" = '")) ||
to->append(m_value, strlen(m_value)) ||
to->append(STRING_WITH_LEN("';\n"));
}
};
mysql_variable variables[] = {
{"gtid_slave_pos", &gtid_slave_pos},
{NULL, NULL}
};
read_mysql_variables(connection, "SHOW SLAVE STATUS", status, false);
read_mysql_variables(connection, "SHOW VARIABLES", variables, true);
class Show_slave_status
{
Var m_mariadb_connection_name; // MariaDB: e.g. 'master1'
Var m_master; // e.g. 'localhost'
Var m_filename; // e.g. 'source-bin.000002'
Var m_position; // a number
Var m_mysql_gtid_executed; // MySQL56: e.g. single '<UUID>:1-5" or multiline
// '<UUID1>:1-10,\n<UUID2>:1-20\n<UUID3>:1-30'
Var m_mariadb_using_gtid; // MariaDB: 'No','Slave_Pos','Current_Pos'
if (master == NULL || filename == NULL || position == NULL) {
public:
Show_slave_status()
:m_mariadb_connection_name("Connection_name"),
m_master("Master_Host"),
m_filename("Relay_Master_Log_File"),
m_position("Exec_Master_Log_Pos"),
m_mysql_gtid_executed("Executed_Gtid_Set"),
m_mariadb_using_gtid("Using_Gtid")
{ }
void init(MYSQL_RES *res, MYSQL_ROW row)
{
m_mariadb_connection_name.init(res, row);
m_master.init(res, row);
m_filename.init(res, row);
m_position.init(res, row);
m_mysql_gtid_executed.init(res, row);
m_mariadb_using_gtid.init(res, row);
// Normalize
if (m_mysql_gtid_executed.value())
m_mysql_gtid_executed.replace('\n', ' ');
}
static void msg_is_not_slave()
{
msg("Failed to get master binlog coordinates "
"from SHOW SLAVE STATUS.This means that the server is not a "
"replication slave. Ignoring the --slave-info option");
/* we still want to continue the backup */
result = true;
goto cleanup;
}
/* Print slave status to a file.
If GTID mode is used, construct a CHANGE MASTER statement with
MASTER_AUTO_POSITION and correct a gtid_purged value. */
if (gtid_executed != NULL && *gtid_executed) {
bool is_mariadb_using_gtid() const
{
return !m_mariadb_using_gtid.eq_value("No", 2);
}
static bool start_comment_chunk(String *to)
{
return to->length() ? to->append(STRING_WITH_LEN("; ")) : false;
}
bool print_connection_name_if_set(String *to) const
{
if (!m_mariadb_connection_name.is_null_or_empty())
return m_mariadb_connection_name.print_quoted(to) || to->append(' ');
return false;
}
bool print_comment_master_identity(String *comment) const
{
if (comment->append(STRING_WITH_LEN("master ")))
return true;
if (!m_mariadb_connection_name.is_null_or_empty())
return m_mariadb_connection_name.print_quoted(comment);
return comment->append(STRING_WITH_LEN("''")); // Default not named master
}
bool print_using_master_log_pos(String *sql, String *comment) const
{
return
sql->append(STRING_WITH_LEN("CHANGE MASTER ")) ||
print_connection_name_if_set(sql) ||
sql->append(STRING_WITH_LEN("TO MASTER_LOG_FILE=")) ||
m_filename.print_quoted(sql) ||
sql->append(STRING_WITH_LEN(", MASTER_LOG_POS=")) ||
m_position.print(sql) ||
sql->append(STRING_WITH_LEN(";\n")) ||
print_comment_master_identity(comment) ||
comment->append(STRING_WITH_LEN(" filename ")) ||
m_filename.print_quoted(comment) ||
comment->append(STRING_WITH_LEN(" position ")) ||
m_position.print_quoted(comment);
}
bool print_mysql56(String *sql, String *comment) const
{
/*
SET @@GLOBAL.gtid_purged = '2174B383-5441-11E8-B90A-C80AA9429562:1-1029, '
'224DA167-0C0C-11E8-8442-00059A3C7B00:1-2695';
CHANGE MASTER TO MASTER_AUTO_POSITION=1;
*/
return
sql->append(STRING_WITH_LEN("SET GLOBAL gtid_purged=")) ||
m_mysql_gtid_executed.print_quoted(sql) ||
sql->append(STRING_WITH_LEN(";\n")) ||
sql->append(STRING_WITH_LEN("CHANGE MASTER TO MASTER_AUTO_POSITION=1;\n")) ||
print_comment_master_identity(comment) ||
comment->append(STRING_WITH_LEN(" purge list ")) ||
m_mysql_gtid_executed.print_quoted(comment);
}
bool print_mariadb10_using_gtid(String *sql, String *comment) const
{
return
sql->append(STRING_WITH_LEN("CHANGE MASTER ")) ||
print_connection_name_if_set(sql) ||
sql->append(STRING_WITH_LEN("TO master_use_gtid = slave_pos;\n")) ||
print_comment_master_identity(comment) ||
comment->append(STRING_WITH_LEN(" master_use_gtid = slave_pos"));
}
bool print(String *sql, String *comment, const Var &gtid_slave_pos) const
{
if (!m_mysql_gtid_executed.is_null_or_empty())
{
/* MySQL >= 5.6 with GTID enabled */
for (ptr = strchr(gtid_executed, '\n');
ptr;
ptr = strchr(ptr, '\n')) {
*ptr = ' ';
return print_mysql56(sql, comment);
}
result = backup_file_printf(XTRABACKUP_SLAVE_INFO,
"SET GLOBAL gtid_purged='%s';\n"
"CHANGE MASTER TO MASTER_AUTO_POSITION=1\n",
gtid_executed);
ut_a(asprintf(&mysql_slave_position,
"master host '%s', purge list '%s'",
master, gtid_executed) != -1);
} else if (gtid_slave_pos && *gtid_slave_pos &&
!(using_gtid && !strncmp(using_gtid, "No", 2))) {
if (!gtid_slave_pos.is_null_or_empty() && is_mariadb_using_gtid())
{
/* MariaDB >= 10.0 with GTID enabled */
result = backup_file_printf(XTRABACKUP_SLAVE_INFO,
"SET GLOBAL gtid_slave_pos = '%s';\n"
"CHANGE MASTER TO master_use_gtid = slave_pos\n",
gtid_slave_pos);
ut_a(asprintf(&mysql_slave_position,
"master host '%s', gtid_slave_pos %s",
master, gtid_slave_pos) != -1);
} else {
result = backup_file_printf(XTRABACKUP_SLAVE_INFO,
"CHANGE MASTER TO MASTER_LOG_FILE='%s', "
"MASTER_LOG_POS=%s\n", filename, position);
ut_a(asprintf(&mysql_slave_position,
"master host '%s', filename '%s', position '%s'",
master, filename, position) != -1);
return print_mariadb10_using_gtid(sql, comment);
}
cleanup:
free_mysql_variables(status);
free_mysql_variables(variables);
return print_using_master_log_pos(sql, comment);
}
return(result);
/*
Get master info into strings "sql" and "comment" from a MYSQL_RES.
@return false on success
@return true on error
*/
static bool get_slave_info(MYSQL_RES *show_slave_info_result,
const Var &gtid_slave_pos,
String *sql, String *comment)
{
if (!gtid_slave_pos.is_null_or_empty())
{
// Print gtid_slave_pos if any of the masters really needs it.
while (MYSQL_ROW row= mysql_fetch_row(show_slave_info_result))
{
Show_slave_status status;
status.init(show_slave_info_result, row);
if (status.is_mariadb_using_gtid())
{
if (gtid_slave_pos.print_set_global(sql) ||
comment->append(STRING_WITH_LEN("gtid_slave_pos ")) ||
gtid_slave_pos.print_quoted(comment))
return true; // Error
break;
}
}
}
// Print the list of masters
mysql_data_seek(show_slave_info_result, 0);
while (MYSQL_ROW row= mysql_fetch_row(show_slave_info_result))
{
Show_slave_status status;
status.init(show_slave_info_result, row);
if (start_comment_chunk(comment) ||
status.print(sql, comment, gtid_slave_pos))
return true; // Error
}
return false; // Success
}
/*
Get master info into strings "sql" and "comment".
@return false on success
@return true on error
*/
static bool get_slave_info(MYSQL *mysql, bool show_all_slave_status,
String *sql, String *comment)
{
bool rc= false; // Success
// gtid_slave_pos - MariaDB variable : e.g. "0-1-1" or "1-10-100,2-20-500"
Var gtid_slave_pos("gtid_slave_pos", mysql);
const char *query= show_all_slave_status ? "SHOW ALL SLAVES STATUS" :
"SHOW SLAVE STATUS";
MYSQL_RES *mysql_result= xb_mysql_query(mysql, query, true);
if (!mysql_num_rows(mysql_result))
{
msg_is_not_slave();
// Don't change rc, we still want to continue the backup
}
else
{
rc= get_slave_info(mysql_result, gtid_slave_pos, sql, comment);
}
mysql_free_result(mysql_result);
return rc;
}
};
/*********************************************************************//**
Retrieves MySQL binlog position of the master server in a replication
setup and saves it in a file. It also saves it in mysql_slave_position
variable.
@returns false on error
@returns true on success
*/
bool
write_slave_info(MYSQL *connection)
{
String sql, comment;
bool show_all_slaves_status= false;
switch (server_flavor)
{
case FLAVOR_MARIADB:
show_all_slaves_status= mysql_server_version >= 100000;
break;
case FLAVOR_UNKNOWN:
case FLAVOR_MYSQL:
case FLAVOR_PERCONA_SERVER:
break;
}
if (Show_slave_status::get_slave_info(connection, show_all_slaves_status,
&sql, &comment))
return false; // Error
if (!sql.length())
{
/*
SHOW [ALL] SLAVE STATUS returned no rows.
Don't create the file, but return success to continue the backup.
*/
return true; // Success
}
mysql_slave_position= strdup(comment.c_ptr());
return backup_file_print_buf(XTRABACKUP_SLAVE_INFO, sql.ptr(), sql.length());
}

View File

@@ -51,6 +51,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <my_getopt.h>
#include <mysql_com.h>
#include <my_default.h>
#include <scope.h>
#include <sql_class.h>
#include <fcntl.h>
@@ -4689,13 +4690,6 @@ fail:
goto fail;
}
if (auto b = aligned_malloc(UNIV_PAGE_SIZE_MAX, 4096)) {
field_ref_zero = static_cast<byte*>(
memset_aligned<4096>(b, 0, UNIV_PAGE_SIZE_MAX));
} else {
goto fail;
}
log_sys.create();
/* get current checkpoint_lsn */
@@ -4705,10 +4699,6 @@ fail:
msg("Error: cannot read redo log header");
unlock_and_fail:
mysql_mutex_unlock(&recv_sys.mutex);
free_and_fail:
aligned_free(const_cast<byte*>(field_ref_zero));
field_ref_zero = nullptr;
goto fail;
}
if (!log_sys.is_latest()) {
@@ -4725,7 +4715,7 @@ free_and_fail:
&& (my_mkdir(xtrabackup_extra_lsndir,0777,MYF(0)) < 0)) {
msg("Error: cannot mkdir %d: %s\n",
my_errno, xtrabackup_extra_lsndir);
goto free_and_fail;
goto fail;
}
/* create target dir if not exist */
@@ -4733,13 +4723,13 @@ free_and_fail:
&& (my_mkdir(xtrabackup_target_dir,0777,MYF(0)) < 0)){
msg("Error: cannot mkdir %d: %s\n",
my_errno, xtrabackup_target_dir);
goto free_and_fail;
goto fail;
}
xtrabackup_init_datasinks();
if (!select_history()) {
goto free_and_fail;
goto fail;
}
/* open the log file */
@@ -4748,7 +4738,7 @@ free_and_fail:
if (dst_log_file == NULL) {
msg("Error: failed to open the target stream for '%s'.",
LOG_FILE_NAME);
goto free_and_fail;
goto fail;
}
/* label it */
@@ -4757,7 +4747,7 @@ free_and_fail:
/* Write log header*/
if (ds_write(dst_log_file, log_hdr_buf, 12288)) {
msg("error: write to logfile failed");
goto free_and_fail;
goto fail;
}
log_copying_running = true;
/* start io throttle */
@@ -4774,7 +4764,7 @@ free_and_fail:
msg("merror: xb_load_tablespaces() failed with"
" error %s.", ut_strerr(err));
log_copying_running = false;
goto free_and_fail;
goto fail;
}
/* copy log file by current position */
@@ -4788,7 +4778,7 @@ free_and_fail:
if (log_copy_failed) {
log_copying_running = false;
goto free_and_fail;
goto fail;
}
DBUG_MARIABACKUP_EVENT("before_innodb_log_copy_thread_started", {});
@@ -4798,7 +4788,7 @@ free_and_fail:
/* FLUSH CHANGED_PAGE_BITMAPS call */
if (!flush_changed_page_bitmaps()) {
goto free_and_fail;
goto fail;
}
ut_a(xtrabackup_parallel > 0);
@@ -4865,9 +4855,6 @@ free_and_fail:
if (opt_log_innodb_page_corruption)
ok = corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE);
aligned_free(const_cast<byte*>(field_ref_zero));
field_ref_zero = nullptr;
if (!ok) {
goto fail;
}
@@ -5611,11 +5598,23 @@ static ibool prepare_handle_new_files(const char *data_home_dir,
const char *file_name, void *arg)
{
const char *dest_dir = static_cast<const char *>(arg);
std::string src_path = std::string(data_home_dir) + '/' + std::string(db_name) + '/' + file_name;
std::string src_path = std::string(data_home_dir) + '/' + std::string(db_name) + '/';
/* Copy "*.new" files from incremental to base dir for incremental backup */
std::string dest_path=
dest_dir ? std::string(dest_dir) + '/' + std::string(db_name) +
'/' + file_name : src_path;
'/' : src_path;
/*
A CREATE DATABASE could have happened during the base mariabackup run.
In case if the current table file (e.g. `t1.new`) is from such
a new database, the database directory may not exist yet in
the base backup directory. Let's make sure to check if the directory
exists (and create if needed).
*/
if (!directory_exists(dest_path.c_str(), true/*create if not exists*/))
return FALSE;
src_path+= file_name;
dest_path+= file_name;
size_t index = dest_path.find(".new");
DBUG_ASSERT(index != std::string::npos);
@@ -7043,6 +7042,20 @@ static int main_low(char** argv)
}
}
ut_ad(!field_ref_zero);
if (auto b = aligned_malloc(UNIV_PAGE_SIZE_MAX, 4096)) {
field_ref_zero = static_cast<byte*>(
memset_aligned<4096>(b, 0, UNIV_PAGE_SIZE_MAX));
} else {
msg("Can't allocate memory for field_ref_zero");
return EXIT_FAILURE;
}
auto _ = make_scope_exit([]() {
aligned_free(const_cast<byte*>(field_ref_zero));
field_ref_zero = nullptr;
});
/* --backup */
if (xtrabackup_backup && !xtrabackup_backup_func()) {
return(EXIT_FAILURE);

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBCOMP_ERR\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBCOMP_ERR\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBGALERA_NEW_CLUSTER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBGALERA_NEW_CLUSTER\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBGALERA_RECOVERY\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBGALERA_RECOVERY\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBINNOCHECKSUM\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBINNOCHECKSUM\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMARIABACKUP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIABACKUP\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMARIADB-CONV" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-CONV" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMARIADB-SERVICE-CONVERT\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SERVICE-CONVERT\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMBSTREAM\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMBSTREAM\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMSQL2MYSQL\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMSQL2MYSQL\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMY_PRINT_DEFAULTS" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMY_PRINT_DEFAULTS" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMY_SAFE_PROCESS\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMY_SAFE_PROCESS\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYISAM_FTDUMP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYISAM_FTDUMP\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYISAMCHK\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYISAMCHK\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYISAMLOG\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYISAMLOG\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYISAMPACK\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYISAMPACK\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,4 +1,4 @@
.TH MYROCKS_HOTBACKUP "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH MYROCKS_HOTBACKUP "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.SH NAME
myrocks_hotbackup \- streaming backup for MariaDB MyRocks
.SH DESCRIPTION

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL\-STRESS\-TE" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYSQL\-STRESS\-TE" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL\-TEST\-RUN\" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYSQL\-TEST\-RUN\" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL\&.SERVER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYSQL\&.SERVER\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_CLIENT_TEST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-CLIENT-TEST" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_CONFIG\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMYSQL_CONFIG\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_CONVERT_TAB" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-CONVERT-TAB" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_FIND_ROWS\F" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-FIND-ROWS\F" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_FIX_EXTENSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-FIX-EXTENSI" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_INSTALL_DB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-INSTALL-DB\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_LDB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-LDB\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_PLUGIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-PLUGIN\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_SECURE_INST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SECURE-INST" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_SETPERMISSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SETPERMISSI" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_TZINFO_TO_S" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-TZINFO-TO-S" "1" "22 April 2022" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -41,6 +41,7 @@ can be invoked several ways:
shell> \fBmysql_tzinfo_to_sql \fR\fB\fItz_dir\fR\fR
shell> \fBmysql_tzinfo_to_sql \fR\fB\fItz_file tz_name\fR\fR
shell> \fBmysql_tzinfo_to_sql \-\-leap \fR\fB\fItz_file\fR\fR
shell> \fBmysql_tzinfo_to_sql \-\-skip\-write\-binlog \fR\fB\fItz_dir\fR\fR
.fi
.if n \{\
.RE
@@ -100,6 +101,9 @@ shell> \fBmysql_tzinfo_to_sql \-\-leap \fR\fB\fItz_file\fR\fR\fB | mysql \-u roo
.RE
.\}
.PP
Using the \-\-skip\-write\-binlog option prevents writing of changes to the binary log or to other Galera
cluster members. This can be used with any form of running \fBmysql_tzinfo_to_sql\fR.
.PP
After running
\fBmysql_tzinfo_to_sql\fR, it is best to restart the server so that it does not continue to use any previously cached time zone data\&.
.SH "COPYRIGHT"

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQL_WAITPID\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-WAITPID\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLACCESS\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-ACCESS\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLADMIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-ADMIN\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLBINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-BINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -882,78 +882,11 @@ quote the value (e.g. \fB--rewrite-db="oldname->newname"\fR\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlbinlog: ignore-domain-ids option
.\" ignore-domain-ids option: mysqlbinlog
\fB\-\-ignore\-domain\-ids=\fR\fB\fIIDs\fR\fR
.sp
Hide events which are a part of any stream identified by the domain ID
list \fIIDs\fR\&. Cannot be used with \-\-do\-domain\-ids\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlbinlog: do-domain-ids option
.\" do-domain-ids option: mysqlbinlog
\fB\-\-do\-domain\-ids=\fR\fB\fIIDs\fR\fR
.sp
Display only the events which exist in a stream identified by \fIIDs\fR\&.
Cannot be used with \-\-ignore\-domain\-ids\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlbinlog: ignore-server-ids option
.\" ignore-server-ids option: mysqlbinlog
\fB\-\-ignore\-server\-ids=\fR\fB\fIIDs\fR\fR
.sp
Hide events which originated from any server whose ID is specified in
\fIIDs\fR\&. Cannot be used with \-\-do\-server\-ids\ or \-\-server\-id\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlbinlog: do-server-ids option
.\" do-server-ids option: mysqlbinlog
\fB\-\-do\-server\-ids=\fR\fB\fIIDs\fR\fR
.sp
Display only the events that originated from a server identified in
\fIIDs\fR\&. Cannot be used with \-\-ignore\-server\-ids, and
is an alias for \-\-server\-id\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlbinlog: server-id option
.\" server-id option: mysqlbinlog
\fB\-\-server\-id=\fR\fB\fIid\fR\fR
.sp
Display only those events created by the server having the given server ID\&.
Cannot be used with \-\-ignore\-server\-ids, and is an alias for
\-\-do\-server\-ids\&.
.RE
.sp
.RS 4

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLCHECK\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-CHECK\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLD\FR" "8" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADBD\FR" "8" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLD_MULTI\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-MULTI\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLD_SAFE\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SAFE\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLD_SAFE_HELPER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SAFE-HELPER\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLDUMP\FR" "1" "24 October 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-DUMP\FR" "1" "24 October 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -1549,24 +1549,6 @@ table, but will make the dump operation take considerably longer\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mysqldump: order-by-size option
.\" order-by-size option: mysqldump
\fB\-\-order\-by\-size\fR
.sp
Dump each table according to their size, smallest first\&. Useful when using \-\-single\-transaction on tables which get truncated/altered often\&.
.sp
The assumption here is that smaller tables get truncated more often, and by doing dumping those first, this reduces the chance that a \-\-single\-transaction
dump will fail with with 'Table definition has changed, please retry transaction'\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqldump: password option
.\" password option: mysqldump
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLDUMPSLOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-DUMPSLOW\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLHOTCOPY\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-HOTCOPY\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLIMPORT\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-IMPORT\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLSHOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SHOW\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLSLAP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-SLAP\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLTEST\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBMARIADB-TEST\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,4 +1,4 @@
.TH MYTOP "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH MYTOP "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.SH NAME
mytop \- display MariaDB server performance info like 'top'
.SH "SEE ALSO"

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBPERROR\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBPERROR\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBREPLACE\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBREPLACE\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBRESOLVE_STACK_DUM" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBRESOLVE_STACK_DUM" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBRESOLVEIP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBRESOLVEIP\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBWSREP_SST_COMMON\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBWSREP_SST_COMMON\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBWSREP_SST_MARIABACKUP\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBWSREP_SST_MYSQLDUMP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBWSREP_SST_MYSQLDUMP\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBWSREP_SST_RSYNC\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBWSREP_SST_RSYNC\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
.TH "\FBWSREP_SST_RSYNC_WAN\FR" "1" "15 May 2020" "MariaDB 10\&.10" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------

View File

@@ -0,0 +1,16 @@
# Grep file for regular expression and output to STDOUT
#
# Usage:
# --let $grep_file= /path/to/your/file
# --let $grep_regex= your_regex_string
# --source include/grep.inc
--perl
open (my $fh, "<", "$ENV{grep_file}") or die $!;
while (<$fh>)
{
/$ENV{grep_regex}/ &&
print;
}
close $fh;
EOF

View File

@@ -8,7 +8,6 @@
source include/not_embedded.inc;
-- require include/have_log_bin.require
disable_query_log;
show variables like 'log_bin';
enable_query_log;
if (`select not @@log_bin`) {
skip Test requires: 'have_log_bin';
}

View File

@@ -1,2 +0,0 @@
Variable_name Value
log_bin ON

View File

@@ -78,7 +78,10 @@ sub _gdb {
my ($tmp, $tmp_name) = tempfile();
print $tmp
"bt\n",
"thread apply all bt\n",
"set print sevenbit on\n",
"set print static-members off\n",
"set print frame-arguments all\n",
"thread apply all bt full\n",
"quit\n";
close $tmp or die "Error closing $tmp_name: $!";

View File

@@ -11,8 +11,6 @@ ERROR 42S02: Table 'test.x' doesn't exist
SET SESSION max_session_mem_used= 8192;
LOCK TABLE t1 WRITE;
ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
Warnings:
Note 1054 Unknown column 'b' in 't1'
SET SESSION max_session_mem_used = @max_session_mem_used_save;
UNLOCK TABLES;
DROP TABLE t1;

View File

@@ -14,9 +14,13 @@ SELECT * FROM t1;
ALTER TABLE x MODIFY xx INT;
SET SESSION max_session_mem_used= 8192;
--error 0,ER_OPTION_PREVENTS_STATEMENT
LOCK TABLE t1 WRITE;
--disable_warnings
--error 0,ER_OPTION_PREVENTS_STATEMENT
ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
--enable_warnings
SET SESSION max_session_mem_used = @max_session_mem_used_save;
UNLOCK TABLES;

View File

@@ -236,6 +236,66 @@ insert t1 (b) values (1);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
drop table t1;
#
# MDEV-25638 Assertion `!result' failed in convert_const_to_int
#
create table t1 (v1 bigint check (v1 not in ('x' , 'x111'))) ;
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Truncated incorrect DOUBLE value: 'x111'
select * from t1;
v1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Truncated incorrect DOUBLE value: 'x111'
select v1 from t1;
v1
select * from t1;
v1
prepare stmt from "select * from t1";
execute stmt;
v1
execute stmt;
v1
flush tables;
select * from t1;
v1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'x'
Warning 1292 Truncated incorrect DOUBLE value: 'x111'
select * from t1;
v1
deallocate prepare stmt;
drop table t1;
#
# MDEV-26061 MariaDB server crash at Field::set_default
#
create table t1 (v2 date check (v1 like default (v1)), v1 date default (from_days ('x')));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'x'
insert ignore into t1 values ( 'x' , 'x' ) ;
Warnings:
Warning 1265 Data truncated for column 'v2' at row 1
Warning 1265 Data truncated for column 'v1' at row 1
Warning 1292 Truncated incorrect INTEGER value: 'x'
drop table t1;
#
# End of 10.2 tests
#
#
# MDEV-26061 MariaDB server crash at Field::set_default
#
create table t1 (d timestamp check (default (d) is true)) as select 1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() CHECK (default(`d`) is true),
`1` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#
# End of 10.3 tests
#
#
# MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error
#
create table t1 (id varchar(2), constraint id check (id regexp '[a-z]'));
@@ -247,3 +307,6 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `id` CHECK (`id` regexp '[a-z]')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#
# End of 10.4 tests
#

View File

@@ -177,6 +177,49 @@ select * from t1 where a is null;
insert t1 (b) values (1);
drop table t1;
--echo #
--echo # MDEV-25638 Assertion `!result' failed in convert_const_to_int
--echo #
--enable_prepare_warnings
create table t1 (v1 bigint check (v1 not in ('x' , 'x111'))) ;
select * from t1;
select v1 from t1;
select * from t1;
prepare stmt from "select * from t1";
execute stmt;
execute stmt;
flush tables;
select * from t1;
select * from t1;
deallocate prepare stmt;
drop table t1;
--disable_prepare_warnings
--echo #
--echo # MDEV-26061 MariaDB server crash at Field::set_default
--echo #
create table t1 (v2 date check (v1 like default (v1)), v1 date default (from_days ('x')));
insert ignore into t1 values ( 'x' , 'x' ) ;
drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #
--echo #
--echo # MDEV-26061 MariaDB server crash at Field::set_default
--echo #
create table t1 (d timestamp check (default (d) is true)) as select 1;
show create table t1;
drop table t1;
--echo #
--echo # End of 10.3 tests
--echo #
--echo #
--echo # MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error
--echo #
@@ -184,3 +227,7 @@ create table t1 (id varchar(2), constraint id check (id regexp '[a-z]'));
alter table t1 force;
show create table t1;
drop table t1;
--echo #
--echo # End of 10.4 tests
--echo #

View File

@@ -142,7 +142,7 @@ DROP SERVER s1;
CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test');
Warnings:
Note 1476 The foreign server, s1, you are trying to create already exists
Note 1476 Cannot create foreign server 's1' as it already exists
DROP SERVER IF EXISTS s1;
DROP SERVER IF EXISTS s1;
SHOW BINLOG EVENTS;

View File

@@ -7,7 +7,7 @@ server_name username db
server1 user1 test0
CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user2', HOST 'localhost', DATABASE 'test1');
Warnings:
Note 1476 The foreign server, server1, you are trying to create already exists
Note 1476 Cannot create foreign server 'server1' as it already exists
SELECT server_name, username, db FROM mysql.servers;
server_name username db
server1 user1 test0
@@ -21,10 +21,10 @@ server_name username db
DROP SERVER IF EXISTS server1;
CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test0');
CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test1');
ERROR HY000: The foreign server, server_1, you are trying to create already exists
ERROR HY000: Cannot create foreign server 'server_1' as it already exists
CREATE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
Warnings:
Note 1476 The foreign server, server_1, you are trying to create already exists
Note 1476 Cannot create foreign server 'server_1' as it already exists
SELECT server_name, username, db FROM mysql.servers;
server_name username db
server_1 mysqltest_1 test0

View File

@@ -1,4 +1,7 @@
drop table if exists t1, t2;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
#
# Testcase for BUG#4551
#
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
@@ -18,6 +21,20 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
#
# End of 4.1 tests
#
#
# MDEV-28393 Server crashes in TABLE::mark_default_fields_for_write
#
create table t1 (a int, b text not null default '');
alter table t1 character set = utf8;
create table t2 select * from t1;
insert into t1 values (1,'');
drop table t1, t2;
#
# End of 10.2 tests
#
set sql_mode='ignore_bad_table_options';
create table t1 (
f1 int invisible,
@@ -39,3 +56,6 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
drop table t1;
set sql_mode=default;
#
# End of 10.4 tests
#

View File

@@ -1,42 +1,55 @@
# Testcase for BUG#4551
# This does not work for RBR yet.
--source include/have_innodb.inc
--source include/have_binlog_format_mixed_or_statement.inc
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--echo #
--echo # Testcase for BUG#4551
--echo #
# The bug was that when the table was TEMPORARY, it was not deleted if
# the CREATE SELECT failed (the code intended too, but it actually
# didn't). And as the CREATE TEMPORARY TABLE was not written to the
# binlog if it was a transactional table, it resulted in an
# inconsistency between binlog and the internal list of temp tables.
# This does not work for RBR yet.
--source include/have_binlog_format_mixed_or_statement.inc
--disable_query_log
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
--error ER_DUP_ENTRY
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t2;
--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t2;
--error ER_DUP_ENTRY
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t2;
--error ER_DUP_ENTRY
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146
--error ER_NO_SUCH_TABLE
select * from t2;
drop table t1;
# End of 4.1 tests
--echo #
--echo # End of 4.1 tests
--echo #
--echo #
--echo # MDEV-28393 Server crashes in TABLE::mark_default_fields_for_write
--echo #
create table t1 (a int, b text not null default '');
alter table t1 character set = utf8;
create table t2 select * from t1;
insert into t1 values (1,'');
drop table t1, t2;
--echo #
--echo # End of 10.2 tests
--echo #
set sql_mode='ignore_bad_table_options';
create table t1 (
@@ -50,4 +63,6 @@ show create table t1;
drop table t1;
set sql_mode=default;
# End of 10.4 tests
--echo #
--echo # End of 10.4 tests
--echo #

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,366 @@
--source include/have_utf8mb4.inc
CREATE TABLE t0 (a VARCHAR(64));
INSERT INTO t0 VALUES
('CHARACTER SET DEFAULT'),
('CHARACTER SET latin1'),
('CHARACTER SET utf8mb4'),
('COLLATE DEFAULT'),
('COLLATE utf8mb4_bin'),
('COLLATE latin1_swedish_ci'),
('COLLATE latin1_bin');
CREATE TABLE clauses
(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
cl1 VARCHAR(64) NOT NULL,
cl2 VARCHAR(64) NOT NULL,
cl3 VARCHAR(64) NOT NULL,
clause_count INT GENERATED ALWAYS AS ((cl1<>'') + (cl2<>'') + (cl3<>'')),
clauses TEXT GENERATED ALWAYS AS (CONCAT(cl1,
IF(cl2='','',' '), cl2,
IF(cl3='','',' '), cl3))
);
# No clauses
INSERT INTO clauses (cl1, cl2, cl3)
SELECT '' AS cl1, '' AS cl2, '' AS cl3;
# One clause
INSERT INTO clauses (cl1, cl2, cl3)
SELECT t0.a AS cl1, '' AS cl2, '' AS cl3
FROM t0;
# Two clauses
INSERT INTO clauses (cl1, cl2, cl3)
SELECT t0.a AS cl1, t2.a AS cl2, '' AS cl3
FROM t0 t0, t0 t2;
# Three clauses
INSERT INTO clauses (cl1, cl2, cl3)
SELECT t0.a AS cl1, t2.a AS cl2, t3.a AS cl3
FROM t0 t0, t0 t2, t0 t3;
DROP TABLE t0;
CREATE TABLE results_template
(
id INT NOT NULL PRIMARY KEY,
result TEXT NOT NULL
);
DELIMITER $$;
CREATE PROCEDURE diff_result_tables_stat(table1 VARCHAR(64),
table2 VARCHAR(64),
cond VARCHAR(128))
BEGIN
DECLARE query_counts TEXT DEFAULT
'SELECT '
' COUNT(*),'
' SUM(t1.result=t2.result),'
' SUM(t1.result<>t2.result) '
'FROM table1 t1 JOIN table2 t2 USING (id)/*$(WHERE)*/';
SET query_counts=REPLACE(query_counts, 'table1', table1);
SET query_counts=REPLACE(query_counts, 'table2', table2);
IF (cond<>'')
THEN
SET query_counts=REPLACE(query_counts, '/*$(WHERE)*/', CONCAT('WHERE ',cond));
END IF;
EXECUTE IMMEDIATE query_counts;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE diff_result_tables_records(table1 VARCHAR(64),
table2 VARCHAR(64),
cond VARCHAR(128))
BEGIN
DECLARE query_records TEXT DEFAULT
'SELECT '
' '''' AS ``,'
' clauses.clauses AS attrs,'
' t1.result AS `aaa`,'
' t2.result AS `bbb` '
' FROM table1 t1'
' JOIN table2 t2 USING (id)'
' JOIN clauses USING (id) '
' WHERE t1.result<>t2.result /*$(COND)*/ ORDER BY t1.id';
SET query_records=REPLACE(query_records, 'table1', table1);
SET query_records=REPLACE(query_records, 'table2', table2);
IF (cond<>'')
THEN
SET query_records=REPLACE(query_records, '/*$(COND)*/', CONCAT('AND ',cond));
END IF;
EXECUTE IMMEDIATE query_records;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE diff_result_tables(table1 VARCHAR(64),
table2 VARCHAR(64),
cond VARCHAR(128))
BEGIN
CALL diff_result_tables_stat(table1, table2, cond);
CALL diff_result_tables_records(table1, table2, cond);
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE exec(query_bootstrap TEXT,
query_pattern TEXT,
query_cleanup TEXT,
id INT,
clauses TEXT)
BEGIN
DECLARE query TEXT DEFAULT REPLACE(query_pattern, '/*CSCL*/',clauses);
DECLARE result TEXT DEFAULT NULL;
DECLARE CONTINUE HANDLER FOR
1064, /*ER_PARSE_ERROR*/
1302, /*ER_CONFLICTING_DECLARATIONS*/
1253 /*ER_COLLATION_CHARSET_MISMATCH*/
BEGIN
GET DIAGNOSTICS CONDITION 1 result=MESSAGE_TEXT;
SET result=CONCAT('ERROR: ', result);
END;
IF query_bootstrap<>''
THEN
EXECUTE IMMEDIATE query_bootstrap;
END IF;
EXECUTE IMMEDIATE query;
IF result IS NULL
THEN
IF query_pattern LIKE '%DATABASE%'
THEN
SET result=(SELECT CONCAT('CHARACTER SET ', DEFAULT_CHARACTER_SET_NAME,
' COLLATE ', DEFAULT_COLLATION_NAME)
FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='db1');
ELSE
SET result=(SELECT CONCAT('CHARACTER SET ', SUBSTRING_INDEX(TABLE_COLLATION,'_',1),
' COLLATE ', TABLE_COLLATION)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test1');
END IF;
END IF;
INSERT INTO results (id, result) VALUES (id, result);
IF query_cleanup<>''
THEN
EXECUTE IMMEDIATE query_cleanup;
END IF;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE show_results(query TEXT, clause_count_arg INT)
BEGIN
SELECT '' AS ``, CONCAT(clause_count_arg, ' clauses') AS `TEST:`;
SELECT '' AS ``, COUNT(*) AS `TOTAL`
FROM results JOIN clauses USING (id)
WHERE clauses.clause_count=clause_count_arg;
-- Display erroneous results
SELECT '' AS ``, COUNT(*) AS `ERROR`
FROM results JOIN clauses USING (id)
WHERE clauses.clause_count=clause_count_arg
AND result RLIKE '^ERROR';
SELECT '' AS ``, query, clauses AS attrs, result
FROM results JOIN clauses USING (id)
WHERE clauses.clause_count=clause_count_arg
AND result RLIKE '^ERROR' ORDER BY id;
-- Display successfull results
SELECT '' AS ``, COUNT(*) AS `OK`
FROM results JOIN clauses USING (id)
WHERE clauses.clause_count=clause_count_arg
AND result NOT RLIKE '^ERROR';
SELECT '' AS ``, query, clauses AS attrs, result
FROM results JOIN clauses USING (id)
WHERE clauses.clause_count=clause_count_arg
AND result NOT RLIKE '^ERROR' ORDER BY id;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE run(query_bootstrap TEXT,
query TEXT,
query_cleanup TEXT,
clause_count_arg INT)
BEGIN
FOR rec IN (SELECT * FROM clauses WHERE clause_count=clause_count_arg)
DO
CALL exec(query_bootstrap, query, query_cleanup, rec.id, rec.clauses);
END FOR;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE run_all(query_bootstrap TEXT, query TEXT, query_cleanup TEXT)
BEGIN
DECLARE msg TEXT;
DECLARE count_results INT;
DECLARE count_clauses INT;
FOR i IN 0..3
DO
CALL run(query_bootstrap, query, query_cleanup, i);
END FOR;
SET count_clauses=(SELECT COUNT(*) FROM clauses);
SET count_results=(SELECT COUNT(*) FROM results);
IF (count_results<>count_clauses)
THEN
SET msg=CONCAT('Got ', count_results,' rows in `results`; ',
'Expected ', count_clauses, ' rows');
SIGNAL SQLSTATE '45000'
SET MYSQL_ERRNO=30001,
MESSAGE_TEXT=msg;
END IF;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE show_results_all(query TEXT)
BEGIN
FOR i IN 0..3
DO
CALL show_results(query, i);
END FOR;
END;
$$
DELIMITER ;$$
--vertical_results
--echo #
--echo # Running CREATE DATABASE tests
--echo # Displaying all results
--echo #
SET @@collation_server=utf8mb4_unicode_ci;
CREATE TABLE results LIKE results_template;
CALL run_all('','CREATE DATABASE db1 /*CSCL*/', 'DROP DATABASE IF EXISTS db1');
CALL show_results_all('CREATE DATABASE');
ALTER TABLE results RENAME TO results_create_db;
--echo #
--echo # Running ALTER DATABASE tests
--echo #
CREATE TABLE results LIKE results_template;
CALL run_all('CREATE DATABASE db1 CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci',
'ALTER DATABASE db1 COMMENT '''' /*CSCL*/',
'DROP DATABASE db1');
ALTER TABLE results RENAME TO results_alter_db;
--echo # Displaying results that differ in CREATE DATABASE and ALTER DATABASE
--echo # Only queries with no clauses or with COLLATE DEFAULT alone
--echo # (without any other COLLATE or CHARACTER SET clauses)
--echo # should differ:
--echo # CREATE DATABASE db1 COMMENT '' [COLLATE DEFAULT]; -- means @@collation_server
--echo # ALTER DATABASE db1 COMMENT '' COLLATE DEFAULT; -- means "the default collation of the current character set of db1"
--echo # ALTER DATABASE db1 COMMENT ''; -- means "keep the current db1 collation"
CALL diff_result_tables('results_create_db', 'results_alter_db', '');
--echo #
--echo # Running CREATE TABLE tests
--echo #
CREATE DATABASE test1 COLLATE utf8mb4_unicode_ci;
CREATE TABLE results LIKE results_template;
CALL run_all('',
'CREATE TABLE test1.t1 (a int) /*CSCL*/',
'DROP TABLE IF EXISTS test1.t1');
ALTER TABLE results RENAME TO results_create_table;
--echo # Expect no difference to CREATE DATABASE
CALL diff_result_tables('results_create_db', 'results_create_table', '');
DROP DATABASE test1;
--echo #
--echo # Running ALTER TABLE tests
--echo #
CREATE DATABASE test1 COLLATE utf8mb4_unicode_ci;
CREATE TABLE results LIKE results_template;
CALL run_all('CREATE TABLE test1.t1(a INT) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci',
'ALTER TABLE test1.t1 COMMENT '''' /*CSCL*/',
'DROP TABLE test1.t1');
ALTER TABLE results RENAME TO results_alter_table;
--echo # Only queries with no clauses or with COLLATE DEFAULT alone
--echo # (without any other COLLATE or CHARACTER SET clauses)
--echo # should differ:
--echo # CREATE TABLE test1.t1 COMMENT '' [COLLATE DEFAULT]; -- means "the default collation of the database test1"
--echo # ALTER TABLE test1.t1 COMMENT '' COLLATE DEFAULT; -- means "the default collation of the current character set of test1.t1"
--echo # ALTER TABLE test1.t1 COMMENT ''; -- means "keep the current collation of test.t1"
CALL diff_result_tables('results_create_table', 'results_alter_table', '');
#SELECT result FROM (
#(SELECT * FROM results_create_table)
#EXCEPT
#(SELECT * FROM results_alter_table)) t1;
DROP DATABASE test1;
--echo #
--echo # Running ALTER TABLE CONVERT TO tests
--echo #
CREATE DATABASE test1 COLLATE utf8mb4_unicode_ci;
CREATE TABLE results LIKE results_template;
CALL run_all('CREATE TABLE test1.t1(a INT) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci',
'ALTER TABLE test1.t1 CONVERT TO /*CSCL*/',
'DROP TABLE test1.t1');
ALTER TABLE results RENAME TO results_convert_table;
--echo # CONVERT TO COLLATE (without CHARACTER SET) is not supported yet
CALL diff_result_tables_stat('results_alter_table', 'results_convert_table','');
--echo # Everything that did not fail on syntax error
--echo # should give equal results with ALTER TABLE DEFAULT CHARACTER SET
--echo # Expect 0 non-equal results:
CALL diff_result_tables('results_alter_table', 'results_convert_table',
't2.result NOT RLIKE ''SQL syntax''');
DROP DATABASE test1;
--horizontal_results
DROP PROCEDURE show_results_all;
DROP PROCEDURE run_all;
DROP PROCEDURE show_results;
DROP PROCEDURE exec;
DROP PROCEDURE run;
DROP PROCEDURE diff_result_tables;
DROP PROCEDURE diff_result_tables_stat;
DROP PROCEDURE diff_result_tables_records;
DROP TABLE clauses;
DROP TABLE results_template;
DROP TABLE results_create_db;
DROP TABLE results_alter_db;
DROP TABLE results_create_table;
DROP TABLE results_alter_table;
DROP TABLE results_convert_table;

View File

@@ -0,0 +1,106 @@
#
# MDEV-27896 Wrong result upon COLLATE latin1_bin CHARACTER SET latin1 on the table or the database level
#
CREATE DATABASE db1 COLLATE latin1_bin CHARACTER SET latin1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */
DROP DATABASE db1;
CREATE VIEW cscl AS
SELECT
DEFAULT_CHARACTER_SET_NAME,
DEFAULT_COLLATION_NAME
FROM
INFORMATION_SCHEMA.SCHEMATA
WHERE
SCHEMA_NAME='db1';
SET collation_server=utf8mb4_unicode_ci;
CREATE DATABASE db1 COMMENT 'test';
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_unicode_ci
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE latin1_bin;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
latin1 latin1_bin
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET latin1;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
latin1 latin1_swedish_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET latin1 COLLATE DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
latin1 latin1_swedish_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET latin1 COLLATE latin1_bin;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
latin1 latin1_bin
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT CHARACTER SET latin1;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
latin1 latin1_swedish_ci
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE latin1_bin CHARACTER SET latin1;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
latin1 latin1_bin
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET utf8mb4;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET utf8mb4 CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET latin1;
ERROR HY000: Conflicting declarations: 'CHARACTER SET DEFAULT (utf8mb4)' and 'CHARACTER SET latin1'
CREATE DATABASE db1 CHARACTER SET latin1 CHARACTER SET DEFAULT;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT (utf8mb4)'
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin;
ERROR 42000: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4'
CREATE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT;
ERROR 42000: COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4'
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE utf8mb4_bin;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_bin
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE utf8mb4_bin CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_bin
DROP DATABASE db1;
DROP VIEW cscl;

View File

@@ -0,0 +1,96 @@
--source include/have_utf8mb4.inc
--echo #
--echo # MDEV-27896 Wrong result upon COLLATE latin1_bin CHARACTER SET latin1 on the table or the database level
--echo #
CREATE DATABASE db1 COLLATE latin1_bin CHARACTER SET latin1;
SHOW CREATE DATABASE db1;
DROP DATABASE db1;
CREATE VIEW cscl AS
SELECT
DEFAULT_CHARACTER_SET_NAME,
DEFAULT_COLLATION_NAME
FROM
INFORMATION_SCHEMA.SCHEMATA
WHERE
SCHEMA_NAME='db1';
SET collation_server=utf8mb4_unicode_ci;
CREATE DATABASE db1 COMMENT 'test';
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE latin1_bin;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET latin1;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET latin1 COLLATE DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET latin1 COLLATE latin1_bin;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT CHARACTER SET latin1;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE latin1_bin CHARACTER SET latin1;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET utf8mb4;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET utf8mb4 CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
--error ER_CONFLICTING_DECLARATIONS
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET latin1;
--error ER_CONFLICTING_DECLARATIONS
CREATE DATABASE db1 CHARACTER SET latin1 CHARACTER SET DEFAULT;
--error ER_COLLATION_CHARSET_MISMATCH
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE latin1_bin;
--error ER_COLLATION_CHARSET_MISMATCH
CREATE DATABASE db1 COLLATE latin1_bin CHARACTER SET DEFAULT;
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE utf8mb4_bin;
SELECT * FROM cscl;
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE utf8mb4_bin CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DROP DATABASE db1;
DROP VIEW cscl;

View File

@@ -0,0 +1,27 @@
#
# MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
#
CREATE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
DROP TABLE t1;
#
# MDEV-27782 Wrong columns when using table level `CHARACTER SET utf8mb4 COLLATE DEFAULT`
#
CREATE TABLE t1 (a CHAR(10)) CHARACTER SET latin1 COLLATE DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10)) CHARACTER SET utf8mb4 COLLATE DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
DROP TABLE t1;

View File

@@ -0,0 +1,22 @@
--source include/have_utf8mb4.inc
--echo #
--echo # MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
--echo #
CREATE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET latin1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-27782 Wrong columns when using table level `CHARACTER SET utf8mb4 COLLATE DEFAULT`
--echo #
CREATE TABLE t1 (a CHAR(10)) CHARACTER SET latin1 COLLATE DEFAULT;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10)) CHARACTER SET utf8mb4 COLLATE DEFAULT;
SHOW CREATE TABLE t1;
DROP TABLE t1;

View File

@@ -78,37 +78,113 @@ ALTER DATABASE `` DEFAULT CHARACTER SET latin2;
ERROR 42000: Incorrect database name ''
USE test;
#
# Start of 10.0 tests
# End of 10.0 tests
#
#
# Start of 10.9 tests
#
#
# MDEV-7387 Alter table xxx CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1 should fail
# MDEV-28644 Unexpected error on ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4
#
CREATE DATABASE tmp DEFAULT CHARACTER SET latin5;
USE tmp;
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET utf8;
ERROR HY000: Conflicting declarations: 'CHARACTER SET DEFAULT' and 'CHARACTER SET utf8mb3'
ERROR HY000: Conflicting declarations: 'CHARACTER SET DEFAULT (latin5)' and 'CHARACTER SET utf8mb3'
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET DEFAULT;
ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET DEFAULT'
ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET DEFAULT (latin5)'
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET utf8;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET DEFAULT;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8);
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET latin1;
ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET latin1'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET DEFAULT;
ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET DEFAULT'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET utf8;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET utf8mb3'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET DEFAULT;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET utf8;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin5' and 'CHARACTER SET utf8mb3'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET latin1;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin5' and 'CHARACTER SET latin1'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP DATABASE tmp;
USE test;
#
# End of 10.0 tests
# End of 10.9 tests
#

View File

@@ -108,11 +108,16 @@ ALTER DATABASE `` DEFAULT CHARACTER SET latin2;
USE test;
--echo #
--echo # Start of 10.0 tests
--echo # End of 10.0 tests
--echo #
--echo #
--echo # Start of 10.9 tests
--echo #
--echo #
--echo # MDEV-7387 Alter table xxx CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1 should fail
--echo # MDEV-28644 Unexpected error on ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4
--echo #
CREATE DATABASE tmp DEFAULT CHARACTER SET latin5;
USE tmp;
@@ -125,23 +130,48 @@ DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET DEFAULT;
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8);
--error ER_CONFLICTING_DECLARATIONS
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET latin1;
--error ER_CONFLICTING_DECLARATIONS
SHOW CREATE TABLE t1;
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET DEFAULT;
--error ER_CONFLICTING_DECLARATIONS
SHOW CREATE TABLE t1;
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET utf8;
--error ER_CONFLICTING_DECLARATIONS
SHOW CREATE TABLE t1;
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET DEFAULT;
--error ER_CONFLICTING_DECLARATIONS
SHOW CREATE TABLE t1;
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET utf8;
--error ER_CONFLICTING_DECLARATIONS
SHOW CREATE TABLE t1;
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET latin1;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP DATABASE tmp;
USE test;
--echo #
--echo # End of 10.0 tests
--echo # End of 10.9 tests
--echo #

View File

@@ -723,6 +723,8 @@ utf8mb3_general_ci utf8mb3_general_ci
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest1`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -730,8 +732,6 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = koi8r */ ;
/*!50003 SET character_set_results = koi8r */ ;
/*!50003 SET collation_connection = koi8r_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
INOUT <20><><EFBFBD><EFBFBD><EFBFBD>1 CHAR(10),
@@ -757,6 +757,8 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -764,8 +766,6 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = koi8r */ ;
/*!50003 SET character_set_results = koi8r */ ;
/*!50003 SET collation_connection = koi8r_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
INOUT <20><><EFBFBD><EFBFBD><EFBFBD>1 CHAR(10) CHARACTER SET utf8,
@@ -799,6 +799,8 @@ ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest2`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -806,8 +808,6 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = koi8r */ ;
/*!50003 SET character_set_results = koi8r */ ;
/*!50003 SET collation_connection = koi8r_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
INOUT <20><><EFBFBD><EFBFBD><EFBFBD>1 CHAR(10),
@@ -833,6 +833,8 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -840,8 +842,6 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = koi8r */ ;
/*!50003 SET character_set_results = koi8r */ ;
/*!50003 SET collation_connection = koi8r_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
INOUT <20><><EFBFBD><EFBFBD><EFBFBD>1 CHAR(10) CHARACTER SET utf8,

View File

@@ -723,6 +723,8 @@ utf8mb3_general_ci utf8mb3_general_ci
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest1`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -730,8 +732,6 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = utf8mb3 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
INOUT парам1 CHAR(10),
@@ -757,6 +757,8 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -764,8 +766,6 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = utf8mb3 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(
INOUT парам1 CHAR(10) CHARACTER SET utf8,
@@ -799,6 +799,8 @@ ALTER DATABASE `mysqltest1` CHARACTER SET cp866 COLLATE cp866_general_ci ;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest2`;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -806,8 +808,6 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = utf8mb3 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`(
INOUT парам1 CHAR(10),
@@ -833,6 +833,8 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
ALTER DATABASE `mysqltest2` CHARACTER SET cp866 COLLATE cp866_general_ci ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -840,8 +842,6 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET character_set_client = utf8mb3 */ ;
/*!50003 SET character_set_results = utf8mb3 */ ;
/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`(
INOUT парам1 CHAR(10) CHARACTER SET utf8,

View File

@@ -1,5 +1,3 @@
drop table if exists t1,t2,t3,t4,t5,t6;
drop database if exists mysqltest;
set sql_mode="";
CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
b varchar(1) binary NOT NULL DEFAULT ' ',
@@ -3135,7 +3133,9 @@ t3 CREATE TABLE `t3` (
`max(c)` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2, t3;
#
# MDEV-11359: Implement IGNORE for bulk operation
#
create table t1 (a int primary key default 0, b int default 3);
insert into t1 values (1, ignore);
insert into t1 values (2, ignore);
@@ -3354,6 +3354,9 @@ a b
30 31
drop table t1;
set sql_mode=default;
#
# MDEV-10201 Bad results for CREATE TABLE t1 (a INT DEFAULT b, b INT DEFAULT 4)
#
create table t1 (a int default b, b int default 4, t text);
insert t1 (b, t) values (5, '1 column is omitted');
insert t1 values (default, 5, '2 column gets DEFAULT, keyword');
@@ -3376,8 +3379,14 @@ a b t
5 5 8 reversed, also expression DEFAULT(0)+0
5 5 9 reversed, the value of the DEFAULT(a), that is b
drop table t1;
#
# MDEV-10352 Server crashes in Field::set_default on CREATE TABLE
#
create table t1 (col1 int default(-(default(col1))));
ERROR 01000: Expression for field `col1` is referring to uninitialized field `col1`
#
# MDEV-10354 Assertion `! is_set()' failed in Diagnostics_area::set_ok_status on CREATE TABLE with invalid default
#
create table t1 (col int default (yearweek((exp(710)))));
ERROR 22003: DOUBLE value is out of range in 'exp(710)'
#
@@ -3395,7 +3404,37 @@ ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
show warnings;
Level Code Message
Error 4029 Expression for field `a` is referring to uninitialized field `a`
# end of 10.2 test
#
# MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
#
CREATE TABLE t1 (pk varchar(36) DEFAULT uuid());
INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
1
1
1
DROP TABLE t1;
#
# MDEV-28402: ASAN heap-use-after-free in create_tmp_table,
# Assertion `l_offset >= 0 && table->s->rec_buff_length - l_offset > 0'
#
CREATE TABLE t (a INT, KEY (a));
INSERT INTO t VALUES (1),(2);
SELECT DISTINCT DEFAULT(a), CASE a WHEN 0 THEN 1 ELSE 2 END FROM t GROUP BY a WITH ROLLUP;
DEFAULT(a) CASE a WHEN 0 THEN 1 ELSE 2 END
NULL 2
DROP TABLE t;
CREATE TABLE t (a INT, KEY (a));
INSERT INTO t VALUES (1),(2);
CREATE ALGORITHM=TEMPTABLE VIEW v AS SELECT * FROM t;
SELECT DISTINCT DEFAULT(a), CASE a WHEN 0 THEN 1 ELSE 2 END FROM v GROUP BY a WITH ROLLUP;
DEFAULT(a) CASE a WHEN 0 THEN 1 ELSE 2 END
NULL 2
DROP TABLE t;
DROP VIEW v;
#
# End of 10.2 test
#
#
# MDEV-22703 DEFAULT() on a BLOB column can overwrite the default
# record, which can cause crashes when accessing already released
@@ -3411,4 +3450,18 @@ length(DEFAULT(h))
25
INSERT INTO t1 () VALUES ();
drop table t1;
# end of 10.3 test
#
# End of 10.3 test
#
#
# MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
#
CREATE TABLE t1 (pk text DEFAULT length(uuid()));
INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
1
1
DROP TABLE t1;
#
# End of 10.4 test
#

View File

@@ -1,16 +1,10 @@
--source include/have_innodb.inc
#
# test of already fixed bugs
#
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6;
drop database if exists mysqltest;
#
# Bug 10838
# Insert causes warnings for no default values and corrupts tables
#
--disable_warnings
set sql_mode="";
CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ',
b varchar(1) binary NOT NULL DEFAULT ' ',
@@ -1891,7 +1885,9 @@ show create table t2;
show create table t3;
drop table t1, t2, t3;
--echo #
--echo # MDEV-11359: Implement IGNORE for bulk operation
--echo #
create table t1 (a int primary key default 0, b int default 3);
insert into t1 values (1, ignore);
insert into t1 values (2, ignore);
@@ -2071,9 +2067,9 @@ select * from t1;
drop table t1;
set sql_mode=default;
#
# MDEV-10201 Bad results for CREATE TABLE t1 (a INT DEFAULT b, b INT DEFAULT 4)
#
--echo #
--echo # MDEV-10201 Bad results for CREATE TABLE t1 (a INT DEFAULT b, b INT DEFAULT 4)
--echo #
create table t1 (a int default b, b int default 4, t text);
insert t1 (b, t) values (5, '1 column is omitted');
insert t1 values (default, 5, '2 column gets DEFAULT, keyword');
@@ -2088,15 +2084,15 @@ insert t1 (t,b,a) values ('9 reversed, the value of the DEFAULT(a), that is b',
select * from t1 order by t;
drop table t1;
#
# MDEV-10352 Server crashes in Field::set_default on CREATE TABLE
#
--echo #
--echo # MDEV-10352 Server crashes in Field::set_default on CREATE TABLE
--echo #
--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
create table t1 (col1 int default(-(default(col1))));
#
# MDEV-10354 Assertion `! is_set()' failed in Diagnostics_area::set_ok_status on CREATE TABLE with invalid default
#
--echo #
--echo # MDEV-10354 Assertion `! is_set()' failed in Diagnostics_area::set_ok_status on CREATE TABLE with invalid default
--echo #
--error ER_DATA_OUT_OF_RANGE
create table t1 (col int default (yearweek((exp(710)))));
@@ -2116,7 +2112,34 @@ DROP TABLE t1;
create table t1 (a int as (a));
show warnings;
--echo # end of 10.2 test
--echo #
--echo # MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
--echo #
CREATE TABLE t1 (pk varchar(36) DEFAULT uuid());
INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
DROP TABLE t1;
--echo #
--echo # MDEV-28402: ASAN heap-use-after-free in create_tmp_table,
--echo # Assertion `l_offset >= 0 && table->s->rec_buff_length - l_offset > 0'
--echo #
CREATE TABLE t (a INT, KEY (a));
INSERT INTO t VALUES (1),(2);
SELECT DISTINCT DEFAULT(a), CASE a WHEN 0 THEN 1 ELSE 2 END FROM t GROUP BY a WITH ROLLUP;
DROP TABLE t;
CREATE TABLE t (a INT, KEY (a));
INSERT INTO t VALUES (1),(2);
CREATE ALGORITHM=TEMPTABLE VIEW v AS SELECT * FROM t;
SELECT DISTINCT DEFAULT(a), CASE a WHEN 0 THEN 1 ELSE 2 END FROM v GROUP BY a WITH ROLLUP;
DROP TABLE t;
DROP VIEW v;
--echo #
--echo # End of 10.2 test
--echo #
--echo #
--echo # MDEV-22703 DEFAULT() on a BLOB column can overwrite the default
@@ -2134,4 +2157,18 @@ SELECT length(DEFAULT(h)) FROM t1;
INSERT INTO t1 () VALUES ();
drop table t1;
--echo # end of 10.3 test
--echo #
--echo # End of 10.3 test
--echo #
--echo #
--echo # MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
--echo #
CREATE TABLE t1 (pk text DEFAULT length(uuid()));
INSERT INTO t1 VALUES (),();
SELECT 1 FROM t1 GROUP BY DEFAULT(pk);
DROP TABLE t1;
--echo #
--echo # End of 10.4 test
--echo #

View File

@@ -0,0 +1,18 @@
#
# MDEV-26423: MariaDB server crash in Create_tmp_table::finalize
#
CREATE TABLE v0 (
v2 DATE DEFAULT ( v1 MOD 68321183.000000 ) ,
v1 DATETIME NULL ) engine=innodb;
SHOW DATABASES LIKE 'x';
Database (x)
SELECT DISTINCT v2 , v1 , DEFAULT ( v2 ) FROM v0;
v2 v1 DEFAULT ( v2 )
DROP TABLE v0;
CREATE TABLE t1 (v1 DATE, v2 DATE DEFAULT(v1)) engine=innodb;
SELECT DISTINCT DEFAULT(v2) FROM t1 ;
DEFAULT(v2)
DROP TABLE t1;
#
# End of 10.2 tests
#

Some files were not shown because too many files have changed in this diff Show More