1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.1' into 10.2

This commit is contained in:
Sergei Golubchik
2016-03-23 22:36:46 +01:00
298 changed files with 4436 additions and 1473 deletions

View File

@ -1,11 +1,11 @@
MariaDB is in most aspects identical to MySQL.
Differences between MySQL and MariaDB can be found at:
http://kb.askmonty.org/en/mariadb-versus-mysql-features/
http://kb.askmonty.org/en/mariadb-versus-mysql-compatibility/
https://mariadb.com/kb/en/mariadb-vs-mysql-features/
https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/
The MariaDB manual can be found at:
http://kb.askmonty.org/
https://mariadb.com/kb/
The MySQL Reference Manual is available in various formats on
http://dev.mysql.com/doc.

View File

@ -243,7 +243,7 @@
in the caller's frame is set in the new context as well.
4) For each instruction, call its execute() method.
The result is a pointer to the next instruction to execute (or NULL)
if an error occured.
if an error occurred.
5) On success, set the new values of the OUT and INOUT parameters in
the caller's frame.
@ -853,7 +853,7 @@
// '*nextp' will be set to the index of the next instruction
// to execute. (For most instruction this will be the
// instruction following this one.)
// Returns 0 on success, non-zero if some error occured.
// Returns 0 on success, non-zero if some error occurred.
virtual int execute(THD *, uint *nextp)
}

View File

@ -1,3 +1,3 @@
Instructions for building MariaDB can be found at:
https://kb.askmonty.org/en/compiling-mariadb-from-source/
https://mariadb.com/kb/en/compiling-mariadb-from-source

View File

@ -1,3 +1,3 @@
Up-to-date instructions about building MariaDB on Windows can be found
at: http://kb.askmonty.org/en/building-mariadb-on-windows
at: https://mariadb.com/kb/en/Building_MariaDB_on_Windows

View File

@ -1,4 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=0
MYSQL_VERSION_EXTRA=

View File

@ -3354,7 +3354,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
end:
/* Show warnings if any or error occured */
/* Show warnings if any or error occurred */
if (show_warnings == 1 && (warnings >= 1 || error))
print_warnings();

View File

@ -658,7 +658,7 @@ static int get_upgrade_info_file_name(char* name)
/*
Read the content of mysql_upgrade_info file and
compare the version number form file against
version number wich mysql_upgrade was compiled for
version number which mysql_upgrade was compiled for
NOTE
This is an optimization to avoid running mysql_upgrade

View File

@ -277,8 +277,8 @@ static void usage(void)
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
puts("Please consult the MariaDB/MySQL knowledgebase at");
puts("http://kb.askmonty.org/v/mysqlcheck for latest information about");
puts("Please consult the MariaDB Knowledge Base at");
puts("https://mariadb.com/kb/en/mysqlcheck for latest information about");
puts("this program.");
print_defaults("my", load_default_groups);
puts("");
@ -523,7 +523,6 @@ static int is_view(const char *table)
{
fprintf(stderr, "Failed to %s\n", query);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
my_free(query);
DBUG_RETURN(-1);
}
res= mysql_store_result(sock);

View File

@ -1104,7 +1104,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
Run query and dump the result to stderr in vertical format
NOTE! This function should be safe to call when an error
has occured and thus any further errors will be ignored(although logged)
has occurred and thus any further errors will be ignored (although logged)
SYNOPSIS
show_query
@ -1170,7 +1170,7 @@ static void show_query(MYSQL* mysql, const char* query)
is added to the warning stack, only print @@warning_count-1 warnings.
NOTE! This function should be safe to call when an error
has occured and this any further errors will be ignored(although logged)
has occurred and this any further errors will be ignored(although logged)
SYNOPSIS
show_warnings_before_error
@ -4699,7 +4699,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
master_pos_wait returned NULL. This indicates that
slave SQL thread is not started, the slave's master
information is not initialized, the arguments are
incorrect, or an error has occured
incorrect, or an error has occurred
*/
die("%.*s failed: '%s' returned NULL " \
"indicating slave SQL thread failure",

View File

@ -43,8 +43,8 @@ SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_SUMMARY}
It is GPL v2 licensed, which means you can use the it free of charge under the
conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
MariaDB documentation can be found at http://kb.askmonty.org/
MariaDB bug reports should be submitted through https://mariadb.atlassian.net/
MariaDB documentation can be found at https://mariadb.com/kb
MariaDB bug reports should be submitted through https://jira.mariadb.org
")
@ -78,14 +78,16 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64"
"%ignore ${CMAKE_INSTALL_PREFIX}/sbin"
"%ignore ${CMAKE_INSTALL_PREFIX}/share"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/doc"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
)
@ -123,6 +125,7 @@ SETA(CPACK_RPM_server_PACKAGE_OBSOLETES
"MySQL"
"mysql-server"
"MySQL-server"
"MariaDB-Galera-server"
"MySQL-OurDelta-server")
SETA(CPACK_RPM_server_PACKAGE_PROVIDES
"MariaDB"
@ -176,7 +179,7 @@ MACRO(ALTERNATIVE_NAME real alt)
SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES")
SET(${p} "${${p}} ${alt} = ${ver} ${alt}%{?_isa} = ${ver} config(${alt}) = ${ver}")
SET(o "CPACK_RPM_${real}_PACKAGE_OBSOLETES")
SET(${o} "${${o}} ${alt} ${alt}%{_isa}")
SET(${o} "${${o}} ${alt} ${alt}%{?_isa}")
ENDMACRO(ALTERNATIVE_NAME)
ALTERNATIVE_NAME("devel" "mysql-devel")

View File

@ -74,7 +74,9 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(compat "with${compat}")
ENDIF()
IF (compat STREQUAL ".")
IF (ARG_DISABLED)
SET(howtobuild NO)
ELSEIF (compat STREQUAL ".")
SET(howtobuild DYNAMIC)
ELSEIF (compat STREQUAL "with.")
IF (NOT ARG_MODULE_ONLY)
@ -122,7 +124,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Build either static library or module
IF (PLUGIN_${plugin} MATCHES "(STATIC|AUTO|YES)" AND NOT ARG_MODULE_ONLY
AND NOT ARG_DISABLED AND NOT ARG_CLIENT)
AND NOT ARG_CLIENT)
IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
# If there is a shared library from previous shared build,
@ -178,8 +180,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE)
ENDIF()
ELSEIF(PLUGIN_${plugin} MATCHES "(DYNAMIC|AUTO|YES)"
AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS
AND NOT ARG_DISABLED)
AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
ADD_VERSION_INFO(${target} MODULE SOURCES)
ADD_LIBRARY(${target} MODULE ${SOURCES})

View File

@ -1503,7 +1503,7 @@ my %exprs = (
my %columns = (
active_secs => { hdr => 'SecsActive', num => 1, label => 'Seconds transaction has been active', },
add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additonal pool allocated' },
add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additional pool allocated' },
attempted_op => { hdr => 'Action', num => 0, label => 'The action that caused the error' },
awe_mem_alloc => { hdr => 'AWE Memory', num => 1, label => '[Windows] AWE memory allocated' },
binlog_cache_overflow => { hdr => 'Binlog Cache', num => 1, label => 'Transactions too big for binlog cache that went to disk' },
@ -10365,7 +10365,7 @@ show you something like this:
pages_modified Dirty Pages Pages modified (dirty IB_bp_pages_m
buf_pool_hit_rate Hit Rate Buffer pool hit rate IB_bp_buf_poo
total_mem_alloc Memory Total memory allocate IB_bp_total_m
add_pool_alloc Add'l Pool Additonal pool alloca IB_bp_add_poo
add_pool_alloc Add'l Pool Additional pool alloca IB_bp_add_poo
The first line shows which table you're editing, and reminds you again to press
'?' for a list of key mappings. The rest is a tabular representation of the

View File

@ -1579,7 +1579,7 @@ show you something like this:
\& pages_modified Dirty Pages Pages modified (dirty IB_bp_pages_m
\& buf_pool_hit_rate Hit Rate Buffer pool hit rate IB_bp_buf_poo
\& total_mem_alloc Memory Total memory allocate IB_bp_total_m
\& add_pool_alloc Add\*(Aql Pool Additonal pool alloca IB_bp_add_poo
\& add_pool_alloc Add\*(Aql Pool Additional pool alloca IB_bp_add_poo
.Ve
.PP
The first line shows which table you're editing, and reminds you again to press

View File

@ -366,7 +366,7 @@ sub read_relative_infiles
# The infile must begin with the system variable values.
# Therefore, the first occurance of Aborted_clients indicates the beginning
# of the first set of status values if no sets have occured yet ($stat_n == 0).
# of the first set of status values if no sets have occurred yet ($stat_n == 0).
# In this case, the following status values are printed to the current fh,
# along with the system variable values read thus far, until Aborted_clients
# occurs again. Then begins the second and subsequent sets of status values.

13
debian/control vendored
View File

@ -12,6 +12,7 @@ Build-Depends: bison,
libaio-dev,
libboost-dev,
libjudy-dev,
libkrb5-dev,
libncurses5-dev (>= 5.0-6~),
libpam0g-dev,
libreadline-gplv2-dev,
@ -441,3 +442,15 @@ Depends: libcrack2 (>= 2.9.0), mariadb-server-10.2
Description: CrackLib Password Validation Plugin for MariaDB
This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.
Package: mariadb-gssapi-server-10.1
Section: database
Architecture: any
Depends: libgssapi-krb5-2, mariadb-server-10.1
Description: GSSAPI authentication plugin for MariaDB server
Package: mariadb-gssapi-client-10.1
Section: database
Architecture: any
Depends: libgssapi-krb5-2, mariadb-client-10.1
Description: GSSAPI authentication plugin for MariaDB client

2
debian/copyright vendored
View File

@ -9,7 +9,7 @@ The MariaDB packages were initally made by http://ourdelta.org/, and
are now managed by the MariaDB development team,
maria-developers@lists.launchpad.net
MariaDB can be downloaded from http://downloads.askmonty.org/mariadb/
MariaDB can be downloaded from https://downloads.mariadb.org/
Copyright:

View File

@ -0,0 +1 @@
usr/lib/mysql/plugin/auth_gssapi_client.so

View File

@ -0,0 +1 @@
usr/lib/mysql/plugin/auth_gssapi.so

View File

@ -10,18 +10,11 @@
compress
sharedscripts
postrotate
test -x /usr/bin/mysqladmin || exit 0
test -x /usr/bin/mysqladmin || exit 0
# If this fails, check debian.conf!
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
# Really no mysqld or rather a missing debian-sys-maint user?
# If this occurs and is not a error please report a bug.
if ps cax | grep -q mysqld; then
exit 1
fi
else
$MYADMIN flush-logs
fi
if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then
# If this fails, check debian.conf!
mysqladmin --defaults-file=/etc/mysql/debian.cnf flush-logs
fi
endscript
}

View File

@ -37,6 +37,9 @@ umask 077
# so break my scripts.
export HOME=/etc/mysql/
# Source default config file.
[ -r /etc/default/mariadb ] && . /etc/default/mariadb
## Fetch a particular option from mysql's invocation.
#
# Usage: void mysqld_get_param option
@ -109,7 +112,7 @@ case "${1:-''}" in
/usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &
# 6s was reported in #352070 to be too little
for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-60}"); do
sleep 1
if mysqld_status check_alive nowarn ; then break; fi
log_progress_msg "."

View File

@ -240,7 +240,10 @@ db_stop # in case invoke failes
# Thus MariaDB server is started via init.d script, which in turn redirects to
# systemctl. If we upgrade from MySQL mysql.service may be masked, which also
# means init.d script is disabled. Unmask mysql service explicitely.
deb-systemd-helper unmask mysql.service >/dev/null || true
# Check first that the command exists, to avoid emitting any warning messages.
if [ -x "$(command -v deb-systemd-helper)" ]; then
deb-systemd-helper unmask mysql.service > /dev/null
fi
#DEBHELPER#

View File

@ -121,11 +121,11 @@ void SetErrorString(YasslError error, char* buffer)
break;
case certificate_error :
strncpy(buffer, "unable to proccess cerificate", max);
strncpy(buffer, "unable to process cerificate", max);
break;
case privateKey_error :
strncpy(buffer, "unable to proccess private key, bad format", max);
strncpy(buffer, "unable to process private key, bad format", max);
break;
case badVersion_error :

View File

@ -178,7 +178,7 @@ struct mysql_async_context {
resumed, eg. whether we woke up due to connection completed or timeout
in mysql_real_connect_cont().
*/
unsigned int events_occured;
unsigned int events_occurred;
/*
This is set to the result of the whole asynchronous operation when it
completes. It uses a union, as different calls have different return

View File

@ -22,7 +22,7 @@
if requested.
The functions are documented at
http://kb.askmonty.org/en/progress-reporting#how-to-add-support-for-progress-reporting-to-a-storage-engine
https://mariadb.com/kb/en/progress-reporting/#how-to-add-support-for-progress-reporting-to-a-storage-engine
*/
#ifdef __cplusplus

View File

@ -2233,7 +2233,7 @@ static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row)
/*
Read one row from network: unbuffered non-cursor fetch.
If last row was read, or error occured, erase this statement
If last row was read, or error occurred, erase this statement
from record pointing to object unbuffered fetch is performed from.
SYNOPSIS

View File

@ -1583,7 +1583,7 @@ may fail in total, as each repetition is considered a new test case, which may i
\fB\-\-retry\-failure=\fR\fB\fIN\fR\fR
.sp
When using the \fB-\-retry\fR option to retry failed tests,
stop when N failures have occured (default 2)\&. Setting it to 0 or 1 effectively turns off retries\&.
stop when N failures have occurred (default 2)\&. Setting it to 0 or 1 effectively turns off retries\&.
.RE
.sp
.RS 4

View File

@ -11,7 +11,7 @@ All tests must pass. If one or more of them fail on your system, please
read the following manual section for instructions on how to report the
problem:
http://kb.askmonty.org/v/reporting-bugs
https://mariadb.com/kb/en/reporting-bugs
If you want to use an already running MySQL server for specific tests,
use the --extern option to mysql-test-run. Please note that in this mode,

View File

@ -375,7 +375,7 @@ source include/start_slave.inc;
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
connection master;
TRUNCATE t1;

View File

@ -133,7 +133,7 @@ INSERT INTO global_suppressions VALUES
("Slave: Query caused different errors on master and slave"),
("Slave: Table .* doesn't exist"),
("Slave: Table width mismatch"),
("Slave: The incident LOST_EVENTS occured on the master"),
("Slave: The incident LOST_EVENTS occurred on the master"),
("Slave: Unknown error.* 1105"),
("Slave: Can't drop database.* database doesn't exist"),
("Warning:\s+One can only use the --user.*root"),

View File

@ -34,7 +34,7 @@ package My::SafeProcess;
# will zap the "monitored process" and exit
# - the "monitored process" to exit, in which case it will exit
# itself with same exit code as the "monitored process"
# - the parent process to send the "shutdown" signal in wich case
# - the parent process to send the "shutdown" signal in which case
# monitor will kill the "monitored process" hard and exit
#
#

View File

@ -306,7 +306,7 @@ sub mtr_report_stats ($) {
/Slave: Query caused different errors on master and slave/ or
/Slave: Table .* doesn't exist/ or
/Slave: Table width mismatch/ or
/Slave: The incident LOST_EVENTS occured on the master/ or
/Slave: The incident LOST_EVENTS occurred on the master/ or
/Slave: Unknown error.* 1105/ or
/Slave: Can't drop database.* database doesn't exist/ or
/Slave SQL:.*(?:error.* \d+|Query:.*)/ or

View File

@ -6183,7 +6183,7 @@ Misc options
failures before stopping, set with the --retry-failure
option
retry-failure=N When using the --retry option to retry failed tests,
stop when N failures have occured (default $opt_retry_failure)
stop when N failures have occurred (default $opt_retry_failure)
reorder Reorder tests to get fewer server restarts
help Get this help text

View File

@ -34,11 +34,9 @@ create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_g
insert into t1 values ('hello');
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status OK
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status Table is already up to date
drop table t1;
CREATE TABLE t1 (a int);

View File

@ -3,12 +3,12 @@ Name Location Comment
Booking.com http://www.booking.com Founding member of the MariaDB Foundation
MariaDB Corporation https://mariadb.com Founding member of the MariaDB Foundation
Auttomattic http://automattic.com Member of the MariaDB Foundation
Parallels http://www.parallels.com/products/plesk Founding member of the MariaDB Foundation
Visma http://visma.com Member of the MariaDB Foundation
Nexedi http://www.nexedi.com Member of the MariaDB Foundation
Acronis http://www.acronis.com Member of the MariaDB Foundation
Verkkokauppa.com Finland Sponsor of the MariaDB Foundation
Webyog Bangalore Sponsor of the MariaDB Foundation
Wikimedia Foundation USA Sponsor of the MariaDB Foundation
Google USA Sponsoring parallel replication and GTID
Google USA Sponsoring encryption, parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
Sheeri Kritzer Boston, Mass. USA EFF contribution for UC2006 Auction

View File

@ -379,7 +379,7 @@ SELECT * FROM t1 WHERE a=0;
a
# Connection con1
# Sending:
ALTER TABLE t1 COMMENT 'test';
ALTER TABLE t1 MODIFY a INT UNSIGNED;;
# Connection default
# Wait until ALTER TABLE is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (3);

View File

@ -603,7 +603,7 @@ INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp(
ROLLBACK;
END IF;
END;|
Sleep till the first INSERT into events_test.event_log occured
Sleep till the first INSERT into events_test.event_log occurred
SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
Expect 1
1

View File

@ -1119,3 +1119,84 @@ GROUP_CONCAT(t1a.a ORDER BY 1, t1a.a=0)
1,1
2,2
DROP TABLE t1;
#
# WL#6098 Eliminate GROUP_CONCAT intermediate result limitation.
# Bug#13387020 GROUP_CONCAT WITH ORDER BY RESULTS ARE TRUNCATED.
#
SET group_concat_max_len= 9999999;
CREATE TABLE t1 (f1 LONGTEXT , f2 INTEGER);
INSERT INTO t1 VALUES (REPEAT('a', 500000), 0), (REPEAT('b', 500000), 1), (REPEAT('c', 500000), 2);
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
1500002
SELECT LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC)) FROM t1;
LENGTH(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC))
1500002
SELECT SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5) FROM t1;
SUBSTRING(GROUP_CONCAT(DISTINCT f1 ORDER BY f1 DESC), 1, 5)
ccccc
SELECT LENGTH(GROUP_CONCAT(DISTINCT f1)) FROM t1;
LENGTH(GROUP_CONCAT(DISTINCT f1))
1500002
SELECT LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2)) FROM t1;
LENGTH(GROUP_CONCAT(UPPER(f1) ORDER BY f2))
1500002
SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1)) FROM t1;
LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1))
1500002
SELECT SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5) FROM t1;
SUBSTRING(GROUP_CONCAT(DISTINCT UPPER(f1) ORDER BY f1), 1, 5)
AAAAA
SELECT LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1))) FROM t1;
LENGTH(GROUP_CONCAT(DISTINCT UPPER(f1)))
1500002
CREATE TABLE t2 SELECT GROUP_CONCAT(f1 order by f2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`GROUP_CONCAT(f1 order by f2)` mediumtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`GROUP_CONCAT(UPPER(f1) ORDER BY f2)` mediumtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
SET group_concat_max_len= DEFAULT;
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
1024
Warnings:
Warning 1260 Row 2 was cut by GROUP_CONCAT()
SET group_concat_max_len= 499999;
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 WHERE f2 = 0;
LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
499999
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
499999
499999
499999
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
LENGTH(GROUP_CONCAT(f1 ORDER BY f2))
499999
499999
499999
499999
499999
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
Warning 1260 Row 5 was cut by GROUP_CONCAT()
DROP TABLE t1;
SET group_concat_max_len= DEFAULT;

View File

@ -2298,6 +2298,15 @@ id avg cast_avg
2 9223372036854775807.0000 9223372036854775807
DROP TABLE t1;
#
# MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
#
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
VAR_POP(1)
0.0000
DROP TABLE t1;
#
# MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
#
CREATE TABLE t1 (id INT, a DOUBLE);

View File

@ -2175,10 +2175,10 @@ def case_____a_b 12 19 19 Y 128 0 63
def case_____b_a 12 19 19 Y 128 0 63
def coalesce_a_b 12 19 19 Y 128 0 63
def coalesce_b_a 12 19 19 Y 128 0 63
def if_______a_b 12 10 19 Y 128 0 63
def if_______b_a 12 10 19 Y 128 0 63
def ifnull___a_b 12 10 19 Y 128 0 63
def ifnull___b_a 12 10 19 Y 128 0 63
def if_______a_b 12 19 19 Y 128 0 63
def if_______b_a 12 19 19 Y 128 0 63
def ifnull___a_b 12 19 19 Y 128 0 63
def ifnull___b_a 12 19 19 Y 128 0 63
def least____a_b 12 10 19 Y 128 0 63
def least____b_a 12 10 19 Y 128 0 63
def greatest_a_b 12 10 19 Y 128 0 63
@ -3396,5 +3396,36 @@ c1
DROP TABLE t2;
DROP TABLE t1;
#
# MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
#
SELECT CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END;
CASE 0 WHEN 1 THEN (CASE 2 WHEN 3 THEN NULL END) WHEN 4 THEN 5 END
NULL
SELECT CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END;
CASE 0 WHEN 1 THEN (COALESCE(NULL)) WHEN 4 THEN 5 END
NULL
SELECT CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END;
CASE WHEN TRUE THEN COALESCE(NULL) ELSE 4 END
NULL
SELECT COALESCE(COALESCE(NULL), 1.1) AS c0, IF(0, COALESCE(NULL), 1.1) AS c1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def c0 246 4 3 Y 32896 1 63
def c1 246 4 3 Y 32896 1 63
c0 c1
1.1 1.1
#
# MDEV-9752 Wrong data type for COALEASCE(?,1) in prepared statements
#
PREPARE stmt FROM "CREATE TABLE t1 AS SELECT CONCAT(COALESCE(?,1)) AS a, CONCAT(CASE WHEN TRUE THEN ? ELSE 1 END) AS b";
SET @a=1;
EXECUTE stmt USING @a,@a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(21) DEFAULT NULL,
`b` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# End of 10.1 tests
#

View File

@ -1595,7 +1595,7 @@ explain select * from t1 where a=10 and b=10 or c=10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b,c a,c 5,5 NULL 54 Using union(a,c); Using where
This will switch to sort-union (intersection will be gone, too,
thats a known limitation:
that's a known limitation:
set optimizer_switch='default,index_merge_union=off';
explain select * from t1 where a=10 and b=10 or c=10;
id select_type table type possible_keys key key_len ref rows Extra

View File

@ -9,8 +9,10 @@ select @@log_slow_verbosity;
show variables like "log_slow%";
Variable_name Value
log_slow_admin_statements OFF
log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
log_slow_rate_limit 1
log_slow_slave_statements OFF
log_slow_verbosity
set @org_slow_query_log= @@global.slow_query_log;
set @@log_slow_filter= "filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk,admin";

View File

@ -7,34 +7,19 @@ mtr.test_suppressions OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event
Warning : Engine-independent statistics are not collected for column 'body'
Warning : Engine-independent statistics are not collected for column 'body_utf8'
status : OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category
Warning : Engine-independent statistics are not collected for column 'url'
status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic
Warning : Engine-independent statistics are not collected for column 'description'
Warning : Engine-independent statistics are not collected for column 'example'
Warning : Engine-independent statistics are not collected for column 'url'
status : OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc
Warning : Engine-independent statistics are not collected for column 'param_list'
Warning : Engine-independent statistics are not collected for column 'returns'
Warning : Engine-independent statistics are not collected for column 'body'
Warning : Engine-independent statistics are not collected for column 'comment'
Warning : Engine-independent statistics are not collected for column 'body_utf8'
status : OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
@ -46,12 +31,7 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user
Warning : Engine-independent statistics are not collected for column 'ssl_cipher'
Warning : Engine-independent statistics are not collected for column 'x509_issuer'
Warning : Engine-independent statistics are not collected for column 'x509_subject'
Warning : Engine-independent statistics are not collected for column 'authentication_string'
status : OK
mysql.user OK
mtr.global_suppressions Table is already up to date
mtr.test_suppressions Table is already up to date
mysql.column_stats OK
@ -89,34 +69,19 @@ mysql.user OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event
Warning : Engine-independent statistics are not collected for column 'body'
Warning : Engine-independent statistics are not collected for column 'body_utf8'
status : OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category
Warning : Engine-independent statistics are not collected for column 'url'
status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic
Warning : Engine-independent statistics are not collected for column 'description'
Warning : Engine-independent statistics are not collected for column 'example'
Warning : Engine-independent statistics are not collected for column 'url'
status : OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc
Warning : Engine-independent statistics are not collected for column 'param_list'
Warning : Engine-independent statistics are not collected for column 'returns'
Warning : Engine-independent statistics are not collected for column 'body'
Warning : Engine-independent statistics are not collected for column 'comment'
Warning : Engine-independent statistics are not collected for column 'body_utf8'
status : OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
@ -128,12 +93,7 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user
Warning : Engine-independent statistics are not collected for column 'ssl_cipher'
Warning : Engine-independent statistics are not collected for column 'x509_issuer'
Warning : Engine-independent statistics are not collected for column 'x509_subject'
Warning : Engine-independent statistics are not collected for column 'authentication_string'
status : OK
mysql.user OK
mysql.column_stats Table is already up to date
mysql.columns_priv Table is already up to date
mysql.db Table is already up to date

View File

@ -1821,7 +1821,7 @@ a b
Osnabr<EFBFBD>ck K<>ln
drop table t1;
#
# Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
# Bug#15328 Segmentation fault occurred if my.cnf is invalid for escape sequence
#
--fields-optionally-enclosed-by="
#

View File

@ -1531,6 +1531,46 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select nullif(count(distinct `t1`.`col1`),0) AS `nullif(count(distinct col1),0)` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
create table t1 (col1 varchar(50) default null);
insert into t1 (col1) values ('hello'), ('hello'), ('hello');
create view v1 as select nullif(count(col1),0) from t1;
select * from v1;
nullif(count(col1),0)
3
select nullif(count(col1),0) from t1;
nullif(count(col1),0)
3
drop view v1;
drop table t1;
select nullif((select 1), (select 2));
nullif((select 1), (select 2))
1
create table t1 (f int);
insert into t1 values (1),(2);
select nullif( not f, 1 ) from t1;
nullif( not f, 1 )
0
0
drop table t1;
set names utf8;
create table t1 (f1 varchar(10));
insert into t1 values ('2015-12-31');
select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = '2015-12-31' then NULL else '2002-09-08' end) as datetime(6)),24)'
drop table t1;
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (1),(2);
PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1 )";
EXECUTE stmt;
f1
EXECUTE stmt;
f1
DROP TABLE t1;
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
i
DROP TABLE t1;
#
# End of 10.1 tests
#

View File

@ -50,6 +50,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select ((1,2,(3,4)) in ((3,2,(3,4)),(1,2,(3,NULL)))) AS `row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)))`
select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)));
row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(4,5)))
0
select row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)));
row(1,2,row(3,null)) IN (row(3,2,row(3,4)), row(1,2,row(3,5)))
NULL
SELECT (1,2,3)=(0,NULL,3);
(1,2,3)=(0,NULL,3)
0
@ -130,7 +136,7 @@ ROW(c,2,3) IN(row(1,b,a), row(2,3,1))
0
0
1
NULL
0
select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1;
ROW(a,b,c) IN(row(1,2,3), row(3,2,1))
1
@ -509,5 +515,11 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 10) and (`test`.`t1`.`b` = 10))
DROP TABLE t1;
#
# MDEV-9369 IN operator with ( num, NULL ) gives inconsistent result
#
SELECT (1,null) NOT IN ((2,2),(3,3)), (1,null) NOT IN ((2,2)), (1,null) NOT IN ((3,3));
(1,null) NOT IN ((2,2),(3,3)) (1,null) NOT IN ((2,2)) (1,null) NOT IN ((3,3))
1 1 1
#
# End of 10.1 tests
#

View File

@ -1663,3 +1663,17 @@ FROM mysql.column_stats;
db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_frequency hist_size hist_type HEX(histogram)
test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL
drop table t1;
#
# MDEV-9590: Always print "Engine-independent statistic" warnings and
# might be filtering columns unintentionally from engines
#
set use_stat_tables='NEVER';
create table t1 (test blob);
show variables like 'use_stat_tables';
Variable_name Value
use_stat_tables NEVER
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
drop table t1;
set use_stat_tables=@save_use_stat_tables;

View File

@ -762,6 +762,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_512
@ -775,6 +779,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_512, t2_512, t3_512;
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
@ -855,6 +863,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
@ -868,6 +880,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
@ -948,6 +964,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
@ -961,6 +981,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));

View File

@ -787,6 +787,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_512
@ -801,6 +805,10 @@ select left(a1,7), left(a2,7)
from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_512, t2_512, t3_512;
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
@ -882,6 +890,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1024
@ -896,6 +908,10 @@ select left(a1,7), left(a2,7)
from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1024, t2_1024, t3_1024;
set @blob_len = 1025;
set @suffix_len = @blob_len - @prefix_len;
@ -977,6 +993,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
set @@group_concat_max_len = 256;
explain extended select left(a1,7), left(a2,7)
from t1_1025
@ -991,6 +1011,10 @@ select left(a1,7), left(a2,7)
from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2);
left(a1,7) left(a2,7)
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 3 was cut by GROUP_CONCAT()
drop table t1_1025, t2_1025, t3_1025;
create table t1bit (a1 bit(3), a2 bit(3));
create table t2bit (b1 bit(3), b2 bit(3));

View File

@ -341,3 +341,17 @@ create trigger tr1 before update on t1 for each row do 1;
create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
update t2 set f2=1 where f1=1;
drop table t1, t2;
create table t1 (a int not null, primary key (a));
insert into t1 (a) values (1);
show columns from t1;
Field Type Null Key Default Extra
a int(11) NO PRI NULL
create trigger t1bu before update on t1 for each row begin end;
show columns from t1;
Field Type Null Key Default Extra
a int(11) NO PRI NULL
insert into t1 (a) values (3);
show columns from t1;
Field Type Null Key Default Extra
a int(11) NO PRI NULL
drop table t1;

View File

@ -747,7 +747,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref AtTime AtTime 6 const 1 100.00
Warnings:
Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = '2010-02-22 18:40:07')
Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from `test`.`t1` FORCE INDEX (`attime`) where (`test`.`t1`.`AtTime` = TIMESTAMP'2010-02-22 18:40:07')
DROP TABLE t1;
SET NAMES latin1;
#
@ -963,21 +963,20 @@ a
2001-01-01 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01 00:00:00x')
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01 00:00:00x') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@ -993,20 +992,20 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ' 2001-01-01 00:00:00')
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Incorrect datetime value: ' garbage '
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' garbage ') and (length(`test`.`t1`.`a`) = (30 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and (<cache>(length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@ -1076,13 +1075,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
DROP TABLE t1;
#
# MDEV-8795 Equal expression propagation does not work for temporal literals

View File

@ -1220,3 +1220,31 @@ Warning 1292 Truncated incorrect DOUBLE value: '1E+'
#
# End of 10.0 tests
#
#
# Start of 10.1 tests
#
#
# MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
#
SELECT NULL+1 AS c0,
COALESCE(NULL)+1 AS c2,
COALESCE(COALESCE(NULL))+1 AS c3,
''+1 AS c4,
COALESCE('')+1 AS c5,
COALESCE(COALESCE(''))+1 AS c6;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def c0 5 17 0 Y 32896 0 63
def c2 5 17 0 Y 32896 0 63
def c3 5 17 0 Y 32896 0 63
def c4 5 23 1 N 32897 31 63
def c5 5 17 1 N 32897 0 63
def c6 5 17 1 N 32897 0 63
c0 c2 c3 c4 c5 c6
NULL NULL NULL 1 1 1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: ''
#
# Start of 10.1 tests
#

View File

@ -0,0 +1,156 @@
#
# MDEV-9604 crash in Item::save_in_field with empty enum value
#
SELECT TIME'00:00:00'='';
TIME'00:00:00'=''
1
Warnings:
Warning 1292 Truncated incorrect time value: ''
CREATE TABLE t1 (a ENUM('a'), b TIME, c INT, KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('','00:00:00',0);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT * FROM t1 WHERE b='';
a b c
00:00:00 0
Warnings:
Warning 1292 Truncated incorrect time value: ''
SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
a b c
00:00:00 0
Warnings:
Warning 1292 Truncated incorrect time value: ''
SELECT * FROM t1 WHERE a=b;
a b c
00:00:00 0
Warnings:
Warning 1292 Truncated incorrect time value: ''
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
1
1
Warnings:
Warning 1292 Truncated incorrect time value: ''
ALTER TABLE t1 ENGINE=MyISAM;
SELECT * FROM t1 WHERE b='';
a b c
00:00:00 0
Warnings:
Warning 1292 Truncated incorrect time value: ''
SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
a b c
00:00:00 0
Warnings:
Warning 1292 Truncated incorrect time value: ''
SELECT * FROM t1 WHERE a=b;
a b c
00:00:00 0
Warnings:
Warning 1292 Truncated incorrect time value: ''
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
1
1
Warnings:
Warning 1292 Truncated incorrect time value: ''
DROP TABLE t1;
SELECT DATE'0000-00-00'='';
DATE'0000-00-00'=''
1
Warnings:
Warning 1292 Incorrect datetime value: ''
CREATE TABLE t1 (a ENUM('a'), b DATE, c INT, KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('','0000-00-00',0);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT * FROM t1 WHERE b='';
a b c
0000-00-00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
a b c
0000-00-00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 WHERE a=b;
a b c
0000-00-00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
1
1
Warnings:
Warning 1292 Incorrect datetime value: ''
ALTER TABLE t1 ENGINE=MyISAM;
SELECT * FROM t1 WHERE b='';
a b c
0000-00-00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
a b c
0000-00-00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 WHERE a=b;
a b c
0000-00-00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
1
1
Warnings:
Warning 1292 Incorrect datetime value: ''
DROP TABLE t1;
SELECT TIMESTAMP'0000-00-00 00:00:00'='';
TIMESTAMP'0000-00-00 00:00:00'=''
1
Warnings:
Warning 1292 Incorrect datetime value: ''
CREATE TABLE t1 (a ENUM('a'), b DATETIME, c INT, KEY(b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('','0000-00-00 00:00:00',0);
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT * FROM t1 WHERE b='';
a b c
0000-00-00 00:00:00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
a b c
0000-00-00 00:00:00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 WHERE a=b;
a b c
0000-00-00 00:00:00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
1
1
Warnings:
Warning 1292 Incorrect datetime value: ''
ALTER TABLE t1 ENGINE=MyISAM;
SELECT * FROM t1 WHERE b='';
a b c
0000-00-00 00:00:00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
a b c
0000-00-00 00:00:00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT * FROM t1 WHERE a=b;
a b c
0000-00-00 00:00:00 0
Warnings:
Warning 1292 Incorrect datetime value: ''
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
1
1
Warnings:
Warning 1292 Incorrect datetime value: ''
DROP TABLE t1;

View File

@ -989,7 +989,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE('2015-0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(00:00:00))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00)
# TIME cast + DATE literal
SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09-11';
a
@ -999,7 +999,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=TIME('00:00:00') AND COALESCE(a)=DATE'2015-09
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(00:00:00))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 00:00:00)
# TIME literal + DATE cast
SELECT * FROM t1 WHERE COALESCE(a)=TIME'00:00:00' AND COALESCE(a)=DATE('2015-09-11');
a
@ -1029,7 +1029,7 @@ SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE('2015-09-11')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = '00:00:00') and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00))
# TIME-alike string literal + DATE literal
SELECT * FROM t1 WHERE COALESCE(a)='00:00:00' AND COALESCE(a)=DATE'2015-09-11';
a
@ -1049,7 +1049,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE('2015-09-11');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 0) and (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00))
# TIME-alike integer literal + DATE literal
SELECT * FROM t1 WHERE COALESCE(a)=0 AND COALESCE(a)=DATE'2015-09-11';
a
@ -1069,7 +1069,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME('00:0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)
# DATE cast + TIME literal
SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00:00';
a
@ -1079,7 +1079,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=TIME'00:00
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00)
# DATE cast + TIME-alike string literal
SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00';
a
@ -1089,7 +1089,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)='00:00:00'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)) and (coalesce(`test`.`t1`.`a`) = '00:00:00'))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = '00:00:00'))
# DATE cast + TIME-alike integer literal
SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
a
@ -1099,7 +1099,7 @@ SELECT * FROM t1 WHERE COALESCE(a)=DATE('2015-09-11') AND COALESCE(a)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = <cache>(2015-09-11 00:00:00)) and (coalesce(`test`.`t1`.`a`) = 0))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((coalesce(`test`.`t1`.`a`) = 2015-09-11 00:00:00) and (coalesce(`test`.`t1`.`a`) = 0))
# DATE literal + TIME cast
SELECT * FROM t1 WHERE COALESCE(a)=DATE'2015-09-11' AND COALESCE(a)=TIME('00:00:00');
a

View File

@ -818,21 +818,20 @@ a
2001-01-01 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01 00:00:00x')
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Truncated incorrect datetime value: '2001-01-01 00:00:00x'
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01 00:00:00x') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) <> (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@ -848,20 +847,20 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ' 2001-01-01 00:00:00')
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' 2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (19 + rand())))
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Warning 1292 Incorrect datetime value: ' garbage '
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = ' garbage ') and (length(`test`.`t1`.`a`) = (30 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'0000-00-00 00:00:00') and (<cache>(length(TIMESTAMP'0000-00-00 00:00:00')) = (30 + rand())))
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP);;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
@ -931,13 +930,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIME'00:00:00')
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIME'00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (<cache>(length(TIMESTAMP'2001-01-01 00:00:00')) = (40 + rand())))
DROP TABLE t1;
#
# End of 10.1 tests

View File

@ -826,6 +826,9 @@ drop table t2;
create table t1 (a int);
insert into t1 values (1), (2);
create view v1 as select 5 from t1 order by 1;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 5 AS `5` from `t1` order by 1 latin1 latin1_swedish_ci
select * from v1;
5
5
@ -5884,6 +5887,22 @@ a
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant
# produces invalid definition
#
CREATE TABLE t1 ( i INT );
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS
SELECT 3 AS three, COUNT(*) FROM t1 GROUP BY three;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 3 AS `three`,count(0) AS `COUNT(*)` from `t1` group by '' latin1 latin1_swedish_ci
SELECT * FROM v1;
three COUNT(*)
3 2
drop view v1;
drop table t1;
#
# End of 10.1 tests
#
#

View File

View File

@ -153,3 +153,9 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
#Cleanup.
DROP TABLE t1;
create database mysqltest1;
create table mysqltest1.t1 (a int not null, b int not null) engine=archive
partition by list(a) subpartition by hash(b)
(partition p1 values in (1),
partition p2 values in (2));
drop database mysqltest1;

View File

@ -147,3 +147,10 @@ SHOW CREATE TABLE t1;
--echo #Cleanup.
DROP TABLE t1;
create database mysqltest1;
create table mysqltest1.t1 (a int not null, b int not null) engine=archive
partition by list(a) subpartition by hash(b)
(partition p1 values in (1),
partition p2 values in (2));
drop database mysqltest1;

View File

@ -0,0 +1,52 @@
include/master-slave.inc
[connection master]
RESET MASTER;
DROP DATABASE IF EXISTS db_717;
DROP EVENT IF EXISTS test.e_x1;
set @saved_global_binlog_format = @@global.binlog_format;
set @saved_local_binlog_format = @@session.binlog_format;
SET GLOBAL BINLOG_FORMAT = STATEMENT;
SET SESSION BINLOG_FORMAT = STATEMENT;
CREATE DATABASE db_717;
CREATE FUNCTION db_717.f1() RETURNS INT RETURN 1;
DROP DATABASE db_717;
CREATE FUNCTION db_717.f2() RETURNS INT RETURN 1;
CREATE DATABASE db_717;
CREATE EVENT db_717.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
DROP DATABASE db_717;
CREATE EVENT db_717.e_x2 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
CREATE DATABASE db_717;
CREATE EVENT test.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
DROP DATABASE db_717;
ALTER EVENT test.e_x1 RENAME TO db_717.e_x2;
DROP EVENT test.e_x1;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS test.e_x1
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # CREATE DATABASE db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `db_717`.`f1`() RETURNS int(11)
RETURN 1
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP DATABASE db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # CREATE DATABASE db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_717.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP DATABASE db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # CREATE DATABASE db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT test.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP DATABASE db_717
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP EVENT test.e_x1
SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format;
SET SESSION BINLOG_FORMAT = @saved_local_binlog_format;
include/rpl_end.inc

View File

@ -0,0 +1,85 @@
# MDEV-717
# DROP DATABASE and CREATE PROCEDURE|FUNCTION|EVENT
# statements can appear in wrong order in the binlog.
#
# Note - the test can be undeterministic.
--source include/master-slave.inc
RESET MASTER;
--disable_warnings
DROP DATABASE IF EXISTS db_717;
DROP EVENT IF EXISTS test.e_x1;
--enable_warnings
set @saved_global_binlog_format = @@global.binlog_format;
set @saved_local_binlog_format = @@session.binlog_format;
SET GLOBAL BINLOG_FORMAT = STATEMENT;
SET SESSION BINLOG_FORMAT = STATEMENT;
# test function creation
CREATE DATABASE db_717;
CREATE FUNCTION db_717.f1() RETURNS INT RETURN 1;
--send
DROP DATABASE db_717;
--connection master1
--error 0,ER_BAD_DB_ERROR
CREATE FUNCTION db_717.f2() RETURNS INT RETURN 1;
--connection master
--reap
# test event creation
CREATE DATABASE db_717;
CREATE EVENT db_717.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
--send
DROP DATABASE db_717;
--connection master1
--error 0,ER_BAD_DB_ERROR
CREATE EVENT db_717.e_x2 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
--connection master
--reap
# test event modification
CREATE DATABASE db_717;
CREATE EVENT test.e_x1 ON SCHEDULE EVERY 1000 HOUR DO CREATE TABLE t1(id int);
--send
DROP DATABASE db_717;
--connection master1
--error 0,ER_BAD_DB_ERROR
ALTER EVENT test.e_x1 RENAME TO db_717.e_x2;
--connection master
--reap
DROP EVENT test.e_x1;
source include/show_binlog_events.inc;
SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format;
SET SESSION BINLOG_FORMAT = @saved_local_binlog_format;
--source include/rpl_end.inc

View File

@ -0,0 +1,10 @@
call mtr.add_suppression("System key id 1 is missing at");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /System key id 1 is missing at/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
# Test checks if opening an empty filekeys does not crash the server.

View File

@ -0,0 +1,19 @@
call mtr.add_suppression("InnoDB: New log files created, LSN=.*");
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
call mtr.add_suppression("InnoDB: Error: Table .*");
CREATE TABLE t1 (
pk bigint auto_increment,
col_int int,
col_int_key int,
col_char char(12),
col_char_key char(12),
primary key (pk),
key (`col_int_key` ),
key (`col_char_key` )
) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 VALUES (NULL,1,1,'foo','foo'),(NULL,2,2,'bar','bar'),(NULL,3,3,'baz','baz'),(NULL,4,4,'qux','qux');
INSERT INTO t2
SELECT NULL, a1.col_int, a1.col_int_key, a1.col_char, a1.col_char_key
FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5, t1 a6, t1 a7, t1 a8, t1 a9, t1 a10;
DROP TABLE t1, t2;

View File

@ -8,7 +8,7 @@ begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('secredsecredsecred',10));
insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
set current_num = current_num + 1;
end while;
end//
@ -22,34 +22,34 @@ select count(*) from t1;
count(*)
2000
# ibdata1 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in ibdata1
NOT FOUND /privatejanprivate/ in ibdata1
# t1 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in t1.ibd
NOT FOUND /privatejanprivate/ in t1.ibd
# log0 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in ib_logfile0
NOT FOUND /privatejanprivate/ in ib_logfile0
# log1 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in ib_logfile1
NOT FOUND /privatejanprivate/ in ib_logfile1
# Restart mysqld --innodb_encrypt_log=0
insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
# ibdata1 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in ibdata1
NOT FOUND /privatejanprivate/ in ibdata1
# t1 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in t1.ibd
NOT FOUND /privatejanprivate/ in t1.ibd
# log0 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in ib_logfile0
NOT FOUND /privatejanprivate/ in ib_logfile0
# log1 yes on expecting NOT FOUND
NOT FOUND /secredsecred/ in ib_logfile1
NOT FOUND /privatejanprivate/ in ib_logfile1
# ibdata1 yes on expecting NOT FOUND
NOT FOUND /notsecred/ in ibdata1
NOT FOUND /publicmessage/ in ibdata1
# t1 yes on expecting NOT FOUND
NOT FOUND /notsecred/ in t1.ibd
NOT FOUND /publicmessage/ in t1.ibd
# log0 no on expecting FOUND/NOTFOUND depending where insert goes
FOUND /notsecred/ in ib_logfile0
FOUND /publicmessage/ in ib_logfile0
# log1 no on expecting FOUND/NOTFOUND depending where insert goes
NOT FOUND /notsecred/ in ib_logfile1
NOT FOUND /publicmessage/ in ib_logfile1
drop procedure innodb_insert_proc;
drop table t1;

View File

@ -16,6 +16,7 @@ MIN_KEY_VERSION int(11) unsigned NO 0
CURRENT_KEY_VERSION int(11) unsigned NO 0
KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL
KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL
CURRENT_KEY_ID int(11) unsigned NO 0
# Wait max 5 min for key encryption threads to encrypt one space
# Success!
# Wait max 10 min for key encryption threads to encrypt all space

View File

@ -0,0 +1,14 @@
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
INSERT INTO t2 VALUES ('foobar');
SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
CURRENT_KEY_ID
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
NAME ENCRYPTION_SCHEME MIN_KEY_VERSION CURRENT_KEY_VERSION CURRENT_KEY_ID
test/t1 1 1 1 1
test/t2 1 1 1 2
DROP TABLE t1, t2;

View File

@ -0,0 +1 @@
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/empty_file

View File

@ -0,0 +1,4 @@
let SEARCH_PATTERN=System key id 1 is missing at;
source filekeys_badtest.inc;
--echo # Test checks if opening an empty filekeys does not crash the server.

View File

@ -0,0 +1,6 @@
--innodb-encrypt-log=ON
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
--file-key-management-encryption-algorithm=aes_cbc
--innodb-buffer-pool-size=128M

View File

@ -0,0 +1,38 @@
-- source include/have_innodb.inc
-- source include/not_embedded.inc
-- source filekeys_plugin.inc
call mtr.add_suppression("InnoDB: New log files created, LSN=.*");
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables.");
call mtr.add_suppression("InnoDB: Error: Table .*");
#
# MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables
#
CREATE TABLE t1 (
pk bigint auto_increment,
col_int int,
col_int_key int,
col_char char(12),
col_char_key char(12),
primary key (pk),
key (`col_int_key` ),
key (`col_char_key` )
) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 VALUES (NULL,1,1,'foo','foo'),(NULL,2,2,'bar','bar'),(NULL,3,3,'baz','baz'),(NULL,4,4,'qux','qux');
INSERT INTO t2
SELECT NULL, a1.col_int, a1.col_int_key, a1.col_char, a1.col_char_key
FROM t1 a1, t1 a2, t1 a3, t1 a4, t1 a5, t1 a6, t1 a7, t1 a8, t1 a9, t1 a10;
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 0
--source include/wait_until_disconnected.inc
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
DROP TABLE t1, t2;

View File

@ -28,7 +28,7 @@ begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('secredsecredsecred',10));
insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
set current_num = current_num + 1;
end while;
end//
@ -43,13 +43,15 @@ set autocommit=1;
update t1 set c1 = c1 +1;
select count(*) from t1;
-- source include/restart_mysqld.inc
--let $MYSQLD_DATADIR=`select @@datadir`
--let ib1_IBD = $MYSQLD_DATADIR/ibdata1
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
--let log0 = $MYSQLD_DATADIR/ib_logfile0
--let log1 = $MYSQLD_DATADIR/ib_logfile1
--let SEARCH_RANGE = 10000000
--let SEARCH_PATTERN=secredsecred
--let SEARCH_PATTERN=privatejanprivate
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
@ -68,13 +70,13 @@ select count(*) from t1;
-- let $restart_parameters=--innodb_encrypt_log=0
-- source include/restart_mysqld.inc
insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
--let SEARCH_PATTERN=secredsecred
--let SEARCH_PATTERN=privatejanprivate
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
@ -88,7 +90,7 @@ insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10))
-- let SEARCH_FILE=$log1
-- source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=notsecred
--let SEARCH_PATTERN=publicmessage
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc

View File

@ -0,0 +1 @@
--loose-innodb-tablespaces-encryption

View File

@ -0,0 +1,31 @@
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
INSERT INTO t2 VALUES ('foobar');
#
# MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
#
SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
CURRENT_KEY_ID
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
WHERE NAME LIKE '%t1' OR NAME LIKE '%t2';
DROP TABLE t1, t2;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log

View File

@ -20,7 +20,6 @@ galera_parallel_simple : Failing sporadically
galera_bf_abort : Failing sporadically
galera_log_output_csv : Failing sporadically
galera_as_slave_preordered : wsrep-preordered is not available in MariaDB Galera cluster
galera_forced_binlog_format : TODO: investigate
galera_gra_log : TODO: investigate
galera_as_slave_replication_bundle : TODO: investigate
galera_ssl_upgrade : TODO: investigate

View File

@ -1,18 +1,43 @@
RESET MASTER;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 249;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000001 <Pos> Gtid_list 1 <End_log_pos> []
mysqld-bin.000001 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000001
mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1
mysqld-bin.000001 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000001 <Pos> Query 1 <End_log_pos> BEGIN
mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2
mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
mysqld-bin.000001 <Pos> Write_rows 1 <End_log_pos> table_id: ### flags: STMT_END_F
mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F
mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
mysqld-bin.000001 <Pos> Query 1 <End_log_pos> BEGIN
mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-3
mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
mysqld-bin.000001 <Pos> Write_rows 1 <End_log_pos> table_id: ### flags: STMT_END_F
mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F
mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
DROP TABLE t1;
#
# MDEV-9401: wsrep_forced_binlog_format with binlog causes crash
#
SET SESSION binlog_format = 'ROW';
CREATE DATABASE testdb_9401;
USE testdb_9401;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE USER dummy@localhost;
GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost
GRANT USAGE ON *.* TO 'dummy'@'localhost'
GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE testdb_9401;
# End of tests

View File

@ -0,0 +1,20 @@
# On node_1
CREATE SERVER s1
FOREIGN DATA WRAPPER mysql
OPTIONS (HOST 'foo');
# On node_2
SELECT * FROM mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
s1 foo 3306 mysql
ALTER SERVER s1
OPTIONS (HOST 'bar');
# On node_1
SELECT * FROM mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
s1 bar 3306 mysql
DROP SERVER s1;
# On node_2
SELECT COUNT(*)=0 FROM mysql.servers;
COUNT(*)=0
1
# End of test

View File

@ -7,7 +7,7 @@ DROP DATABASE db1;
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
SHOW CREATE PROCEDURE p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 FROM DUAL latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE p1;
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
@ -18,7 +18,7 @@ DROP PROCEDURE p1;
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION f1;
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
@ -30,10 +30,10 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
SHOW CREATE TRIGGER tr1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1;
CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
SHOW CREATE EVENT event1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
event1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
event1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT event1;

View File

@ -20,6 +20,26 @@ INSERT INTO t1 VALUES (2);
--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
--replace_column 2 <Pos> 5 <End_log_pos>
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 249;
DROP TABLE t1;
--echo #
--echo # MDEV-9401: wsrep_forced_binlog_format with binlog causes crash
--echo #
SET SESSION binlog_format = 'ROW';
CREATE DATABASE testdb_9401;
USE testdb_9401;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE USER dummy@localhost;
GRANT ALL PRIVILEGES ON testdb_9401.t1 TO dummy@localhost;
FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost;
# Cleanup
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE testdb_9401;
--source include/galera_end.inc
--echo # End of tests

View File

@ -0,0 +1,28 @@
# Test for CREATE/ALTER/DROP SERVER in Galera cluster
--source include/galera_cluster.inc
--connection node_1
--echo # On node_1
CREATE SERVER s1
FOREIGN DATA WRAPPER mysql
OPTIONS (HOST 'foo');
--connection node_2
--echo # On node_2
SELECT * FROM mysql.servers;
ALTER SERVER s1
OPTIONS (HOST 'bar');
--connection node_1
--echo # On node_1
SELECT * FROM mysql.servers;
DROP SERVER s1;
--connection node_2
--echo # On node_2
SELECT COUNT(*)=0 FROM mysql.servers;
--source include/galera_end.inc
--echo # End of test

View File

@ -4,6 +4,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--connection node_2
SET SESSION wsrep_sync_wait = 1;

View File

@ -0,0 +1,21 @@
create table t2 (a smallint(6) not null, b int(10) not null, name varchar(20), primary key(a,b), key(name)) engine=InnoDB;
insert into t2 values (8355,3,"sanja"),(8355,4,"wlad"),(8366,5, "lawrin"),(8366,6,"markusjm");
select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
count(distinct name)
1
select count(distinct name) from t2 where a=8366 and b=5;
count(distinct name)
1
select count(distinct name) from t2 where a=8366 and b between 5 and 5.5;
count(distinct name)
1
select sum(distinct a) from t2 where a=8366 and b>=5 and b<=5;
sum(distinct a)
8366
select sum(distinct a) from t2 where a=8366 and b=5;
sum(distinct a)
8366
select sum(distinct a) from t2 where a=8366 and b between 5 and 5.5;
sum(distinct a)
8366
drop table t2;

View File

@ -376,7 +376,7 @@ space_id page_id start_lsn end_lsn
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_changed_pages but the InnoDB storage engine is not installed
select * from information_schema.innodb_tablespaces_encryption;
SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER
SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_encryption but the InnoDB storage engine is not installed
select * from information_schema.innodb_tablespaces_scrubbing;

View File

@ -0,0 +1,18 @@
--source include/have_innodb.inc
#
# MDEV-9667: Server hangs after select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
#
create table t2 (a smallint(6) not null, b int(10) not null, name varchar(20), primary key(a,b), key(name)) engine=InnoDB;
insert into t2 values (8355,3,"sanja"),(8355,4,"wlad"),(8366,5, "lawrin"),(8366,6,"markusjm");
select count(distinct name) from t2 where a=8366 and b>=5 and b<=5;
select count(distinct name) from t2 where a=8366 and b=5;
select count(distinct name) from t2 where a=8366 and b between 5 and 5.5;
select sum(distinct a) from t2 where a=8366 and b>=5 and b<=5;
select sum(distinct a) from t2 where a=8366 and b=5;
select sum(distinct a) from t2 where a=8366 and b between 5 and 5.5;
drop table t2;

View File

@ -36,7 +36,6 @@ count
2
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('+MySQL -YourSQL' IN BOOLEAN MODE);

View File

@ -247,7 +247,6 @@ articles CREATE TABLE `articles` (
ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body);
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will");
id title body
@ -570,7 +569,6 @@ select @@innodb_ft_enable_stopword;
1
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will");
id title body

View File

@ -122,11 +122,9 @@ a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
analyze table t1;
Table Op Msg_type Msg_text
mysqltest_innodb_zip.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
mysqltest_innodb_zip.t1 analyze status OK
analyze table t2;
Table Op Msg_type Msg_text
mysqltest_innodb_zip.t2 analyze Warning Engine-independent statistics are not collected for column 'b'
mysqltest_innodb_zip.t2 analyze status OK
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
table_schema table_name row_format data_length index_length

View File

@ -337,7 +337,7 @@ START SLAVE;
--source include/wait_for_slave_to_start.inc
--replace_result $gtid GTID
eval SELECT MASTER_GTID_WAIT("$gtid", 30);
# The bug occured here, the slave would get an out-of-order binlog error
# The bug occurred here, the slave would get an out-of-order binlog error
# due to trying to re-apply the 100-x-x transaction.
# Restart stopped multi-source connections, and sync up.

View File

@ -322,7 +322,6 @@ FLUSH TABLES;
# replacing p6 with a crashed MYD file (1) (splitted dynamic record)
ANALYZE TABLE t1_will_crash;
Table Op Msg_type Msg_text
test.t1_will_crash analyze Warning Engine-independent statistics are not collected for column 'c'
test.t1_will_crash analyze status OK
OPTIMIZE TABLE t1_will_crash;
Table Op Msg_type Msg_text

View File

@ -1653,7 +1653,7 @@ if($print_details)
--enable_result_log
--horizontal_results
--echo # Dump detailed differences after - before statement execution
--echo # 1. The statement executing connection and hopefully noone else
--echo # 1. The statement executing connection and hopefully no one else
SELECT @default_object_instance_begin;
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
COUNT_READ, SUM_NUMBER_OF_BYTES_READ,

View File

@ -1663,7 +1663,7 @@ if($print_details)
--enable_result_log
--horizontal_results
--echo # Dump detailed differences after - before statement execution
--echo # 1. The statement executing connection and hopefully noone else
--echo # 1. The statement executing connection and hopefully no one else
SELECT @default_object_instance_begin;
SELECT EVENT_NAME, OBJECT_INSTANCE_BEGIN,
COUNT_READ, SUM_NUMBER_OF_BYTES_READ,

View File

@ -11,7 +11,7 @@ PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Simple password strength checks
PLUGIN_LICENSE GPL
LOAD_OPTION ON
PLUGIN_MATURITY Alpha
PLUGIN_MATURITY Gamma
PLUGIN_AUTH_VERSION 1.0
select * from information_schema.system_variables where variable_name like 'simple_password_check%' order by 1;
VARIABLE_NAME SIMPLE_PASSWORD_CHECK_DIGITS

View File

@ -0,0 +1,107 @@
#
# Test user to check if we can grant the created role to it.
#
create user test_user;
#
# First create the role.
#
SET @createRole = 'CREATE ROLE developers';
PREPARE stmtCreateRole FROM @createRole;
EXECUTE stmtCreateRole;
#
# Test to see if the role is created.
#
SELECT user, host,is_role FROM mysql.user
WHERE user = 'developers';
user host is_role
developers Y
SHOW GRANTS;
Grants for root@localhost
GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
# Test reexecution.
EXECUTE stmtCreateRole;
ERROR HY000: Operation CREATE ROLE failed for 'developers'
#
# Now grant the role to the test user.
#
SET @grantRole = 'GRANT developers to test_user';
PREPARE stmtGrantRole FROM @grantRole;
EXECUTE stmtGrantRole;
# Test reexecution.
EXECUTE stmtGrantRole;
#
# We should see 2 entries in the roles_mapping table.
#
SELECT * FROM mysql.roles_mapping;
Host User Role Admin_option
% test_user developers N
localhost root developers Y
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT developers TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Test revoking a role.
#
SET @revokeRole = 'REVOKE developers FROM test_user';
PREPARE stmtRevokeRole FROM @revokeRole;
EXECUTE stmtRevokeRole;
EXECUTE stmtRevokeRole;
ERROR HY000: Cannot revoke role 'developers' from: 'test_user'@'%'.
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT USAGE ON *.* TO 'test_user'@'%'
EXECUTE stmtGrantRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT developers TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Now drop the role.
#
SET @dropRole = 'DROP ROLE developers';
PREPARE stmtDropRole FROM @dropRole;
EXECUTE stmtDropRole;
#
# Check both user and roles_mapping table for traces of our role.
#
SELECT user, host,is_role FROM mysql.user
WHERE user = 'developers';
user host is_role
SELECT * FROM mysql.roles_mapping;
Host User Role Admin_option
SHOW GRANTS;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Test reexecution.
#
EXECUTE stmtCreateRole;
SELECT user, host,is_role FROM mysql.user
WHERE user = 'developers';
user host is_role
developers Y
SELECT * FROM mysql.roles_mapping;
Host User Role Admin_option
localhost root developers Y
SHOW GRANTS;
Grants for root@localhost
GRANT developers TO 'root'@'localhost' WITH ADMIN OPTION
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT USAGE ON *.* TO 'test_user'@'%'
EXECUTE stmtDropRole;
# Cleanup.
DROP USER test_user;

View File

@ -0,0 +1,85 @@
--source include/not_embedded.inc
--echo #
--echo # Test user to check if we can grant the created role to it.
--echo #
create user test_user;
--echo #
--echo # First create the role.
--echo #
SET @createRole = 'CREATE ROLE developers';
PREPARE stmtCreateRole FROM @createRole;
EXECUTE stmtCreateRole;
--echo #
--echo # Test to see if the role is created.
--echo #
SELECT user, host,is_role FROM mysql.user
WHERE user = 'developers';
SHOW GRANTS;
--echo # Test reexecution.
--error ER_CANNOT_USER
EXECUTE stmtCreateRole;
--echo #
--echo # Now grant the role to the test user.
--echo #
SET @grantRole = 'GRANT developers to test_user';
PREPARE stmtGrantRole FROM @grantRole;
EXECUTE stmtGrantRole;
--echo # Test reexecution.
EXECUTE stmtGrantRole;
--echo #
--echo # We should see 2 entries in the roles_mapping table.
--echo #
--sorted_result
SELECT * FROM mysql.roles_mapping;
SHOW GRANTS FOR test_user;
--echo #
--echo # Test revoking a role.
--echo #
SET @revokeRole = 'REVOKE developers FROM test_user';
PREPARE stmtRevokeRole FROM @revokeRole;
EXECUTE stmtRevokeRole;
--error ER_CANNOT_REVOKE_ROLE
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
EXECUTE stmtGrantRole;
SHOW GRANTS FOR test_user;
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
--echo #
--echo # Now drop the role.
--echo #
SET @dropRole = 'DROP ROLE developers';
PREPARE stmtDropRole FROM @dropRole;
EXECUTE stmtDropRole;
--echo #
--echo # Check both user and roles_mapping table for traces of our role.
--echo #
SELECT user, host,is_role FROM mysql.user
WHERE user = 'developers';
SELECT * FROM mysql.roles_mapping;
SHOW GRANTS;
SHOW GRANTS FOR test_user;
--echo #
--echo # Test reexecution.
--echo #
EXECUTE stmtCreateRole;
SELECT user, host,is_role FROM mysql.user
WHERE user = 'developers';
SELECT * FROM mysql.roles_mapping;
SHOW GRANTS;
SHOW GRANTS FOR test_user;
EXECUTE stmtDropRole;
--echo # Cleanup.
DROP USER test_user;

View File

@ -0,0 +1,19 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(id int auto_increment primary key);
create table t2(id int auto_increment primary key);
create table slave_only(id int auto_increment primary key);
insert into slave_only values(NULL);
create trigger t1i after insert on t1 for each row insert into slave_only values(NULL);
stop slave;
set global replicate_ignore_table="test.t2";
start slave;
insert into t2 values(NULL);
insert into t1 values(NULL);
drop table t1, t2, slave_only;
stop slave;
set global replicate_ignore_table="";
start slave;
drop table t1, t2;
include/rpl_end.inc

View File

@ -142,8 +142,8 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
include/wait_for_slave_sql_error.inc [errno=1590]
Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: error writing to the binary log'
FOUND /Slave SQL: The incident LOST_EVENTS occured on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log'
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
SELECT * FROM t4 ORDER BY a;
a
1

View File

@ -39,6 +39,6 @@ a
4
5
FOUND /Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error/ in mysqld.2.err
FOUND /Slave SQL: The incident LOST_EVENTS occured on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
DROP TABLE t1;
include/rpl_end.inc

View File

@ -16,9 +16,9 @@ a
2
3
4
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
include/wait_for_slave_sql_error.inc [errno=1590]
Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: <none>'
Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: <none>'
**** On Slave ****
SELECT * FROM t1;
a

View File

@ -151,7 +151,7 @@ include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;

View File

@ -152,7 +152,7 @@ include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;

View File

@ -76,6 +76,21 @@ ALTER TABLE t1 ADD INDEX id1(a);
INSERT INTO t1 values(1, sleep(3));
### Assertion is good. Both Master and Slave exhibit the
### same number of queries in slow log: 1
********************************************************************
**** TRUNCATE the slow log then check whether runtime changes of
**** log_slow_slave_statements work without slave restart.
********************************************************************
SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
SET @@global.log_slow_slave_statements = off;
TRUNCATE mysql.slow_log;
INSERT INTO t1 values(1, sleep(3));;
SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
sql_text
SET @@global.log_slow_slave_statements = on;
INSERT INTO t1 values(1, sleep(3));;
SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
sql_text
INSERT INTO t1 values(1, sleep(3))
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
DROP TABLE t1;

View File

@ -151,7 +151,7 @@ include/start_slave.inc
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
TRUNCATE t1;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;

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