Merge 10.5 into 10.6
This commit is contained in:
commit
92abdcca5a
@ -41,6 +41,7 @@ addons:
|
||||
- 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
|
||||
@ -50,11 +51,12 @@ addons:
|
||||
- libboost-system-dev
|
||||
- libboost-thread-dev
|
||||
- libcrack2-dev
|
||||
- libcurl3-dev
|
||||
- libcurl4-openssl-dev
|
||||
- libdbd-mysql
|
||||
- libedit-dev
|
||||
- libjemalloc-dev
|
||||
- libjudy-dev
|
||||
- libkrb5-dev
|
||||
- liblz4-dev
|
||||
- libncurses5-dev
|
||||
- libnuma-dev
|
||||
@ -63,7 +65,6 @@ addons:
|
||||
- libreadline-gplv2-dev
|
||||
- libsnappy-dev
|
||||
- libssl-dev
|
||||
- libstemmer-dev
|
||||
- libxml2-dev
|
||||
- lsb-release
|
||||
- perl
|
||||
@ -136,7 +137,6 @@ jobs:
|
||||
- dh-exec
|
||||
- dh-systemd
|
||||
- fakeroot
|
||||
- libdistro-info-perl
|
||||
- libsystemd-dev
|
||||
- libzstd-dev
|
||||
- po-debconf
|
||||
|
@ -1177,9 +1177,6 @@ get_options(int *argc,char ***argv)
|
||||
if (debug_check_flag)
|
||||
my_end_arg= MY_CHECK_ERROR;
|
||||
|
||||
if (!user)
|
||||
user= (char *)"root";
|
||||
|
||||
/*
|
||||
If something is created and --no-drop is not specified, we drop the
|
||||
schema.
|
||||
|
5
debian/additions/debian-start
vendored
5
debian/additions/debian-start
vendored
@ -1,11 +1,10 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script is executed by "/etc/init.d/mariadb" on every (re)start.
|
||||
# This script is executed by both SysV init /etc/init.d/mariadb and
|
||||
# systemd mariadb.service on every (re)start.
|
||||
#
|
||||
# Changes to this file will be preserved when updating the Debian package.
|
||||
#
|
||||
# NOTE: This file is read only by the traditional SysV init script, not systemd.
|
||||
#
|
||||
|
||||
source /usr/share/mysql/debian-start.inc.sh
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
|
||||
[client]
|
||||
# Example of client certificate usage
|
||||
# ssl-cert = /etc/mysql/client-cert.pem
|
||||
# ssl-key = /etc/mysql/client-key.pem
|
||||
#ssl-cert = /etc/mysql/client-cert.pem
|
||||
#ssl-key = /etc/mysql/client-key.pem
|
||||
#
|
||||
# Allow only TLS encrypted connections
|
||||
# ssl-verify-server-cert = on
|
||||
#ssl-verify-server-cert = on
|
||||
|
||||
# This group is *never* read by mysql client library, though this
|
||||
# /etc/mysql/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL
|
||||
|
@ -82,6 +82,7 @@ expire_logs_days = 10
|
||||
#ssl-ca = /etc/mysql/cacert.pem
|
||||
#ssl-cert = /etc/mysql/server-cert.pem
|
||||
#ssl-key = /etc/mysql/server-key.pem
|
||||
#require-secure-transport = on
|
||||
|
||||
#
|
||||
# * Character sets
|
||||
|
@ -7,8 +7,8 @@
|
||||
[galera]
|
||||
# Mandatory settings
|
||||
#wsrep_on = ON
|
||||
#wsrep_provider =
|
||||
#wsrep_cluster_address =
|
||||
#wsrep_cluster_name = "MariaDB Galera Cluster"
|
||||
#wsrep_cluster_address = gcomm://
|
||||
#binlog_format = row
|
||||
#default_storage_engine = InnoDB
|
||||
#innodb_autoinc_lock_mode = 2
|
||||
|
20
debian/control
vendored
20
debian/control
vendored
@ -5,6 +5,7 @@ Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
|
||||
Build-Depends: bison,
|
||||
chrpath,
|
||||
cmake,
|
||||
cracklib-runtime,
|
||||
debhelper (>= 9),
|
||||
dh-apparmor,
|
||||
dh-exec,
|
||||
@ -12,6 +13,7 @@ Build-Depends: bison,
|
||||
flex [i386 amd64],
|
||||
gdb,
|
||||
libaio-dev [linux-any],
|
||||
libarchive-dev,
|
||||
libboost-atomic-dev [i386 amd64],
|
||||
libboost-chrono-dev [i386 amd64],
|
||||
libboost-date-time-dev [i386 amd64],
|
||||
@ -23,38 +25,41 @@ Build-Depends: bison,
|
||||
libcrack2-dev (>= 2.9.0),
|
||||
libcurl4-openssl-dev | libcurl4-dev,
|
||||
libedit-dev,
|
||||
libedit-dev:native,
|
||||
libjemalloc-dev [linux-any],
|
||||
libjudy-dev,
|
||||
libkrb5-dev,
|
||||
liblz4-dev,
|
||||
libncurses5-dev (>= 5.0-6~),
|
||||
libnuma-dev [!armhf],
|
||||
libncurses5-dev:native (>= 5.0-6~),
|
||||
libnuma-dev [linux-any],
|
||||
libpam0g-dev,
|
||||
libpcre2-dev,
|
||||
libreadline-gplv2-dev [i386 amd64],
|
||||
libsnappy-dev,
|
||||
libssl-dev | libssl1.0-dev,
|
||||
libssl-dev,
|
||||
libssl-dev:native,
|
||||
libsystemd-dev [linux-any],
|
||||
libxml2-dev,
|
||||
libzstd-dev,
|
||||
lsb-release,
|
||||
perl,
|
||||
perl:any,
|
||||
po-debconf,
|
||||
psmisc,
|
||||
unixodbc-dev,
|
||||
uuid-dev,
|
||||
zlib1g-dev (>= 1:1.1.3-5~)
|
||||
Rules-Requires-Root: no
|
||||
Standards-Version: 3.8.2
|
||||
Standards-Version: 4.5.0
|
||||
Homepage: https://mariadb.org/
|
||||
Vcs-Browser: https://github.com/MariaDB/server/
|
||||
Vcs-Git: https://github.com/MariaDB/server.git
|
||||
|
||||
Package: libmariadb-dev
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Section: libdevel
|
||||
Depends: libmariadb3 (= ${binary:Version}),
|
||||
libssl-dev,
|
||||
zlib1g-dev,
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
@ -188,12 +193,12 @@ Description: Virtual package to satisfy external libmysqlclient18 depends
|
||||
|
||||
Package: libmariadbd19
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Section: libs
|
||||
Depends: ${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Breaks: libmariadbd-dev (<< ${source:Version})
|
||||
Replaces: libmariadbd-dev (<< ${source:Version})
|
||||
Multi-Arch: same
|
||||
Description: MariaDB embedded database, shared library
|
||||
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
|
||||
server. SQL (Structured Query Language) is the most popular database query
|
||||
@ -204,7 +209,6 @@ Description: MariaDB embedded database, shared library
|
||||
|
||||
Package: libmariadbd-dev
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Section: libdevel
|
||||
Provides: libmysqld-dev
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
@ -241,6 +245,7 @@ Package: mariadb-common
|
||||
Architecture: all
|
||||
Depends: mysql-common (>= 5.6.25),
|
||||
${misc:Depends}
|
||||
Multi-Arch: foreign
|
||||
Description: MariaDB common configuration files
|
||||
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
|
||||
server. SQL (Structured Query Language) is the most popular database query
|
||||
@ -679,6 +684,7 @@ Description: GSSAPI authentication plugin for MariaDB server
|
||||
|
||||
Package: mariadb-plugin-gssapi-client
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: libgssapi-krb5-2,
|
||||
mariadb-client-10.6 (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
|
12
debian/mariadb-common.postinst
vendored
12
debian/mariadb-common.postinst
vendored
@ -23,6 +23,18 @@ case "$1" in
|
||||
echo " ln -sf mariadb.cnf /etc/mysql/my.cnf"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Note that MySQL in Debian runs the configure-symlinks from the
|
||||
# mysql-server-x.x.postinst and postrm files, while the MySQL.com (and
|
||||
# Percona.com) packaging triggers update-alternatives directly form the
|
||||
# mysql-common (and percona-x-common) package using priority 200.
|
||||
#
|
||||
# Thus, we need to ensure here that mariadb.cnf indeed became the primary
|
||||
# alternative and override with priority 500 if needed.
|
||||
if ! update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf"
|
||||
then
|
||||
update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mariadb.cnf" 500 || true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
151
debian/mariadb-server-10.6.README.Debian
vendored
151
debian/mariadb-server-10.6.README.Debian
vendored
@ -1,41 +1,145 @@
|
||||
* MYSQL WON'T START OR STOP?:
|
||||
=============================
|
||||
* MYSQL WON'T START OR STOP?
|
||||
============================
|
||||
|
||||
The most common reasons the server does not start are:
|
||||
- AppArmor is enforced and something is wrong with the confinement profile.
|
||||
- Process supervisor scripts (init, systemd etc) fail to execute normally.
|
||||
- The configuration in /etc/mysql/... is wrong and prevents server from running.
|
||||
|
||||
First check the contents of syslog (or systemd journal) and then check the
|
||||
logs at /var/log/mysql/ for any hints of what might be wrong.
|
||||
|
||||
Examples:
|
||||
grep mysql /var/log/syslog
|
||||
journalctl -u mariadb
|
||||
|
||||
|
||||
* NEW SERVICE NAME, PROCESS AND BINARY NAMES IN MARIADB 10.5
|
||||
============================================================
|
||||
|
||||
Starting form MariaDB 10.5, the default SysV init service name is 'mariadb',
|
||||
and can be accessed at path /etc/init.d/mariadb. The alias 'mysql' is only
|
||||
created on upgrades.
|
||||
|
||||
On systemd services both 'mariadb' and alias 'mysql' are available all the time.
|
||||
|
||||
Note that the new daemon name is 'mariadbd' instead of 'mysqld' and also most
|
||||
of the binaries have been renamed to mariadb-something, yet the old mysql-something
|
||||
name has been kept as a symbolic link to the new name for backwards compatibility.
|
||||
|
||||
|
||||
* NATIVE SYSTEMD SERVICE INTRODUCED IN MARIADB 10.1
|
||||
===================================================
|
||||
|
||||
From MariaDB 10.1 onwards the upstream mariadb.service and mariadb@.service are
|
||||
used to provide the full systemd experience. Some features available in
|
||||
traditional /etc/init.d/mysql have been changed. For details see
|
||||
https://mariadb.com/kb/en/mariadb/systemd/
|
||||
|
||||
|
||||
* MIXING PACKAGES FROM MARIAD.ORG AND OFFICIAL DEBIAN REPOSITORIES
|
||||
==================================================================
|
||||
|
||||
Please note that the MariaDB packaging in official Debian repositories are of
|
||||
a completely new generation compared to the legacy packaging used in MariaDB.org
|
||||
repositories. You cannot mix and match MariaDB 10.1 packages from official
|
||||
Debian (or Ubuntu) repositories with packages from MariaDB.org repositories.
|
||||
Packages from the MariaDB.org repositories include the revision string '+maria'.
|
||||
|
||||
If a MariaDB.org repository is enabled, learn to use apt pinning properly.
|
||||
|
||||
Please do not file bugs in Debian regarding packages with '+maria' in the
|
||||
revision string.
|
||||
|
||||
|
||||
* ROOT USER AUTHENTICATION VIA UNIX SOCKET
|
||||
==========================================
|
||||
|
||||
On new installs no root password is set and no debian-sys-maint user is
|
||||
created anymore. Instead the MariaDB root account is set to be authenticated
|
||||
using the unix socket, e.g. any mysqld invocation by root or via sudo will
|
||||
let the user see the mysqld prompt.
|
||||
|
||||
You may never ever delete the mysql user "root". Although it has no password
|
||||
is set, the unix_auth plugin ensure that it can only be run locally as the root
|
||||
user.
|
||||
|
||||
* WHAT TO DO AFTER UPGRADES:
|
||||
============================
|
||||
The credentials in /etc/mysql/debian.cnf specify the user which is used by the
|
||||
init scripts to stop the server and perform logrotation. This used to be the
|
||||
debian-sys-maint user which is no longer used as root can run directly.
|
||||
|
||||
If you have start/stop problems make sure that the /etc/mysql/debian.cnf file
|
||||
specifies the root user and no password. In the long run please stop using that
|
||||
file as is has been obsoleted.
|
||||
|
||||
|
||||
* MARIADB IS SECURE BY DEFAULT
|
||||
==============================
|
||||
|
||||
MariaDB in Debian is secure by default, because:
|
||||
|
||||
- It only listens to the localhost socket and cannot be accessed remotely unless
|
||||
the sysadmin changes the configurationin /etc/mysql to allow so.
|
||||
- There is no debian-sys-maint with password in /etc/mysql/debian.cnf anymore.
|
||||
- There is no root account with password anymore. The system admin needs to
|
||||
create one themselves if they need it. With no password, all issues related
|
||||
to password management and password leaking are gone. Sysadmins can access
|
||||
the database without a password simply by running 'sudo mysql' thanks to
|
||||
socket based authentication, which detects the system root user and allows
|
||||
them to use the mysqld console as the mysql root user. For details see
|
||||
https://www.slideshare.net/ottokekalainen/less-passwords-more-security-unix-socket-authentication-and-other-mariadb-hardening-tips
|
||||
- There is no test database nor test accounts in the out-of-the-box Debian
|
||||
installation.
|
||||
|
||||
Therefore there is also no need to run the 'mysql_secure_installation'. In fact
|
||||
that script will try to do things that are already prevented, and might fail.
|
||||
|
||||
|
||||
* WHAT TO DO AFTER UPGRADES
|
||||
===========================
|
||||
|
||||
The privilege tables are automatically updated so all there is left is read
|
||||
the release notes on https://mariadb.com/kb/en/release-notes/ to see if any
|
||||
changes affect custom apps.
|
||||
|
||||
* WHAT TO DO AFTER INSTALLATION:
|
||||
================================
|
||||
There should not be any need to run 'mysql_upgrade' manually, as the upgrade
|
||||
scripts do that automatically.
|
||||
|
||||
|
||||
* WHAT TO DO AFTER INSTALLATION
|
||||
===============================
|
||||
|
||||
The MySQL manual describes certain steps to do at this stage in a separate
|
||||
chapter. They are not necessary as the Debian packages does them
|
||||
automatically.
|
||||
|
||||
There should not be any need to run 'mysql_install_db' manually, as the install
|
||||
scripts do that automatically.
|
||||
|
||||
The only thing that is left over for the admin is
|
||||
- setting the passwords
|
||||
- creating new users and databases
|
||||
- read the rest of this text
|
||||
|
||||
* NETWORKING:
|
||||
=============
|
||||
|
||||
* NETWORKING
|
||||
============
|
||||
|
||||
For security reasons, the Debian package has enabled networking only on the
|
||||
loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with
|
||||
"netstat -tlnp" where it is listening. If your connection is aborted
|
||||
immediately check your firewall rules or network routes.
|
||||
|
||||
* WHERE IS THE DOCUMENTATION?:
|
||||
==============================
|
||||
* WHERE IS THE DOCUMENTATION?
|
||||
=============================
|
||||
|
||||
https://mariadb.com/kb
|
||||
|
||||
* PASSWORDS:
|
||||
============
|
||||
It is strongly recommended you create an admin users for your database
|
||||
administration needs.
|
||||
|
||||
* PASSWORDS
|
||||
===========
|
||||
|
||||
It is recommended you create additional admin users for your database
|
||||
administration needs in addition to the default root user.
|
||||
|
||||
If your local unix account is the one you want to have local super user
|
||||
access on your database with you can create the following account that will
|
||||
@ -52,8 +156,7 @@ the DB server over the network:
|
||||
|
||||
sudo /usr/bin/mysql -e "GRANT ALL ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION"
|
||||
|
||||
Scripts should run as a user have the required grants and be authenticated via
|
||||
unix_socket.
|
||||
Scripts should run as a user who have the required grants and be identified via unix_socket.
|
||||
|
||||
It is wise to run scripts as the "mysql" system user. Like root,
|
||||
mysql@localhost is created by default to have all privileges in MariaDB
|
||||
@ -68,8 +171,10 @@ can read it. Every other configuration parameter can be stored there, too.
|
||||
For more information in the MariaDB manual in/usr/share/doc/mariadb-doc or
|
||||
https://mariadb.com/kb/en/configuring-mariadb-with-mycnf/.
|
||||
|
||||
|
||||
* FURTHER NOTES ON REPLICATION
|
||||
===============================
|
||||
==============================
|
||||
|
||||
If the MySQL server is acting as a replication slave, you should not
|
||||
set --tmpdir to point to a directory on a memory-based filesystem or to
|
||||
a directory that is cleared when the server host restarts. A replication
|
||||
@ -78,18 +183,22 @@ that it can replicate temporary tables or LOAD DATA INFILE operations. If
|
||||
files in the temporary file directory are lost when the server restarts,
|
||||
replication fails.
|
||||
|
||||
|
||||
* DOWNGRADING
|
||||
============================
|
||||
=============
|
||||
|
||||
Unsupported. Period.
|
||||
|
||||
You might get lucky downgrading a few minor versions without issued. Take a
|
||||
backup first. If you break it you get to keep both pieces. Do a restore from
|
||||
backup or upgrade to the previous version.
|
||||
|
||||
If doing a major version downgrade, take a mysqldump/mydumpber consistent
|
||||
If doing a major version downgrade, take a mysqldump/maria-backup consistent
|
||||
backup using the current version and reload after downgrading and purging
|
||||
existing databases.
|
||||
|
||||
|
||||
* BACKUPS
|
||||
============================
|
||||
=========
|
||||
|
||||
Backups save jobs. Don't get caught without one.
|
||||
|
2
debian/mariadb-server-10.6.config
vendored
2
debian/mariadb-server-10.6.config
vendored
@ -9,6 +9,6 @@ ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
|
||||
|
||||
# Beware that there are two ypwhich one of them needs the 2>/dev/null!
|
||||
if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
|
||||
db_input high mariadb-server-10.0/nis_warning || true
|
||||
db_input high mariadb-server-10.5/nis_warning || true
|
||||
db_go
|
||||
fi
|
||||
|
3
debian/mariadb-server-10.6.mysql.default
vendored
3
debian/mariadb-server-10.6.mysql.default
vendored
@ -10,8 +10,7 @@
|
||||
# https://wiki.debian.org/Teams/pkg-systemd/Packaging#overriding_options_and_.2Fetc.2Fdefault_handling
|
||||
# https://mariadb.com/kb/en/mariadb/systemd/
|
||||
#
|
||||
# Note also that MariaDB systemd does _not_ utilize mysqld_safe nor debian-start.
|
||||
|
||||
# Note also that MariaDB systemd does _not_ utilize mysqld_safe.
|
||||
|
||||
# The delay in seconds the init script waits for the server to be up and running after having started "mysqld_safe" to run the "/etc/mysql/debian-start" script.
|
||||
# If the server is still not responding after the delay, the script won't be executed and an error will be thrown on the syslog.
|
||||
|
17
debian/mariadb-server-10.6.postinst
vendored
17
debian/mariadb-server-10.6.postinst
vendored
@ -103,6 +103,7 @@ EOF
|
||||
rmdir $mysql_upgradedir 2>/dev/null || true
|
||||
|
||||
done
|
||||
|
||||
# Upgrading from mysql.com needs might have the root user as auth_socket.
|
||||
# auto.cnf is a sign of a mysql install, that doesn't exist in mariadb.
|
||||
# We use lsof to protect against concurrent access by mysqld (mariadb has
|
||||
@ -184,13 +185,27 @@ EOF
|
||||
# And while it's not needed for new installations, we keep using
|
||||
# --defaults-file option for tools (for the sake of upgrades)
|
||||
# and thus need /etc/mysql/debian.cnf to exist, even if it's empty.
|
||||
# In the long run the goal is to obsolete this file.
|
||||
dc=$mysql_cfgdir/debian.cnf;
|
||||
if [ ! -d "$mysql_cfgdir" ]; then
|
||||
install -o 0 -g 0 -m 0755 -d $mysql_cfgdir
|
||||
fi
|
||||
if [ ! -e "$dc" ]; then
|
||||
cat /dev/null > $dc
|
||||
echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
|
||||
echo "# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE." >>$dc
|
||||
echo "# This file exists only for backwards compatibility for" >>$dc
|
||||
echo "# tools that run '--defaults-file=/etc/mysql/debian.cnf'" >>$dc
|
||||
echo "# and have root level access to the local filesystem." >>$dc
|
||||
echo "# With those permissions one can run 'mariadb' directly" >>$dc
|
||||
echo "# anyway thanks to unix socket authentication and hence" >>$dc
|
||||
echo "# this file is useless. See package README for more info." >>$dc
|
||||
echo "[client]" >>$dc
|
||||
echo "host = localhost" >>$dc
|
||||
echo "user = root" >>$dc
|
||||
echo "[mysql_upgrade]" >>$dc
|
||||
echo "host = localhost" >>$dc
|
||||
echo "user = root" >>$dc
|
||||
echo "# THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE." >>$dc
|
||||
fi
|
||||
# Keep it only root-readable, as it always was
|
||||
chown 0:0 $dc
|
||||
|
43
debian/rules
vendored
43
debian/rules
vendored
@ -12,14 +12,16 @@ include /usr/share/dpkg/default.mk
|
||||
CFLAGS+=$(CPPFLAGS)
|
||||
CXXFLAGS+=$(CPPFLAGS)
|
||||
|
||||
# Only do a strict symbol checking on Linux
|
||||
ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
|
||||
DPKG_GENSYMBOLS_CHECK_LEVEL := 4
|
||||
endif
|
||||
|
||||
BUILDDIR := builddir
|
||||
DEB_VERSION_REVISION := $(shell echo $(DEB_VERSION) | sed -e 's/^.*-//')
|
||||
RELEASE := $(shell lsb_release -r -s) # Use changelog based DEB_DISTRIBUTION instead?
|
||||
TMP:=$(CURDIR)/debian/tmp
|
||||
|
||||
CC := $(DEB_HOST_GNU_TYPE)-gcc
|
||||
CXX := $(DEB_HOST_GNU_TYPE)-g++
|
||||
|
||||
# According to Debian Policy version 4.2.0 builds should be as verbose as
|
||||
# possible unless 'terse' is specifically passed.
|
||||
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
|
||||
@ -36,18 +38,20 @@ else
|
||||
NUMJOBS = 1
|
||||
endif
|
||||
|
||||
# Ignore test suite exit code on unstable platforms
|
||||
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),mips mipsel mips64el alpha powerpc sh4 hurd-i386 sparc64 kfreebsd-i386 kfreebsd-amd64))
|
||||
TESTSUITE_FAIL_CMD:=true
|
||||
else
|
||||
TESTSUITE_FAIL_CMD:=exit 1
|
||||
endif
|
||||
|
||||
# RocksDB cannot build on 32-bit platforms
|
||||
ifeq (32,$(DEB_HOST_ARCH_BITS))
|
||||
CMAKEFLAGS += -DPLUGIN_ROCKSDB=NO
|
||||
endif
|
||||
|
||||
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
||||
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),alpha amd64 arm arm64 i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64))
|
||||
CMAKEFLAGS += -DSTACK_DIRECTION=-1
|
||||
endif
|
||||
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),hppa))
|
||||
CMAKEFLAGS += -DSTACK_DIRECTION=1
|
||||
endif
|
||||
endif
|
||||
|
||||
# Add extra flag to avoid WolfSSL code crashing the entire mariadbd on s390x. This
|
||||
# can be removed once upstream has made the code s390x compatible, see
|
||||
# https://jira.mariadb.org/browse/MDEV-21705 and
|
||||
@ -81,12 +85,12 @@ endif
|
||||
|
||||
# Don't build ColumnStore as part of the native build, only build it when
|
||||
# triggered by autobake-deb.sh. Saves build time and disk space.
|
||||
mkdir -p $(BUILDDIR) && cd $(BUILDDIR) && \
|
||||
sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \
|
||||
CC=${CC} \
|
||||
CXX=${CXX} \
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr \
|
||||
PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \
|
||||
NO_UPDATE_BUILD_VERSION=1 \
|
||||
dh_auto_configure --builddirectory=$(BUILDDIR) -- \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
$(CMAKEFLAGS) \
|
||||
$(if $(filter $(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)),,-DIMPORT_EXECUTABLES=$(CURDIR)/builddir-native/import_executables.cmake) \
|
||||
-DCOMPILATION_COMMENT="mariadb.org binary distribution" \
|
||||
-DMYSQL_SERVER_SUFFIX="-$(DEB_VERSION_REVISION)" \
|
||||
-DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
|
||||
@ -94,7 +98,7 @@ endif
|
||||
-DBUILD_CONFIG=mysql_release \
|
||||
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
|
||||
-DPLUGIN_COLUMNSTORE=NO \
|
||||
-DDEB=$(DEB_VENDOR) ..'
|
||||
-DDEB=$(DEB_VENDOR)
|
||||
|
||||
# This is needed, otherwise 'make test' will run before binaries have been built
|
||||
override_dh_auto_build:
|
||||
@ -111,7 +115,10 @@ override_dh_auto_test:
|
||||
[ ! -f debian/unstable-tests.$(DEB_HOST_ARCH) ] || cat debian/unstable-tests.$(DEB_HOST_ARCH) >> mysql-test/unstable-tests
|
||||
# Run testsuite
|
||||
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
|
||||
cd $(BUILDDIR)/mysql-test && ./mtr --force --mem --parallel=$(NUMJOBS) --skip-rpl --suite=main --skip-test-list=unstable-tests || $(TESTSUITE_FAIL_CMD) ;
|
||||
cd $(BUILDDIR)/mysql-test && \
|
||||
./mtr --force --mem \
|
||||
--parallel=$(NUMJOBS) --skip-rpl --suite=main \
|
||||
--skip-test-list=unstable-tests
|
||||
endif
|
||||
|
||||
override_dh_auto_install:
|
||||
@ -143,7 +150,7 @@ endif
|
||||
# to satisfy Debian reproducible build requirements
|
||||
nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.6/mariadbd.sym.gz
|
||||
|
||||
# rename and install AppArmor profile
|
||||
# Rename and install AppArmor profile
|
||||
install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mariadbd
|
||||
|
||||
# Install libmariadbclient18 compatibility links
|
||||
|
19
debian/salsa-ci.yml
vendored
19
debian/salsa-ci.yml
vendored
@ -29,18 +29,19 @@ stages:
|
||||
build:
|
||||
extends: .build-package
|
||||
script: &autobake-deb-steps
|
||||
# Run Salsa-CI .build-before-script equivalent
|
||||
- mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR}
|
||||
- mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
|
||||
- apt-get update && apt-get install --yes devscripts equivs ccache build-essential
|
||||
# Installing build-essential (sic!) until https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958414 is fixed
|
||||
# Run Salsa-CI .build-script equivalent
|
||||
- export CCACHE_DIR="${CCACHE_TMP_DIR}"
|
||||
- apt-get update && eatmydata apt-get install --yes --no-install-recommends aptitude devscripts ccache equivs
|
||||
- cd ${WORKING_DIR}/${SOURCE_DIR}
|
||||
- eatmydata install-build-deps.sh .
|
||||
- update-ccache-symlinks; ccache -z # Zero out ccache counters
|
||||
- mk-build-deps debian/control -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends" -r -i
|
||||
- while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent
|
||||
- debian/autobake-deb.sh |& tail -n 10000 # Keep Gitlab-CI output under 4 MB
|
||||
- cd ..; rm -rfv *.tmp # Clean away build files not to store as artifacts
|
||||
- cp -v *.* ${WORKING_DIR}/
|
||||
- rm -rf "${WORKING_DIR}/source_dir" # Remove excess source files
|
||||
- cd ${WORKING_DIR}
|
||||
- rm -rf ${WORKING_DIR}/${SOURCE_DIR}
|
||||
- du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB.
|
||||
- ccache -s # Show ccache stats to validate it worked
|
||||
- mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR} || true
|
||||
@ -114,8 +115,10 @@ build native deb:
|
||||
ccache -s
|
||||
mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
|
||||
|
||||
autopkgtest:
|
||||
extends: .test-autopkgtest
|
||||
# Temporarily ignore until https://github.com/MariaDB/server/pull/1729 is merged
|
||||
missing-breaks:
|
||||
extends: .test-missing-breaks
|
||||
allow_failure: true
|
||||
|
||||
piuparts:
|
||||
extends: .test-piuparts
|
||||
|
2
debian/source/lintian-overrides
vendored
2
debian/source/lintian-overrides
vendored
@ -20,3 +20,5 @@ version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5
|
||||
version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-8.0
|
||||
version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-8.0
|
||||
version-substvar-for-external-package libmariadbd-dev -> libmariadbclient-dev
|
||||
# ColumnStore not used in Debian, safe to ignore. Reported upstream in https://jira.mariadb.org/browse/MDEV-24124
|
||||
source-is-missing storage/columnstore/columnstore/utils/jemalloc/libjemalloc.so.2
|
||||
|
@ -4,7 +4,7 @@ MariaBackup: hot backup tool for InnoDB
|
||||
Originally Created 3/3/2009 Yasufumi Kinoshita
|
||||
Written by Alexey Kopytov, Aleksandr Kuzminsky, Stewart Smith, Vadim Tkachenko,
|
||||
Yasufumi Kinoshita, Ignacio Nin and Baron Schwartz.
|
||||
(c) 2017, 2020, MariaDB Corporation.
|
||||
(c) 2017, 2021, MariaDB Corporation.
|
||||
Portions written by Marko Mäkelä.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -2168,6 +2168,14 @@ error:
|
||||
static bool innodb_init()
|
||||
{
|
||||
bool create_new_db = false;
|
||||
|
||||
if (srv_io_capacity >= SRV_MAX_IO_CAPACITY_LIMIT / 2) {
|
||||
/* Avoid overflow. */
|
||||
srv_max_io_capacity = SRV_MAX_IO_CAPACITY_LIMIT;
|
||||
} else {
|
||||
srv_max_io_capacity = std::max(2 * srv_io_capacity, 2000UL);
|
||||
}
|
||||
|
||||
/* Check if the data files exist or not. */
|
||||
dberr_t err = srv_sys_space.check_file_spec(&create_new_db, 5U << 20);
|
||||
|
||||
@ -5603,6 +5611,10 @@ static bool xtrabackup_prepare_func(char** argv)
|
||||
if (xtrabackup_incremental)
|
||||
inc_dir_tables_hash.create(1000);
|
||||
|
||||
msg("open files limit requested %u, set to %lu",
|
||||
(uint) xb_open_files_limit,
|
||||
xb_set_max_open_files(xb_open_files_limit));
|
||||
|
||||
/* Fix DDL for prepare. Process .del,.ren, and .new files.
|
||||
The order in which files are processed, is important
|
||||
(see MDEV-18185, MDEV-18201)
|
||||
|
@ -51,6 +51,10 @@ public:
|
||||
{ return m.fetch_sub(i, o); }
|
||||
Type fetch_xor(const Type i, std::memory_order o= std::memory_order_relaxed)
|
||||
{ return m.fetch_xor(i, o); }
|
||||
Type fetch_and(const Type i, std::memory_order o= std::memory_order_relaxed)
|
||||
{ return m.fetch_and(i, o); }
|
||||
Type fetch_or(const Type i, std::memory_order o= std::memory_order_relaxed)
|
||||
{ return m.fetch_or(i, o); }
|
||||
bool compare_exchange_strong(Type& i1, const Type i2,
|
||||
std::memory_order o1= std::memory_order_relaxed,
|
||||
std::memory_order o2= std::memory_order_relaxed)
|
||||
|
@ -158,7 +158,9 @@ typedef struct st_mysql_ftparser_boolean_info
|
||||
the word to MySQL full-text index. When parsing a search query,
|
||||
this function will add the new word to the list of words to search
|
||||
for. The boolean_info argument can be NULL for all cases except
|
||||
when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO.
|
||||
when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. A plugin can replace this
|
||||
callback to post-process every parsed word before passing it to the original
|
||||
mysql_add_word function.
|
||||
|
||||
ftparser_state: A generic pointer. The plugin can set it to point
|
||||
to information to be used internally for its own purposes.
|
||||
|
@ -1587,7 +1587,7 @@ drop table t1;
|
||||
--echo #
|
||||
--echo # Check strnxfrm() with odd length
|
||||
--echo #
|
||||
set max_sort_length=9;
|
||||
set max_sort_length=65;
|
||||
select @@max_sort_length;
|
||||
eval create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine $engine;
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
|
@ -4397,7 +4397,7 @@ with t as (select * from t1 where a <=3)
|
||||
select * from t;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` <= 3)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= 3)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
a
|
||||
3
|
||||
@ -4413,7 +4413,7 @@ order by a desc limit 3 )
|
||||
select a from t1 where a=4 union select a from t where a=7;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 union select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3 order by `a` desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3 order by `a` desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
a
|
||||
4
|
||||
@ -4429,7 +4429,7 @@ order by a desc limit 3 )
|
||||
(select a from t1 where a=4 union select a from t where a=7 order by a desc);
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3) union (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3) order by `a` desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
a
|
||||
7
|
||||
@ -4469,7 +4469,7 @@ order by 1 desc limit 3 )
|
||||
select a from t1 where a=4 union select a from t where a=7 order by a desc;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as (values (2),(1) union (values (4),(7)) order by 1 desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as (values (2),(1) union (values (4),(7)) order by 1 desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
a
|
||||
7
|
||||
@ -4484,7 +4484,7 @@ order by 1 desc limit 3 )
|
||||
select a from t1 where a=1 union select a from t where a=7 order by a desc;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as ((values (2),(1)) union (values (4),(7) order by 1 desc) order by 1 desc limit 3)select `t1`.`a` AS `a` from `t1` where `t1`.`a` = 1 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t(`a`) as ((values (2),(1)) union (values (4),(7) order by 1 desc) order by 1 desc limit 3)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
a
|
||||
7
|
||||
@ -4496,7 +4496,7 @@ s as (select * from t1 where a > 3)
|
||||
select a from t where a=1 union select a from s where a=7 order by a desc;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3), s as (select `t1`.`a` AS `a` from `t1` where `t1`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
a
|
||||
7
|
||||
|
@ -67,7 +67,7 @@ FROM t1, cte WHERE t1.from_ = cte.to_
|
||||
select * from cte;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive cte(`depth`,`from_`,`to_`) as (select 0 AS `depth`,1 AS `from_`,1 AS `to_` union select `cte`.`depth` + 1 AS `depth+1`,`t1`.`from_` AS `from_`,`t1`.`to_` AS `to_` from (`t1` join `cte`) where `t1`.`from_` = `cte`.`to_`) CYCLE `from_`,`to_` RESTRICT select `cte`.`depth` AS `depth`,`cte`.`from_` AS `from_`,`cte`.`to_` AS `to_` from `cte` latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive cte(`depth`,`from_`,`to_`) as (select 0 AS `depth`,1 AS `from_`,1 AS `to_` union select `cte`.`depth` + 1 AS `depth+1`,`test`.`t1`.`from_` AS `from_`,`test`.`t1`.`to_` AS `to_` from (`test`.`t1` join `cte`) where `test`.`t1`.`from_` = `cte`.`to_`) CYCLE `from_`,`to_` RESTRICT select `cte`.`depth` AS `depth`,`cte`.`from_` AS `from_`,`cte`.`to_` AS `to_` from `cte` latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
depth from_ to_
|
||||
0 1 1
|
||||
|
@ -571,7 +571,7 @@ with t as (select a from t1 where b >= 'c')
|
||||
select * from t2,t where t2.c=t.a;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `t1`.`a` AS `a` from `t1` where `t1`.`b` >= 'c')select `t2`.`c` AS `c`,`t`.`a` AS `a` from (`t2` join `t`) where `t2`.`c` = `t`.`a` latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `test`.`t2`.`c` AS `c`,`t`.`a` AS `a` from (`test`.`t2` join `t`) where `test`.`t2`.`c` = `t`.`a` latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
c a
|
||||
4 4
|
||||
@ -588,7 +588,7 @@ with t as (select a, count(*) from t1 where b >= 'c' group by a)
|
||||
select * from t2,t where t2.c=t.a;
|
||||
show create view v2;
|
||||
View Create View character_set_client collation_connection
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` where `t1`.`b` >= 'c' group by `t1`.`a`)select `t2`.`c` AS `c`,`t`.`a` AS `a`,`t`.`count(*)` AS `count(*)` from (`t2` join `t`) where `t2`.`c` = `t`.`a` latin1 latin1_swedish_ci
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `test`.`t1`.`a` AS `a`,count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` >= 'c' group by `test`.`t1`.`a`)select `test`.`t2`.`c` AS `c`,`t`.`a` AS `a`,`t`.`count(*)` AS `count(*)` from (`test`.`t2` join `t`) where `test`.`t2`.`c` = `t`.`a` latin1 latin1_swedish_ci
|
||||
select * from v2;
|
||||
c a count(*)
|
||||
4 4 2
|
||||
@ -606,7 +606,7 @@ with t(c) as (select a from t1 where b >= 'c')
|
||||
select * from t r1 where r1.c=4;
|
||||
show create view v3;
|
||||
View Create View character_set_client collation_connection
|
||||
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t(`c`) as (select `t1`.`a` AS `c` from `t1` where `t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci
|
||||
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS with t(`c`) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c` from `t` `r1` where `r1`.`c` = 4 latin1 latin1_swedish_ci
|
||||
select * from v3;
|
||||
c
|
||||
4
|
||||
@ -1349,7 +1349,7 @@ r.r_regionkey in
|
||||
select r_regionkey from t where r_name <> "ASIA");
|
||||
show create view v;
|
||||
View Create View character_set_client collation_connection
|
||||
v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `n`.`n_nationkey` AS `n_nationkey`,`n`.`n_name` AS `n_name`,`n`.`n_regionkey` AS `n_regionkey`,`r`.`r_regionkey` AS `r_regionkey`,`r`.`r_name` AS `r_name` from (`nation` `n` join `region` `r`) where `n`.`n_regionkey` = `r`.`r_regionkey` and `r`.`r_regionkey` in (with t as (select `region`.`r_regionkey` AS `r_regionkey`,`region`.`r_name` AS `r_name` from `region` where `region`.`r_regionkey` <= 3)select `t`.`r_regionkey` from `t` where `t`.`r_name` <> 'ASIA') latin1 latin1_swedish_ci
|
||||
v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `n`.`n_nationkey` AS `n_nationkey`,`n`.`n_name` AS `n_name`,`n`.`n_regionkey` AS `n_regionkey`,`r`.`r_regionkey` AS `r_regionkey`,`r`.`r_name` AS `r_name` from (`test`.`nation` `n` join `test`.`region` `r`) where `n`.`n_regionkey` = `r`.`r_regionkey` and `r`.`r_regionkey` in (with t as (select `test`.`region`.`r_regionkey` AS `r_regionkey`,`test`.`region`.`r_name` AS `r_name` from `test`.`region` where `test`.`region`.`r_regionkey` <= 3)select `t`.`r_regionkey` from `t` where `t`.`r_name` <> 'ASIA') latin1 latin1_swedish_ci
|
||||
select * from v;
|
||||
n_nationkey n_name n_regionkey r_regionkey r_name
|
||||
0 ALGERIA 0 0 AFRICA
|
||||
@ -1690,6 +1690,41 @@ ERROR 3D000: No database selected
|
||||
DROP TABLE test.t;
|
||||
connection default;
|
||||
disconnect con1;
|
||||
#
|
||||
# MDEV-22781: create view with CTE without default database
|
||||
#
|
||||
drop database test;
|
||||
create database db1;
|
||||
create table db1.t1 (a int);
|
||||
insert into db1.t1 values (3),(7),(1);
|
||||
create view db1.v1 as with t as (select * from db1.t1) select * from t;
|
||||
show create view db1.v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS with t as (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci
|
||||
select * from db1.v1;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
drop view db1.v1;
|
||||
prepare stmt from "
|
||||
create view db1.v1 as with t as (select * from db1.t1) select * from t;
|
||||
";
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
show create view db1.v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS with t as (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`)select `t`.`a` AS `a` from `t` latin1 latin1_swedish_ci
|
||||
select * from db1.v1;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
drop view db1.v1;
|
||||
drop table db1.t1;
|
||||
drop database db1;
|
||||
create database test;
|
||||
use test;
|
||||
# End of 10.2 tests
|
||||
#
|
||||
# MDEV-21673: several references to CTE that uses
|
||||
|
@ -1213,6 +1213,35 @@ DROP TABLE test.t;
|
||||
--connection default
|
||||
--disconnect con1
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22781: create view with CTE without default database
|
||||
--echo #
|
||||
|
||||
drop database test;
|
||||
create database db1;
|
||||
create table db1.t1 (a int);
|
||||
insert into db1.t1 values (3),(7),(1);
|
||||
|
||||
create view db1.v1 as with t as (select * from db1.t1) select * from t;
|
||||
show create view db1.v1;
|
||||
select * from db1.v1;
|
||||
drop view db1.v1;
|
||||
|
||||
prepare stmt from "
|
||||
create view db1.v1 as with t as (select * from db1.t1) select * from t;
|
||||
";
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
show create view db1.v1;
|
||||
select * from db1.v1;
|
||||
drop view db1.v1;
|
||||
|
||||
drop table db1.t1;
|
||||
drop database db1;
|
||||
|
||||
create database test;
|
||||
use test;
|
||||
|
||||
--echo # End of 10.2 tests
|
||||
|
||||
--echo #
|
||||
|
48
mysql-test/main/cte_nonrecursive_not_embedded.result
Normal file
48
mysql-test/main/cte_nonrecursive_not_embedded.result
Normal file
@ -0,0 +1,48 @@
|
||||
#
|
||||
# MDEV-20751: query using many CTEs with grant_tables enabled
|
||||
#
|
||||
connection default;
|
||||
CREATE DATABASE db;
|
||||
USE db;
|
||||
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES (3), (7), (1);
|
||||
CREATE TABLE t2 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t2 VALUES (2), (8), (4);
|
||||
CREATE USER 'u1'@'localhost';
|
||||
GRANT USAGE ON db.* TO 'u1'@'localhost';
|
||||
GRANT SELECT ON db.t1 TO 'u1'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
connect u1,'localhost',u1,,;
|
||||
connection u1;
|
||||
USE db;
|
||||
WITH
|
||||
cte1 AS
|
||||
(SELECT a FROM t1),
|
||||
cte2 AS
|
||||
(SELECT cte1.a FROM t1,cte1 WHERE cte1.a = t1.a),
|
||||
cte3 AS
|
||||
(SELECT cte2.a FROM t1,cte1,cte2 WHERE cte1.a = t1.a AND t1.a = cte2.a),
|
||||
cte4 AS
|
||||
(SELECT cte2.a FROM t1,cte2 WHERE cte2.a = t1.a)
|
||||
SELECT * FROM cte4 as r;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
WITH
|
||||
cte1 AS
|
||||
(SELECT a FROM t2),
|
||||
cte2 AS
|
||||
(SELECT cte1.a FROM t2,cte1 WHERE cte1.a = t2.a),
|
||||
cte3 AS
|
||||
(SELECT cte2.a FROM t2,cte1,cte2 WHERE cte1.a = t2.a AND t2.a = cte2.a),
|
||||
cte4 AS
|
||||
(SELECT cte2.a FROM t2,cte2 WHERE cte2.a = t2.a)
|
||||
SELECT * FROM cte4 as r;
|
||||
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't2'
|
||||
disconnect u1;
|
||||
connection default;
|
||||
DROP USER 'u1'@'localhost';
|
||||
DROP DATABASE db;
|
||||
USE test;
|
||||
# End of 10.2 tests
|
58
mysql-test/main/cte_nonrecursive_not_embedded.test
Normal file
58
mysql-test/main/cte_nonrecursive_not_embedded.test
Normal file
@ -0,0 +1,58 @@
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20751: query using many CTEs with grant_tables enabled
|
||||
--echo #
|
||||
|
||||
--connection default
|
||||
|
||||
CREATE DATABASE db;
|
||||
USE db;
|
||||
|
||||
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES (3), (7), (1);
|
||||
CREATE TABLE t2 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t2 VALUES (2), (8), (4);
|
||||
|
||||
|
||||
CREATE USER 'u1'@'localhost';
|
||||
GRANT USAGE ON db.* TO 'u1'@'localhost';
|
||||
GRANT SELECT ON db.t1 TO 'u1'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
--connect (u1,'localhost',u1,,)
|
||||
--connection u1
|
||||
USE db;
|
||||
|
||||
WITH
|
||||
cte1 AS
|
||||
(SELECT a FROM t1),
|
||||
cte2 AS
|
||||
(SELECT cte1.a FROM t1,cte1 WHERE cte1.a = t1.a),
|
||||
cte3 AS
|
||||
(SELECT cte2.a FROM t1,cte1,cte2 WHERE cte1.a = t1.a AND t1.a = cte2.a),
|
||||
cte4 AS
|
||||
(SELECT cte2.a FROM t1,cte2 WHERE cte2.a = t1.a)
|
||||
SELECT * FROM cte4 as r;
|
||||
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
WITH
|
||||
cte1 AS
|
||||
(SELECT a FROM t2),
|
||||
cte2 AS
|
||||
(SELECT cte1.a FROM t2,cte1 WHERE cte1.a = t2.a),
|
||||
cte3 AS
|
||||
(SELECT cte2.a FROM t2,cte1,cte2 WHERE cte1.a = t2.a AND t2.a = cte2.a),
|
||||
cte4 AS
|
||||
(SELECT cte2.a FROM t2,cte2 WHERE cte2.a = t2.a)
|
||||
SELECT * FROM cte4 as r;
|
||||
|
||||
--disconnect u1
|
||||
--connection default
|
||||
|
||||
DROP USER 'u1'@'localhost';
|
||||
DROP DATABASE db;
|
||||
|
||||
USE test;
|
||||
|
||||
--echo # End of 10.2 tests
|
@ -818,7 +818,7 @@ where p.id = a.father or p.id = a.mother
|
||||
select * from ancestors;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where `folks`.`name` = 'Me' and `folks`.`dob` = '2000-01-01' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `a`) where `p`.`id` = `a`.`father` or `p`.`id` = `a`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with recursive ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' and `test`.`folks`.`dob` = '2000-01-01' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`test`.`folks` `p` join `ancestors` `a`) where `p`.`id` = `a`.`father` or `p`.`id` = `a`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci
|
||||
select * from v1;
|
||||
id name dob father mother
|
||||
100 Me 2000-01-01 20 30
|
||||
@ -849,7 +849,7 @@ where p.id = ma.mother
|
||||
select * from ancestors;
|
||||
show create view v2;
|
||||
View Create View character_set_client collation_connection
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with recursive ancestors as (select `folks`.`id` AS `id`,`folks`.`name` AS `name`,`folks`.`dob` AS `dob`,`folks`.`father` AS `father`,`folks`.`mother` AS `mother` from `folks` where `folks`.`name` = 'Me' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `fa`) where `p`.`id` = `fa`.`father` union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`folks` `p` join `ancestors` `ma`) where `p`.`id` = `ma`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with recursive ancestors as (select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`test`.`folks` `p` join `ancestors` `fa`) where `p`.`id` = `fa`.`father` union select `p`.`id` AS `id`,`p`.`name` AS `name`,`p`.`dob` AS `dob`,`p`.`father` AS `father`,`p`.`mother` AS `mother` from (`test`.`folks` `p` join `ancestors` `ma`) where `p`.`id` = `ma`.`mother`)select `ancestors`.`id` AS `id`,`ancestors`.`name` AS `name`,`ancestors`.`dob` AS `dob`,`ancestors`.`father` AS `father`,`ancestors`.`mother` AS `mother` from `ancestors` latin1 latin1_swedish_ci
|
||||
select * from v2;
|
||||
id name dob father mother
|
||||
100 Me 2000-01-01 20 30
|
||||
@ -4232,6 +4232,273 @@ a b c
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-24019: query with recursive CTE when no default database is set
|
||||
#
|
||||
drop database test;
|
||||
with recursive a as
|
||||
(select 1 from dual union select * from a as r)
|
||||
select * from a;
|
||||
1
|
||||
1
|
||||
create database db1;
|
||||
create table db1.t1 (a int);
|
||||
insert into db1.t1 values (3), (7), (1);
|
||||
with recursive cte as
|
||||
(select * from db1.t1 union select * from (select * from cte) as t)
|
||||
select * from cte;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
explain with recursive cte as
|
||||
(select * from db1.t1 union select * from (select * from cte) as t)
|
||||
select * from cte;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 3
|
||||
3 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 3
|
||||
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
|
||||
prepare stmt from "with recursive cte as
|
||||
(select * from db1.t1 union select * from (select * from cte) as t)
|
||||
select * from cte";
|
||||
execute stmt;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
execute stmt;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
deallocate prepare stmt;
|
||||
drop database db1;
|
||||
create database test;
|
||||
use test;
|
||||
#
|
||||
# MDEV-23406: query with mutually recursive CTEs when big_tables=1
|
||||
#
|
||||
set @save_big_tables=@@big_tables;
|
||||
set big_tables=1;
|
||||
Warnings:
|
||||
Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
|
||||
create table folks(id int, name char(32), dob date, father int, mother int);
|
||||
insert into folks values
|
||||
(100, 'Me', '2000-01-01', 20, 30),
|
||||
(20, 'Dad', '1970-02-02', 10, 9),
|
||||
(30, 'Mom', '1975-03-03', 8, 7),
|
||||
(10, 'Grandpa Bill', '1940-04-05', null, null),
|
||||
(9, 'Grandma Ann', '1941-10-15', null, null),
|
||||
(25, 'Uncle Jim', '1968-11-18', 8, 7),
|
||||
(98, 'Sister Amy', '2001-06-20', 20, 30),
|
||||
(7, 'Grandma Sally', '1943-08-23', null, 6),
|
||||
(8, 'Grandpa Ben', '1940-10-21', null, null),
|
||||
(6, 'Grandgrandma Martha', '1923-05-17', null, null),
|
||||
(67, 'Cousin Eddie', '1992-02-28', 25, 27),
|
||||
(27, 'Auntie Melinda', '1971-03-29', null, null);
|
||||
with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
union
|
||||
select h.*, w.*
|
||||
from folks v, folks h, folks w
|
||||
where v.name = 'Me' and
|
||||
(v.father = h.id AND v.mother= w.id)
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples;
|
||||
h_name h_dob w_name w_dob
|
||||
Dad 1970-02-02 Mom 1975-03-03
|
||||
Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
|
||||
Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
|
||||
explain with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
union
|
||||
select h.*, w.*
|
||||
from folks v, folks h, folks w
|
||||
where v.name = 'Me' and
|
||||
(v.father = h.id AND v.mother= w.id)
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 1728
|
||||
4 DERIVED <derived3> ALL NULL NULL NULL NULL 1728
|
||||
5 RECURSIVE UNION <derived3> ALL NULL NULL NULL NULL 1728
|
||||
NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL
|
||||
3 DERIVED v ALL NULL NULL NULL NULL 12 Using where
|
||||
3 DERIVED h ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
|
||||
3 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join)
|
||||
2 RECURSIVE UNION <derived4> ALL NULL NULL NULL NULL 2
|
||||
2 RECURSIVE UNION h ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
|
||||
2 RECURSIVE UNION w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join)
|
||||
NULL UNION RESULT <union3,2> ALL NULL NULL NULL NULL NULL
|
||||
prepare stmt from "with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
union
|
||||
select h.*, w.*
|
||||
from folks v, folks h, folks w
|
||||
where v.name = 'Me' and
|
||||
(v.father = h.id AND v.mother= w.id)
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples";
|
||||
execute stmt;
|
||||
h_name h_dob w_name w_dob
|
||||
Dad 1970-02-02 Mom 1975-03-03
|
||||
Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
|
||||
Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
|
||||
execute stmt;
|
||||
h_name h_dob w_name w_dob
|
||||
Dad 1970-02-02 Mom 1975-03-03
|
||||
Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
|
||||
Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
|
||||
deallocate prepare stmt;
|
||||
with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select *
|
||||
from folks
|
||||
where name = 'Me'
|
||||
union all
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union all
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples;
|
||||
h_name h_dob w_name w_dob
|
||||
Dad 1970-02-02 Mom 1975-03-03
|
||||
Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
|
||||
Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
|
||||
explain with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select *
|
||||
from folks
|
||||
where name = 'Me'
|
||||
union all
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union all
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
|
||||
3 DERIVED folks ALL NULL NULL NULL NULL 12 Using where
|
||||
4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2
|
||||
5 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2
|
||||
NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL
|
||||
2 DERIVED h ALL NULL NULL NULL NULL 12
|
||||
2 DERIVED w ALL NULL NULL NULL NULL 12 Using join buffer (flat, BNL join)
|
||||
2 DERIVED <derived3> ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join)
|
||||
prepare stmt from "with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select *
|
||||
from folks
|
||||
where name = 'Me'
|
||||
union all
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union all
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples";
|
||||
execute stmt;
|
||||
h_name h_dob w_name w_dob
|
||||
Dad 1970-02-02 Mom 1975-03-03
|
||||
Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
|
||||
Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
|
||||
execute stmt;
|
||||
h_name h_dob w_name w_dob
|
||||
Dad 1970-02-02 Mom 1975-03-03
|
||||
Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
|
||||
Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
|
||||
deallocate prepare stmt;
|
||||
drop table folks;
|
||||
set big_tables=@save_big_tables;
|
||||
Warnings:
|
||||
Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
@ -2725,6 +2725,135 @@ deallocate prepare stmt;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24019: query with recursive CTE when no default database is set
|
||||
--echo #
|
||||
|
||||
drop database test;
|
||||
|
||||
let $q=
|
||||
with recursive a as
|
||||
(select 1 from dual union select * from a as r)
|
||||
select * from a;
|
||||
|
||||
eval $q;
|
||||
|
||||
create database db1;
|
||||
create table db1.t1 (a int);
|
||||
insert into db1.t1 values (3), (7), (1);
|
||||
|
||||
let $q=
|
||||
with recursive cte as
|
||||
(select * from db1.t1 union select * from (select * from cte) as t)
|
||||
select * from cte;
|
||||
|
||||
eval $q;
|
||||
eval explain $q;
|
||||
|
||||
eval prepare stmt from "$q";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
drop database db1;
|
||||
|
||||
create database test;
|
||||
use test;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-23406: query with mutually recursive CTEs when big_tables=1
|
||||
--echo #
|
||||
|
||||
set @save_big_tables=@@big_tables;
|
||||
set big_tables=1;
|
||||
|
||||
create table folks(id int, name char(32), dob date, father int, mother int);
|
||||
|
||||
insert into folks values
|
||||
(100, 'Me', '2000-01-01', 20, 30),
|
||||
(20, 'Dad', '1970-02-02', 10, 9),
|
||||
(30, 'Mom', '1975-03-03', 8, 7),
|
||||
(10, 'Grandpa Bill', '1940-04-05', null, null),
|
||||
(9, 'Grandma Ann', '1941-10-15', null, null),
|
||||
(25, 'Uncle Jim', '1968-11-18', 8, 7),
|
||||
(98, 'Sister Amy', '2001-06-20', 20, 30),
|
||||
(7, 'Grandma Sally', '1943-08-23', null, 6),
|
||||
(8, 'Grandpa Ben', '1940-10-21', null, null),
|
||||
(6, 'Grandgrandma Martha', '1923-05-17', null, null),
|
||||
(67, 'Cousin Eddie', '1992-02-28', 25, 27),
|
||||
(27, 'Auntie Melinda', '1971-03-29', null, null);
|
||||
|
||||
let q=
|
||||
with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
union
|
||||
select h.*, w.*
|
||||
from folks v, folks h, folks w
|
||||
where v.name = 'Me' and
|
||||
(v.father = h.id AND v.mother= w.id)
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples;
|
||||
|
||||
eval $q;
|
||||
eval explain $q;
|
||||
eval prepare stmt from "$q";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
let $q=
|
||||
with recursive
|
||||
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
|
||||
w_id, w_name, w_dob, w_father, w_mother)
|
||||
as
|
||||
(
|
||||
select h.*, w.*
|
||||
from folks h, folks w, coupled_ancestors a
|
||||
where a.father = h.id AND a.mother = w.id
|
||||
),
|
||||
coupled_ancestors (id, name, dob, father, mother)
|
||||
as
|
||||
(
|
||||
select *
|
||||
from folks
|
||||
where name = 'Me'
|
||||
union all
|
||||
select h_id, h_name, h_dob, h_father, h_mother
|
||||
from ancestor_couples
|
||||
union all
|
||||
select w_id, w_name, w_dob, w_father, w_mother
|
||||
from ancestor_couples
|
||||
)
|
||||
select h_name, h_dob, w_name, w_dob
|
||||
from ancestor_couples;
|
||||
|
||||
eval $q;
|
||||
eval explain $q;
|
||||
eval prepare stmt from "$q";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
drop table folks;
|
||||
|
||||
set big_tables=@save_big_tables;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
@ -1492,6 +1492,8 @@ ab
|
||||
AE
|
||||
AE
|
||||
SET max_sort_length=8;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '8'
|
||||
SELECT * FROM t1 ORDER BY s1;
|
||||
s1
|
||||
ab
|
||||
|
@ -1765,6 +1765,8 @@ ab
|
||||
AE
|
||||
AE
|
||||
SET max_sort_length=8;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '8'
|
||||
SELECT * FROM t1 ORDER BY s1;
|
||||
s1
|
||||
ab
|
||||
|
@ -1505,6 +1505,8 @@ ab
|
||||
AE
|
||||
AE
|
||||
SET max_sort_length=8;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '8'
|
||||
SELECT * FROM t1 ORDER BY s1;
|
||||
s1
|
||||
ab
|
||||
|
@ -6760,9 +6760,11 @@ DFFFDFFF9CFF9DFF9EFF
|
||||
# Checking strnxfrm() with odd length
|
||||
#
|
||||
set max_sort_length=9;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '9'
|
||||
select @@max_sort_length;
|
||||
@@max_sort_length
|
||||
9
|
||||
64
|
||||
create table t1 (a varchar(128) character set utf8 collate utf8_general_ci);
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
select * from t1 order by a;
|
||||
|
@ -2371,10 +2371,10 @@ drop table t1;
|
||||
#
|
||||
# Check strnxfrm() with odd length
|
||||
#
|
||||
set max_sort_length=9;
|
||||
set max_sort_length=65;
|
||||
select @@max_sort_length;
|
||||
@@max_sort_length
|
||||
9
|
||||
65
|
||||
create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci);
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
select * from t1 order by a;
|
||||
|
@ -1520,7 +1520,7 @@ drop table t1;
|
||||
--echo #
|
||||
--echo # Check strnxfrm() with odd length
|
||||
--echo #
|
||||
set max_sort_length=9;
|
||||
set max_sort_length=65;
|
||||
select @@max_sort_length;
|
||||
create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci);
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
|
@ -2203,10 +2203,10 @@ drop table t1;
|
||||
#
|
||||
# Check strnxfrm() with odd length
|
||||
#
|
||||
set max_sort_length=9;
|
||||
set max_sort_length=65;
|
||||
select @@max_sort_length;
|
||||
@@max_sort_length
|
||||
9
|
||||
65
|
||||
create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine heap;
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
select * from t1 order by a;
|
||||
|
@ -2329,10 +2329,10 @@ drop table t1;
|
||||
#
|
||||
# Check strnxfrm() with odd length
|
||||
#
|
||||
set max_sort_length=9;
|
||||
set max_sort_length=65;
|
||||
select @@max_sort_length;
|
||||
@@max_sort_length
|
||||
9
|
||||
65
|
||||
create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine InnoDB;
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
select * from t1 order by a;
|
||||
|
@ -2336,10 +2336,10 @@ drop table t1;
|
||||
#
|
||||
# Check strnxfrm() with odd length
|
||||
#
|
||||
set max_sort_length=9;
|
||||
set max_sort_length=65;
|
||||
select @@max_sort_length;
|
||||
@@max_sort_length
|
||||
9
|
||||
65
|
||||
create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine MyISAM;
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
select * from t1 order by a;
|
||||
|
@ -599,7 +599,8 @@ Note 4091 Unknown SEQUENCE: 'test.s4,test.s3'
|
||||
# Generating test tables
|
||||
drop temporary sequence if exists s1,t1,t2,s2;
|
||||
Warnings:
|
||||
Note 4091 Unknown SEQUENCE: 'test.t1,test.t2'
|
||||
Note 4090 'test.t1' is not a SEQUENCE
|
||||
Note 4090 'test.t2' is not a SEQUENCE
|
||||
# Generating test tables
|
||||
drop temporary sequence if exists s1,v1,v2,s2;
|
||||
Warnings:
|
||||
@ -607,18 +608,24 @@ Note 4091 Unknown SEQUENCE: 'test.v1,test.v2'
|
||||
# Generating test tables
|
||||
drop temporary sequence if exists v1,t1,t2,v2,s2;
|
||||
Warnings:
|
||||
Note 4091 Unknown SEQUENCE: 'test.v1,test.t1,test.t2,test.v2'
|
||||
Note 4090 'test.t1' is not a SEQUENCE
|
||||
Note 4090 'test.t2' is not a SEQUENCE
|
||||
Note 4091 Unknown SEQUENCE: 'test.v1,test.v2'
|
||||
# Generating test tables
|
||||
drop temporary sequence if exists s1,t1,v1,t3,s4;
|
||||
Warnings:
|
||||
Note 4091 Unknown SEQUENCE: 'test.t1,test.v1,test.t3,test.s4'
|
||||
Note 4090 'test.t1' is not a SEQUENCE
|
||||
Note 4091 Unknown SEQUENCE: 'test.v1,test.t3,test.s4'
|
||||
drop temporary sequence if exists t2,v2,s2,s1;
|
||||
Warnings:
|
||||
Note 4091 Unknown SEQUENCE: 'test.t2,test.v2,test.s1'
|
||||
Note 4090 'test.t2' is not a SEQUENCE
|
||||
Note 4091 Unknown SEQUENCE: 'test.v2,test.s1'
|
||||
# Generating test tables
|
||||
drop temporary sequence if exists t1,v1,t2,v2;
|
||||
Warnings:
|
||||
Note 4091 Unknown SEQUENCE: 'test.t1,test.v1,test.t2,test.v2'
|
||||
Note 4090 'test.t1' is not a SEQUENCE
|
||||
Note 4090 'test.t2' is not a SEQUENCE
|
||||
Note 4091 Unknown SEQUENCE: 'test.v1,test.v2'
|
||||
# Generating test tables
|
||||
drop temporary table t1,t2;
|
||||
drop temporary sequence s1,s2;
|
||||
|
@ -1280,6 +1280,18 @@ Name_exp_1
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-4677 GROUP_CONCAT not showing any output with group_concat_max_len >= 4Gb
|
||||
#
|
||||
set group_concat_max_len=1024*1024*1024*4;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect group_concat_max_len value: '4294967296'
|
||||
create table t1 (i int, j int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
select i, group_concat(j) from t1 group by i;
|
||||
i group_concat(j)
|
||||
1 1,2
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
@ -939,6 +939,16 @@ DROP VIEW v1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-4677 GROUP_CONCAT not showing any output with group_concat_max_len >= 4Gb
|
||||
--echo #
|
||||
set group_concat_max_len=1024*1024*1024*4;
|
||||
create table t1 (i int, j int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
select i, group_concat(j) from t1 group by i;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
@ -289,6 +289,24 @@ a b c d
|
||||
3 f_ 1 0 1
|
||||
3 f\_ 0 1 0
|
||||
drop table t1;
|
||||
create table t1 (f int);
|
||||
insert t1 values (1),(2);
|
||||
select 1 from (select distinct * from t1) as x where f < (select 1 like 2 escape (3=1));
|
||||
1
|
||||
drop table t1;
|
||||
create table t1(f1 int);
|
||||
insert into t1 values(1);
|
||||
update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1;
|
||||
ERROR HY000: Incorrect arguments to ESCAPE
|
||||
select * from (select 1 like 2 escape (1 in (select 1 from t1))) x;
|
||||
1 like 2 escape (1 in (select 1 from t1))
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (f int);
|
||||
insert t1 values (1),(2);
|
||||
create view v1 as select * from t1 where (1 like 2 escape (3 in (('h', 'b') in (select 'k', 'k' union select 'g', 'j'))) and f >= 0);
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-17359 - Extend expression supported by like (| & << >> || + - * / DIV MOD ^ )
|
||||
#
|
||||
|
@ -187,7 +187,7 @@ DROP TABLE t1;
|
||||
--echo #
|
||||
|
||||
#
|
||||
# Item_func_line::print()
|
||||
# Item_func_like::print()
|
||||
#
|
||||
create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!';
|
||||
show create view v1;
|
||||
@ -208,6 +208,33 @@ set sql_mode=default;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Item_func_like::fix_fields()
|
||||
#
|
||||
create table t1 (f int);
|
||||
insert t1 values (1),(2);
|
||||
select 1 from (select distinct * from t1) as x where f < (select 1 like 2 escape (3=1));
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Item_func_like::fix_fields, ESCAPE, const_item()
|
||||
#
|
||||
create table t1(f1 int);
|
||||
insert into t1 values(1);
|
||||
--error ER_WRONG_ARGUMENTS
|
||||
update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1;
|
||||
select * from (select 1 like 2 escape (1 in (select 1 from t1))) x;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Item_func_like::walk
|
||||
#
|
||||
create table t1 (f int);
|
||||
insert t1 values (1),(2);
|
||||
create view v1 as select * from t1 where (1 like 2 escape (3 in (('h', 'b') in (select 'k', 'k' union select 'g', 'j'))) and f >= 0);
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17359 - Extend expression supported by like (| & << >> || + - * / DIV MOD ^ )
|
||||
--echo #
|
||||
|
@ -863,6 +863,7 @@ where data_type = 'longtext' and table_schema != 'performance_schema'
|
||||
order by binary table_name, ordinal_position;
|
||||
table_schema table_name column_name
|
||||
information_schema ALL_PLUGINS PLUGIN_DESCRIPTION
|
||||
information_schema CHECK_CONSTRAINTS CHECK_CLAUSE
|
||||
information_schema COLUMNS COLUMN_DEFAULT
|
||||
information_schema COLUMNS COLUMN_TYPE
|
||||
information_schema COLUMNS GENERATION_EXPRESSION
|
||||
@ -2222,17 +2223,10 @@ SCHEMA_NAME
|
||||
# MDEV-14836: Assertion `m_status == DA_ERROR' failed in
|
||||
# Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
|
||||
#
|
||||
SELECT * FROM seq_1_to_100 LIMIT ROWS EXAMINED 10;
|
||||
seq
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
|
||||
Warnings:
|
||||
Warning 1931 Query execution was interrupted. The query examined at least 11 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
|
||||
Warning 1931 Query execution was interrupted. The query examined at least ### rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
|
||||
#
|
||||
# End of 10.2 Test
|
||||
#
|
||||
|
@ -1928,7 +1928,8 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a'
|
||||
--echo # Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
|
||||
--echo #
|
||||
|
||||
SELECT * FROM seq_1_to_100 LIMIT ROWS EXAMINED 10;
|
||||
replace_regex /at least \d+ rows/at least ### rows/;
|
||||
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 Test
|
||||
|
@ -229,3 +229,37 @@ drop user definer@localhost;
|
||||
drop database mysqltest1;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
#
|
||||
# MDEV-24331 mysqldump fails with "Got error: 1356" if the database contains a view with a subquery
|
||||
#
|
||||
create user u1@localhost;
|
||||
grant all privileges on test.* to u1@localhost;
|
||||
connect con1,localhost,u1;
|
||||
use test;
|
||||
create table t1 (id int not null);
|
||||
create view v1 as select * from (select * from t1) dt;
|
||||
lock table v1 read;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`id` tinyint NOT NULL
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
||||
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
||||
/*!50001 SET character_set_client = latin1 */;
|
||||
/*!50001 SET character_set_results = latin1 */;
|
||||
/*!50001 SET collation_connection = latin1_swedish_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`u1`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v1` AS select `dt`.`id` AS `id` from (select `test`.`t1`.`id` AS `id` from `test`.`t1`) `dt` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop user u1@localhost;
|
||||
|
@ -75,3 +75,20 @@ drop user definer@localhost;
|
||||
drop database mysqltest1;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24331 mysqldump fails with "Got error: 1356" if the database contains a view with a subquery
|
||||
--echo #
|
||||
create user u1@localhost;
|
||||
grant all privileges on test.* to u1@localhost;
|
||||
connect con1,localhost,u1;
|
||||
use test;
|
||||
create table t1 (id int not null);
|
||||
create view v1 as select * from (select * from t1) dt;
|
||||
lock table v1 read;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
exec $MYSQL_DUMP test v1 -uu1 --compact;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop user u1@localhost;
|
||||
|
@ -484,8 +484,6 @@ even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@loca
|
||||
DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost;
|
||||
DROP PROCEDURE test.pr;
|
||||
use test;
|
||||
call mtr.add_suppression('Column last_update in table `mysql`.`innodb_table_stats` is INT NOT NULL but should be');
|
||||
alter table mysql.innodb_table_stats modify last_update int not null;
|
||||
create table extralongname_extralongname_extralongname_extralongname_ext (
|
||||
id int(10) unsigned not null,
|
||||
created_date date not null,
|
||||
|
@ -172,8 +172,6 @@ DROP PROCEDURE test.pr;
|
||||
# MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars
|
||||
#
|
||||
use test;
|
||||
call mtr.add_suppression('Column last_update in table `mysql`.`innodb_table_stats` is INT NOT NULL but should be');
|
||||
alter table mysql.innodb_table_stats modify last_update int not null;
|
||||
|
||||
create table extralongname_extralongname_extralongname_extralongname_ext (
|
||||
id int(10) unsigned not null,
|
||||
|
@ -845,18 +845,20 @@ col2 col col
|
||||
2 2 2
|
||||
1 3 3
|
||||
drop table t1, t2;
|
||||
create table t1 (a char(25));
|
||||
create table t1 (a char(70));
|
||||
insert into t1 set a = repeat('x', 20);
|
||||
insert into t1 set a = concat(repeat('x', 19), 'z');
|
||||
insert into t1 set a = concat(repeat('x', 19), 'ab');
|
||||
insert into t1 set a = concat(repeat('x', 19), 'aa');
|
||||
insert into t1 set a = concat(repeat('x', 63), 'z');
|
||||
insert into t1 set a = concat(repeat('x', 63), 'ab');
|
||||
insert into t1 set a = concat(repeat('x', 63), 'aa');
|
||||
set max_sort_length=20;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '20'
|
||||
select a from t1 order by a;
|
||||
a
|
||||
xxxxxxxxxxxxxxxxxxxab
|
||||
xxxxxxxxxxxxxxxxxxxaa
|
||||
xxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxz
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxab
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaa
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
`sid` decimal(8,0) default null,
|
||||
@ -3317,6 +3319,8 @@ drop table t1;
|
||||
SET @save_sort_buffer_size= @@sort_buffer_size;
|
||||
SET @save_max_sort_length= @@max_sort_length;
|
||||
SET max_sort_length=8;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '8'
|
||||
SET sort_buffer_size=1024;
|
||||
CREATE TABLE t1(a INT, b DECIMAL(65), c BLOB);
|
||||
INSERT INTO t1 SELECT seq, seq, seq from seq_1_to_25;
|
||||
@ -3384,6 +3388,8 @@ SET @save_max_sort_length= @@max_sort_length;
|
||||
SET @save_sort_buffer_size= @@sort_buffer_size;
|
||||
SET @save_max_length_for_sort_data= @@max_length_for_sort_data;
|
||||
SET max_sort_length=8;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '8'
|
||||
SET sort_buffer_size=1024;
|
||||
SET max_length_for_sort_data=7000;
|
||||
CREATE TABLE t1(a VARCHAR(64), b VARCHAR(2048))DEFAULT CHARSET=utf8;
|
||||
@ -3520,6 +3526,8 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
|
||||
SET max_length_for_sort_data= 30;
|
||||
SET sql_select_limit = 3;
|
||||
SET max_sort_length=8;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_sort_length value: '8'
|
||||
SELECT * FROM t1 ORDER BY a+1;
|
||||
a b
|
||||
1 1
|
||||
|
@ -533,11 +533,11 @@ drop table t1, t2;
|
||||
# Bug #5428: a problem with small max_sort_length value
|
||||
#
|
||||
|
||||
create table t1 (a char(25));
|
||||
create table t1 (a char(70));
|
||||
insert into t1 set a = repeat('x', 20);
|
||||
insert into t1 set a = concat(repeat('x', 19), 'z');
|
||||
insert into t1 set a = concat(repeat('x', 19), 'ab');
|
||||
insert into t1 set a = concat(repeat('x', 19), 'aa');
|
||||
insert into t1 set a = concat(repeat('x', 63), 'z');
|
||||
insert into t1 set a = concat(repeat('x', 63), 'ab');
|
||||
insert into t1 set a = concat(repeat('x', 63), 'aa');
|
||||
set max_sort_length=20;
|
||||
select a from t1 order by a;
|
||||
drop table t1;
|
||||
|
@ -8016,4 +8016,8 @@ create or replace view v1 as select 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3
|
||||
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
|
||||
view_definition
|
||||
select 1 is true is false AS `1 IS TRUE IS FALSE`,/*always not null*/ 1 is null AS `2 IS FALSE IS UNKNOWN`,/*always not null*/ 1 is null AS `3 IS UNKNOWN IS NULL`,/*always not null*/ 1 is null is true AS `4 IS NULL IS TRUE`
|
||||
create or replace view v1 as select 2 IS TRUE = 3, 2 IS FALSE = 3, 2 IS UNKNOWN = 3, 2 IS NULL = 3, ISNULL(2) = 1;
|
||||
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
|
||||
view_definition
|
||||
select 2 is true = 3 AS `2 IS TRUE = 3`,2 is false = 3 AS `2 IS FALSE = 3`,/*always not null*/ 1 is null = 3 AS `2 IS UNKNOWN = 3`,/*always not null*/ 1 is null = 3 AS `2 IS NULL = 3`,/*always not null*/ 1 is null = 1 AS `ISNULL(2) = 1`
|
||||
drop view v1;
|
||||
|
@ -4785,4 +4785,7 @@ Select view_definition from information_schema.views where table_schema='test' a
|
||||
create or replace view v1 as select 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3 IS UNKNOWN IS NULL, 4 IS NULL IS TRUE;
|
||||
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
|
||||
|
||||
create or replace view v1 as select 2 IS TRUE = 3, 2 IS FALSE = 3, 2 IS UNKNOWN = 3, 2 IS NULL = 3, ISNULL(2) = 1;
|
||||
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
|
||||
|
||||
drop view v1;
|
||||
|
@ -818,33 +818,33 @@ select @@character_set_results;
|
||||
NULL
|
||||
set character_set_results=default;
|
||||
set GLOBAL query_cache_size=1355776;
|
||||
create table t1 (id int auto_increment primary key, c char(25));
|
||||
create table t1 (id int auto_increment primary key, c char(65));
|
||||
insert into t1 set c = repeat('x',24);
|
||||
insert into t1 set c = concat(repeat('x',24),'x');
|
||||
insert into t1 set c = concat(repeat('x',24),'w');
|
||||
insert into t1 set c = concat(repeat('x',24),'y');
|
||||
insert into t1 set c = concat(repeat('x',64),'x');
|
||||
insert into t1 set c = concat(repeat('x',64),'w');
|
||||
insert into t1 set c = concat(repeat('x',64),'y');
|
||||
set max_sort_length=200;
|
||||
select c from t1 order by c, id;
|
||||
c
|
||||
xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxw
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxy
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
|
||||
reset query cache;
|
||||
set max_sort_length=20;
|
||||
set max_sort_length=64;
|
||||
select c from t1 order by c, id;
|
||||
c
|
||||
xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxw
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxy
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
|
||||
set max_sort_length=200;
|
||||
select c from t1 order by c, id;
|
||||
c
|
||||
xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxw
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxy
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy
|
||||
set max_sort_length=default;
|
||||
select '1' || '3' from t1;
|
||||
'1' || '3'
|
||||
|
@ -606,15 +606,15 @@ set character_set_results=default;
|
||||
#
|
||||
# max_sort_length
|
||||
set GLOBAL query_cache_size=1355776;
|
||||
create table t1 (id int auto_increment primary key, c char(25));
|
||||
create table t1 (id int auto_increment primary key, c char(65));
|
||||
insert into t1 set c = repeat('x',24);
|
||||
insert into t1 set c = concat(repeat('x',24),'x');
|
||||
insert into t1 set c = concat(repeat('x',24),'w');
|
||||
insert into t1 set c = concat(repeat('x',24),'y');
|
||||
insert into t1 set c = concat(repeat('x',64),'x');
|
||||
insert into t1 set c = concat(repeat('x',64),'w');
|
||||
insert into t1 set c = concat(repeat('x',64),'y');
|
||||
set max_sort_length=200;
|
||||
select c from t1 order by c, id;
|
||||
reset query cache;
|
||||
set max_sort_length=20;
|
||||
set max_sort_length=64;
|
||||
select c from t1 order by c, id;
|
||||
set max_sort_length=200;
|
||||
select c from t1 order by c, id;
|
||||
|
@ -3226,6 +3226,31 @@ pk a b
|
||||
1 5 50
|
||||
65 5 50
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t2 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
col1 varchar(255),
|
||||
key (key1, pk)
|
||||
);
|
||||
insert into t2 (pk, key1)
|
||||
select A.a+10 *B.a + 100*C.a, A.a+10 *B.a +100*C.a from t1 A, t1 B, t1 C;
|
||||
# This must use ALL, not range:
|
||||
explain select * from t2 force index (primary) where pk not in (1,2,3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 1000 Using where
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-24444: ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN
|
||||
#
|
||||
CREATE TABLE t1 (id INT, a CHAR(3), b INT, PRIMARY KEY(id), KEY(b), KEY(a));
|
||||
INSERT INTO t1 VALUES (1,'foo',10),(2,'bar',20);
|
||||
CREATE TABLE t2 (code CHAR(8), num INT, PRIMARY KEY (code));
|
||||
INSERT INTO t2 VALUES ('100',1),('111',2);
|
||||
SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR t2.num != 3;
|
||||
id a b code num
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
|
@ -2180,6 +2180,40 @@ eval $q4;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# MDEV-21958: Query having many NOT-IN clauses running forever (testcase 2)
|
||||
#
|
||||
create table t1(a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
create table t2 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
col1 varchar(255),
|
||||
key (key1, pk)
|
||||
);
|
||||
|
||||
insert into t2 (pk, key1)
|
||||
select A.a+10 *B.a + 100*C.a, A.a+10 *B.a +100*C.a from t1 A, t1 B, t1 C;
|
||||
|
||||
--echo # This must use ALL, not range:
|
||||
explain select * from t2 force index (primary) where pk not in (1,2,3);
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24444: ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN
|
||||
--echo #
|
||||
CREATE TABLE t1 (id INT, a CHAR(3), b INT, PRIMARY KEY(id), KEY(b), KEY(a));
|
||||
INSERT INTO t1 VALUES (1,'foo',10),(2,'bar',20);
|
||||
|
||||
CREATE TABLE t2 (code CHAR(8), num INT, PRIMARY KEY (code));
|
||||
INSERT INTO t2 VALUES ('100',1),('111',2);
|
||||
|
||||
SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR t2.num != 3;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
@ -3215,6 +3215,31 @@ pk a b
|
||||
70 4 40
|
||||
71 2 20
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t2 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
col1 varchar(255),
|
||||
key (key1, pk)
|
||||
);
|
||||
insert into t2 (pk, key1)
|
||||
select A.a+10 *B.a + 100*C.a, A.a+10 *B.a +100*C.a from t1 A, t1 B, t1 C;
|
||||
# This must use ALL, not range:
|
||||
explain select * from t2 force index (primary) where pk not in (1,2,3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 1000 Using where
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-24444: ASAN use-after-poison in Item_func_in::get_func_mm_tree with NOT IN
|
||||
#
|
||||
CREATE TABLE t1 (id INT, a CHAR(3), b INT, PRIMARY KEY(id), KEY(b), KEY(a));
|
||||
INSERT INTO t1 VALUES (1,'foo',10),(2,'bar',20);
|
||||
CREATE TABLE t2 (code CHAR(8), num INT, PRIMARY KEY (code));
|
||||
INSERT INTO t2 VALUES ('100',1),('111',2);
|
||||
SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR t2.num != 3;
|
||||
id a b code num
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
|
37
mysql-test/main/range_notembedded.result
Normal file
37
mysql-test/main/range_notembedded.result
Normal file
@ -0,0 +1,37 @@
|
||||
drop table if exists t1,t2;
|
||||
#
|
||||
# MDEV-21958: Query having many NOT-IN clauses running forever
|
||||
#
|
||||
create table t2 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
col1 int,
|
||||
key (key1, pk)
|
||||
);
|
||||
insert into t2 (pk, key1) values (1,1),(2,2),(3,3),(4,4),(5,5);
|
||||
set @tmp_21958=@@optimizer_trace;
|
||||
set optimizer_trace=1;
|
||||
explain select * from t2 where key1 in (1,2,3) and pk not in (1,2,3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range PRIMARY,key1 key1 5 NULL 3 Using index condition
|
||||
# This should show only ranges in form "(1) <= (key1) <= (1)"
|
||||
# ranges over "pk" should not be constructed.
|
||||
select json_detailed(JSON_EXTRACT(trace, '$**.ranges'))
|
||||
from information_schema.optimizer_trace;
|
||||
json_detailed(JSON_EXTRACT(trace, '$**.ranges'))
|
||||
[
|
||||
|
||||
[
|
||||
"(1) <= (key1) <= (1)",
|
||||
"(2) <= (key1) <= (2)",
|
||||
"(3) <= (key1) <= (3)"
|
||||
],
|
||||
|
||||
[
|
||||
"(1) <= (key1) <= (1)",
|
||||
"(2) <= (key1) <= (2)",
|
||||
"(3) <= (key1) <= (3)"
|
||||
]
|
||||
]
|
||||
set optimizer_trace=@tmp_21958;
|
||||
drop table t2;
|
33
mysql-test/main/range_notembedded.test
Normal file
33
mysql-test/main/range_notembedded.test
Normal file
@ -0,0 +1,33 @@
|
||||
#
|
||||
# Range tests without embedded server.
|
||||
# The first reason to have them is that embedded server doesn't have
|
||||
# optimizer trace.
|
||||
#
|
||||
--source include/not_embedded.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-21958: Query having many NOT-IN clauses running forever
|
||||
--echo #
|
||||
create table t2 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
col1 int,
|
||||
key (key1, pk)
|
||||
);
|
||||
|
||||
insert into t2 (pk, key1) values (1,1),(2,2),(3,3),(4,4),(5,5);
|
||||
|
||||
set @tmp_21958=@@optimizer_trace;
|
||||
set optimizer_trace=1;
|
||||
explain select * from t2 where key1 in (1,2,3) and pk not in (1,2,3);
|
||||
|
||||
--echo # This should show only ranges in form "(1) <= (key1) <= (1)"
|
||||
--echo # ranges over "pk" should not be constructed.
|
||||
select json_detailed(JSON_EXTRACT(trace, '$**.ranges'))
|
||||
from information_schema.optimizer_trace;
|
||||
set optimizer_trace=@tmp_21958;
|
||||
|
||||
drop table t2;
|
@ -11,9 +11,11 @@ create user oldauth@localhost identified with 'mysql_old_password' using '378b24
|
||||
create user oldpass@localhost identified by password '378b243e220ca493';
|
||||
create user oldpassold@localhost identified with 'mysql_old_password';
|
||||
set password for oldpassold@localhost = '378b243e220ca493';
|
||||
create user invalidmysql57auth@localhost identified via 'mysql_native_password' using '*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE';
|
||||
select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
|
||||
User Host Password plugin authentication_string
|
||||
invalidauth localhost invalid mysql_native_password invalid
|
||||
invalidmysql57auth localhost *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE mysql_native_password *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE
|
||||
invalidpass localhost invalid mysql_native_password invalid
|
||||
invalidpassnat localhost invalid mysql_native_password invalid
|
||||
mariadb.sys localhost mysql_native_password
|
||||
@ -95,6 +97,7 @@ set password for oldpassold@localhost = PASSWORD('test2');
|
||||
select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
|
||||
User Host Password plugin authentication_string
|
||||
invalidauth localhost invalid mysql_native_password invalid
|
||||
invalidmysql57auth localhost *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE mysql_native_password *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE
|
||||
invalidpass localhost invalid mysql_native_password invalid
|
||||
invalidpassnat localhost invalid mysql_native_password invalid
|
||||
mariadb.sys localhost mysql_native_password
|
||||
@ -160,6 +163,9 @@ ERROR 28000: Access denied for user 'invalidpass'@'localhost' (using password: Y
|
||||
connect(localhost,invalidpassnat,invalid,test,MASTER_PORT,MASTER_SOCKET);
|
||||
connect con,localhost,invalidpassnat,invalid,;
|
||||
ERROR 28000: Access denied for user 'invalidpassnat'@'localhost' (using password: YES)
|
||||
connect(localhost,invalidmysql57auth,invalid,test,MASTER_PORT,MASTER_SOCKET);
|
||||
connect con,localhost,invalidmysql57auth,invalid,;
|
||||
ERROR 28000: Access denied for user 'invalidmysql57auth'@'localhost' (using password: YES)
|
||||
connect con,localhost,oldauth,test2,;
|
||||
select current_user();
|
||||
current_user()
|
||||
@ -177,7 +183,7 @@ oldpassold@localhost
|
||||
disconnect con;
|
||||
connection default;
|
||||
drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
|
||||
drop user invalidauth@localhost, invalidpass@localhost, invalidpassnat@localhost;
|
||||
drop user invalidauth@localhost, invalidpass@localhost, invalidpassnat@localhost,invalidmysql57auth@localhost;
|
||||
drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
|
||||
set global secure_auth=default;
|
||||
# switching from mysql.global_priv to mysql.user
|
||||
|
@ -31,6 +31,8 @@ create user oldpass@localhost identified by password '378b243e220ca493';
|
||||
create user oldpassold@localhost identified with 'mysql_old_password';
|
||||
set password for oldpassold@localhost = '378b243e220ca493';
|
||||
|
||||
create user invalidmysql57auth@localhost identified via 'mysql_native_password' using '*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE';
|
||||
|
||||
--sorted_result
|
||||
select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
|
||||
|
||||
@ -131,6 +133,9 @@ select current_user();
|
||||
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
--connect(con,localhost,invalidpassnat,invalid,)
|
||||
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
--connect(con,localhost,invalidmysql57auth,invalid,)
|
||||
|
||||
--connect(con,localhost,oldauth,test2,)
|
||||
select current_user();
|
||||
@ -144,7 +149,7 @@ select current_user();
|
||||
|
||||
--connection default
|
||||
drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
|
||||
drop user invalidauth@localhost, invalidpass@localhost, invalidpassnat@localhost;
|
||||
drop user invalidauth@localhost, invalidpass@localhost, invalidpassnat@localhost,invalidmysql57auth@localhost;
|
||||
drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
|
||||
set global secure_auth=default;
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (y year,y2 year(2));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
@ -28,6 +27,9 @@ y y2
|
||||
2001 01
|
||||
2069 69
|
||||
drop table t1;
|
||||
#
|
||||
# Bug 2335
|
||||
#
|
||||
create table t1 (y year);
|
||||
insert ignore into t1 values (now());
|
||||
Warnings:
|
||||
@ -36,6 +38,9 @@ select if(y = now(), 1, 0) from t1;
|
||||
if(y = now(), 1, 0)
|
||||
1
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #27176: Assigning a string to an year column has unexpected results
|
||||
#
|
||||
create table t1(a year);
|
||||
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
|
||||
Warnings:
|
||||
@ -47,7 +52,9 @@ a
|
||||
2001
|
||||
2001
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# End of 5.0 tests
|
||||
#
|
||||
#
|
||||
# Bug #49480: WHERE using YEAR columns returns unexpected results
|
||||
#
|
||||
@ -373,7 +380,8 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas
|
||||
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
DROP TABLE t1;
|
||||
#
|
||||
End of 5.1 tests
|
||||
# End of 5.1 tests
|
||||
#
|
||||
create function y2k() returns int deterministic return 2000;
|
||||
create table t1 (a year(2), b int);
|
||||
Warnings:
|
||||
@ -456,9 +464,6 @@ DROP TABLE t1;
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
#
|
||||
# MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings
|
||||
#
|
||||
CREATE TABLE t1 (a YEAR);
|
||||
@ -500,6 +505,64 @@ Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Various widths of the YEAR
|
||||
#
|
||||
create or replace table t1 (a YEAR(0));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create or replace table t1 (a YEAR(1));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(1)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create or replace table t1 (a YEAR(2));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create or replace table t1 (a YEAR(3));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create or replace table t1 (a YEAR(4));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create or replace table t1 (a YEAR(5));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(5)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create or replace table t1 (a YEAR(100));
|
||||
Warnings:
|
||||
Note 1287 'YEAR(100)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` year(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
@ -1,9 +1,6 @@
|
||||
#
|
||||
# Test year
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (y year,y2 year(2));
|
||||
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
|
||||
@ -12,24 +9,27 @@ select * from t1 order by y;
|
||||
select * from t1 order by y2;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug 2335
|
||||
#
|
||||
--echo #
|
||||
--echo # Bug 2335
|
||||
--echo #
|
||||
|
||||
create table t1 (y year);
|
||||
insert ignore into t1 values (now());
|
||||
select if(y = now(), 1, 0) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #27176: Assigning a string to an year column has unexpected results
|
||||
#
|
||||
--echo #
|
||||
--echo # Bug #27176: Assigning a string to an year column has unexpected results
|
||||
--echo #
|
||||
|
||||
create table t1(a year);
|
||||
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
--echo #
|
||||
--echo # End of 5.0 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49480: WHERE using YEAR columns returns unexpected results
|
||||
@ -168,9 +168,10 @@ CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
|
||||
ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
||||
|
||||
--echo End of 5.1 tests
|
||||
#
|
||||
# fun with convert_const_to_int
|
||||
# in some cases 00 is equal to 2000, in others it is not.
|
||||
@ -229,10 +230,6 @@ DROP TABLE t1;
|
||||
--echo # End of 10.1 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.2 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings
|
||||
--echo #
|
||||
@ -268,6 +265,17 @@ SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
|
||||
ALTER TABLE t1 MODIFY a YEAR;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Various widths of the YEAR
|
||||
--echo #
|
||||
create or replace table t1 (a YEAR(0)); SHOW CREATE TABLE t1;
|
||||
create or replace table t1 (a YEAR(1)); SHOW CREATE TABLE t1;
|
||||
create or replace table t1 (a YEAR(2)); SHOW CREATE TABLE t1;
|
||||
create or replace table t1 (a YEAR(3)); SHOW CREATE TABLE t1;
|
||||
create or replace table t1 (a YEAR(4)); SHOW CREATE TABLE t1;
|
||||
create or replace table t1 (a YEAR(5)); SHOW CREATE TABLE t1;
|
||||
create or replace table t1 (a YEAR(100)); SHOW CREATE TABLE t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
|
@ -6726,6 +6726,41 @@ DROP PROCEDURE sp;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-24314: create view with derived table without default database
|
||||
#
|
||||
drop database test;
|
||||
create database db1;
|
||||
create table db1.t1 (a int);
|
||||
insert into db1.t1 values (3),(7),(1);
|
||||
create view db1.v1 as select * from (select * from db1.t1) t;
|
||||
show create view db1.v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS select `t`.`a` AS `a` from (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`) `t` latin1 latin1_swedish_ci
|
||||
select * from db1.v1;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
drop view db1.v1;
|
||||
prepare stmt from "
|
||||
create view db1.v1 as select * from (select * from db1.t1) t;
|
||||
";
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
show create view db1.v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db1`.`v1` AS select `t`.`a` AS `a` from (select `db1`.`t1`.`a` AS `a` from `db1`.`t1`) `t` latin1 latin1_swedish_ci
|
||||
select * from db1.v1;
|
||||
a
|
||||
3
|
||||
7
|
||||
1
|
||||
drop view db1.v1;
|
||||
drop table db1.t1;
|
||||
drop database db1;
|
||||
create database test;
|
||||
use test;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
@ -6432,6 +6432,36 @@ DROP PROCEDURE sp;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24314: create view with derived table without default database
|
||||
--echo #
|
||||
|
||||
drop database test;
|
||||
|
||||
create database db1;
|
||||
create table db1.t1 (a int);
|
||||
insert into db1.t1 values (3),(7),(1);
|
||||
|
||||
create view db1.v1 as select * from (select * from db1.t1) t;
|
||||
show create view db1.v1;
|
||||
select * from db1.v1;
|
||||
drop view db1.v1;
|
||||
|
||||
prepare stmt from "
|
||||
create view db1.v1 as select * from (select * from db1.t1) t;
|
||||
";
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
show create view db1.v1;
|
||||
select * from db1.v1;
|
||||
drop view db1.v1;
|
||||
|
||||
drop table db1.t1;
|
||||
drop database db1;
|
||||
|
||||
create database test;
|
||||
use test;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
@ -3259,6 +3259,7 @@ sub mysql_install_db {
|
||||
mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
|
||||
mtr_add_arg($args, "--core-file");
|
||||
mtr_add_arg($args, "--console");
|
||||
mtr_add_arg($args, "--character-set-server=latin1");
|
||||
|
||||
if ( $opt_debug )
|
||||
{
|
||||
|
@ -9,5 +9,3 @@
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
|
||||
binlog_spurious_ddl_errors : BUG#11761680 2013-01-18 astha Fixed on mysql-5.6 and trunk
|
||||
|
@ -1,5 +1,5 @@
|
||||
SET @old_binlog_format= @@global.binlog_format;
|
||||
INSTALL PLUGIN example SONAME 'ha_example.so';
|
||||
INSTALL PLUGIN example SONAME 'ha_example';
|
||||
################################################################################
|
||||
# Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog
|
||||
# format to STATEMENT and the transaction isolation level to READ COMMITTED as
|
||||
@ -18,7 +18,7 @@ ALTER TABLE t_row ADD COLUMN b INT;
|
||||
CREATE TRIGGER trig_row BEFORE INSERT ON t_row FOR EACH ROW INSERT INTO t_stmt VALUES (1);
|
||||
CREATE INDEX i ON t_row(a);
|
||||
CREATE TABLE t_row_new ENGINE = InnoDB SELECT * FROM t_row;
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
|
||||
DROP TABLE t_row;
|
||||
|
||||
|
||||
@ -36,12 +36,11 @@ DROP TABLE t_row;
|
||||
SET binlog_format = ROW;
|
||||
CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;
|
||||
ALTER TABLE t_stmt ADD COLUMN b INT;
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'ALTER TABLE'
|
||||
CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1);
|
||||
CREATE INDEX i ON t_stmt(a);
|
||||
ERROR 42000: Too many key parts specified; max 0 parts allowed
|
||||
CREATE TABLE t_stmt_new ENGINE = EXAMPLE SELECT * FROM t_stmt;
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging.
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging
|
||||
DROP TABLE t_stmt;
|
||||
|
||||
|
||||
|
@ -7,9 +7,11 @@ INSERT INTO t2 VALUES (1),(2),(3);
|
||||
**** Truncate of empty table shall be logged
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -18,18 +20,17 @@ DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -37,16 +38,20 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
# Even though the isolation level might be permissive, truncate
|
||||
# table follows a stricter isolation as its locking is based on
|
||||
@ -59,9 +64,11 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -71,18 +78,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -90,16 +96,20 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
@ -109,9 +119,11 @@ SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -121,18 +133,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -140,16 +151,20 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
@ -159,9 +174,11 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -171,18 +188,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -190,16 +206,20 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
@ -209,9 +229,11 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -221,18 +243,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -240,16 +261,20 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Annotate_rows # # INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
SET BINLOG_FORMAT=STATEMENT;
|
||||
RESET MASTER;
|
||||
@ -261,9 +286,11 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -273,18 +300,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -292,14 +318,16 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
# Truncate is not supported for SBR if the isolation level is
|
||||
# READ UNCOMMITTED or READ COMMITTED. These specific isolation
|
||||
@ -312,9 +340,11 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -324,18 +354,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -343,14 +372,16 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
@ -360,9 +391,11 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
TRUNCATE TABLE t1;
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
TRUNCATE TABLE t2;
|
||||
show binlog events from <binlog_start>;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t2
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -372,18 +405,17 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
# Connection: default
|
||||
BEGIN;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
# Connection: truncate
|
||||
connect truncate,localhost,root,,;
|
||||
TRUNCATE TABLE t1;
|
||||
# Connection: default
|
||||
connection default;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
COMMIT;
|
||||
# Connection: truncate
|
||||
connection truncate;
|
||||
# Reaping TRUNCATE TABLE
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
@ -391,13 +423,16 @@ COUNT(*)
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
4
|
||||
# Connection: default
|
||||
show binlog events from <binlog_start>;
|
||||
connection default;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Gtid # # GTID #-#-#
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
disconnect truncate;
|
||||
DROP TABLE t1,t2;
|
||||
SET BINLOG_FORMAT=@old_binlog_format;
|
||||
SET @@global.binlog_format = @old_binlog_format;
|
||||
SET @@session.binlog_format = @old_binlog_format;
|
||||
|
@ -1 +0,0 @@
|
||||
--innodb
|
@ -71,7 +71,6 @@ DROP TABLE t_row;
|
||||
SET binlog_format = ROW;
|
||||
CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;
|
||||
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
ALTER TABLE t_stmt ADD COLUMN b INT;
|
||||
|
||||
CREATE TRIGGER trig_stmt BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1);
|
||||
|
@ -1 +0,0 @@
|
||||
--loose-innodb
|
@ -41,4 +41,5 @@ source include/binlog_truncate.test;
|
||||
let $before_truncate = SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
source include/binlog_truncate.test;
|
||||
|
||||
SET BINLOG_FORMAT=@old_binlog_format;
|
||||
SET @@global.binlog_format = @old_binlog_format;
|
||||
SET @@session.binlog_format = @old_binlog_format;
|
@ -164,20 +164,15 @@ connection slave;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
[ master status should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 0
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 14
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 0
|
||||
[ semi-sync replication of these transactions will fail ]
|
||||
insert into t1 values (500);
|
||||
[ master status should be OFF ]
|
||||
@ -235,9 +230,6 @@ max(a)
|
||||
500
|
||||
connection master;
|
||||
[ master status should be ON again after slave catches up ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 12
|
||||
@ -304,8 +296,6 @@ connection master;
|
||||
create table t1 (a int) engine = ENGINE_TYPE;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
show status like 'Rpl_relay%';
|
||||
Variable_name Value
|
||||
[ test reset master ]
|
||||
connection master;
|
||||
reset master;
|
||||
@ -321,7 +311,7 @@ Rpl_semi_sync_master_yes_tx 0
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
@ -353,6 +343,7 @@ include/stop_slave.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
@ -403,10 +394,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_slave_status OFF
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
[ Semi-sync status on master should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 0
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
|
@ -2284,6 +2284,32 @@ connection master;
|
||||
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
|
||||
#
|
||||
# MDEV-17573 Assertion in federatedx on multi-update
|
||||
#
|
||||
create table t1 (
|
||||
x int,
|
||||
d datetime);
|
||||
create table t1f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t1';
|
||||
create table t2 (
|
||||
x int, y int,
|
||||
d datetime);
|
||||
create table t2f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t2';
|
||||
create table t3 (
|
||||
x int, y int, z int,
|
||||
d datetime);
|
||||
create table t3f engine=FEDERATED connection='mysql://root@127.0.0.1:MASTER_MYPORT/test/t3';
|
||||
insert into t1 values (1, "1990-01-01 00:00");
|
||||
insert into t1 values (1, "1991-01-01 11:11");
|
||||
insert into t2 values (2, 2, "1992-02-02 22:22");
|
||||
insert into t3 values (3, 3, 3, "1993-03-03 23:33");
|
||||
update t1f, t2f, t3f set t1f.x= 11, t2f.y= 22, t3f.z= 33;
|
||||
drop table t1f;
|
||||
drop table t2f;
|
||||
drop table t3f;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
#
|
||||
# MDEV-21049 Segfault in create federatedx table with empty hostname
|
||||
#
|
||||
connection master;
|
||||
|
@ -2010,6 +2010,35 @@ connection master;
|
||||
--error ER_CANT_CREATE_FEDERATED_TABLE
|
||||
eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17573 Assertion in federatedx on multi-update
|
||||
--echo #
|
||||
create table t1 (
|
||||
x int,
|
||||
d datetime);
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
eval create table t1f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1';
|
||||
|
||||
create table t2 (
|
||||
x int, y int,
|
||||
d datetime);
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
eval create table t2f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t2';
|
||||
|
||||
create table t3 (
|
||||
x int, y int, z int,
|
||||
d datetime);
|
||||
--replace_result $MASTER_MYPORT MASTER_MYPORT
|
||||
eval create table t3f engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t3';
|
||||
|
||||
insert into t1 values (1, "1990-01-01 00:00");
|
||||
insert into t1 values (1, "1991-01-01 11:11");
|
||||
insert into t2 values (2, 2, "1992-02-02 22:22");
|
||||
insert into t3 values (3, 3, 3, "1993-03-03 23:33");
|
||||
update t1f, t2f, t3f set t1f.x= 11, t2f.y= 22, t3f.z= 33;
|
||||
|
||||
drop table t1f; drop table t2f; drop table t3f; drop table t1; drop table t2; drop table t3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-21049 Segfault in create federatedx table with empty hostname
|
||||
--echo #
|
||||
|
@ -90,7 +90,9 @@ CREATE TABLE t3
|
||||
(
|
||||
a int,
|
||||
b int check (b>0), # field constraint named 'b'
|
||||
CONSTRAINT b check (b>10) # table constraint
|
||||
CONSTRAINT b check (b>10), # table constraint
|
||||
# `CHECK_CLAUSE` should allow more then `var(64)` constraints
|
||||
CONSTRAINT b1 check (b<123456789012345678901234567890123456789012345678901234567890123456789)
|
||||
) ENGINE=InnoDB;
|
||||
SELECT * from information_schema.check_constraints;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
|
||||
@ -104,6 +106,7 @@ def foo t2 CHK_dates `start_date` is null
|
||||
def foo t2 name char_length(`name`) > 2
|
||||
def foo t3 b `b` > 0
|
||||
def foo t3 b `b` > 10
|
||||
def foo t3 b1 `b` < 123456789012345678901234567890123456789012345678901234567890123456789
|
||||
disconnect con1;
|
||||
CONNECT con2, localhost, boo2,, test;
|
||||
SELECT * from information_schema.check_constraints;
|
||||
|
@ -24,7 +24,7 @@ def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 N
|
||||
def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select NEVER NULL
|
||||
def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select NEVER NULL
|
||||
def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
|
||||
@ -572,7 +572,7 @@ NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(
|
||||
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
|
||||
|
@ -24,7 +24,7 @@ def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 N
|
||||
def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) NEVER NULL
|
||||
def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) NEVER NULL
|
||||
def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
|
||||
def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
|
||||
@ -572,7 +572,7 @@ NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(
|
||||
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)
|
||||
|
@ -91,9 +91,9 @@ TABLE_CATALOG def
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME CHECK_CONSTRAINTS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 11
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT DYNAMIC_OR_PAGE
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
@ -1157,9 +1157,9 @@ TABLE_CATALOG def
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME CHECK_CONSTRAINTS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 11
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT DYNAMIC_OR_PAGE
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -91,9 +91,9 @@ TABLE_CATALOG def
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME CHECK_CONSTRAINTS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 11
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT DYNAMIC_OR_PAGE
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
@ -1157,9 +1157,9 @@ TABLE_CATALOG def
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME CHECK_CONSTRAINTS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
ENGINE MYISAM_OR_MARIA
|
||||
VERSION 11
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT DYNAMIC_OR_PAGE
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -69,7 +69,9 @@ CREATE TABLE t3
|
||||
(
|
||||
a int,
|
||||
b int check (b>0), # field constraint named 'b'
|
||||
CONSTRAINT b check (b>10) # table constraint
|
||||
CONSTRAINT b check (b>10), # table constraint
|
||||
# `CHECK_CLAUSE` should allow more then `var(64)` constraints
|
||||
CONSTRAINT b1 check (b<123456789012345678901234567890123456789012345678901234567890123456789)
|
||||
) ENGINE=InnoDB;
|
||||
--sorted_result
|
||||
SELECT * from information_schema.check_constraints;
|
||||
|
35
mysql-test/suite/galera/r/MDEV-24327.result
Normal file
35
mysql-test/suite/galera/r/MDEV-24327.result
Normal file
@ -0,0 +1,35 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
INSERT INTO t1 VALUES (1, 'f');
|
||||
INSERT INTO t1 VALUES (2, 'g');
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
UPDATE t1 SET f2 = '1' WHERE f1 = 1;
|
||||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
connection node_1a;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
|
||||
connection node_1;
|
||||
COMMIT;
|
||||
connection node_1a;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
connection node_2;
|
||||
UPDATE t1 SET f2 = '2' WHERE f1 = 2;
|
||||
connection node_1a;
|
||||
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
connection node_1;
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
1 1
|
||||
2 2
|
||||
"node 1 is complete now"
|
||||
connection node_2;
|
||||
DROP TABLE t1;
|
4
mysql-test/suite/galera/r/MENT-1047.result
Normal file
4
mysql-test/suite/galera/r/MENT-1047.result
Normal file
@ -0,0 +1,4 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
XA START 'trx';
|
||||
ERROR 42000: This version of MariaDB doesn't yet support 'XA transactions with Galera replication'
|
@ -1,3 +1,5 @@
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
|
6
mysql-test/suite/galera/t/MDEV-24327.cnf
Normal file
6
mysql-test/suite/galera/t/MDEV-24327.cnf
Normal file
@ -0,0 +1,6 @@
|
||||
!include ../galera_2nodes.cnf
|
||||
|
||||
[mysqld.1]
|
||||
log-bin=mariadb-bin
|
||||
log-slave-updates=OFF
|
||||
|
87
mysql-test/suite/galera/t/MDEV-24327.test
Normal file
87
mysql-test/suite/galera/t/MDEV-24327.test
Normal file
@ -0,0 +1,87 @@
|
||||
#
|
||||
# MDEV-24327 wsrep XID checkpointing order violation with log_slave_updates=OFF
|
||||
#
|
||||
# Here we have configure two node cluster with --log-bin=ON and --log-slave_-updates=OFF
|
||||
#
|
||||
# a transaction in node executes so far that it has replicated and reached
|
||||
# commit phase, We have sync point before entering commit order monitor and
|
||||
# the transaction is parked there
|
||||
#
|
||||
# Then another transaction is executed in node 2, it replicates and commits in node 2
|
||||
# and is received and applied in node 1. After applying it will remain waiting for
|
||||
# commit order monitor, as it has later seqno than the first transaction in node 1.
|
||||
#
|
||||
# control connection in node 1 waits to see the
|
||||
#
|
||||
# With the buggy version of MDEV-24327, the applier has however, already synced the
|
||||
# wsrep XID checkpoint
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/galera_have_debug_sync.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
INSERT INTO t1 VALUES (1, 'f');
|
||||
INSERT INTO t1 VALUES (2, 'g');
|
||||
|
||||
--connection node_1
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE t1 SET f2 = '1' WHERE f1 = 1;
|
||||
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
--connection node_1a
|
||||
--let $expected_wsrep_received = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received'`
|
||||
--source include/galera_wait_sync_point.inc
|
||||
--source include/galera_clear_sync_point.inc
|
||||
|
||||
# Block the commit, send the COMMIT and wait until it gets blocked
|
||||
|
||||
--let $galera_sync_point = commit_monitor_master_enter_sync
|
||||
--source include/galera_set_sync_point.inc
|
||||
|
||||
--connection node_1
|
||||
--send COMMIT
|
||||
|
||||
--connection node_1a
|
||||
|
||||
# wait for the commit to block in sync point
|
||||
|
||||
--let $galera_sync_point = commit_monitor_master_enter_sync
|
||||
--source include/galera_wait_sync_point.inc
|
||||
--source include/galera_clear_sync_point.inc
|
||||
|
||||
#
|
||||
# replicate non conflicting transaction from node 2
|
||||
# it will get later seqno and should sync XID checkpoint after transaction in node 1
|
||||
#
|
||||
--connection node_2
|
||||
UPDATE t1 SET f2 = '2' WHERE f1 = 2;
|
||||
|
||||
#
|
||||
# wait until update from node 2 has been committed
|
||||
# if XID checkpointing order was violated, node 1 would crash for assert
|
||||
#
|
||||
|
||||
--connection node_1a
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_wsrep_received FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $galera_sync_point = commit_monitor_master_enter_sync
|
||||
--source include/galera_signal_sync_point.inc
|
||||
--source include/galera_clear_sync_point.inc
|
||||
|
||||
--connection node_1
|
||||
--reap
|
||||
SELECT * FROM t1;
|
||||
--echo "node 1 is complete now"
|
||||
|
||||
|
||||
--connection node_2
|
||||
DROP TABLE t1;
|
7
mysql-test/suite/galera/t/MENT-1047.test
Normal file
7
mysql-test/suite/galera/t/MENT-1047.test
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
# MENT-1047 - Reject XA with Galera replication
|
||||
#
|
||||
--source include/galera_cluster.inc
|
||||
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
XA START 'trx';
|
@ -8,9 +8,10 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/galera_have_debug_sync.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source suite/galera/include/auto_increment_offset_save.inc
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
# Force node_2 gcomm background thread to terminate via exception.
|
||||
--connection node_2
|
||||
@ -41,4 +42,4 @@ SET SESSION wsrep_on=0;
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");
|
||||
|
||||
--source suite/galera/include/auto_increment_offset_restore.inc
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
@ -13,6 +13,9 @@ INSERT INTO t1 VALUES (1, 'a');
|
||||
SET GLOBAL wsrep_on=ON;
|
||||
|
||||
--connection node_2
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_on=OFF;
|
||||
INSERT INTO t1 VALUES (1, 'a');
|
||||
SET GLOBAL wsrep_on=ON;
|
||||
|
@ -790,3 +790,31 @@ t1 CREATE TABLE `t1` (
|
||||
ALTER TABLE t1 DROP INDEX f1;
|
||||
ALTER TABLE t1 DROP f3;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-24041 Generated column DELETE with FOREIGN KEY crash InnoDB
|
||||
#
|
||||
CREATE TABLE emails (
|
||||
id int,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB;
|
||||
CREATE TABLE email_stats (
|
||||
id int,
|
||||
email_id int,
|
||||
date_sent char(4),
|
||||
generated_email_id int as (email_id),
|
||||
PRIMARY KEY (id),
|
||||
KEY mautic_generated_sent_date_email_id (generated_email_id),
|
||||
FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB;
|
||||
CREATE TABLE emails_metadata (
|
||||
email_id int,
|
||||
PRIMARY KEY (email_id),
|
||||
CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO emails VALUES (1);
|
||||
INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan');
|
||||
INSERT INTO emails_metadata VALUES (1);
|
||||
DELETE FROM emails;
|
||||
DROP TABLE email_stats;
|
||||
DROP TABLE emails_metadata;
|
||||
DROP TABLE emails;
|
||||
|
@ -649,3 +649,40 @@ SHOW CREATE TABLE t1;
|
||||
ALTER TABLE t1 DROP INDEX f1;
|
||||
ALTER TABLE t1 DROP f3;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24041 Generated column DELETE with FOREIGN KEY crash InnoDB
|
||||
--echo #
|
||||
|
||||
CREATE TABLE emails (
|
||||
id int,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE email_stats (
|
||||
id int,
|
||||
email_id int,
|
||||
date_sent char(4),
|
||||
generated_email_id int as (email_id),
|
||||
PRIMARY KEY (id),
|
||||
KEY mautic_generated_sent_date_email_id (generated_email_id),
|
||||
FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
CREATE TABLE emails_metadata (
|
||||
email_id int,
|
||||
PRIMARY KEY (email_id),
|
||||
CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
INSERT INTO emails VALUES (1);
|
||||
INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan');
|
||||
INSERT INTO emails_metadata VALUES (1);
|
||||
|
||||
DELETE FROM emails;
|
||||
|
||||
DROP TABLE email_stats;
|
||||
DROP TABLE emails_metadata;
|
||||
DROP TABLE emails;
|
||||
|
@ -81,4 +81,5 @@ CREATE TABLE t1(f1 INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1;
|
||||
ERROR 21000: Operand should contain 1 column(s)
|
||||
UPDATE (SELECT ((SELECT 1 FROM t1),1) = (1,1) FROM t1 WHERE (SELECT 1 FROM t1)) x, t1 AS d SET d.f1 = 1;
|
||||
DROP TABLE t1;
|
||||
|
@ -4,7 +4,6 @@ dummy INSERT, the table should be empty
|
||||
dummy INSERT, the table should be empty
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -57,7 +56,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -110,7 +108,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (1);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -163,7 +160,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (1), (1);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -216,7 +212,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (1), (1), (1), (1), (1), (1), (1), (1), (1);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -269,7 +264,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (2);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -322,7 +316,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (1), (2);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -375,7 +368,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (2), (3);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -428,7 +420,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (1), (2), (3), (3);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
@ -481,7 +472,6 @@ TRUNCATE TABLE test_innodb_stats;
|
||||
INSERT INTO test_innodb_stats (a) VALUES (1), (2), (3), (4), (5), (1), (2), (3), (4), (5);
|
||||
ANALYZE TABLE test_innodb_stats;
|
||||
Table Op Msg_type Msg_text
|
||||
test.test_innodb_stats analyze status Engine-independent statistics collected
|
||||
test.test_innodb_stats analyze status OK
|
||||
SELECT
|
||||
stat_name,
|
||||
|
@ -35,4 +35,5 @@ CREATE TABLE t1(f1 INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
--error ER_OPERAND_COLUMNS
|
||||
UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1;
|
||||
UPDATE (SELECT ((SELECT 1 FROM t1),1) = (1,1) FROM t1 WHERE (SELECT 1 FROM t1)) x, t1 AS d SET d.f1 = 1;
|
||||
DROP TABLE t1;
|
||||
|
@ -10,7 +10,7 @@
|
||||
DROP TABLE IF EXISTS test_innodb_stats;
|
||||
|
||||
set @save_use_stat_tables= @@use_stat_tables;
|
||||
set @@use_stat_tables= COMPLEMENTARY;
|
||||
set @@use_stat_tables= NEVER;
|
||||
|
||||
CREATE TABLE test_innodb_stats (
|
||||
a INT,
|
||||
|
@ -452,8 +452,8 @@ TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,,,0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv,
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT PROXY ON plug_dest TO plug',0
|
||||
TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,test,`plug_dest`@`%`,0
|
||||
TIME,HOSTNAME,plug,localhost,ID,0,CONNECT,test,,0
|
||||
TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,test,`plug_dest`@`%`,0
|
||||
TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,test,,0
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,
|
||||
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv,
|
||||
|
@ -9,7 +9,6 @@ source include/have_innodb.inc;
|
||||
source include/master-slave.inc;
|
||||
|
||||
let $engine_type= InnoDB;
|
||||
#let $engine_type= MyISAM;
|
||||
|
||||
# Suppress warnings that might be generated during the test
|
||||
connection master;
|
||||
@ -94,7 +93,6 @@ enable_query_log;
|
||||
echo [ status of semi-sync on master should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
# reset master to make sure the following test will start with a clean environment
|
||||
@ -201,16 +199,23 @@ connection slave;
|
||||
source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
--source include/kill_binlog_dump_threads.inc
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
|
||||
# The first semi-sync check should be on because after slave stop,
|
||||
# there are no transactions on the master.
|
||||
echo [ master status should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
|
||||
let $status_var= Rpl_semi_sync_master_status;
|
||||
let $status_var_value= ON;
|
||||
source include/wait_for_status_var.inc;
|
||||
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
|
||||
echo [ semi-sync replication of these transactions will fail ];
|
||||
insert into t1 values (500);
|
||||
@ -225,7 +230,6 @@ source include/wait_for_status_var.inc;
|
||||
echo [ master status should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
# Semi-sync status on master is now OFF, so all these transactions
|
||||
@ -246,7 +250,6 @@ insert into t1 values (100);
|
||||
echo [ master status should be OFF ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
--echo #
|
||||
@ -274,9 +277,11 @@ connection master;
|
||||
|
||||
# The master semi-sync status should be on again after slave catches up.
|
||||
echo [ master status should be ON again after slave catches up ];
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
|
||||
let $status_var= Rpl_semi_sync_master_status;
|
||||
let $status_var_value= ON;
|
||||
source include/wait_for_status_var.inc;
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
--replace_result 305 304
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
|
||||
@ -332,11 +337,7 @@ replace_result $engine_type ENGINE_TYPE;
|
||||
eval create table t1 (a int) engine = $engine_type;
|
||||
drop table t1;
|
||||
|
||||
##show status like 'Rpl_semi_sync_master_status';
|
||||
|
||||
sync_slave_with_master;
|
||||
--replace_column 2 #
|
||||
show status like 'Rpl_relay%';
|
||||
|
||||
echo [ test reset master ];
|
||||
connection master;
|
||||
@ -353,19 +354,7 @@ source include/stop_slave.inc;
|
||||
reset slave;
|
||||
|
||||
# Kill the dump thread on master for previous slave connection and
|
||||
# wait for it to exit
|
||||
connection master;
|
||||
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
|
||||
if ($_tid)
|
||||
{
|
||||
--replace_result $_tid _tid
|
||||
eval kill query $_tid;
|
||||
|
||||
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
}
|
||||
--source include/kill_binlog_dump_threads.inc
|
||||
|
||||
connection slave;
|
||||
source include/start_slave.inc;
|
||||
@ -404,17 +393,7 @@ connection master;
|
||||
reset master;
|
||||
|
||||
# Kill the dump thread on master for previous slave connection and wait for it to exit
|
||||
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
|
||||
if ($_tid)
|
||||
{
|
||||
--replace_result $_tid _tid
|
||||
eval kill query $_tid;
|
||||
|
||||
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
}
|
||||
--source include/kill_binlog_dump_threads.inc
|
||||
|
||||
# Do not binlog the following statement because it will generate
|
||||
# different events for ROW and STATEMENT format
|
||||
@ -459,21 +438,16 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
connection master;
|
||||
|
||||
# Kill the dump thread on master for previous slave connection and wait for it to exit
|
||||
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
|
||||
if ($_tid)
|
||||
{
|
||||
--replace_result $_tid _tid
|
||||
eval kill query $_tid;
|
||||
|
||||
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
}
|
||||
--source include/kill_binlog_dump_threads.inc
|
||||
|
||||
echo [ Semi-sync status on master should be ON ];
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
let $status_var= Rpl_semi_sync_master_clients;
|
||||
let $status_var_value= 0;
|
||||
source include/wait_for_status_var.inc;
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
let $status_var= Rpl_semi_sync_master_status;
|
||||
let $status_var_value= ON;
|
||||
source include/wait_for_status_var.inc;
|
||||
set global rpl_semi_sync_master_enabled= 0;
|
||||
|
||||
connection slave;
|
||||
|
@ -4,5 +4,8 @@ connect con1,localhost,root,,;
|
||||
CREATE TEMPORARY TABLE tmp (a INT);
|
||||
CREATE TABLE non_existing_db.t SELECT 1 AS b;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
connection master;
|
||||
connection slave;
|
||||
connection slave;
|
||||
include/assert.inc ["Slave_open_temp_tables count should be 0"]
|
||||
include/rpl_end.inc
|
@ -164,20 +164,15 @@ connection slave;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
[ master status should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 0
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 14
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 0
|
||||
[ semi-sync replication of these transactions will fail ]
|
||||
insert into t1 values (500);
|
||||
[ master status should be OFF ]
|
||||
@ -235,9 +230,6 @@ max(a)
|
||||
500
|
||||
connection master;
|
||||
[ master status should be ON again after slave catches up ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 12
|
||||
@ -304,8 +296,6 @@ connection master;
|
||||
create table t1 (a int) engine = ENGINE_TYPE;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
show status like 'Rpl_relay%';
|
||||
Variable_name Value
|
||||
[ test reset master ]
|
||||
connection master;
|
||||
reset master;
|
||||
@ -321,7 +311,7 @@ Rpl_semi_sync_master_yes_tx 0
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
@ -353,6 +343,7 @@ include/stop_slave.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
@ -403,10 +394,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_slave_status OFF
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
[ Semi-sync status on master should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 0
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
|
@ -165,20 +165,15 @@ connection slave;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
[ master status should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 0
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 16
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 0
|
||||
[ semi-sync replication of these transactions will fail ]
|
||||
insert into t1 values (500);
|
||||
[ master status should be OFF ]
|
||||
@ -236,9 +231,6 @@ max(a)
|
||||
500
|
||||
connection master;
|
||||
[ master status should be ON again after slave catches up ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 12
|
||||
@ -305,8 +297,6 @@ connection master;
|
||||
create table t1 (a int) engine = ENGINE_TYPE;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
show status like 'Rpl_relay%';
|
||||
Variable_name Value
|
||||
[ test reset master ]
|
||||
connection master;
|
||||
reset master;
|
||||
@ -322,7 +312,7 @@ Rpl_semi_sync_master_yes_tx 0
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
connection slave;
|
||||
include/start_slave.inc
|
||||
connection master;
|
||||
@ -354,6 +344,7 @@ include/stop_slave.inc
|
||||
reset slave;
|
||||
connection master;
|
||||
reset master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
@ -404,10 +395,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_slave_status OFF
|
||||
connection master;
|
||||
include/kill_binlog_dump_threads.inc
|
||||
[ Semi-sync status on master should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 0
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user