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

Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

This commit is contained in:
Alexander Barkov
2017-04-05 14:42:14 +04:00
1038 changed files with 91660 additions and 533 deletions

6
.gitignore vendored
View File

@ -97,6 +97,9 @@ pcre/pcre_chartables.c
pcre/pcregrep
pcre/pcretest
pcre/test*grep
plugin/aws_key_management/aws-sdk-cpp
plugin/aws_key_management/aws_sdk_cpp
plugin/aws_key_management/aws_sdk_cpp-prefix
scripts/comp_sql
scripts/make_binary_distribution
scripts/msql2mysql
@ -179,6 +182,9 @@ storage/myisam/myisamlog
storage/myisam/myisampack
storage/myisam/rt_test
storage/myisam/sp_test
storage/rocksdb/ldb
storage/rocksdb/mysql_ldb
storage/rocksdb/sst_dump
storage/tokudb/PerconaFT/buildheader/db.h
storage/tokudb/PerconaFT/buildheader/make_tdb
storage/tokudb/PerconaFT/buildheader/runcat.sh

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "libmariadb"]
path = libmariadb
url = https://github.com/MariaDB/mariadb-connector-c
[submodule "storage/rocksdb/rocksdb"]
path = storage/rocksdb/rocksdb
url = https://github.com/facebook/rocksdb.git

View File

@ -364,6 +364,10 @@ IF(WITH_UNIT_TESTS)
ENDIF()
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# mariadb_connector_c fetches submodules which is useful for plugins
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)
# Add storage engines and plugins.
CONFIGURE_PLUGINS()
@ -373,7 +377,6 @@ ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(mysys_ssl)
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(libservices)

9
cmake/FindLZ4.cmake Normal file
View File

@ -0,0 +1,9 @@
find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
find_library(LZ4_LIBRARY NAMES lz4)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
LZ4 DEFAULT_MSG
LZ4_LIBRARY LZ4_INCLUDE_DIR)
mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARY)

18
cmake/FindZSTD.cmake Normal file
View File

@ -0,0 +1,18 @@
find_path(
ZSTD_INCLUDE_DIR
NAMES "zstd.h"
)
find_library(
ZSTD_LIBRARY
NAMES zstd
)
set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
ZSTD DEFAULT_MSG ZSTD_INCLUDE_DIR ZSTD_LIBRARIES)
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARIES ZSTD_FOUND)

View File

@ -63,6 +63,26 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
ENDIF()
IF(MSVC)
SET(MSVC_CRT_TYPE /MT CACHE STRING
"Runtime library - specify runtime library for linking (/MT,/MTd,/MD,/MDd)"
)
SET(VALID_CRT_TYPES /MTd /MDd /MD /MT)
IF (NOT ";${VALID_CRT_TYPES};" MATCHES ";${MSVC_CRT_TYPE};")
MESSAGE(FATAL_ERROR "Invalid value ${MSVC_CRT_TYPE} for MSVC_CRT_TYPE, choose one of /MT,/MTd,/MD,/MDd ")
ENDIF()
IF(MSVC_CRT_TYPE MATCHES "/MD")
# Dynamic runtime (DLLs), need to install CRT libraries.
SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE)# upgrade wizard
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT VCCRT)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS TRUE)
SET(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
IF(MSVC_CRT_TYPE STREQUAL "/MDd")
SET (CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY TRUE)
ENDIF()
INCLUDE(InstallRequiredSystemLibraries)
ENDIF()
# Enable debug info also in Release build,
# and create PDB to be able to analyze crashes.
FOREACH(type EXE SHARED MODULE)
@ -77,6 +97,10 @@ IF(MSVC)
# information for use with the debugger. The symbolic debugging
# information includes the names and types of variables, as well as
# functions and line numbers. No .pdb file is produced by the compiler.
#
# - Remove preprocessor flag _DEBUG that older cmakes use with Config=Debug,
# it is as defined by Debug runtimes itself (/MTd /MDd)
FOREACH(lang C CXX)
SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Z7")
ENDFOREACH()
@ -85,7 +109,8 @@ IF(MSVC)
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
STRING(REGEX REPLACE "/M[TD][d]?" "${MSVC_CRT_TYPE}" "${flag}" "${${flag}}" )
STRING(REGEX REPLACE "/D[ ]?_DEBUG" "" "${flag}" "${${flag}}")
STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}")
ENDFOREACH()
@ -117,13 +142,6 @@ IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099")
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
# _WIN64 is defined by the compiler itself.
# Yet, we define it here again to work around a bug with Intellisense
# described here: http://tinyurl.com/2cb428.
# Syntax highlighting is important for proper debugger functionality.
ADD_DEFINITIONS("-D_WIN64")
ENDIF()
ENDIF()
# Always link with socket library

View File

@ -72,6 +72,16 @@ then
sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.2.install
fi
# Convert gcc version to numberical value. Format is Mmmpp where M is Major
# version, mm is minor version and p is patch.
GCCVERSION=$(gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$/&00/')
# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
# x86 32 bit.
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]]
then
sed '/Package: mariadb-plugin-rocksdb/,+7d' -i debian/control
fi
# Adjust changelog, add new version
echo "Incrementing changelog and starting build scripts"

9
debian/control vendored
View File

@ -22,6 +22,7 @@ Build-Depends: bison,
libpcre3-dev (>= 2:8.35-3.2~),
libreadline-gplv2-dev,
libssl-dev,
libsnappy-dev,
libsystemd-dev,
libxml2-dev,
lsb-release,
@ -452,6 +453,14 @@ Description: Connect storage engine for MariaDB
other interesting features.
This package contains the Connect plugin for MariaDB.
Package: mariadb-plugin-rocksdb
Architecture: any
Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends}
Description: RocksDB storage engine for MariaDB
The RocksDB storage engine is a high performance storage engine, aimed
at maximising storage efficiency while maintaining InnoDB-like performance.
This package contains the RocksDB plugin for MariaDB.
Package: mariadb-plugin-oqgraph
Architecture: any
Depends: libjudydebian1, mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends}

4
debian/mariadb-plugin-rocksdb.install vendored Normal file
View File

@ -0,0 +1,4 @@
etc/mysql/conf.d/rocksdb.cnf etc/mysql/mariadb.conf.d
usr/lib/mysql/plugin/ha_rocksdb.so
usr/bin/mysql_ldb
usr/bin/sst_dump

View File

@ -25,7 +25,6 @@
C_MODE_START
extern const char _my_bits_nbits[256];
extern const uchar _my_bits_reverse_table[256];
/*
@ -40,37 +39,32 @@ static inline uint my_bit_log2(ulong value)
return bit;
}
static inline uint my_count_bits(ulonglong v)
{
#if SIZEOF_LONG_LONG > 4
/* The following code is a bit faster on 16 bit machines than if we would
only shift v */
ulong v2=(ulong) (v >> 32);
return (uint) (uchar) (_my_bits_nbits[(uchar) v] +
_my_bits_nbits[(uchar) (v >> 8)] +
_my_bits_nbits[(uchar) (v >> 16)] +
_my_bits_nbits[(uchar) (v >> 24)] +
_my_bits_nbits[(uchar) (v2)] +
_my_bits_nbits[(uchar) (v2 >> 8)] +
_my_bits_nbits[(uchar) (v2 >> 16)] +
_my_bits_nbits[(uchar) (v2 >> 24)]);
#else
return (uint) (uchar) (_my_bits_nbits[(uchar) v] +
_my_bits_nbits[(uchar) (v >> 8)] +
_my_bits_nbits[(uchar) (v >> 16)] +
_my_bits_nbits[(uchar) (v >> 24)]);
#endif
}
/*
Count bits in 32bit integer
Algorithm by Sean Anderson, according to:
http://graphics.stanford.edu/~seander/bithacks.html
under "Counting bits set, in parallel"
(Orignal code public domain).
*/
static inline uint my_count_bits_uint32(uint32 v)
{
return (uint) (uchar) (_my_bits_nbits[(uchar) v] +
_my_bits_nbits[(uchar) (v >> 8)] +
_my_bits_nbits[(uchar) (v >> 16)] +
_my_bits_nbits[(uchar) (v >> 24)]);
v = v - ((v >> 1) & 0x55555555);
v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}
static inline uint my_count_bits(ulonglong x)
{
return my_count_bits_uint32((uint32)x) + my_count_bits_uint32((uint32)(x >> 32));
}
/*
Next highest power of two

View File

@ -393,6 +393,23 @@ DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, min, max, blk }
#define MYSQL_SYSVAR_UINT64_T(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, uint64_t) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, min, max, blk }
#ifdef _WIN64
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, min, max, blk }
#else
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
#name, comment, check, update, &varname, def, min, max, blk }
#endif
#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \

View File

@ -0,0 +1,5 @@
perl mysql-test-run.pl --verbose-restart --force --testcase-timeout=45 --suite-timeout=600 --max-test-fail=500 --retry=3 --parallel=4 --suite=^
main,^
innodb,^
plugins,^
rocksdb

View File

@ -305,7 +305,6 @@ if(!$log_error_)
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
}
--let SEARCH_FILE= $log_error_
--let SEARCH_RANGE=-50000
--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
--source include/search_pattern_in_file.inc

View File

@ -1,19 +0,0 @@
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
if ($restart_parameters)
{
--echo # Kill and restart: $restart_parameters
--exec echo "restart: $restart_parameters" > $_expect_file_name
}
if (!$restart_parameters)
{
--echo # Kill and restart
--exec echo "restart" > $_expect_file_name
}
--shutdown_server 0
--source include/wait_until_disconnected.inc
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect

View File

@ -12,37 +12,22 @@
#
# Optionally, SEARCH_RANGE can be set to the max number of bytes of the file
# to search. If negative, it will search that many bytes at the end of the
# file. The default is to search only the first 50000 bytes of the file.
# file. By default the search happens from the last CURRENT_TEST:
# marker till the end of file (appropriate for searching error logs).
#
# Optionally, SEARCH_ABORT can be set to "FOUND" or "NOT FOUND" and this
# will abort if the search result doesn't match the requested one.
#
# In case of
# - SEARCH_FILE and/or SEARCH_PATTERN is not set
# - SEARCH_FILE cannot be opened
# - SEARCH_FILE does not contain SEARCH_PATTERN
# the test will abort immediate.
# MTR will report something like
# ....
# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
# main.1st [ pass ] 3
# innodb.innodb_page_size [ fail ]
# Test ended at 2011-11-11 18:15:58
#
# CURRENT_TEST: innodb.innodb_page_size
# # ERROR: The file '<name>' does not contain the expected pattern <pattern>
# mysqltest: In included file "./include/search_pattern_in_file.inc":
# included from ./include/search_pattern_in_file.inc at line 36:
# At line 25: command "perl" failed with error 255. my_errno=175
#
# The result from queries just before the failure was:
# ...
# - saving '<some path>' to '<some path>'
# main.1st [ pass ] 2
#
# Typical use case (check invalid server startup options):
# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
# --error 0,1
# --remove_file $error_log
# let SEARCH_FILE= $error_log;
# let SEARCH_RANGE= -50000;
# # Stop the server
# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
# --exec echo "wait" > $restart_file
@ -60,36 +45,36 @@
perl;
use strict;
die "SEARCH_FILE not set" unless $ENV{'SEARCH_FILE'};
my @search_files= glob($ENV{'SEARCH_FILE'});
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{'SEARCH_RANGE'};
die "SEARCH_FILE not set" unless $ENV{SEARCH_FILE};
my @search_files= glob($ENV{SEARCH_FILE});
my $search_pattern= $ENV{SEARCH_PATTERN} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{SEARCH_RANGE};
my $content;
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
foreach my $search_file (@search_files) {
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
my $file_content;
if ($search_range >= 0) {
if ($search_range > 0) {
read(FILE, $file_content, $search_range, 0);
} else {
} elsif ($search_range < 0) {
my $size= -s $search_file;
$search_range = -$size if $size > -$search_range;
seek(FILE, $search_range, 2);
read(FILE, $file_content, -$search_range, 0);
} else {
while(<FILE>) { # error log
if (/^CURRENT_TEST:/) {
$content='';
} else {
$content.=$_;
}
}
}
close(FILE);
$content.= $file_content;
}
$ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1};
if ($content =~ m{$search_pattern}) {
die "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
if $ENV{SEARCH_ABORT} eq 'FOUND';
print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
unless defined $ENV{SEARCH_ABORT};
} else {
die "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
if $ENV{SEARCH_ABORT} eq 'NOT FOUND';
print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
unless defined $ENV{SEARCH_ABORT};
}
my @matches=($content =~ m/$search_pattern/gs);
my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
$ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};
print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
exit $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/;
EOF

View File

@ -719,3 +719,38 @@ DROP FUNCTION getText;
DROP DATABASE test1;
USE test;
SET NAMES latin1;
#
# MDEV-11320, MySQL BUG#81810: Inconsistent sort order for blob/text between InnoDB and filesort
#
CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
KEY b (b(32))
);
INSERT INTO t1 (b) VALUES ('a'), (_binary 0x1), (_binary 0x0), ('');
drop table t1;
CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
PRIMARY KEY b (b(32))
);
INSERT INTO t1 (b) VALUES ('a'), (_binary 0x1), (_binary 0x0), ('');
explain
select hex(b) from t1 force index (PRIMARY) where b<'zzz';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 34 NULL 4 Using where
select hex(b) from t1 force index (PRIMARY) where b<'zzz';
hex(b)
00
01
61
explain
select hex(b) from t1 where b<'zzz' order by b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where; Using filesort
select hex(b) from t1 where b<'zzz' order by b;
hex(b)
00
01
61
drop table t1;

View File

@ -6,7 +6,7 @@ set global long_query_time=0.2;
create table t1 (i int);
insert into t1 values (0);
create event ev on schedule at CURRENT_TIMESTAMP + INTERVAL 1 second do update t1 set i=1+sleep(0.5);
FOUND /update t1 set i=1/ in mysqld-slow.log
FOUND 1 /update t1 set i=1/ in mysqld-slow.log
drop table t1;
set global event_scheduler= @event_scheduler_save;
set global slow_query_log= @slow_query_log_save;

View File

@ -1,4 +1,4 @@
#
# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
#
FOUND /\[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names/ in my_restart.err
FOUND 1 /\[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names/ in my_restart.err

View File

@ -1111,8 +1111,8 @@ length(c1) c1
0
SELECT DISTINCT length(c1), c1 FROM t1 ORDER BY c1;
length(c1) c1
0
2 A
0
2 B
DROP TABLE t1;
End of 4.1 tests

View File

@ -5533,4 +5533,4 @@ USE `db1`;
DROP DATABASE db1;
DROP DATABASE db2;
FOUND /Database: mysql/ in bug11505.sql
FOUND 1 /Database: mysql/ in bug11505.sql

View File

@ -2157,4 +2157,4 @@ Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
connection default;
disconnect pipe_con;
FOUND /\[ERROR\] Create named pipe failed/ in second-mysqld.err
FOUND 1 /\[ERROR\] Create named pipe failed/ in second-mysqld.err

View File

@ -2332,3 +2332,677 @@ DROP TABLE t1;
#
# End of 10.1 tests
#
#
# MDEV-10454: range access keys extracted
# from <row> IN (<row value list>)
#
create table t1(a int, b int, c varchar(16), key idx(a,b)) engine=myisam;
insert into t1 values
(1,1,'xx'), (2,2,'yyy'), (3,3,'zzzz'), (1,2,'zz'), (1,3,'x'),
(2,3,'yy'), (4,5,'ww'), (7,8,'xxxxx'), (4,3,'zyx'), (1,2,'uuu'),
(2,1,'w'), (5,5,'wx'), (2,3,'ww'), (7,7,'xxxyy'), (3,3,'zyxw'),
(3,2,'uuuw'), (2,2,'wxz'), (5,5,'xw'), (12,12,'xx'), (12,12,'y'),
(13,13,'z'), (11,12,'zz'), (11,13,'x'), (12,13,'y'), (14,15,'w'),
(17,18,'xx'), (14,13,'zx'), (11,12,'u'), (12,11,'w'), (5,5,'wx'),
(12,13,'ww'), (17,17,'xxxyy'), (13,13,'zyxw'), (13,12,'uuuw'), (12,12,'wxz'),
(15,15,'xw'), (1,1,'xa'), (2,2,'yya'), (3,3,'zzza'), (1,2,'za'),
(1,3,'xb'), (2,3,'ya'), (4,5,'wa'), (7,8,'xxxxa'), (4,3,'zya'),
(1,2,'uua'), (2,1,'wb'), (5,5,'wc'), (2,3,'wa'), (7,7,'xxxya'),
(3,3,'zyxa'), (3,2,'uuua'), (2,2,'wxa'), (5,5,'xa'), (12,12,'xa'),
(22,12,'yb'), (23,13,'zb'), (21,12,'za'), (24,13,'c'), (32,13,'d'),
(34,15,'wd'), (47,18,'xa'), (54,13,'za'), (51,12,'ub'), (52,11,'wc'),
(5,5,'wd'), (62,13,'wa'), (67,17,'xxxya'), (63,13,'zyxa'), (73,12,'uuua'),
(82,12,'wxa'), (85,15,'xd');
# range access to t1 by 2-component keys for index idx
explain select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 10 NULL 7 Using where
explain format=json select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
"rows": 7,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))"
}
}
}
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
a b c
2 3 yy
2 3 ww
2 3 ya
2 3 wa
3 3 zzzz
3 3 zyxw
3 3 zzza
3 3 zyxa
7 7 xxxyy
7 7 xxxya
prepare stmt from "select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7))";
execute stmt;
a b c
2 3 yy
2 3 ww
2 3 ya
2 3 wa
3 3 zzzz
3 3 zyxw
3 3 zzza
3 3 zyxa
7 7 xxxyy
7 7 xxxya
execute stmt;
a b c
2 3 yy
2 3 ww
2 3 ya
2 3 wa
3 3 zzzz
3 3 zyxw
3 3 zzza
3 3 zyxa
7 7 xxxyy
7 7 xxxya
deallocate prepare stmt;
# range access to t1 by 1-component keys for index idx
explain select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 5 Using where
explain format=json select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))"
}
}
}
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
a b c
4 5 ww
4 5 wa
# range access to t1 by 1-component keys for index idx
explain select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 5 Using where
explain format=json select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))"
}
}
}
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
a b c
4 3 zyx
4 3 zya
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='index_merge=off';
create table t2(
d int, e int, key idx1(d), key idx2(e), f varchar(32)
) engine=myisam;
insert into t2 values
(9,5,'a'), (9,8,'b'), (9,3,'c'), (9,2,'d'), (9,1,'e'),
(6,5,'f'), (6,3,'g'), (6,7,'h'), (3,3,'i'), (6,2,'j'),
(9,5,'aa'), (9,8,'ba'), (9,3,'ca'), (2,2,'da'), (9,1,'ea'),
(6,5,'fa'), (6,3,'ga'), (6,7,'ha'), (9,3,'ia'), (6,2,'ja');
# join order: (t2,t1) with ref access of t1
# range access to t1 by keys for index idx1
explain select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx1,idx2 idx1 5 NULL 3 Using index condition; Using where
1 SIMPLE t1 ref idx idx 5 test.t2.d 8
explain format=json select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 3,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
a b c d e f
2 1 w 2 2 da
2 1 wb 2 2 da
2 2 yyy 2 2 da
2 2 wxz 2 2 da
2 2 yya 2 2 da
2 2 wxa 2 2 da
2 3 yy 2 2 da
2 3 ww 2 2 da
2 3 ya 2 2 da
2 3 wa 2 2 da
3 2 uuuw 3 3 i
3 2 uuua 3 3 i
3 3 zzzz 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
3 3 zyxa 3 3 i
insert into t2 values
(4,5,'a'), (7,8,'b'), (4,3,'c'), (1,2,'d'), (2,1,'e'), (5,5,'f'),
(2,3,'g'), (7,7,'h'), (3,3,'i'), (3,2,'j'), (2,2,'k'), (5,5,'l'),
(4,5,'aa'), (7,8,'bb'), (4,3,'cc'), (1,2,'dd'), (2,1,'ee'), (9,5,'ff'),
(2,3,'gg'), (7,7,'hh'), (3,3,'ii'), (3,2,'jj'), (2,2,'kk'), (9,5,'ll'),
(4,5,'aaa'), (7,8,'bbb'), (4,3,'ccc'), (1,2,'ddd'), (2,1,'eee'), (5,5,'fff'),
(2,3,'ggg'), (7,7,'hhh'), (3,3,'iii'), (3,2,'jjj'), (2,2,'kkk'), (5,5,'lll'),
(14,15,'a'), (17,18,'b'), (14,13,'c'), (11,12,'d'), (12,11,'e'), (15,15,'f'),
(12,13,'g'), (17,17,'h'), (13,13,'i'), (13,12,'j'), (12,12,'k'), (15,15,'l'),
(24,25,'a'), (27,28,'b'), (24,23,'c'), (21,22,'d'), (22,21,'e'), (25,25,'f'),
(22,23,'g'), (27,27,'h'), (23,23,'i'), (23,22,'j'), (22,22,'k'), (25,25,'l'),
(34,35,'a'), (37,38,'b'), (34,33,'c'), (31,32,'d'), (32,31,'e'), (35,35,'f'),
(32,33,'g'), (37,37,'h'), (33,33,'i'), (33,32,'j'), (32,32,'k'), (35,35,'l'),
(44,45,'a'), (47,48,'b'), (44,43,'c'), (41,42,'d'), (42,41,'e'), (45,45,'f'),
(42,43,'g'), (47,47,'h'), (43,43,'i'), (43,42,'j'), (42,42,'k'), (45,45,'l');
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 6 Using index condition
1 SIMPLE t2 ref idx1,idx2 idx1 5 test.t1.a 12 Using where
explain format=json select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 6,
"filtered": 100,
"index_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 12,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
a b c d e f
3 2 uuuw 3 3 i
3 2 uuuw 3 3 i
3 2 uuua 3 3 i
3 2 uuua 3 3 i
3 3 zzzz 3 3 i
3 3 zzzz 3 3 i
3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
3 3 zzza 3 3 i
3 3 zyxa 3 3 i
3 3 zyxa 3 3 i
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
prepare stmt from "select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1";
execute stmt;
a b c d e f
3 2 uuuw 3 3 i
3 2 uuuw 3 3 i
3 2 uuua 3 3 i
3 2 uuua 3 3 i
3 3 zzzz 3 3 i
3 3 zzzz 3 3 i
3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
3 3 zzza 3 3 i
3 3 zyxa 3 3 i
3 3 zyxa 3 3 i
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
execute stmt;
a b c d e f
3 2 uuuw 3 3 i
3 2 uuuw 3 3 i
3 2 uuua 3 3 i
3 2 uuua 3 3 i
3 3 zzzz 3 3 i
3 3 zzzz 3 3 i
3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
3 3 zzza 3 3 i
3 3 zyxa 3 3 i
3 3 zyxa 3 3 i
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
deallocate prepare stmt;
insert into t1 select * from t1;
# join order: (t2,t1) with ref access of t1
# range access to t2 by keys for index idx2
explain select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx1,idx2 idx2 5 NULL 6 Using where
1 SIMPLE t1 ref idx idx 5 test.t2.d 11
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx2",
"key_length": "5",
"used_key_parts": ["e"],
"rows": 6,
"filtered": 100,
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1 and t2.d is not null"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
alter table t2 drop index idx1, drop index idx2, add index idx3(d,e);
# join order: (t2,t1) with ref access of t1
# range access to t2 by 2-component keys for index idx3
explain select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx3 idx3 10 NULL 5 Using index condition; Using where
1 SIMPLE t1 ref idx idx 5 test.t2.d 11
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "10",
"used_key_parts": ["d", "e"],
"rows": 5,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 15 Using index condition
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
a b c d e f
4 3 zyx 4 5 a
4 3 zya 4 5 a
4 3 zyx 4 5 a
4 3 zya 4 5 a
4 5 ww 4 5 a
4 5 wa 4 5 a
4 5 ww 4 5 a
4 5 wa 4 5 a
7 7 xxxyy 7 8 b
7 7 xxxya 7 8 b
7 7 xxxyy 7 8 b
7 7 xxxya 7 8 b
7 8 xxxxx 7 8 b
7 8 xxxxa 7 8 b
7 8 xxxxx 7 8 b
7 8 xxxxa 7 8 b
# join order: (t1,t2) with ref access of t2
# no range access
explain select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL idx NULL NULL NULL 144 Using where
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
a b c d e f
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 13 Using index condition; Using where
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 13,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and length(t1.c) = 1"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
a b c d e f
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
prepare stmt from "select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1";
execute stmt;
a b c d e f
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
execute stmt;
a b c d e f
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
deallocate prepare stmt;
create table t3 (id int primary key, v int) engine=myisam;
insert into t3 values
(3,2), (1,1), (4,12), (2,15);
# join order: (t3,t1,t2) with const t3 and ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range idx idx 5 NULL 13 Using index condition; Using where
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "const",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 13,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and length(t1.c) = 1"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "length(t2.f) = 1"
}
}
}
select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
a b c d e f id v
2 1 w 2 1 e 1 1
2 1 w 2 2 k 1 1
2 1 w 2 3 g 1 1
2 1 w 2 1 e 1 1
2 1 w 2 2 k 1 1
2 1 w 2 3 g 1 1
# IN predicate is always FALSE
explain select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((9,9),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
prepare stmt from "select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((9,9),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1";
execute stmt;
a b c d e f id v
execute stmt;
a b c d e f id v
deallocate prepare stmt;
set optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
#
# End of 10.2 tests
#

View File

@ -2334,4 +2334,688 @@ DROP TABLE t1;
#
# End of 10.1 tests
#
#
# MDEV-10454: range access keys extracted
# from <row> IN (<row value list>)
#
create table t1(a int, b int, c varchar(16), key idx(a,b)) engine=myisam;
insert into t1 values
(1,1,'xx'), (2,2,'yyy'), (3,3,'zzzz'), (1,2,'zz'), (1,3,'x'),
(2,3,'yy'), (4,5,'ww'), (7,8,'xxxxx'), (4,3,'zyx'), (1,2,'uuu'),
(2,1,'w'), (5,5,'wx'), (2,3,'ww'), (7,7,'xxxyy'), (3,3,'zyxw'),
(3,2,'uuuw'), (2,2,'wxz'), (5,5,'xw'), (12,12,'xx'), (12,12,'y'),
(13,13,'z'), (11,12,'zz'), (11,13,'x'), (12,13,'y'), (14,15,'w'),
(17,18,'xx'), (14,13,'zx'), (11,12,'u'), (12,11,'w'), (5,5,'wx'),
(12,13,'ww'), (17,17,'xxxyy'), (13,13,'zyxw'), (13,12,'uuuw'), (12,12,'wxz'),
(15,15,'xw'), (1,1,'xa'), (2,2,'yya'), (3,3,'zzza'), (1,2,'za'),
(1,3,'xb'), (2,3,'ya'), (4,5,'wa'), (7,8,'xxxxa'), (4,3,'zya'),
(1,2,'uua'), (2,1,'wb'), (5,5,'wc'), (2,3,'wa'), (7,7,'xxxya'),
(3,3,'zyxa'), (3,2,'uuua'), (2,2,'wxa'), (5,5,'xa'), (12,12,'xa'),
(22,12,'yb'), (23,13,'zb'), (21,12,'za'), (24,13,'c'), (32,13,'d'),
(34,15,'wd'), (47,18,'xa'), (54,13,'za'), (51,12,'ub'), (52,11,'wc'),
(5,5,'wd'), (62,13,'wa'), (67,17,'xxxya'), (63,13,'zyxa'), (73,12,'uuua'),
(82,12,'wxa'), (85,15,'xd');
# range access to t1 by 2-component keys for index idx
explain select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 10 NULL 7 Using where; Rowid-ordered scan
explain format=json select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
"rows": 7,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
}
}
}
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
a b c
3 3 zzzz
2 3 yy
2 3 ww
7 7 xxxyy
3 3 zyxw
3 3 zzza
2 3 ya
2 3 wa
7 7 xxxya
3 3 zyxa
prepare stmt from "select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7))";
execute stmt;
a b c
3 3 zzzz
2 3 yy
2 3 ww
7 7 xxxyy
3 3 zyxw
3 3 zzza
2 3 ya
2 3 wa
7 7 xxxya
3 3 zyxa
execute stmt;
a b c
3 3 zzzz
2 3 yy
2 3 ww
7 7 xxxyy
3 3 zyxw
3 3 zzza
2 3 ya
2 3 wa
7 7 xxxya
3 3 zyxa
deallocate prepare stmt;
# range access to t1 by 1-component keys for index idx
explain select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 5 Using where; Rowid-ordered scan
explain format=json select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
}
}
}
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
a b c
4 5 ww
4 5 wa
# range access to t1 by 1-component keys for index idx
explain select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 5 Using where; Rowid-ordered scan
explain format=json select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 5,
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))",
"mrr_type": "Rowid-ordered scan"
}
}
}
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
a b c
4 3 zyx
4 3 zya
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='index_merge=off';
create table t2(
d int, e int, key idx1(d), key idx2(e), f varchar(32)
) engine=myisam;
insert into t2 values
(9,5,'a'), (9,8,'b'), (9,3,'c'), (9,2,'d'), (9,1,'e'),
(6,5,'f'), (6,3,'g'), (6,7,'h'), (3,3,'i'), (6,2,'j'),
(9,5,'aa'), (9,8,'ba'), (9,3,'ca'), (2,2,'da'), (9,1,'ea'),
(6,5,'fa'), (6,3,'ga'), (6,7,'ha'), (9,3,'ia'), (6,2,'ja');
# join order: (t2,t1) with ref access of t1
# range access to t1 by keys for index idx1
explain select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx1,idx2 idx1 5 NULL 3 Using index condition; Using where; Rowid-ordered scan
1 SIMPLE t1 ref idx idx 5 test.t2.d 8
explain format=json select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"rows": 3,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 8,
"filtered": 100
}
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
a b c d e f
3 2 uuuw 3 3 i
3 2 uuua 3 3 i
3 3 zzzz 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
3 3 zyxa 3 3 i
2 1 w 2 2 da
2 1 wb 2 2 da
2 2 yyy 2 2 da
2 2 wxz 2 2 da
2 2 yya 2 2 da
2 2 wxa 2 2 da
2 3 yy 2 2 da
2 3 ww 2 2 da
2 3 ya 2 2 da
2 3 wa 2 2 da
insert into t2 values
(4,5,'a'), (7,8,'b'), (4,3,'c'), (1,2,'d'), (2,1,'e'), (5,5,'f'),
(2,3,'g'), (7,7,'h'), (3,3,'i'), (3,2,'j'), (2,2,'k'), (5,5,'l'),
(4,5,'aa'), (7,8,'bb'), (4,3,'cc'), (1,2,'dd'), (2,1,'ee'), (9,5,'ff'),
(2,3,'gg'), (7,7,'hh'), (3,3,'ii'), (3,2,'jj'), (2,2,'kk'), (9,5,'ll'),
(4,5,'aaa'), (7,8,'bbb'), (4,3,'ccc'), (1,2,'ddd'), (2,1,'eee'), (5,5,'fff'),
(2,3,'ggg'), (7,7,'hhh'), (3,3,'iii'), (3,2,'jjj'), (2,2,'kkk'), (5,5,'lll'),
(14,15,'a'), (17,18,'b'), (14,13,'c'), (11,12,'d'), (12,11,'e'), (15,15,'f'),
(12,13,'g'), (17,17,'h'), (13,13,'i'), (13,12,'j'), (12,12,'k'), (15,15,'l'),
(24,25,'a'), (27,28,'b'), (24,23,'c'), (21,22,'d'), (22,21,'e'), (25,25,'f'),
(22,23,'g'), (27,27,'h'), (23,23,'i'), (23,22,'j'), (22,22,'k'), (25,25,'l'),
(34,35,'a'), (37,38,'b'), (34,33,'c'), (31,32,'d'), (32,31,'e'), (35,35,'f'),
(32,33,'g'), (37,37,'h'), (33,33,'i'), (33,32,'j'), (32,32,'k'), (35,35,'l'),
(44,45,'a'), (47,48,'b'), (44,43,'c'), (41,42,'d'), (42,41,'e'), (45,45,'f'),
(42,43,'g'), (47,47,'h'), (43,43,'i'), (43,42,'j'), (42,42,'k'), (45,45,'l');
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 6 Using index condition; Rowid-ordered scan
1 SIMPLE t2 ref idx1,idx2 idx1 5 test.t1.a 12 Using where
explain format=json select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 6,
"filtered": 100,
"index_condition": "t1.a is not null",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx1", "idx2"],
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 12,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
a b c d e f
3 3 zzzz 3 3 i
3 3 zzzz 3 3 i
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 2 uuuw 3 3 i
3 2 uuuw 3 3 i
3 3 zzza 3 3 i
3 3 zzza 3 3 i
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
3 3 zyxa 3 3 i
3 3 zyxa 3 3 i
3 2 uuua 3 3 i
3 2 uuua 3 3 i
prepare stmt from "select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1";
execute stmt;
a b c d e f
3 3 zzzz 3 3 i
3 3 zzzz 3 3 i
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 2 uuuw 3 3 i
3 2 uuuw 3 3 i
3 3 zzza 3 3 i
3 3 zzza 3 3 i
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
3 3 zyxa 3 3 i
3 3 zyxa 3 3 i
3 2 uuua 3 3 i
3 2 uuua 3 3 i
execute stmt;
a b c d e f
3 3 zzzz 3 3 i
3 3 zzzz 3 3 i
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 2 uuuw 3 3 i
3 2 uuuw 3 3 i
3 3 zzza 3 3 i
3 3 zzza 3 3 i
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
3 3 zyxa 3 3 i
3 3 zyxa 3 3 i
3 2 uuua 3 3 i
3 2 uuua 3 3 i
deallocate prepare stmt;
insert into t1 select * from t1;
# join order: (t2,t1) with ref access of t1
# range access to t2 by keys for index idx2
explain select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx1,idx2 idx2 5 NULL 6 Using where; Rowid-ordered scan
1 SIMPLE t1 ref idx idx 5 test.t2.d 11
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx1", "idx2"],
"key": "idx2",
"key_length": "5",
"used_key_parts": ["e"],
"rows": 6,
"filtered": 100,
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1 and t2.d is not null",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
alter table t2 drop index idx1, drop index idx2, add index idx3(d,e);
# join order: (t2,t1) with ref access of t1
# range access to t2 by 2-component keys for index idx3
explain select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx3 idx3 10 NULL 5 Using index condition; Using where; Rowid-ordered scan
1 SIMPLE t1 ref idx idx 5 test.t2.d 11
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t2",
"access_type": "range",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "10",
"used_key_parts": ["d", "e"],
"rows": 5,
"filtered": 100,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t1",
"access_type": "ref",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
"rows": 11,
"filtered": 100
}
}
}
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 15 Using index condition; Rowid-ordered scan
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 15,
"filtered": 100,
"index_condition": "t1.a is not null",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
a b c d e f
4 5 ww 4 5 a
7 8 xxxxx 7 8 b
4 3 zyx 4 5 a
7 7 xxxyy 7 8 b
4 5 wa 4 5 a
7 8 xxxxa 7 8 b
4 3 zya 4 5 a
7 7 xxxya 7 8 b
4 5 ww 4 5 a
7 8 xxxxx 7 8 b
4 3 zyx 4 5 a
7 7 xxxyy 7 8 b
4 5 wa 4 5 a
7 8 xxxxa 7 8 b
4 3 zya 4 5 a
7 7 xxxya 7 8 b
# join order: (t1,t2) with ref access of t2
# no range access
explain select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL idx NULL NULL NULL 144 Using where
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
"rows": 144,
"filtered": 100,
"attached_condition": "t1.a is not null"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
a b c d e f
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
7 8 xxxxx 7 7 h
7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 13 Using index condition; Using where; Rowid-ordered scan
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 13,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and length(t1.c) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "length(t2.f) = 1"
}
}
}
select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
a b c d e f
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
prepare stmt from "select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1";
execute stmt;
a b c d e f
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
execute stmt;
a b c d e f
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
2 1 w 2 1 e
2 1 w 2 2 k
2 1 w 2 3 g
deallocate prepare stmt;
create table t3 (id int primary key, v int) engine=myisam;
insert into t3 values
(3,2), (1,1), (4,12), (2,15);
# join order: (t3,t1,t2) with const t3 and ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range idx idx 5 NULL 13 Using index condition; Using where; Rowid-ordered scan
1 SIMPLE t2 ref idx3 idx3 5 test.t1.a 3 Using where
explain format=json select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t3",
"access_type": "const",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["const"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
"rows": 13,
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and length(t1.c) = 1",
"mrr_type": "Rowid-ordered scan"
},
"table": {
"table_name": "t2",
"access_type": "ref",
"possible_keys": ["idx3"],
"key": "idx3",
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
"rows": 3,
"filtered": 100,
"attached_condition": "length(t2.f) = 1"
}
}
}
select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
a b c d e f id v
2 1 w 2 1 e 1 1
2 1 w 2 2 k 1 1
2 1 w 2 3 g 1 1
2 1 w 2 1 e 1 1
2 1 w 2 2 k 1 1
2 1 w 2 3 g 1 1
# IN predicate is always FALSE
explain select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((9,9),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
prepare stmt from "select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((9,9),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1";
execute stmt;
a b c d e f id v
execute stmt;
a b c d e f id v
deallocate prepare stmt;
set optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
#
# End of 10.2 tests
#
set optimizer_switch=@mrr_icp_extra_tmp;

View File

@ -13,4 +13,4 @@ drop user user1@localhost;
#
# MDEV-8491 - On shutdown, report the user and the host executed that.
#
FOUND /mysqld(\.exe)? \(root\[root\] @ localhost \[(::1)?\]\): Normal shutdown/ in mysqld.1.err
FOUND 2 /mysqld(\.exe)? \(root\[root\] @ localhost \[(::1)?\]\): Normal shutdown/ in mysqld.1.err

View File

@ -5479,7 +5479,7 @@ DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1, t2;
create view v1 as select 1;
FOUND /mariadb-version/ in v1.frm
FOUND 1 /mariadb-version/ in v1.frm
drop view v1;
#
# MDEV-7260: Crash in get_best_combination when executing multi-table

View File

@ -2,5 +2,5 @@ set global log_warnings=2;
connect foo,localhost,root;
set @@wait_timeout=1;
connection default;
FOUND /Aborted.*Got timeout reading communication packets/ in mysqld.1.err
FOUND 1 /Aborted.*Got timeout reading communication packets/ in mysqld.1.err
set global log_warnings=@@log_warnings;

View File

@ -598,23 +598,23 @@ DROP SERVER server_name_to_encrypt;
#############################
# Final checks for the master
#############################
NOT FOUND /_to_encrypt/ in master-bin.0*
NOT FOUND /COMMIT/ in master-bin.0*
NOT FOUND /TIMESTAMP/ in master-bin.0*
NOT FOUND /_to_encrypt.*/ in master-bin.0*
NOT FOUND /COMMIT.*/ in master-bin.0*
NOT FOUND /TIMESTAMP.*/ in master-bin.0*
include/save_master_pos.inc
#############################
# Final checks for the slave
#############################
connection server_2;
include/sync_io_with_master.inc
FOUND /_to_encrypt/ in slave-relay-bin.0*
FOUND /COMMIT/ in slave-relay-bin.0*
FOUND /TIMESTAMP/ in slave-relay-bin.0*
FOUND 1 /_to_encrypt.*/ in slave-relay-bin.0*
FOUND 1 /COMMIT.*/ in slave-relay-bin.0*
FOUND 1 /TIMESTAMP.*/ in slave-relay-bin.0*
include/start_slave.inc
include/sync_slave_sql_with_io.inc
FOUND /_to_encrypt/ in slave-bin.0*
FOUND /COMMIT/ in slave-bin.0*
FOUND /TIMESTAMP/ in slave-bin.0*
FOUND 1 /_to_encrypt.*/ in slave-bin.0*
FOUND 1 /COMMIT.*/ in slave-bin.0*
FOUND 1 /TIMESTAMP.*/ in slave-bin.0*
##########
# Cleanup
##########

View File

@ -106,16 +106,17 @@ SET binlog_row_image= MINIMAL;
--let $master_datadir= `SELECT @@datadir`
--let SEARCH_RANGE = 500000
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= _to_encrypt
--let SEARCH_PATTERN= _to_encrypt.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= COMMIT
--let SEARCH_PATTERN= COMMIT.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= TIMESTAMP
--let SEARCH_PATTERN= TIMESTAMP.*
--source include/search_pattern_in_file.inc
--disable_connect_log
@ -138,15 +139,15 @@ SET binlog_row_image= MINIMAL;
# Check that relay logs are unencrypted
--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
--let SEARCH_PATTERN= _to_encrypt
--let SEARCH_PATTERN= _to_encrypt.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
--let SEARCH_PATTERN= COMMIT
--let SEARCH_PATTERN= COMMIT.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $slave_datadir/slave-relay-bin.0*
--let SEARCH_PATTERN= TIMESTAMP
--let SEARCH_PATTERN= TIMESTAMP.*
--source include/search_pattern_in_file.inc
@ -158,15 +159,15 @@ SET binlog_row_image= MINIMAL;
--enable_connect_log
--let SEARCH_FILE= $slave_datadir/slave-bin.0*
--let SEARCH_PATTERN= _to_encrypt
--let SEARCH_PATTERN= _to_encrypt.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $slave_datadir/slave-bin.0*
--let SEARCH_PATTERN= COMMIT
--let SEARCH_PATTERN= COMMIT.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $slave_datadir/slave-bin.0*
--let SEARCH_PATTERN= TIMESTAMP
--let SEARCH_PATTERN= TIMESTAMP.*
--source include/search_pattern_in_file.inc
--echo ##########

View File

@ -58,6 +58,7 @@ INSERT INTO table1_to_encrypt SELECT NULL,NOW(),b FROM table1_to_encrypt;
# Make sure that binary logs are encrypted
--let SEARCH_RANGE = 500000
--let SEARCH_FILE= master-bin.0*
--let SEARCH_PATTERN= table1_to_encrypt
--source include/search_pattern_in_file.inc

View File

@ -52,6 +52,7 @@ INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
# Make sure that binary logs are not encrypted
--let SEARCH_RANGE = 500000
--let SEARCH_FILE= master-bin.0*
--let SEARCH_PATTERN= table1_no_encryption
--source include/search_pattern_in_file.inc

View File

@ -149,9 +149,9 @@ DROP SERVER server_name_to_encrypt;
#################
# Master binlog checks
#################
FOUND /_to_encrypt/ in master-bin.0*
FOUND /COMMIT/ in master-bin.0*
FOUND /TIMESTAMP/ in master-bin.0*
FOUND 1 /_to_encrypt.*/ in master-bin.0*
FOUND 1 /COMMIT.*/ in master-bin.0*
FOUND 1 /TIMESTAMP.*/ in master-bin.0*
include/save_master_pos.inc
#################
# Relay log checks

View File

@ -42,16 +42,17 @@
--let $master_datadir= `SELECT @@datadir`
--let SEARCH_RANGE = 500000
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= _to_encrypt
--let SEARCH_PATTERN= _to_encrypt.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= COMMIT
--let SEARCH_PATTERN= COMMIT.*
--source include/search_pattern_in_file.inc
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= TIMESTAMP
--let SEARCH_PATTERN= TIMESTAMP.*
--source include/search_pattern_in_file.inc
--disable_connect_log

View File

@ -19,7 +19,7 @@ FLUSH BINARY LOGS;
SET binlog_format=ROW;
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
FOUND /table1_no_encryption/ in master-bin.0*
FOUND 11 /table1_no_encryption/ in master-bin.0*
#####################################################
# Part 2: restart master, now with binlog encryption
#####################################################

View File

@ -52,6 +52,7 @@ INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
--let $master_datadir= `SELECT @@datadir`
--let SEARCH_RANGE = 500000
--let SEARCH_FILE= $master_datadir/master-bin.0*
--let SEARCH_PATTERN= table1_no_encryption
--source include/search_pattern_in_file.inc

View File

@ -174,7 +174,7 @@ INSERT INTO t4 VALUES (2);
connection slave;
include/wait_for_slave_sql_error.inc [errno=1590]
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
FOUND 1 /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

@ -7,5 +7,6 @@
--echo #
--let SEARCH_FILE=$datadir/master-bin.0*
--let SEARCH_RANGE = 500000
--let SEARCH_PATTERN= xxxxxxxxxxx
--source include/search_pattern_in_file.inc

View File

@ -21,7 +21,7 @@ NOT FOUND /foobar/ in t1.ibd
# t2 ... on expecting NOT FOUND
NOT FOUND /temp/ in t2.ibd
# t3 no on expecting FOUND
FOUND /dummy/ in t3.ibd
FOUND 42 /dummy/ in t3.ibd
# ibdata1 expecting NOT FOUND
NOT FOUND /foobar/ in ibdata1
# Now turn off encryption and wait for threads to decrypt everything
@ -43,7 +43,7 @@ NOT FOUND /foobar/ in t1.ibd
# t2 ... on expecting FOUND
NOT FOUND /temp/ in t2.ibd
# t3 no on expecting FOUND
FOUND /dummy/ in t3.ibd
FOUND 42 /dummy/ in t3.ibd
# ibdata1 expecting NOT FOUND
NOT FOUND /foobar/ in ibdata1
# Now turn on encryption and wait for threads to encrypt all spaces
@ -65,7 +65,7 @@ NOT FOUND /foobar/ in t1.ibd
# t2 ... on expecting NOT FOUND
NOT FOUND /temp/ in t2.ibd
# t3 no on expecting FOUND
FOUND /dummy/ in t3.ibd
FOUND 42 /dummy/ in t3.ibd
# ibdata1 expecting NOT FOUND
NOT FOUND /foobar/ in ibdata1
drop table t1, t2, t3;

View File

@ -1,7 +1,7 @@
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
FOUND 1 /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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
FOUND 1 /Cannot decrypt .*filekeys-data.enc. Wrong key/ 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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("File 'bad' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File 'bad' not found/ in mysqld.1.err
FOUND 1 /File 'bad' not found/ 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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
FOUND 1 /Cannot decrypt .*filekeys-data.enc. Wrong key/ 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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("file-key-management-filename is not set");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /file-key-management-filename is not set/ in mysqld.1.err
FOUND 1 /file-key-management-filename is not set/ 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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("File '.*keys.txt' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File '.*keys.txt' not found/ in mysqld.1.err
FOUND 1 /File '.*keys.txt' not found/ 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
@ -12,7 +12,7 @@ ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 2
call mtr.add_suppression("File '.*keys.txt' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /File '.*keys.txt' not found/ in mysqld.1.err
FOUND 1 /File '.*keys.txt' not found/ 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
@ -21,7 +21,7 @@ plugin_status
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
FOUND 1 /Invalid key id/ 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
@ -32,7 +32,7 @@ ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 11
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
FOUND 2 /Invalid key id/ 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
@ -41,7 +41,7 @@ plugin_status
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
FOUND 2 /Invalid key id/ 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
@ -52,7 +52,7 @@ ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 47
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key id/ in mysqld.1.err
FOUND 2 /Invalid key id/ 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
@ -61,7 +61,7 @@ plugin_status
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
FOUND 3 /Invalid key/ 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
@ -72,7 +72,7 @@ ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 33
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
FOUND 4 /Invalid key/ 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
@ -81,7 +81,7 @@ plugin_status
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
FOUND 4 /Invalid key/ 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
@ -92,7 +92,7 @@ ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 2
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Invalid key/ in mysqld.1.err
FOUND 4 /Invalid key/ 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
@ -101,7 +101,7 @@ plugin_status
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
FOUND 1 /Syntax error/ 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
@ -112,7 +112,7 @@ ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 1
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
FOUND 2 /Syntax error/ 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
@ -121,7 +121,7 @@ plugin_status
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
FOUND 2 /Syntax error/ 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
@ -132,7 +132,7 @@ ERROR HY000: System key id 1 is missing at MYSQL_TMP_DIR/keys.txt line 1, column
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
FOUND 2 /Syntax error/ 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
@ -141,7 +141,7 @@ plugin_status
call mtr.add_suppression("System key id 1");
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/ in mysqld.1.err
FOUND 1 /System key id 1/ 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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*tooshort.enc. Not encrypted");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*tooshort.enc. Not encrypted/ in mysqld.1.err
FOUND 1 /Cannot decrypt .*tooshort.enc. Not encrypted/ 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

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*keys.txt. Not encrypted");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Cannot decrypt .*keys.txt. Not encrypted/ in mysqld.1.err
FOUND 1 /Cannot decrypt .*keys.txt. Not encrypted/ 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

View File

@ -99,5 +99,5 @@ NOT FOUND /verysecretmessage/ in t3.ibd
# t4 page compressed and encrypted expecting NOT FOUND
NOT FOUND /verysecretmessage/ in t4.ibd
# t5 normal expecting FOUND
FOUND /verysecretmessage/ in t5.ibd
FOUND 289 /verysecretmessage/ in t5.ibd
DROP TABLE t1,t2,t3,t4,t5,t6;

View File

@ -57,9 +57,9 @@ NOT FOUND /secred/ in t5.ibd
# t6 on expecting NOT FOUND
NOT FOUND /secred/ in t6.ibd
# t7 off expecting FOUND
FOUND /public/ in t7.ibd
FOUND 1 /public/ in t7.ibd
# t8 row compressed expecting NOT FOUND
FOUND /public/ in t8.ibd
FOUND 1 /public/ in t8.ibd
# t9 page compressed expecting NOT FOUND
NOT FOUND /public/ in t9.ibd
use test;

View File

@ -51,7 +51,7 @@ INSERT INTO t0 VALUES(NULL, 5, 5, 'public', 'gossip');
# ib_logfile0 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile0
# ib_logfile0 expecting FOUND
FOUND /public|gossip/ in ib_logfile0
FOUND 3 /public|gossip/ in ib_logfile0
# ibdata1 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)|public|gossip/ in ibdata1
# t0.ibd expecting NOT FOUND

View File

@ -3,52 +3,52 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2\./ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2\./ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log checkpoint
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
FOUND /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
FOUND 2 /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log block
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
FOUND 1 /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
# distant future redo log format, with valid header checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html/ in mysqld.1.err
FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html/ in mysqld.1.err
# valid header, but old-format checkpoint blocks
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
FOUND 1 /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log)
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
FOUND /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
FOUND 1 /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@ -66,26 +66,26 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Starting crash recovery from checkpoint LSN=1213964/ in mysqld.1.err
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bogus/ in mysqld.1.err
FOUND /InnoDB: ############### CORRUPT LOG RECORD FOUND ##################/ in mysqld.1.err
FOUND /InnoDB: Log record type 55, page 151:488\. Log parsing proceeded successfully up to 1213973\. Previous log record type 56, is multi 0 Recv offset 9, prev 0/ in mysqld.1.err
FOUND /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 bogus / in mysqld.1.err
FOUND /InnoDB: Set innodb_force_recovery to ignore this error/ in mysqld.1.err
FOUND 1 /InnoDB: Starting crash recovery from checkpoint LSN=1213964/ in mysqld.1.err
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bogus/ in mysqld.1.err
FOUND 1 /InnoDB: ############### CORRUPT LOG RECORD FOUND ##################/ in mysqld.1.err
FOUND 1 /InnoDB: Log record type 55, page 151:488\. Log parsing proceeded successfully up to 1213973\. Previous log record type 56, is multi 0 Recv offset 9, prev 0/ in mysqld.1.err
FOUND 1 /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 bogus / in mysqld.1.err
FOUND 1 /InnoDB: Set innodb_force_recovery to ignore this error/ in mysqld.1.err
# Test a corrupted MLOG_FILE_NAME record.
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid block
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid log record
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@ -97,7 +97,7 @@ SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
1
1
FOUND /InnoDB: Encrypting redo log/ in mysqld.1.err
FOUND 1 /InnoDB: Encrypting redo log/ in mysqld.1.err
ib_buffer_pool
ib_logfile0
ib_logfile1

View File

@ -13,7 +13,6 @@
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
--let SEARCH_RANGE = 10000000
--let SEARCH_PATTERN=foobar
SET GLOBAL innodb_file_per_table = ON;

View File

@ -7,7 +7,6 @@ call mtr.add_suppression("Plugin 'file_key_management' init function returned er
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_RANGE= -10000
--source include/search_pattern_in_file.inc
--error ER_CANT_CREATE_TABLE

View File

@ -432,7 +432,6 @@ DELETE FROM t7 WHERE a = 100000200;
set global innodb_flush_log_at_trx_commit=1;
INSERT INTO t9 VALUES(100000000200);
DELETE FROM t9 WHERE a = 100000000200;
# Kill and restart
INSERT INTO t1 VALUES(0);
SELECT a AS `Expect 126` FROM t1 ORDER BY a DESC LIMIT 1;
Expect 126
@ -498,7 +497,6 @@ SELECT * FROM t19;
a
1
2
# Kill and restart
INSERT INTO t1 VALUES(0), (0);
SELECT * FROM t1;
a
@ -639,7 +637,6 @@ BEGIN;
# Without the fix in page_create_empty() the counter value would be lost
# when ROLLBACK deletes the last row.
ROLLBACK;
# Kill and restart
INSERT INTO t3 VALUES(0);
SELECT MAX(a) AS `Expect 120` FROM t3;
Expect 120
@ -913,7 +910,6 @@ UPDATE t33 SET a = 10 WHERE a = 1;
INSERT INTO t33 VALUES(2, NULL);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
COMMIT;
# Kill and restart
# This will not insert 0
INSERT INTO t31(a) VALUES(6), (0);
SELECT * FROM t31;

View File

@ -43,7 +43,6 @@ a
3
BEGIN;
INSERT INTO t2 VALUES (42);
# Kill and restart
disconnect con1;
disconnect con2;
connection default;
@ -98,7 +97,6 @@ SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern';
info
UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2
# Kill and restart
disconnect con2;
connection default;
ERROR HY000: Lost connection to MySQL server during query
@ -130,7 +128,6 @@ SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: after_row_upd_extern';
info
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2
# Kill and restart
disconnect con2;
connection default;
ERROR HY000: Lost connection to MySQL server during query

View File

@ -38,7 +38,7 @@ SELECT b FROM t1 LIMIT 3;
ERROR HY000: Lost connection to MySQL server during query
disconnect con1;
connection default;
FOUND /Wrote log record for ibuf update in place operation/ in my_restart.err
FOUND 1 /Wrote log record for ibuf update in place operation/ in my_restart.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK

View File

@ -77,7 +77,6 @@ pk c1
4 44
START TRANSACTION;
INSERT INTO bug_53756 VALUES (666,666);
# Kill and restart
disconnect con1;
disconnect con2;
disconnect con3;

View File

@ -17,7 +17,6 @@ UPDATE t SET b=4*a WHERE a=32;
XA END '789';
XA PREPARE '789';
CONNECT con3,localhost,root,,;
# Kill and restart
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
a b

View File

@ -10,6 +10,8 @@ INSERT INTO t1 VALUES (1,2);
ALTER TABLE t1 ADD PRIMARY KEY(a), ALGORITHM=INPLACE;
ALTER TABLE t1 DROP INDEX b, ADD INDEX (b);
# Kill the server
FOUND 1 /scan .*: multi-log rec MLOG_FILE_CREATE2.*page .*:0/ in mysqld.1.err
FOUND 1 /scan .*: log rec MLOG_INDEX_LOAD/ in mysqld.1.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK

View File

@ -3,52 +3,52 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2\./ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2\./ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log checkpoint
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
FOUND /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
FOUND 2 /Plugin 'InnoDB' registration as a STORAGE ENGINE failed/ in mysqld.1.err
# redo log from before MariaDB 10.2.2, with corrupted log block
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
FOUND 1 /InnoDB: Invalid redo log header checksum/ in mysqld.1.err
# distant future redo log format, with valid header checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html/ in mysqld.1.err
FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html/ in mysqld.1.err
# valid header, but old-format checkpoint blocks
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
FOUND 1 /InnoDB: No valid checkpoint found .corrupted redo log/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 3362026715 found: 144444122/ in mysqld.1.err
FOUND 1 /InnoDB: Missing MLOG_CHECKPOINT between the checkpoint 1213964 and the end 1213952\./ in mysqld.1.err
# --innodb-force-recovery=6 (skip the entire redo log)
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
FOUND /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
FOUND 1 /\[Note\] InnoDB: .* started; log sequence number 0/ in mysqld.1.err
# valid header, valid checkpoint 1, all-zero (invalid) checkpoint 2, invalid block number
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@ -66,26 +66,26 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Starting crash recovery from checkpoint LSN=1213964/ in mysqld.1.err
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bogus/ in mysqld.1.err
FOUND /InnoDB: ############### CORRUPT LOG RECORD FOUND ##################/ in mysqld.1.err
FOUND /InnoDB: Log record type 55, page 151:488\. Log parsing proceeded successfully up to 1213973\. Previous log record type 56, is multi 0 Recv offset 9, prev 0/ in mysqld.1.err
FOUND /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 bogus / in mysqld.1.err
FOUND /InnoDB: Set innodb_force_recovery to ignore this error/ in mysqld.1.err
FOUND 1 /InnoDB: Starting crash recovery from checkpoint LSN=1213964/ in mysqld.1.err
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bogus/ in mysqld.1.err
FOUND 1 /InnoDB: ############### CORRUPT LOG RECORD FOUND ##################/ in mysqld.1.err
FOUND 1 /InnoDB: Log record type 55, page 151:488\. Log parsing proceeded successfully up to 1213973\. Previous log record type 56, is multi 0 Recv offset 9, prev 0/ in mysqld.1.err
FOUND 1 /len 22. hex 38000000000012860cb7809781e80006626f67757300. asc 8 bogus / in mysqld.1.err
FOUND 1 /InnoDB: Set innodb_force_recovery to ignore this error/ in mysqld.1.err
# Test a corrupted MLOG_FILE_NAME record.
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid block
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
FOUND 1 /InnoDB: Invalid log block checksum. block: 2372 checkpoint no: 1 expected: 2454333373 found: 150151/ in mysqld.1.err
# valid header, invalid checkpoint 1, valid checkpoint 2, invalid log record
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@ -97,8 +97,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Obtaining redo log encryption key version 1 failed/ in mysqld.1.err
FOUND /InnoDB: Decrypting checkpoint failed/ in mysqld.1.err
FOUND 1 /InnoDB: Obtaining redo log encryption key version 1 failed/ in mysqld.1.err
FOUND 1 /InnoDB: Decrypting checkpoint failed/ in mysqld.1.err
ib_buffer_pool
ib_logfile0
ib_logfile1

View File

@ -6,14 +6,14 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002'/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002'/ in mysqld.1.err
# Remove undo001,undo002,ibdata1,ibdata2,ib_logfile1,ib_logfile2,ib_logfile101
# Start mysqld with non existent innodb_log_group_home_dir
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+/ in mysqld.1.err
FOUND 1 /File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+/ in mysqld.1.err
# Remove ibdata1 & ibdata2
# Successfully let InnoDB create tablespaces
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
@ -27,7 +27,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /The innodb_system data file 'ibdata1' was not found but one of the other data files 'ibdata2' exists/ in mysqld.1.err
FOUND 1 /The innodb_system data file 'ibdata1' was not found but one of the other data files 'ibdata2' exists/ in mysqld.1.err
bak_ib_logfile0
bak_ib_logfile1
bak_ib_logfile2
@ -49,8 +49,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages/ in mysqld.1.err
FOUND /InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages/ in mysqld.1.err
FOUND 1 /InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing/ in mysqld.1.err
bak_ib_logfile0
bak_ib_logfile1
bak_ib_logfile2
@ -88,7 +88,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: undo tablespace .*undo001.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\./ in mysqld.1.err
FOUND 1 /InnoDB: undo tablespace .*undo001.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\./ in mysqld.1.err
bak_ib_logfile0
bak_ib_logfile1
bak_ib_logfile2
@ -175,7 +175,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /undo tablespace .*undo003.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\./ in mysqld.1.err
FOUND 1 /undo tablespace .*undo003.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\./ in mysqld.1.err
bak_ib_logfile0
bak_ib_logfile1
bak_ib_logfile2
@ -207,7 +207,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Unable to open undo tablespace.*undo002/ in mysqld.1.err
FOUND 1 /InnoDB: Unable to open undo tablespace.*undo002/ in mysqld.1.err
bak_ib_logfile0
bak_ib_logfile1
bak_ib_logfile2
@ -244,7 +244,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Unable to open undo tablespace.*undo001/ in mysqld.1.err
FOUND 1 /InnoDB: Unable to open undo tablespace.*undo001/ in mysqld.1.err
bak_ib_logfile0
bak_ib_logfile1
bak_ib_logfile2
@ -340,7 +340,7 @@ WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
1
1
FOUND /Resizing redo log from 1\*\d+ to 3\*\d+ pages; LSN=\d+/ in mysqld.1.err
FOUND 1 /Resizing redo log from 1\*\d+ to 3\*\d+ pages; LSN=\d+/ in mysqld.1.err
# Cleanup
bak_ib_logfile0
bak_ib_logfile1

View File

@ -14,30 +14,30 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID/ in mysqld.1.err
FOUND 1 /InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID.*/ in mysqld.1.err
# Fault 2: Wrong space_id in a dirty file, and a missing file.
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Ignoring data file '.*t1.ibd' with space ID/ in mysqld.1.err
FOUND /InnoDB: Tablespace \d+ was not found at.*t3.ibd/ in mysqld.1.err
FOUND 1 /InnoDB: Ignoring data file '.*t1.ibd' with space ID.*/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace \d+ was not found at.*t3.ibd.*/ in mysqld.1.err
# Fault 3: Wrong space_id in a dirty file, and no missing file.
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Ignoring data file '.*t[23].ibd' with space ID/ in mysqld.1.err
FOUND /InnoDB: Tablespace \d+ was not found at .*t1.ibd/ in mysqld.1.err
FOUND /InnoDB: Tablespace \d+ was not found at .*t3.ibd/ in mysqld.1.err
FOUND /InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace/ in mysqld.1.err
FOUND 1 /InnoDB: Ignoring data file '.*t[23].ibd' with space ID.*/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t1.ibd.*/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t3.ibd.*/ in mysqld.1.err
FOUND 1 /InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*/ in mysqld.1.err
# Fault 4: Missing data file
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*/ in mysqld.1.err
# Fault 5: Wrong type of data file
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
@ -47,8 +47,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /\[ERROR\] InnoDB: Cannot read first page of .*t2.ibd/ in mysqld.1.err
FOUND /\[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Cannot read first page of .*t2.ibd.*/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages.*/ in mysqld.1.err
SELECT * FROM t2;
a
9
@ -81,20 +81,20 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
FOUND /\[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages/ in mysqld.1.err
FOUND /\[ERROR\] InnoDB: Cannot read first page of .*u2.ibd/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages.*/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Cannot read first page of .*u2.ibd.*/ in mysqld.1.err
# Fault 7: Missing or wrong data file and innodb_force_recovery
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
FOUND /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace/ in mysqld.1.err
FOUND /\[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' for space ID \d+ because the target file exists/ in mysqld.1.err
FOUND /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
FOUND /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace/ in mysqld.1.err
FOUND /\[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*/ in mysqld.1.err
FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' for space ID \d+ because the target file exists.*/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*/ in mysqld.1.err
FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*/ in mysqld.1.err
FOUND 1 /\[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!.*/ in mysqld.1.err
DROP TABLE u1,u2,u3,u6;
# List of files:
SHOW TABLES;

View File

@ -7,8 +7,8 @@ CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
# Kill the server
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND /InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either/ in mysqld.1.err
FOUND 1 /InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND /srv_prepare_to_delete_redo_log_files: ib_log: MLOG_CHECKPOINT.* written/ in mysqld.1.err
FOUND 1 /srv_prepare_to_delete_redo_log_files: ib_log: MLOG_CHECKPOINT.* written/ in mysqld.1.err
DROP TABLE t1;

View File

@ -1,13 +1,11 @@
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (42);
# Kill and restart: --innodb-log-file-size=6M
SELECT * FROM t1;
a
INSERT INTO t1 VALUES (42);
BEGIN;
DELETE FROM t1;
# Kill and restart: --innodb-log-files-in-group=3 --innodb-log-file-size=5M
SELECT * FROM t1;
a
42
@ -24,34 +22,48 @@ connection default;
# Kill the server
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /syntax error in innodb_log_group_home_dir/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Starting crash recovery from checkpoint LSN=.*/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 2 /redo log from 3\*[0-9]+ to 2\*[0-9]+ pages/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 3 /redo log from 3\*[0-9]+ to 2\*[0-9]+ pages/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 2 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 4 /redo log from 3\*[0-9]+ to 2\*[0-9]+ pages/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Cannot create log files in read-only mode/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of innodb_page_size/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err
FOUND 1 /InnoDB: Renaming log file .*ib_logfile101 to .*ib_logfile0/ in mysqld.1.err
SELECT * FROM t1;
a
42

View File

@ -13,7 +13,6 @@ SET GLOBAL innodb_flush_log_at_trx_commit=1;
BEGIN;
INSERT INTO t VALUES(0);
ROLLBACK;
# Kill and restart: --innodb-force-recovery=3
disconnect con1;
SELECT * FROM t;
a

View File

@ -138,18 +138,23 @@ Tables_in_test
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
ERROR HY000: Can't create table `test`.`t1` (errno: 165 "Table is read only")
# test various bad start-up parameters
FOUND 1 /innodb_temporary and innodb_system file names seem to be the same/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /support raw device/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 2 /support raw device/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /The innodb_temporary data file 'ibtmp1' must be at least/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: syntax error in file path/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS

View File

@ -6,7 +6,6 @@ UPDATE t1 set a=2;
XA END 'x';
XA PREPARE 'x';
connection default;
# Kill and restart
disconnect con1;
connect con1,localhost,root;
SELECT * FROM t1 LOCK IN SHARE MODE;

View File

@ -251,7 +251,8 @@ set global innodb_flush_log_at_trx_commit=1;
INSERT INTO t9 VALUES(100000000200);
DELETE FROM t9 WHERE a = 100000000200;
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
INSERT INTO t1 VALUES(0);
SELECT a AS `Expect 126` FROM t1 ORDER BY a DESC LIMIT 1;
@ -306,7 +307,7 @@ RENAME TABLE t9 to t19;
INSERT INTO t19 VALUES(0), (0);
SELECT * FROM t19;
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
INSERT INTO t1 VALUES(0), (0);
SELECT * FROM t1;
@ -400,7 +401,7 @@ while ($i) {
--enable_query_log
ROLLBACK;
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
INSERT INTO t3 VALUES(0);
SELECT MAX(a) AS `Expect 120` FROM t3;
@ -494,7 +495,7 @@ UPDATE t33 SET a = 10 WHERE a = 1;
INSERT INTO t33 VALUES(2, NULL);
COMMIT;
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
--echo # This will not insert 0
INSERT INTO t31(a) VALUES(6), (0);

View File

@ -70,7 +70,8 @@ SELECT a FROM t1;
BEGIN;
INSERT INTO t2 VALUES (42);
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
disconnect con1;
disconnect con2;
@ -138,7 +139,8 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern';
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
disconnect con2;
connection default;
@ -177,7 +179,8 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: after_row_upd_extern';
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
disconnect con2;
connection default;

View File

@ -84,7 +84,8 @@ SELECT * FROM bug_53756;
START TRANSACTION;
INSERT INTO bug_53756 VALUES (666,666);
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
--disconnect con1
--disconnect con2
--disconnect con3

View File

@ -33,7 +33,8 @@ XA PREPARE '789';
CONNECT (con3,localhost,root,,);
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
COMMIT;

View File

@ -4,6 +4,9 @@
# Embedded server does not support crashing
--source include/not_embedded.inc
# start afresh
--source include/restart_mysqld.inc
--echo #
--echo # Bug#21801423 INNODB REDO LOG DOES NOT INDICATE WHEN
--echo # FILES ARE CREATED
@ -26,19 +29,12 @@ ALTER TABLE t1 DROP INDEX b, ADD INDEX (b);
--let $restart_parameters= --debug=d,ib_log
--source include/start_mysqld.inc
let SEARCH_RANGE = -50000;
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_ABORT=NOT FOUND;
# Look for at least one MLOG_FILE_CREATE2 in the error log.
# Theoretically, it may have been written by this test or an earlier test.
# FIXME: redirect the error log of the restart to a new file,
# and ensure that we have exactly 2 records there.
# ensure that we have exactly 2 records there.
let SEARCH_PATTERN=scan .*: multi-log rec MLOG_FILE_CREATE2.*page .*:0;
--source include/search_pattern_in_file.inc
# Look for at least one MLOG_INDEX_LOAD in the error log.
# Theoretically, it may have been written by this test or an earlier test.
# FIXME: redirect the error log of the restart to a new file,
# and ensure that we have exactly 3 records there.
# ensure that we have exactly 3 records there.
let SEARCH_PATTERN=scan .*: log rec MLOG_INDEX_LOAD;
--source include/search_pattern_in_file.inc

View File

@ -20,7 +20,6 @@ call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
let bugdir= $MYSQLTEST_VARDIR/tmp/log_corruption;
--mkdir $bugdir
--let SEARCH_RANGE = -50000
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES

View File

@ -26,7 +26,6 @@ let bugdir= $MYSQLTEST_VARDIR/tmp/log_file;
--mkdir $bugdir
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_RANGE = -100000;
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');

View File

@ -30,7 +30,6 @@ COMMIT;
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_RANGE= -50000;
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
@ -39,7 +38,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# checkpoint after the INSERT. That is what we checked above.
--source include/start_mysqld.inc
eval $check_no_innodb;
let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID;
let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Another data file called .*t1.ibd exists with the same space ID.*;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@ -54,10 +53,10 @@ let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t2.ibd' with space ID \d+. Ano
--source include/start_mysqld.inc
eval $check_no_innodb;
let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t1.ibd' with space ID;
let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t1.ibd' with space ID.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd;
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd.*;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@ -73,14 +72,14 @@ let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd;
--source include/start_mysqld.inc
eval $check_no_innodb;
let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t[23].ibd' with space ID;
let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t[23].ibd' with space ID.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t1.ibd;
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t1.ibd.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t3.ibd;
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t3.ibd.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace;
let SEARCH_PATTERN= InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@ -96,7 +95,7 @@ eval $check_no_innodb;
--source include/shutdown_mysqld.inc
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace;
.*InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.*;
--source include/search_pattern_in_file.inc
--echo # Fault 5: Wrong type of data file
@ -120,9 +119,9 @@ EOF
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*t2.ibd;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*t2.ibd.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages.*;
--source include/search_pattern_in_file.inc
# Restore t2.ibd
@ -214,17 +213,17 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages.*;
--source include/search_pattern_in_file.inc
# TODO: These errors should state the file name (u2.ibd) and be ignored
# in innodb-force-recovery mode once
# Bug#18131883 IMPROVE INNODB ERROR MESSAGES REGARDING FILES
# has been fixed:
let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*u2.ibd;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*u2.ibd.*;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@ -239,26 +238,26 @@ let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*u2.ibd;
--source include/start_mysqld.inc
eval $check_no_innodb;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace;
let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' for space ID \d+ because the target file exists;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' for space ID \d+ because the target file exists.*;
--source include/search_pattern_in_file.inc
--remove_file $MYSQLD_DATADIR/test/u6.ibd
--source include/restart_mysqld.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace;
let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace.*;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= \[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!;
let SEARCH_PATTERN= \[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!.*;
--source include/search_pattern_in_file.inc
--let $restart_parameters=

View File

@ -32,7 +32,6 @@ CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
SELECT * FROM t1;
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_RANGE = -50000
--let SEARCH_PATTERN = InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either
--source include/search_pattern_in_file.inc

View File

@ -29,7 +29,8 @@ BEGIN;
INSERT INTO t1 VALUES (42);
let $restart_parameters = --innodb-log-file-size=6M;
--source include/kill_and_restart_mysqld.inc
let $shutdown_timeout=0;
--source include/restart_mysqld.inc
SELECT * FROM t1;
@ -38,7 +39,8 @@ BEGIN;
DELETE FROM t1;
let $restart_parameters = --innodb-log-files-in-group=3 --innodb-log-file-size=5M;
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
let $shutdown_timeout=;
SELECT * FROM t1;
@ -46,7 +48,6 @@ INSERT INTO t1 VALUES (0),(123);
let MYSQLD_DATADIR= `select @@datadir`;
let SEARCH_ABORT = NOT FOUND;
let SEARCH_RANGE= -50000;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
BEGIN;
@ -73,7 +74,7 @@ let SEARCH_PATTERN= syntax error in innodb_log_group_home_dir;
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: Starting crash recovery from checkpoint LSN=;
let SEARCH_PATTERN= InnoDB: Starting crash recovery from checkpoint LSN=.*;
--source include/search_pattern_in_file.inc
--let $restart_parameters= --debug=d,innodb_log_abort_3

View File

@ -20,7 +20,9 @@ BEGIN;
INSERT INTO t VALUES(0);
ROLLBACK;
--let $restart_parameters= --innodb-force-recovery=3
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout= 0
--source include/restart_mysqld.inc
--let $shutdown_timeout= 30
--disconnect con1
SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

View File

@ -122,7 +122,6 @@ create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb
--echo # test various bad start-up parameters
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_RANGE = -50000;
let SEARCH_ABORT = NOT FOUND;
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');

View File

@ -15,7 +15,8 @@ connect (con1,localhost,root);
XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x';
connection default;
--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
disconnect con1;
connect (con1,localhost,root);

View File

@ -23,7 +23,6 @@ DELETE FROM articles LIMIT 1;
ROLLBACK;
disconnect flush_redo_log;
connection default;
# Kill and restart
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...');
CREATE FULLTEXT INDEX idx ON articles (title,body);
@ -52,7 +51,6 @@ DELETE FROM articles LIMIT 1;
ROLLBACK;
disconnect flush_redo_log;
connection default;
# Kill and restart
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...');
SELECT * FROM articles
@ -83,7 +81,6 @@ INSERT INTO articles VALUES
BEGIN;
INSERT INTO articles VALUES
(100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
# Kill and restart
INSERT INTO articles VALUES (8, 12, 'MySQL Tutorial','DBMS stands for DataBase ...');
SELECT * FROM articles WHERE MATCH (title, body)
AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE);

View File

@ -47,7 +47,8 @@ ROLLBACK;
--disconnect flush_redo_log
--connection default
--source include/kill_and_restart_mysqld.inc
let $shutdown_timeout=0;
--source include/restart_mysqld.inc
# This insert will re-initialize the Doc ID counter, it should not crash
INSERT INTO articles (title,body) VALUES
@ -85,7 +86,7 @@ ROLLBACK;
--disconnect flush_redo_log
--connection default
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
# This insert will re-initialize the Doc ID counter, it should not crash
INSERT INTO articles (title,body) VALUES
@ -126,7 +127,7 @@ BEGIN;
INSERT INTO articles VALUES
(100, 200, 'MySQL Tutorial','DBMS stands for DataBase ...');
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
# This would re-initialize the FTS index and do the re-tokenization
# of above records

View File

@ -14,16 +14,16 @@ insert into t1 values(3,"compressed table");
[2]: check the innochecksum with full form --strict-check=crc32
[3]: check the innochecksum with short form -C crc32
[4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
FOUND /Error: --no-check must be associated with --write option./ in my_restart.err
FOUND 1 /Error: --no-check must be associated with --write option./ in my_restart.err
[5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
FOUND /Error: --no-check must be associated with --write option./ in my_restart.err
FOUND 1 /Error: --no-check must be associated with --write option./ in my_restart.err
[6]: check the innochecksum with full form strict-check & no-check , an error is expected
FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
FOUND 1 /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[7]: check the innochecksum with short form strict-check & no-check , an error is expected
FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
FOUND 1 /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[8]: check the innochecksum with short & full form combination
# strict-check & no-check, an error is expected
FOUND /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
FOUND 1 /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[9]: check the innochecksum with full form --strict-check=innodb
[10]: check the innochecksum with full form --strict-check=none
# when server Default checksum=crc32
@ -32,16 +32,16 @@ FOUND /Error: --strict-check option cannot be used together with --no-check opti
[12]: check the innochecksum with short form -C none
# when server Default checksum=crc32
[13]: check strict-check with invalid values
FOUND /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'crc\' to \'strict-check\'/ in my_restart.err
FOUND /Error while setting value \'no\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'crc\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'no\' to \'strict-check\'/ in my_restart.err
[14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
# Also check the long form of write option.
[14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
@ -85,7 +85,7 @@ c1 c2
1 Innochecksum InnoDB1
# Stop server
[18]:check Innochecksum with invalid write options
FOUND /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
FOUND /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
FOUND /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
DROP TABLE tab1;

View File

@ -206,10 +206,10 @@ Filename::tab#.ibd
# allow-mismatches,page,start-page,end-page
[9]: check the both short and long options "page" and "start-page" when
# seek value is larger than file size.
FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
# innochecksum will fail with error code: 1
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err

View File

@ -174,7 +174,7 @@ INSERT INTO t4 VALUES (2);
connection slave;
include/wait_for_slave_sql_error.inc [errno=1590]
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
FOUND 1 /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

@ -49,8 +49,8 @@ a
3
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 occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
FOUND 1 /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 1 /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
connection master;
DROP TABLE t1;
connection master;

View File

@ -68,7 +68,6 @@ if(!$log_error_)
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
}
--let SEARCH_FILE=$log_error_
--let SEARCH_RANGE=-50000
--let SEARCH_PATTERN=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
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590

View File

@ -9,7 +9,6 @@ sync_slave_with_master;
source include/stop_slave.inc;
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/slave_log.err;
let SEARCH_PATTERN=Error reading packet from server: Lost connection;
let SEARCH_RANGE= -50000;
source include/search_pattern_in_file.inc;
source include/start_slave.inc;

View File

@ -308,3 +308,34 @@ DROP FUNCTION getText;
DROP DATABASE test1;
USE test;
SET NAMES latin1;
--echo #
--echo # MDEV-11320, MySQL BUG#81810: Inconsistent sort order for blob/text between InnoDB and filesort
--echo #
CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
KEY b (b(32))
);
INSERT INTO t1 (b) VALUES ('a'), (_binary 0x1), (_binary 0x0), ('');
drop table t1;
CREATE TABLE t1 (
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
PRIMARY KEY b (b(32))
);
INSERT INTO t1 (b) VALUES ('a'), (_binary 0x1), (_binary 0x0), ('');
explain
select hex(b) from t1 force index (PRIMARY) where b<'zzz';
select hex(b) from t1 force index (PRIMARY) where b<'zzz';
explain
select hex(b) from t1 where b<'zzz' order by b;
select hex(b) from t1 where b<'zzz' order by b;
drop table t1;

View File

@ -28,6 +28,5 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--error 1
--exec $MYSQLD_CMD --enable-named-pipe --skip-networking --log-error=second-mysqld.err
let SEARCH_FILE=$MYSQLD_DATADIR/second-mysqld.err;
let SEARCH_RANGE= -50;
let SEARCH_PATTERN=\[ERROR\] Create named pipe failed;
source include/search_pattern_in_file.inc;

View File

@ -1857,3 +1857,195 @@ DROP TABLE t1;
--echo #
--echo # End of 10.1 tests
--echo #
--echo #
--echo # MDEV-10454: range access keys extracted
--echo # from <row> IN (<row value list>)
--echo #
create table t1(a int, b int, c varchar(16), key idx(a,b)) engine=myisam;
insert into t1 values
(1,1,'xx'), (2,2,'yyy'), (3,3,'zzzz'), (1,2,'zz'), (1,3,'x'),
(2,3,'yy'), (4,5,'ww'), (7,8,'xxxxx'), (4,3,'zyx'), (1,2,'uuu'),
(2,1,'w'), (5,5,'wx'), (2,3,'ww'), (7,7,'xxxyy'), (3,3,'zyxw'),
(3,2,'uuuw'), (2,2,'wxz'), (5,5,'xw'), (12,12,'xx'), (12,12,'y'),
(13,13,'z'), (11,12,'zz'), (11,13,'x'), (12,13,'y'), (14,15,'w'),
(17,18,'xx'), (14,13,'zx'), (11,12,'u'), (12,11,'w'), (5,5,'wx'),
(12,13,'ww'), (17,17,'xxxyy'), (13,13,'zyxw'), (13,12,'uuuw'), (12,12,'wxz'),
(15,15,'xw'), (1,1,'xa'), (2,2,'yya'), (3,3,'zzza'), (1,2,'za'),
(1,3,'xb'), (2,3,'ya'), (4,5,'wa'), (7,8,'xxxxa'), (4,3,'zya'),
(1,2,'uua'), (2,1,'wb'), (5,5,'wc'), (2,3,'wa'), (7,7,'xxxya'),
(3,3,'zyxa'), (3,2,'uuua'), (2,2,'wxa'), (5,5,'xa'), (12,12,'xa'),
(22,12,'yb'), (23,13,'zb'), (21,12,'za'), (24,13,'c'), (32,13,'d'),
(34,15,'wd'), (47,18,'xa'), (54,13,'za'), (51,12,'ub'), (52,11,'wc'),
(5,5,'wd'), (62,13,'wa'), (67,17,'xxxya'), (63,13,'zyxa'), (73,12,'uuua'),
(82,12,'wxa'), (85,15,'xd');
--echo # range access to t1 by 2-component keys for index idx
let $q1=
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
eval explain $q1;
eval explain format=json $q1;
eval $q1;
eval prepare stmt from "$q1";
execute stmt;
execute stmt;
deallocate prepare stmt;
--echo # range access to t1 by 1-component keys for index idx
let $q2=
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
eval explain $q2;
eval explain format=json $q2;
eval $q2;
--echo # range access to t1 by 1-component keys for index idx
let $q3=
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
eval explain $q3;
eval explain format=json $q3;
eval $q3;
# this setting should be removed after fixes for mdev-12186, mdev-12187
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='index_merge=off';
create table t2(
d int, e int, key idx1(d), key idx2(e), f varchar(32)
) engine=myisam;
insert into t2 values
(9,5,'a'), (9,8,'b'), (9,3,'c'), (9,2,'d'), (9,1,'e'),
(6,5,'f'), (6,3,'g'), (6,7,'h'), (3,3,'i'), (6,2,'j'),
(9,5,'aa'), (9,8,'ba'), (9,3,'ca'), (2,2,'da'), (9,1,'ea'),
(6,5,'fa'), (6,3,'ga'), (6,7,'ha'), (9,3,'ia'), (6,2,'ja');
--echo # join order: (t2,t1) with ref access of t1
--echo # range access to t1 by keys for index idx1
let $q4=
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
eval explain $q4;
eval explain format=json $q4;
eval $q4;
insert into t2 values
(4,5,'a'), (7,8,'b'), (4,3,'c'), (1,2,'d'), (2,1,'e'), (5,5,'f'),
(2,3,'g'), (7,7,'h'), (3,3,'i'), (3,2,'j'), (2,2,'k'), (5,5,'l'),
(4,5,'aa'), (7,8,'bb'), (4,3,'cc'), (1,2,'dd'), (2,1,'ee'), (9,5,'ff'),
(2,3,'gg'), (7,7,'hh'), (3,3,'ii'), (3,2,'jj'), (2,2,'kk'), (9,5,'ll'),
(4,5,'aaa'), (7,8,'bbb'), (4,3,'ccc'), (1,2,'ddd'), (2,1,'eee'), (5,5,'fff'),
(2,3,'ggg'), (7,7,'hhh'), (3,3,'iii'), (3,2,'jjj'), (2,2,'kkk'), (5,5,'lll'),
(14,15,'a'), (17,18,'b'), (14,13,'c'), (11,12,'d'), (12,11,'e'), (15,15,'f'),
(12,13,'g'), (17,17,'h'), (13,13,'i'), (13,12,'j'), (12,12,'k'), (15,15,'l'),
(24,25,'a'), (27,28,'b'), (24,23,'c'), (21,22,'d'), (22,21,'e'), (25,25,'f'),
(22,23,'g'), (27,27,'h'), (23,23,'i'), (23,22,'j'), (22,22,'k'), (25,25,'l'),
(34,35,'a'), (37,38,'b'), (34,33,'c'), (31,32,'d'), (32,31,'e'), (35,35,'f'),
(32,33,'g'), (37,37,'h'), (33,33,'i'), (33,32,'j'), (32,32,'k'), (35,35,'l'),
(44,45,'a'), (47,48,'b'), (44,43,'c'), (41,42,'d'), (42,41,'e'), (45,45,'f'),
(42,43,'g'), (47,47,'h'), (43,43,'i'), (43,42,'j'), (42,42,'k'), (45,45,'l');
--echo # join order: (t1,t2) with ref access of t2
--echo # range access to t1 by 1-component keys for index idx
let $q5=
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
eval explain $q5;
eval explain format=json $q5;
eval $q5;
eval prepare stmt from "$q5";
execute stmt;
execute stmt;
deallocate prepare stmt;
insert into t1 select * from t1;
--echo # join order: (t2,t1) with ref access of t1
--echo # range access to t2 by keys for index idx2
let $q6=
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
eval explain $q6;
eval explain format=json $q6;
eval $q6;
alter table t2 drop index idx1, drop index idx2, add index idx3(d,e);
--echo # join order: (t2,t1) with ref access of t1
--echo # range access to t2 by 2-component keys for index idx3
let $q7=
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
eval explain $q7;
eval explain format=json $q7;
eval $q7;
--echo # join order: (t1,t2) with ref access of t2
--echo # range access to t1 by 1-component keys for index idx
let $q8=
select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
eval explain $q8;
eval explain format=json $q8;
eval $q8;
--echo # join order: (t1,t2) with ref access of t2
--echo # no range access
let $q9=
select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
eval explain $q9;
eval explain format=json $q9;
eval $q9;
--echo # join order: (t1,t2) with ref access of t2
--echo # range access to t1 by 1-component keys for index idx
let $q10=
select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
eval explain $q10;
eval explain format=json $q10;
eval $q10;
eval prepare stmt from "$q10";
execute stmt;
execute stmt;
deallocate prepare stmt;
create table t3 (id int primary key, v int) engine=myisam;
insert into t3 values
(3,2), (1,1), (4,12), (2,15);
--echo # join order: (t3,t1,t2) with const t3 and ref access of t2
--echo # range access to t1 by 1-component keys for index idx
let $q11=
select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
eval explain $q11;
eval explain format=json $q11;
eval $q11;
--echo # IN predicate is always FALSE
let $q12=
select * from t1,t2,t3
where id = 1 and a = d and
(a,v+1) in ((9,9),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
eval explain $q12;
eval prepare stmt from "$q12";
execute stmt;
execute stmt;
deallocate prepare stmt;
set optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -34,6 +34,5 @@ drop user user1@localhost;
--echo # MDEV-8491 - On shutdown, report the user and the host executed that.
--echo #
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_RANGE= -50000
--let SEARCH_PATTERN=mysqld(\.exe)? \(root\[root\] @ localhost \[(::1)?\]\): Normal shutdown
--source include/search_pattern_in_file.inc

View File

@ -5387,6 +5387,7 @@ create view v1 as select 1;
--let $MYSQLD_DATADIR= `select @@datadir`
--let SEARCH_FILE= $MYSQLD_DATADIR/test/v1.frm
--let SEARCH_RANGE= 50000
--let SEARCH_PATTERN=mariadb-version
--source include/search_pattern_in_file.inc

View File

@ -10,7 +10,6 @@ set @@wait_timeout=1;
sleep 2;
connection default;
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_RANGE= -50;
let SEARCH_PATTERN= Aborted.*Got timeout reading communication packets;
source include/search_pattern_in_file.inc;
set global log_warnings=@@log_warnings;

View File

@ -17,24 +17,6 @@
#include <my_bit.h>
const char _my_bits_nbits[256] = {
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,
};
/*
perl -e 'print map{", 0x".unpack H2,pack B8,unpack b8,chr$_}(0..255)'

View File

@ -51,10 +51,11 @@ ENDIF()
FIND_LIBRARY(AWS_CPP_SDK_CORE NAMES aws-cpp-sdk-core PATH_SUFFIXES "${SDK_INSTALL_BINARY_PREFIX}")
FIND_LIBRARY(AWS_CPP_SDK_KMS NAMES aws-cpp-sdk-kms PATH_SUFFIXES "${SDK_INSTALL_BINARY_PREFIX}")
SET(CMAKE_REQUIRED_FLAGS ${CXX11_FLAGS})
CHECK_INCLUDE_FILE_CXX(aws/kms/KMSClient.h HAVE_AWS_HEADERS)
FIND_PATH(AWS_CPP_SDK_INCLUDE_DIR NAMES aws/kms/KMSClient.h)
IF(AWS_CPP_SDK_CORE AND AWS_CPP_SDK_KMS AND HAVE_AWS_HEADERS)
IF(AWS_CPP_SDK_CORE AND AWS_CPP_SDK_KMS AND AWS_CPP_SDK_INCLUDE_DIR)
# AWS C++ SDK installed
INCLUDE_DIRECTORIES(${AWS_CPP_SDK_INCLUDE_DIR})
SET(AWS_SDK_LIBS ${AWS_CPP_SDK_CORE} ${AWS_CPP_SDK_KMS})
ELSE()
OPTION(AWS_SDK_EXTERNAL_PROJECT "Allow download and build AWS C++ SDK" OFF)
@ -95,13 +96,27 @@ ELSE()
SET(EXTRA_SDK_CMAKE_FLAGS ${EXTRA_SDK_CMAKE_FLAGS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
ENDIF()
SET(byproducts )
# We do not need to build the whole SDK , just 2 of its libs
set(AWS_SDK_LIBS aws-cpp-sdk-core aws-cpp-sdk-kms)
FOREACH(lib ${AWS_SDK_LIBS})
ADD_LIBRARY(${lib} STATIC IMPORTED GLOBAL)
ADD_DEPENDENCIES(${lib} aws_sdk_cpp)
SET(loc "${CMAKE_CURRENT_BINARY_DIR}/aws_sdk_cpp/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
IF(CMAKE_VERSION VERSION_GREATER "3.1")
SET(byproducts ${byproducts} BUILD_BYPRODUCTS ${loc})
ENDIF()
SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LOCATION ${loc})
ENDFOREACH()
SET(AWS_SDK_PATCH_COMMAND )
ExternalProject_Add(
aws_sdk_cpp
GIT_REPOSITORY "https://github.com/awslabs/aws-sdk-cpp.git"
GIT_TAG "1.0.8"
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_BINARY_DIR}/aws-sdk-cpp"
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/aws-sdk-cpp"
${byproducts}
CMAKE_ARGS
-DBUILD_ONLY=kms
-DBUILD_SHARED_LIBS=OFF
@ -111,34 +126,28 @@ ELSE()
"-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} ${PIC_FLAG}"
"-DCMAKE_CXX_FLAGS_MINSIZEREL=${CMAKE_CXX_FLAGS_MINSIZEREL} ${PIC_FLAG}"
${EXTRA_SDK_CMAKE_FLAGS}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/aws_sdk_cpp
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/aws_sdk_cpp
TEST_COMMAND ""
)
SET_TARGET_PROPERTIES(aws_sdk_cpp PROPERTIES EXCLUDE_FROM_ALL TRUE)
# We do not need to build the whole SDK , just 2 of its libs
set(AWS_SDK_LIBS aws-cpp-sdk-core aws-cpp-sdk-kms)
FOREACH(lib ${AWS_SDK_LIBS})
ADD_LIBRARY(${lib} STATIC IMPORTED GLOBAL)
ADD_DEPENDENCIES(${lib} aws_sdk_cpp)
SET(loc "${CMAKE_BINARY_DIR}/aws_sdk_cpp/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LOCATION ${loc})
IF(WIN32)
SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "bcrypt;winhttp;wininet;userenv")
ELSE()
SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${SSL_LIBRARIES};${CURL_LIBRARIES};${UUID_LIBRARIES}")
ENDIF()
ENDFOREACH()
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# Need whole-archive , otherwise static libraries are not linked
SET(AWS_SDK_LIBS -Wl,--whole-archive ${AWS_SDK_LIBS} -Wl,--no-whole-archive)
ENDIF()
SET_TARGET_PROPERTIES(aws_sdk_cpp PROPERTIES EXCLUDE_FROM_ALL TRUE)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/aws_sdk_cpp/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/aws_sdk_cpp/include)
ENDIF()
ADD_DEFINITIONS(${SSL_DEFINES}) # Need to know whether openssl should be initialized
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
IF(WIN32)
SET(AWS_CPP_SDK_DEPENDENCIES bcrypt winhttp wininet userenv version)
ELSE()
SET(AWS_CPP_SDK_DEPENDENCIES ${SSL_LIBRARIES} ${CURL_LIBRARIES} ${UUID_LIBRARIES})
ENDIF()
MYSQL_ADD_PLUGIN(aws_key_management aws_key_management_plugin.cc
LINK_LIBRARIES ${AWS_SDK_LIBS}
LINK_LIBRARIES ${AWS_SDK_LIBS} ${AWS_CPP_SDK_DEPENDENCIES}
COMPONENT aws-key-management)

View File

@ -8203,7 +8203,7 @@ void Field_blob::sort_string(uchar *to,uint length)
uchar *blob;
uint blob_length=get_length();
if (!blob_length)
if (!blob_length && field_charset->pad_char == 0)
bzero(to,length);
else
{

View File

@ -3312,7 +3312,7 @@ public:
memcpy(ptr,length,packlength);
memcpy(ptr+packlength, &data,sizeof(char*));
}
void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, const uchar *data)
{
uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*);
store_length(ptr_ofs, packlength, length);

View File

@ -2212,7 +2212,8 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
if (hton->state == SHOW_OPTION_YES &&
hton->start_consistent_snapshot)
{
hton->start_consistent_snapshot(hton, thd);
if (hton->start_consistent_snapshot(hton, thd))
return TRUE;
*((bool *)arg)= false;
}
return FALSE;
@ -2220,7 +2221,7 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
int ha_start_consistent_snapshot(THD *thd)
{
bool warn= true;
bool err, warn= true;
/*
Holding the LOCK_commit_ordered mutex ensures that we get the same
@ -2230,9 +2231,15 @@ int ha_start_consistent_snapshot(THD *thd)
have a consistent binlog position.
*/
mysql_mutex_lock(&LOCK_commit_ordered);
plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);
err= plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);
mysql_mutex_unlock(&LOCK_commit_ordered);
if (err)
{
ha_rollback_trans(thd, true);
return 1;
}
/*
Same idea as when one wants to CREATE TABLE in one engine which does not
exist:
@ -5428,7 +5435,7 @@ int handler::compare_key(key_range *range)
This is used by index condition pushdown implementation.
*/
int handler::compare_key2(key_range *range)
int handler::compare_key2(key_range *range) const
{
int cmp;
if (!range)

View File

@ -3199,7 +3199,7 @@ public:
virtual int read_range_next();
void set_end_range(const key_range *end_key);
int compare_key(key_range *range);
int compare_key2(key_range *range);
int compare_key2(key_range *range) const;
virtual int ft_init() { return HA_ERR_WRONG_COMMAND; }
void ft_end() { ft_handler=NULL; }
virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
@ -3949,10 +3949,16 @@ private:
void mark_trx_read_write_internal();
bool check_table_binlog_row_based_internal(bool binlog_row);
/* Private helpers */
protected:
/*
These are intended to be used only by handler::ha_xxxx() functions
However, engines that implement read_range_XXX() (like MariaRocks)
or embed other engines (like ha_partition) may need to call these also
*/
inline void increment_statistics(ulong SSV::*offset) const;
inline void decrement_statistics(ulong SSV::*offset) const;
private:
/*
Low-level primitives for storage engines. These should be
overridden by the storage engine class. To call these methods, use

View File

@ -2108,6 +2108,7 @@ public:
void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
table_map usable_tables, SARGABLE_PARAM **sargables);
SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
SEL_TREE *get_func_row_mm_tree(RANGE_OPT_PARAM *param, Item_row *key_row);
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
{
/*
@ -2169,6 +2170,7 @@ public:
cmp_item *make_same();
void store_value_by_template(THD *thd, cmp_item *tmpl, Item *);
friend class Item_func_in;
cmp_item *get_comparator(uint i) { return comparators[i]; }
};
@ -2182,6 +2184,7 @@ public:
uchar *get_value(Item *item);
friend class Item_func_in;
Item_result result_type() { return ROW_RESULT; }
cmp_item *get_cmp_item() { return &tmp; }
};
/* Functions used by where clause */

View File

@ -120,6 +120,13 @@ public:
bool check_cols(uint c);
bool null_inside() { return with_null; };
void bring_value();
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
{
Item_args::propagate_equal_fields(thd, Context_identity(), cond);
return this;
}
bool check_vcol_func_processor(void *arg) {return FALSE; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_row>(thd, mem_root, this); }

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