summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--client/mysql.cc1
-rw-r--r--cmake/install_macros.cmake24
-rw-r--r--cmake/plugin.cmake22
-rw-r--r--extra/jemalloc/src/ctl.c2
-rw-r--r--include/mysql/service_logger.h2
-rw-r--r--libmysql/libmysql.c4
-rw-r--r--libmysqld/CMakeLists.txt2
-rw-r--r--mysql-test/CMakeLists.txt24
-rw-r--r--mysql-test/lib/My/Suite.pm1
-rw-r--r--mysql-test/lib/mtr_cases.pm67
-rwxr-xr-xmysql-test/mysql-test-run.pl70
-rw-r--r--mysql-test/r/derived.result14
-rw-r--r--mysql-test/r/func_time.result31
-rw-r--r--mysql-test/r/merge.result7
-rw-r--r--mysql-test/r/ps.result23
-rw-r--r--mysql-test/r/table_elim.result28
-rw-r--r--mysql-test/r/union.result15
-rw-r--r--mysql-test/t/derived.test10
-rw-r--r--mysql-test/t/func_time.test12
-rw-r--r--mysql-test/t/merge.test9
-rw-r--r--mysql-test/t/ps.test22
-rw-r--r--mysql-test/t/table_elim.test31
-rw-r--r--mysql-test/t/union.test16
-rw-r--r--mysys/my_addr_resolve.c4
-rw-r--r--plugin/query_response_time/mysql-test/query_response_time/suite.pm2
-rw-r--r--sql-common/my_time.c4
-rw-r--r--sql/item.h7
-rw-r--r--sql/item_func.h5
-rw-r--r--sql/item_timefunc.cc4
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/opt_table_elimination.cc15
-rw-r--r--sql/sql_base.cc4
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_select.cc5
-rw-r--r--sql/sql_time.cc19
-rw-r--r--sql/sql_time.h1
-rw-r--r--sql/sql_union.cc18
-rw-r--r--sql/table.cc6
-rw-r--r--storage/innobase/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff18
-rw-r--r--storage/innobase/mysql-test/storage_engine/trx/disabled.def2
-rw-r--r--storage/innobase/mysql-test/storage_engine/trx/level_read_committed.rdiff11
-rw-r--r--storage/innobase/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff11
-rw-r--r--storage/maria/ma_check.c2
-rw-r--r--storage/myisammrg/ha_myisammrg.cc43
-rw-r--r--storage/myisammrg/mysql-test/storage_engine/disabled.def2
-rw-r--r--storage/tokudb/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/CMakeLists.txt1
-rw-r--r--storage/tokudb/mysql-test/rpl/suite.pm1
-rw-r--r--storage/tokudb/mysql-test/tokudb/suite.pm3
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_1.test1
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_10.test1
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/hotindex-insert-bigchar.opt1
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test4
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test4
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test4
-rw-r--r--storage/tokudb/mysql-test/tokudb_add_index/suite.pm6
-rw-r--r--storage/tokudb/mysql-test/tokudb_add_index/t/add_index_6.test5
-rw-r--r--storage/tokudb/mysql-test/tokudb_alter_table/suite.pm6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result9
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_2.result18
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result9
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/suite.pm6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_2.test12
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_3.test6
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/suite.pm6
-rw-r--r--storage/xtradb/fil/fil0fil.c14
-rw-r--r--support-files/compiler_warnings.supp5
-rw-r--r--support-files/rpm/server-postin.sh4
-rw-r--r--tests/bug25714.c2
71 files changed, 584 insertions, 182 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3164f91c84e..dfa63cb8c92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,12 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
CMAKE_POLICY(VERSION 2.8)
endif()
+# explicitly set the policy to OLD
+# (cannot use NEW, not everyone is on cmake-2.8.12 yet)
+IF(POLICY CMP0022)
+ CMAKE_POLICY(SET CMP0022 OLD)
+ENDIF()
+
MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
diff --git a/client/mysql.cc b/client/mysql.cc
index 4e41dbadca6..4f9b4c3bc92 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1383,7 +1383,6 @@ sig_handler handle_sigint(int sig)
mysql_real_query(kill_mysql, kill_buffer, (uint) strlen(kill_buffer));
mysql_close(kill_mysql);
tee_fprintf(stdout, "Ctrl-C -- query killed. Continuing normally.\n");
- interrupted_query= 0;
if (in_com_source)
aborted= 1; // Abort source command
return;
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 9f4148342a7..f2e474395dc 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -376,3 +376,27 @@ FUNCTION(INSTALL_DEBUG_TARGET target)
ENDIF()
ENDFUNCTION()
+
+FUNCTION(INSTALL_MYSQL_TEST from to)
+ IF(INSTALL_MYSQLTESTDIR)
+ INSTALL(
+ DIRECTORY ${from}
+ DESTINATION "${INSTALL_MYSQLTESTDIR}/${to}"
+ USE_SOURCE_PERMISSIONS
+ COMPONENT Test
+ PATTERN "var/" EXCLUDE
+ PATTERN "lib/My/SafeProcess" EXCLUDE
+ PATTERN "lib/t*" EXCLUDE
+ PATTERN "CPack" EXCLUDE
+ PATTERN "CMake*" EXCLUDE
+ PATTERN "mtr.out*" EXCLUDE
+ PATTERN ".cvsignore" EXCLUDE
+ PATTERN "*.am" EXCLUDE
+ PATTERN "*.in" EXCLUDE
+ PATTERN "*.vcxproj" EXCLUDE
+ PATTERN "*.vcxproj.filters" EXCLUDE
+ PATTERN "*.vcxproj.user" EXCLUDE
+ PATTERN "CTest" EXCLUDE
+ )
+ ENDIF()
+ENDFUNCTION()
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 110a49167d3..59bbaadfb78 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -27,23 +27,6 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
-# Append collections files for the plugin to the common files
-# Make sure we don't copy twice if running cmake again
-
-MACRO(PLUGIN_APPEND_COLLECTIONS plugin)
- SET(fcopied "${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/FilesCopied")
- IF(NOT EXISTS ${fcopied})
- FILE(GLOB collections ${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/*)
- FOREACH(cfile ${collections})
- FILE(READ ${cfile} contents)
- GET_FILENAME_COMPONENT(fname ${cfile} NAME)
- FILE(APPEND ${CMAKE_SOURCE_DIR}/mysql-test/collections/${fname} "${contents}")
- FILE(APPEND ${fcopied} "${fname}\n")
- MESSAGE(STATUS "Appended ${cfile}")
- ENDFOREACH()
- ENDIF()
-ENDMACRO()
-
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT"
@@ -238,6 +221,11 @@ MACRO(MYSQL_ADD_PLUGIN)
TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
ENDIF()
+ GET_FILENAME_COMPONENT(subpath ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+ IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mysql-test")
+ INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
+ ENDIF()
+
ENDMACRO()
diff --git a/extra/jemalloc/src/ctl.c b/extra/jemalloc/src/ctl.c
index f2ef4e60611..7ce4fc4d573 100644
--- a/extra/jemalloc/src/ctl.c
+++ b/extra/jemalloc/src/ctl.c
@@ -1109,7 +1109,7 @@ epoch_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
void *newp, size_t newlen)
{
int ret;
- uint64_t newval;
+ uint64_t newval __attribute__((unused));
malloc_mutex_lock(&ctl_mtx);
WRITE(newval, uint64_t);
diff --git a/include/mysql/service_logger.h b/include/mysql/service_logger.h
index a84c4a4f2ee..962ab2fbc0b 100644
--- a/include/mysql/service_logger.h
+++ b/include/mysql/service_logger.h
@@ -80,7 +80,7 @@ extern struct logger_service_st {
#define logger_rotate(log) (logger_service->rotate(log))
#define logger_vprintf(log, fmt, argptr) (logger_service->\
vprintf(log, fmt, argptr))
-#define logger_printf logger_service->printf
+#define logger_printf (*logger_service->printf)
#define logger_write(log, buffer, size) \
(logger_service->write(log, buffer, size))
#else
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 4306b3b774d..6cc44c26aa3 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -204,11 +204,11 @@ void STDCALL mysql_server_end()
mysql_client_plugin_deinit();
+ finish_client_errs();
+ vio_end();
#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif
- finish_client_errs();
- vio_end();
/* If library called my_init(), free memory allocated by it */
if (!org_my_init_done)
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 5696c2581dc..de0a356e80e 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -142,6 +142,8 @@ ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Development)
+INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development)
+
# Visual Studio users need debug static library
IF(MSVC)
INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR}/debug)
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 5ffbd78316c..16eb2a6f166 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -13,29 +13,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-IF(INSTALL_MYSQLTESTDIR)
-INSTALL(
- DIRECTORY .
- DESTINATION ${INSTALL_MYSQLTESTDIR}
- USE_SOURCE_PERMISSIONS
- COMPONENT Test
- PATTERN "var/" EXCLUDE
- PATTERN "lib/My/SafeProcess" EXCLUDE
- PATTERN "lib/t*" EXCLUDE
- PATTERN "CPack" EXCLUDE
- PATTERN "CMake*" EXCLUDE
- PATTERN "mtr.out*" EXCLUDE
- PATTERN ".cvsignore" EXCLUDE
- PATTERN "*.am" EXCLUDE
- PATTERN "*.in" EXCLUDE
- PATTERN "*.vcxproj" EXCLUDE
- PATTERN "*.vcxproj.filters" EXCLUDE
- PATTERN "*.vcxproj.user" EXCLUDE
- PATTERN "CTest" EXCLUDE
-)
-ENDIF()
-
-
+INSTALL_MYSQL_TEST("." ".")
IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
# Enable running mtr from build directory
diff --git a/mysql-test/lib/My/Suite.pm b/mysql-test/lib/My/Suite.pm
index b5870ea1e16..a603008fabe 100644
--- a/mysql-test/lib/My/Suite.pm
+++ b/mysql-test/lib/My/Suite.pm
@@ -3,6 +3,7 @@
package My::Suite;
+sub is_default { 0 }
sub config_files { () }
sub servers { () }
sub skip_combinations { () }
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 1327afdb426..870df115f58 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -23,7 +23,7 @@ package mtr_cases;
use strict;
use base qw(Exporter);
-our @EXPORT= qw(collect_option collect_test_cases);
+our @EXPORT= qw(collect_option collect_test_cases collect_default_suites);
use Carp;
@@ -62,6 +62,21 @@ use My::Suite;
require "mtr_misc.pl";
+# locate plugin suites, depending on whether it's a build tree or installed
+my @plugin_suitedirs;
+my $plugin_suitedir_regex;
+my $overlay_regex;
+
+if (-d '../sql') {
+ @plugin_suitedirs= ('storage/*/mysql-test', 'plugin/*/mysql-test');
+ $overlay_regex= '\b(?:storage|plugin)/(\w+)/mysql-test\b';
+} else {
+ @plugin_suitedirs= ('mysql-test/plugin/*');
+ $overlay_regex= '\bmysql-test/plugin/(\w+)\b';
+}
+$plugin_suitedir_regex= $overlay_regex;
+$plugin_suitedir_regex=~ s/\Q(\w+)\E/\\w+/;
+
# Precompiled regex's for tests to do or skip
my $do_test_reg;
my $skip_test_reg;
@@ -263,12 +278,11 @@ sub load_suite_object {
# returns a pair of (suite, suitedir)
-sub load_suite_for_file($) {
+sub suite_for_file($) {
my ($file) = @_;
- return load_suite_object($2, $1)
- if $file =~ m@^(.*/(?:storage|plugin)/\w+/mysql-test/(\w+))/@;
- return load_suite_object($2, $1) if $file =~ m@^(.*/mysql-test/suite/(\w+))/@;
- return load_suite_object('main', $1) if $file =~ m@^(.*/mysql-test)/@;
+ return ($2, $1) if $file =~ m@^(.*/$plugin_suitedir_regex/(\w+))/@o;
+ return ($2, $1) if $file =~ m@^(.*/mysql-test/suite/(\w+))/@;
+ return ('main', $1) if $file =~ m@^(.*/mysql-test)/@;
mtr_error("Cannot determine suite for $file");
}
@@ -316,10 +330,32 @@ sub parse_disabled {
}
#
+# load suite.pm files from plugin suites
+# collect the list of default plugin suites.
+# XXX currently it does not support nested suites
+#
+sub collect_default_suites(@)
+{
+ my @dirs = my_find_dir(dirname($::glob_mysql_test_dir),
+ [ @plugin_suitedirs ], '*');
+ for my $d (@dirs) {
+ next unless -f "$d/suite.pm";
+ my $sname= basename($d);
+ # ignore overlays here, otherwise we'd need accurate
+ # duplicate detection with overlay support for the default suite list
+ next if $sname eq 'main' or -d "$::glob_mysql_test_dir/suite/$sname";
+ my $s = load_suite_object($sname, $d);
+ push @_, $sname if $s->is_default();
+ }
+ return @_;
+}
+
+
+#
# processes one user-specified suite name.
# it could contain wildcards, e.g engines/*
#
-sub collect_suite_name
+sub collect_suite_name($$)
{
my $suitename= shift; # Test suite name
my $opt_cases= shift;
@@ -339,25 +375,22 @@ sub collect_suite_name
else
{
my @dirs = my_find_dir(dirname($::glob_mysql_test_dir),
- ["mysql-test/suite",
- "storage/*/mysql-test",
- "plugin/*/mysql-test"],
- [$suitename]);
+ ["mysql-test/suite", @plugin_suitedirs ],
+ $suitename);
#
# if $suitename contained wildcards, we'll have many suites and
# their overlays here. Let's group them appropriately.
#
for (@dirs) {
- m@^.*/mysql-test/(?:suite/)?(.*)$@ or confess $_;
+ m@^.*/(?:mysql-test/suite|$plugin_suitedir_regex)/(.*)$@o or confess $_;
push @{$suites{$1}}, $_;
}
}
} else {
$suites{$suitename} = [ $::glob_mysql_test_dir,
my_find_dir(dirname($::glob_mysql_test_dir),
- ["storage/*/mysql-test",
- "plugin/*/mysql-test"],
- ['main'], NOT_REQUIRED) ];
+ [ @plugin_suitedirs ],
+ 'main', NOT_REQUIRED) ];
}
my @cases;
@@ -404,7 +437,7 @@ sub collect_one_suite {
local %file_combinations = ();
local %file_in_overlay = ();
- confess $_ unless m@/(?:storage|plugin)/(\w+)/mysql-test/[\w/]*\w$@;
+ confess $_ unless m@/$overlay_regex/@o;
next unless defined $over and ($over eq '' or $over eq $1);
push @cases,
# don't add cases that take *all* data from the parent suite
@@ -1050,7 +1083,7 @@ sub get_tags_from_file($$) {
# for combinations we need to make sure that its suite object is loaded,
# even if this file does not belong to a current suite!
my $comb_file = "$suffix.combinations";
- $suite = load_suite_for_file($comb_file) if $prefix[0] eq '';
+ $suite = load_suite_object(suite_for_file($comb_file)) if $prefix[0] eq '';
my @comb;
unless ($suite->{skip}) {
my $from = "$prefix[0]$comb_file";
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 26d1bfd420a..d368e968014 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -162,32 +162,32 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
-my $DEFAULT_SUITES= join(',', map { "$_-" } qw(
- main
- archive
- binlog
- csv
- federated
- funcs_1
- funcs_2
- handler
- heap
- innodb
- maria
- multi_source
- optimizer_unfixed_bugs
- oqgraph
- parts
- percona
- perfschema
- plugins
- roles
- rpl
- sphinx
- sys_vars
- unit
- vcol
- ));
+my @DEFAULT_SUITES= qw(
+ main-
+ archive-
+ binlog-
+ csv-
+ federated-
+ funcs_1-
+ funcs_2-
+ handler-
+ heap-
+ innodb-
+ maria-
+ multi_source-
+ optimizer_unfixed_bugs-
+ oqgraph-
+ parts-
+ percona-
+ perfschema-
+ plugins-
+ roles-
+ rpl-
+ sphinx-
+ sys_vars-
+ unit-
+ vcol-
+ );
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -378,8 +378,6 @@ sub main {
# directly before it executes them, like "make test-force-pl" in RPM builds.
mtr_report("Logging: $0 ", join(" ", @ARGV));
- $DEFAULT_SUITES.=",sequence,sql_discovery,query_response_time" if $source_dist;
-
command_line_setup();
# --help will not reach here, so now it's safe to assume we have binaries
@@ -390,11 +388,6 @@ sub main {
}
- if (!$opt_suites) {
- $opt_suites= $DEFAULT_SUITES;
- }
- mtr_report("Using suites: $opt_suites") unless @opt_cases;
-
print "vardir: $opt_vardir\n";
initialize_servers();
init_timers();
@@ -403,6 +396,11 @@ sub main {
executable_setup();
+ if (!$opt_suites) {
+ $opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES);
+ }
+ mtr_report("Using suites: $opt_suites") unless @opt_cases;
+
# --debug[-common] implies we run debug server
$opt_debug_server= 1 if $opt_debug || $opt_debug_common;
@@ -2950,7 +2948,7 @@ sub check_ndbcluster_support {
mtr_report(" - enabling ndbcluster");
$ndbcluster_enabled= 1;
# Add MySQL Cluster test suites
- $DEFAULT_SUITES.=",ndb,ndb_binlog,rpl_ndb,ndb_rpl,ndb_memcache";
+ push @DEFAULT_SUITES, qw(ndb ndb_binlog rpl_ndb ndb_rpl ndb_memcache);
return;
}
@@ -6319,6 +6317,8 @@ sub usage ($) {
exit;
}
+ local $"= ','; # for @DEFAULT_SUITES below
+
print <<HERE;
$0 [ OPTIONS ] [ TESTCASE ]
@@ -6386,7 +6386,7 @@ Options to control what test suites or cases to run
suite[s]=NAME1,..,NAMEN
Collect tests in suites from the comma separated
list of suite names.
- The default is: "$DEFAULT_SUITES"
+ The default is: "@DEFAULT_SUITES"
skip-rpl Skip the replication test cases.
big-test Also run tests marked as "big". Repeat this option
twice to run only "big" tests.
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 9d31ceab4d1..699d3279e3e 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -465,6 +465,20 @@ t1.val=t3.val
;
ERROR 42S22: Unknown column 'v.val' in 'field list'
drop table t1, t2;
+#
+# MDEV-5353: server crash on subselect if WHERE applied to some
+# result field
+#
+SELECT * FROM
+( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
+WHERE tmp.b;
+a b
+100 200
+SELECT * FROM
+( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
+WHERE tmp.a;
+a b
+100 200
# End of 5.3 tests
#
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 45457e6a4fd..938b0ee005f 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -365,7 +365,7 @@ extract(DAY_MINUTE FROM "02 10:11:12")
21011
select extract(DAY_SECOND FROM "225 10:11:12");
extract(DAY_SECOND FROM "225 10:11:12")
-8385959
+34225959
Warnings:
Warning 1292 Truncated incorrect time value: '225 10:11:12'
select extract(HOUR FROM "1999-01-02 10:11:12");
@@ -1025,7 +1025,7 @@ Note 1105 Cast to unsigned converted negative integer to it's positive complemen
Warning 1292 Truncated incorrect time value: '18446744073709551615:00:00'
SELECT EXTRACT(HOUR FROM '10000:02:03');
EXTRACT(HOUR FROM '10000:02:03')
-838
+22
Warnings:
Warning 1292 Truncated incorrect time value: '10000:02:03'
CREATE TABLE t1(f1 TIME);
@@ -2347,3 +2347,30 @@ DROP TABLE t1;
SELECT MAKETIME(0, 0, -0.1);
MAKETIME(0, 0, -0.1)
NULL
+#
+# MDEV-4857 Wrong result of HOUR('1 00:00:00')
+#
+SELECT HOUR('1 02:00:00'), HOUR('26:00:00');
+HOUR('1 02:00:00') HOUR('26:00:00')
+26 26
+SELECT HOUR(TIME'1 02:00:00'), HOUR(TIME'26:00:00');
+HOUR(TIME'1 02:00:00') HOUR(TIME'26:00:00')
+26 26
+SELECT HOUR(TIME('1 02:00:00')), HOUR(TIME('26:00:00'));
+HOUR(TIME('1 02:00:00')) HOUR(TIME('26:00:00'))
+26 26
+SELECT DAY(TIME('1 02:00:00')), DAY(TIME('26:00:00'));
+DAY(TIME('1 02:00:00')) DAY(TIME('26:00:00'))
+0 0
+SELECT EXTRACT(HOUR FROM '1 02:00:00'), EXTRACT(HOUR FROM '26:00:00');
+EXTRACT(HOUR FROM '1 02:00:00') EXTRACT(HOUR FROM '26:00:00')
+2 2
+SELECT EXTRACT(HOUR FROM TIME'1 02:00:00'), EXTRACT(HOUR FROM TIME'26:00:00');
+EXTRACT(HOUR FROM TIME'1 02:00:00') EXTRACT(HOUR FROM TIME'26:00:00')
+2 2
+SELECT EXTRACT(HOUR FROM TIME('1 02:00:00')), EXTRACT(HOUR FROM TIME('26:00:00'));
+EXTRACT(HOUR FROM TIME('1 02:00:00')) EXTRACT(HOUR FROM TIME('26:00:00'))
+2 2
+SELECT EXTRACT(DAY FROM TIME('1 02:00:00')), EXTRACT(DAY FROM TIME('26:00:00'));
+EXTRACT(DAY FROM TIME('1 02:00:00')) EXTRACT(DAY FROM TIME('26:00:00'))
+1 1
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 5c4261e7d6d..c0b23651e70 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2394,6 +2394,13 @@ REPAIR TABLE m1;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
DROP TABLE m1, t1;
+create temporary table t1_temp(i int);
+create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last;
+alter table tm_temp_temp insert_method=first;
+check table tm_temp_temp;
+Table Op Msg_type Msg_text
+test.tm_temp_temp check status OK
+drop temporary table t1_temp, tm_temp_temp;
End of 5.1 tests
#
# MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 4f41151f555..fa15bcf5576 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3996,4 +3996,27 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
deallocate prepare st;
drop table t1;
+#
+# Bug mdev-5410: crash at the execution of PS with subselect
+# formed by UNION with global ORDER BY
+#
+CREATE TABLE t1 (a int DEFAULT NULL);
+INSERT INTO t1 VALUES (2), (4);
+CREATE TABLE t2 (b int DEFAULT NULL);
+INSERT INTO t2 VALUES (1), (3);
+PREPARE stmt FROM "
+SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b
+ UNION ALL
+ SELECT a FROM t1 WHERE t1.a+3<= t2.b
+ ORDER BY a DESC) AS c1 FROM t2) t3;
+";
+EXECUTE stmt;
+c1
+NULL
+2
+EXECUTE stmt;
+c1
+NULL
+2
+DROP TABLE t1,t2;
# End of 5.3 tests
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index 59054607acb..ff488fea427 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -610,6 +610,34 @@ id select_type table type possible_keys key key_len ref rows Extra
drop view v1;
DROP TABLE t1,t2,t3;
#
+# MDEV-5344: LEFT OUTER JOIN table data is lost in ON DUPLICATE KEY UPDATE section
+#
+create table t1 (
+id int(10) unsigned NOT NULL DEFAULT '0',
+v int(10) unsigned DEFAULT '0',
+PRIMARY KEY (id)
+);
+create table t2 (
+id int(10) unsigned NOT NULL DEFAULT '0',
+PRIMARY KEY (id)
+) ;
+create table t3 (
+id int(10) unsigned NOT NULL DEFAULT '0',
+v int(10) unsigned DEFAULT '0',
+PRIMARY KEY (id)
+);
+insert into t1 values (1, 10), (2, 10);
+insert into t2 values (1), (2);
+insert into t3 values (1, 20);
+insert into t1
+select t2.id, 5 from t2 LEFT OUTER JOIN t3 ON t2.id = t3.id
+on duplicate key update t1.v = t3.v;
+select * from t1;
+id v
+1 20
+2 NULL
+drop table t1,t2,t3;
+#
# BUG#919878: Assertion `!eliminated_tables...
#
CREATE TABLE t1 ( a INT );
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index d1be5e233df..a3ad63c035a 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1734,6 +1734,21 @@ i
6
DROP VIEW v1;
DROP TABLE t1;
+#
+# mdev-5382: UNION with ORDER BY in subselect
+#
+CREATE TABLE t1 (a int DEFAULT NULL);
+INSERT INTO t1 VALUES (2), (4);
+CREATE TABLE t2 (b int DEFAULT NULL);
+INSERT INTO t2 VALUES (1), (3);
+SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b
+UNION ALL
+SELECT a FROM t1 WHERE t1.a+3<= t2.b
+ORDER BY a DESC) AS c1 FROM t2) t3;
+c1
+NULL
+2
+DROP TABLE t1,t2;
End of 5.3 tests
#
# Bug#57986 ORDER BY clause is not used after a UNION,
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index a67a0e6c9d0..559a8b76280 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -383,7 +383,17 @@ set
drop table t1, t2;
+--echo #
+--echo # MDEV-5353: server crash on subselect if WHERE applied to some
+--echo # result field
+--echo #
+SELECT * FROM
+( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
+WHERE tmp.b;
+SELECT * FROM
+( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
+WHERE tmp.a;
--echo # End of 5.3 tests
--echo #
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 045b91b3e7b..b9e57483b7e 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1437,3 +1437,15 @@ DROP TABLE t1;
--echo #
SELECT MAKETIME(0, 0, -0.1);
+--echo #
+--echo # MDEV-4857 Wrong result of HOUR('1 00:00:00')
+--echo #
+SELECT HOUR('1 02:00:00'), HOUR('26:00:00');
+SELECT HOUR(TIME'1 02:00:00'), HOUR(TIME'26:00:00');
+SELECT HOUR(TIME('1 02:00:00')), HOUR(TIME('26:00:00'));
+SELECT DAY(TIME('1 02:00:00')), DAY(TIME('26:00:00'));
+
+SELECT EXTRACT(HOUR FROM '1 02:00:00'), EXTRACT(HOUR FROM '26:00:00');
+SELECT EXTRACT(HOUR FROM TIME'1 02:00:00'), EXTRACT(HOUR FROM TIME'26:00:00');
+SELECT EXTRACT(HOUR FROM TIME('1 02:00:00')), EXTRACT(HOUR FROM TIME('26:00:00'));
+SELECT EXTRACT(DAY FROM TIME('1 02:00:00')), EXTRACT(DAY FROM TIME('26:00:00'));
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 7e198275730..6573c2b09c0 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1830,6 +1830,15 @@ REPAIR TABLE m1;
#
DROP TABLE m1, t1;
+#
+# MDEV-5266 MySQL:57657 - Temporary MERGE table with temporary underlying is broken by ALTER
+#
+create temporary table t1_temp(i int);
+create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last;
+alter table tm_temp_temp insert_method=first;
+check table tm_temp_temp;
+drop temporary table t1_temp, tm_temp_temp;
+
--echo End of 5.1 tests
--echo #
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index ff28631862c..5f4c815a192 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3572,4 +3572,26 @@ show status like '%Handler_read%';
deallocate prepare st;
drop table t1;
+--echo #
+--echo # Bug mdev-5410: crash at the execution of PS with subselect
+--echo # formed by UNION with global ORDER BY
+--echo #
+
+CREATE TABLE t1 (a int DEFAULT NULL);
+INSERT INTO t1 VALUES (2), (4);
+CREATE TABLE t2 (b int DEFAULT NULL);
+INSERT INTO t2 VALUES (1), (3);
+
+PREPARE stmt FROM "
+SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b
+ UNION ALL
+ SELECT a FROM t1 WHERE t1.a+3<= t2.b
+ ORDER BY a DESC) AS c1 FROM t2) t3;
+";
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DROP TABLE t1,t2;
+
--echo # End of 5.3 tests
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test
index 357953290c4..0d42dca57b7 100644
--- a/mysql-test/t/table_elim.test
+++ b/mysql-test/t/table_elim.test
@@ -544,6 +544,37 @@ drop view v1;
DROP TABLE t1,t2,t3;
--echo #
+--echo # MDEV-5344: LEFT OUTER JOIN table data is lost in ON DUPLICATE KEY UPDATE section
+--echo #
+create table t1 (
+ id int(10) unsigned NOT NULL DEFAULT '0',
+ v int(10) unsigned DEFAULT '0',
+ PRIMARY KEY (id)
+);
+
+create table t2 (
+ id int(10) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (id)
+) ;
+
+create table t3 (
+ id int(10) unsigned NOT NULL DEFAULT '0',
+ v int(10) unsigned DEFAULT '0',
+ PRIMARY KEY (id)
+);
+
+insert into t1 values (1, 10), (2, 10);
+insert into t2 values (1), (2);
+insert into t3 values (1, 20);
+
+insert into t1
+select t2.id, 5 from t2 LEFT OUTER JOIN t3 ON t2.id = t3.id
+on duplicate key update t1.v = t3.v;
+
+select * from t1;
+drop table t1,t2,t3;
+
+--echo #
--echo # BUG#919878: Assertion `!eliminated_tables...
--echo #
CREATE TABLE t1 ( a INT );
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index faa35de3ec1..a53427f7fc6 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1188,6 +1188,22 @@ deallocate prepare stmt1;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # mdev-5382: UNION with ORDER BY in subselect
+--echo #
+
+ CREATE TABLE t1 (a int DEFAULT NULL);
+ INSERT INTO t1 VALUES (2), (4);
+ CREATE TABLE t2 (b int DEFAULT NULL);
+ INSERT INTO t2 VALUES (1), (3);
+
+ SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b
+ UNION ALL
+ SELECT a FROM t1 WHERE t1.a+3<= t2.b
+ ORDER BY a DESC) AS c1 FROM t2) t3;
+
+ DROP TABLE t1,t2;
+
--echo End of 5.3 tests
--echo #
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index e5a3a5fe13b..90e6f43f390 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -153,6 +153,10 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
while (*s != ':')
s++;
*s++= 0;
+
+ if (strcmp(loc->file, "??") == 0)
+ return 1;
+
loc->line= 0;
while (isdigit(*s))
loc->line = loc->line * 10 + (*s++ - '0');
diff --git a/plugin/query_response_time/mysql-test/query_response_time/suite.pm b/plugin/query_response_time/mysql-test/query_response_time/suite.pm
index 4ee84a22f14..5b4983bc1f6 100644
--- a/plugin/query_response_time/mysql-test/query_response_time/suite.pm
+++ b/plugin/query_response_time/mysql-test/query_response_time/suite.pm
@@ -8,5 +8,7 @@ return "No QUERY_RESPONSE_TIME plugin" unless
return "Not run for embedded server" if $::opt_embedded_server;
+sub is_default { 1 }
+
bless { };
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 05dcd773321..297eec15b13 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -557,8 +557,8 @@ fractional:
l_time->year= 0; /* For protocol::store_time */
l_time->month= 0;
- l_time->day= date[0];
- l_time->hour= date[1];
+ l_time->day= 0;
+ l_time->hour= date[1] + date[0] * 24; /* Mix days and hours */
l_time->minute= date[2];
l_time->second= date[3];
l_time->second_part= date[4];
diff --git a/sql/item.h b/sql/item.h
index ea17668d47d..113e8bdcb9c 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -3307,13 +3307,16 @@ class Item_direct_view_ref :public Item_direct_ref
TABLE_LIST *view;
TABLE *null_ref_table;
+#define NO_NULL_TABLE (reinterpret_cast<TABLE *>(0x1))
+
bool check_null_ref()
{
if (null_ref_table == NULL)
{
- null_ref_table= view->get_real_join_table();
+ if (!(null_ref_table= view->get_real_join_table()))
+ null_ref_table= NO_NULL_TABLE;
}
- if (null_ref_table->null_row)
+ if (null_ref_table != NO_NULL_TABLE && null_ref_table->null_row)
{
null_value= 1;
return TRUE;
diff --git a/sql/item_func.h b/sql/item_func.h
index f4be9a14fe3..384a6b535df 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -166,7 +166,10 @@ public:
Item **item, uint nitems);
inline bool get_arg0_time(MYSQL_TIME *ltime)
{
- return (null_value=args[0]->get_time(ltime));
+ null_value= args[0]->get_time(ltime);
+ DBUG_ASSERT(null_value ||
+ ltime->time_type != MYSQL_TIMESTAMP_TIME || ltime->day == 0);
+ return null_value;
}
bool is_null() {
update_null_value();
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 425008ab43b..a3652ebf16e 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2142,6 +2142,10 @@ longlong Item_extract::val_int()
return 0;
neg= ltime.neg ? -1 : 1;
+ DBUG_ASSERT(ltime.time_type != MYSQL_TIMESTAMP_TIME || ltime.day == 0);
+ if (ltime.time_type == MYSQL_TIMESTAMP_TIME)
+ time_to_daytime_interval(&ltime);
+
switch (int_type) {
case INTERVAL_YEAR: return ltime.year;
case INTERVAL_YEAR_MONTH: return ltime.year*100L+ltime.month;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1d4002df60f..4e6646feead 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1914,7 +1914,9 @@ void clean_up(bool print_message)
delete binlog_filter;
delete global_rpl_filter;
end_ssl();
+#ifndef EMBEDDED_LIBRARY
vio_end();
+#endif /*!EMBEDDED_LIBRARY*/
#if defined(ENABLED_DEBUG_SYNC)
/* End the debug sync facility. See debug_sync.cc. */
debug_sync_end();
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index 4a10d402fac..9f304ad043b 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -609,6 +609,21 @@ void eliminate_tables(JOIN *join)
/* Find the tables that are referred to from WHERE/HAVING */
used_tables= (join->conds? join->conds->used_tables() : 0) |
(join->having? join->having->used_tables() : 0);
+
+ /*
+ For "INSERT ... SELECT ... ON DUPLICATE KEY UPDATE column = val"
+ we should also take into account tables mentioned in "val".
+ */
+ if (join->thd->lex->sql_command == SQLCOM_INSERT_SELECT &&
+ join->select_lex == &thd->lex->select_lex)
+ {
+ List_iterator<Item> val_it(thd->lex->value_list);
+ while ((item= val_it++))
+ {
+ DBUG_ASSERT(item->fixed);
+ used_tables |= item->used_tables();
+ }
+ }
/* Add tables referred to from the select list */
List_iterator<Item> it(join->fields_list);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3f4be0da25d..6e0a852601c 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -6635,9 +6635,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
else
{
if (thd->mark_used_columns == MARK_COLUMNS_READ)
- it->walk(&Item::register_field_in_read_map, 1, (uchar *) 0);
+ it->walk(&Item::register_field_in_read_map, 0, (uchar *) 0);
else
- it->walk(&Item::register_field_in_write_map, 1, (uchar *) 0);
+ it->walk(&Item::register_field_in_write_map, 0, (uchar *) 0);
}
}
else
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 77b03f32105..4ce9c3828d7 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -721,7 +721,7 @@ public:
void print(String *str, enum_query_type query_type);
bool add_fake_select_lex(THD *thd);
- void init_prepare_fake_select_lex(THD *thd);
+ void init_prepare_fake_select_lex(THD *thd, bool first_execution);
inline bool is_prepared() { return prepared; }
bool change_result(select_result_interceptor *result,
select_result_interceptor *old_result);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 77f79783db0..54f9881fe45 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -11444,17 +11444,18 @@ void JOIN::cleanup(bool full)
tabs_kind= WALK_EXECUTION_TABS;
if (table_count)
{
- for (tab= first_breadth_first_tab(this, tabs_kind); tab;
+ for (tab= first_breadth_first_tab(this, tabs_kind); tab;
tab= next_breadth_first_tab(this, tabs_kind, tab))
{
tab->cleanup();
}
}
cleaned= true;
+
}
else
{
- for (tab= first_linear_tab(this, WITH_CONST_TABLES); tab;
+ for (tab= first_linear_tab(this, WITH_CONST_TABLES); tab;
tab= next_linear_tab(this, tab, WITH_BUSH_ROOTS))
{
if (tab->table)
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index e9fda9be0b1..cf3cdd61000 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -1085,3 +1085,22 @@ int my_time_compare(MYSQL_TIME *a, MYSQL_TIME *b)
return 0;
}
+
+/*
+ Convert a TIME value to DAY-TIME interval, e.g. for extraction:
+ EXTRACT(DAY FROM x), EXTRACT(HOUR FROM x), etc.
+ Moves full days from ltime->hour to ltime->day.
+ Note, time_type is set to MYSQL_TIMESTAMP_NONE, to make sure that
+ the structure is not used for anything else other than extraction:
+ non-extraction TIME functions expect zero day value!
+*/
+void time_to_daytime_interval(MYSQL_TIME *ltime)
+{
+ DBUG_ASSERT(ltime->time_type == MYSQL_TIMESTAMP_TIME);
+ DBUG_ASSERT(ltime->year == 0);
+ DBUG_ASSERT(ltime->month == 0);
+ DBUG_ASSERT(ltime->day == 0);
+ ltime->day= ltime->hour / 24;
+ ltime->hour%= 24;
+ ltime->time_type= MYSQL_TIMESTAMP_NONE;
+}
diff --git a/sql/sql_time.h b/sql/sql_time.h
index f8b1e950b14..ab8f0e0b962 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -33,6 +33,7 @@ typedef struct st_known_date_time_format KNOWN_DATE_TIME_FORMAT;
ulong convert_period_to_month(ulong period);
ulong convert_month_to_period(ulong month);
+void time_to_daytime_interval(MYSQL_TIME *l_time);
bool get_date_from_daynr(long daynr,uint *year, uint *month, uint *day);
my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, uint *error_code);
bool str_to_time_with_warn(CHARSET_INFO *cs, const char *str, uint length,
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 864f5a8d91a..76857b58234 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -193,13 +193,15 @@ void select_union::cleanup()
SYNOPSIS
st_select_lex_unit::init_prepare_fake_select_lex()
thd - thread handler
+ first_execution - TRUE at the first execution of the union
RETURN
options of SELECT
*/
void
-st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg)
+st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg,
+ bool first_execution)
{
thd_arg->lex->current_select= fake_select_lex;
fake_select_lex->table_list.link_in_list(&result_table_list,
@@ -207,7 +209,13 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd_arg)
fake_select_lex->context.table_list=
fake_select_lex->context.first_name_resolution_table=
fake_select_lex->get_table_list();
- if (!fake_select_lex->first_execution)
+ /*
+ The flag fake_select_lex->first_execution indicates whether this is
+ called at the first execution of the statement, while first_execution
+ shows whether this is called at the first execution of the union that
+ may form just a subselect.
+ */
+ if (!fake_select_lex->first_execution && first_execution)
{
for (ORDER *order= global_parameters->order_list.first;
order;
@@ -481,7 +489,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
{
/* Validate the global parameters of this union */
- init_prepare_fake_select_lex(thd);
+ init_prepare_fake_select_lex(thd, TRUE);
/* Should be done only once (the only item_list per statement) */
DBUG_ASSERT(fake_select_lex->join == 0);
if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->variables.option_bits,
@@ -622,6 +630,7 @@ bool st_select_lex_unit::exec()
SELECT_LEX *select_cursor=first_select();
ulonglong add_rows=0;
ha_rows examined_rows= 0;
+ bool first_execution= !executed;
DBUG_ENTER("st_select_lex_unit::exec");
bool was_executed= executed;
@@ -644,6 +653,7 @@ bool st_select_lex_unit::exec()
{
ha_rows records_at_start= 0;
thd->lex->current_select= sl;
+ fake_select_lex->uncacheable|= sl->uncacheable;
{
set_limit(sl);
@@ -750,7 +760,7 @@ bool st_select_lex_unit::exec()
if (!thd->is_fatal_error) // Check if EOM
{
set_limit(global_parameters);
- init_prepare_fake_select_lex(thd);
+ init_prepare_fake_select_lex(thd, first_execution);
JOIN *join= fake_select_lex->join;
if (!join)
{
diff --git a/sql/table.cc b/sql/table.cc
index 7adf4f4831b..f6bea7221ce 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -5016,10 +5016,8 @@ TABLE *TABLE_LIST::get_real_join_table()
*/
for (TABLE_LIST *t= ti++; t; t= ti++)
tbl= t;
- /*
- It is impossible that the list is empty
- so tbl can't be NULL after above loop.
- */
+ if (!tbl)
+ return NULL; // view/derived with no tables
if (!tbl->nested_join)
break;
/* go deeper if we've found nested join */
diff --git a/storage/innobase/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff b/storage/innobase/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff
new file mode 100644
index 00000000000..e6149be58dc
--- /dev/null
+++ b/storage/innobase/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff
@@ -0,0 +1,18 @@
+--- suite/storage_engine/trx/cons_snapshot_serializable.result 2013-11-27 18:46:36.000000000 +0400
++++ suite/storage_engine/trx/cons_snapshot_serializable.reject 2013-11-28 19:17:02.000000000 +0400
+@@ -5,12 +5,15 @@
+ CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+ SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+ START TRANSACTION WITH CONSISTENT SNAPSHOT;
++Warnings:
++Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
+ connection con2;
+ INSERT INTO t1 (a) VALUES (1);
+ connection con1;
+ # If consistent read works on this isolation level (SERIALIZABLE), the following SELECT should not return the value we inserted (1)
+ SELECT a FROM t1;
+ a
++1
+ COMMIT;
+ connection default;
+ disconnect con1;
diff --git a/storage/innobase/mysql-test/storage_engine/trx/disabled.def b/storage/innobase/mysql-test/storage_engine/trx/disabled.def
deleted file mode 100644
index 7b8a16d0b7a..00000000000
--- a/storage/innobase/mysql-test/storage_engine/trx/disabled.def
+++ /dev/null
@@ -1,2 +0,0 @@
-cons_snapshot_serializable : MySQL:65146 (CONSISTENT SNAPSHOT does not work with SERIALIZABLE)
-
diff --git a/storage/innobase/mysql-test/storage_engine/trx/level_read_committed.rdiff b/storage/innobase/mysql-test/storage_engine/trx/level_read_committed.rdiff
new file mode 100644
index 00000000000..cb64d32138b
--- /dev/null
+++ b/storage/innobase/mysql-test/storage_engine/trx/level_read_committed.rdiff
@@ -0,0 +1,11 @@
+--- suite/storage_engine/trx/level_read_committed.result 2013-11-28 19:18:48.000000000 +0400
++++ suite/storage_engine/trx/level_read_committed.reject 2013-11-28 19:18:59.000000000 +0400
+@@ -77,6 +77,8 @@
+ CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+ START TRANSACTION WITH CONSISTENT SNAPSHOT;
++Warnings:
++Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
+ connection con2;
+ INSERT INTO t1 (a) VALUES (1);
+ connection con1;
diff --git a/storage/innobase/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff b/storage/innobase/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff
new file mode 100644
index 00000000000..6a79abe3ca5
--- /dev/null
+++ b/storage/innobase/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff
@@ -0,0 +1,11 @@
+--- suite/storage_engine/trx/level_read_uncommitted.result 2013-11-28 19:18:48.000000000 +0400
++++ suite/storage_engine/trx/level_read_uncommitted.reject 2013-11-28 19:19:50.000000000 +0400
+@@ -102,6 +102,8 @@
+ CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
+ SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+ START TRANSACTION WITH CONSISTENT SNAPSHOT;
++Warnings:
++Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
+ connection con2;
+ INSERT INTO t1 (a) VALUES (1);
+ connection con1;
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index fdb2bae3d8c..304a37a9633 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -1862,6 +1862,8 @@ static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend,
uint UNINIT_VAR(row_count), real_row_count, empty_space, page_type, bitmap_pattern;
uint bitmap_for_page;
+ LINT_INIT(empty_space);
+
if (_ma_killed_ptr(param))
{
_ma_scan_end_block_record(info);
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 481ca41ba9d..3220d53aefa 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1481,31 +1481,36 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
if (!(create_info->used_fields & HA_CREATE_USED_UNION))
{
- MYRG_TABLE *open_table;
+ TABLE_LIST *child_table;
THD *thd=current_thd;
create_info->merge_list.next= &create_info->merge_list.first;
create_info->merge_list.elements=0;
- for (open_table=file->open_tables ;
- open_table != file->end_table ;
- open_table++)
+ if (children_l != NULL)
{
- TABLE_LIST *ptr;
- LEX_STRING db, name;
- LINT_INIT(db.str);
-
- if (!(ptr = (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
- goto err;
- split_file_name(open_table->table->filename, &db, &name);
- if (!(ptr->table_name= thd->strmake(name.str, name.length)))
- goto err;
- if (db.length && !(ptr->db= thd->strmake(db.str, db.length)))
- goto err;
-
- create_info->merge_list.elements++;
- (*create_info->merge_list.next) = ptr;
- create_info->merge_list.next= &ptr->next_local;
+ for (child_table= children_l;;
+ child_table= child_table->next_global)
+ {
+ TABLE_LIST *ptr;
+
+ if (!(ptr= (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
+ goto err;
+
+ if (!(ptr->table_name= thd->strmake(child_table->table_name,
+ child_table->table_name_length)))
+ goto err;
+ if (child_table->db && !(ptr->db= thd->strmake(child_table->db,
+ child_table->db_length)))
+ goto err;
+
+ create_info->merge_list.elements++;
+ (*create_info->merge_list.next)= ptr;
+ create_info->merge_list.next= &ptr->next_local;
+
+ if (&child_table->next_global == children_last_l)
+ break;
+ }
}
*create_info->merge_list.next=0;
}
diff --git a/storage/myisammrg/mysql-test/storage_engine/disabled.def b/storage/myisammrg/mysql-test/storage_engine/disabled.def
index 9f7569a2d24..86b96c2ba2b 100644
--- a/storage/myisammrg/mysql-test/storage_engine/disabled.def
+++ b/storage/myisammrg/mysql-test/storage_engine/disabled.def
@@ -1,2 +1,2 @@
-alter_table_online : MySQL:57657 (Temporary MERGE table with temporary underlying is broken by ALTER)
+alter_table_online : MDEV-5266 (Temporary MERGE table with temporary underlying is broken by ALTER)
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index c5197dd5dc0..91f92c9ef14 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -15,7 +15,7 @@ IF(NOT TOKUDB_OK)
ENDIF()
############################################
-SET(ENV{TOKUDB_VERSION} "7.0.4")
+SET(ENV{TOKUDB_VERSION} "7.1.0")
SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-5.5/README-TOKUDB\nusr/share/doc/mariadb-server-5.5/README.md" PARENT_SCOPE)
SET(USE_BDB OFF CACHE BOOL "")
SET(USE_VALGRIND OFF CACHE BOOL "")
diff --git a/storage/tokudb/ft-index/CMakeLists.txt b/storage/tokudb/ft-index/CMakeLists.txt
index 87c04be75e5..22249b66522 100644
--- a/storage/tokudb/ft-index/CMakeLists.txt
+++ b/storage/tokudb/ft-index/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
project(TokuDB)
diff --git a/storage/tokudb/mysql-test/rpl/suite.pm b/storage/tokudb/mysql-test/rpl/suite.pm
index e001340cd14..ba9809a9930 100644
--- a/storage/tokudb/mysql-test/rpl/suite.pm
+++ b/storage/tokudb/mysql-test/rpl/suite.pm
@@ -7,5 +7,6 @@ $ENV{TOKU_HUGE_PAGES_OK}=1;
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
+
bless { };
diff --git a/storage/tokudb/mysql-test/tokudb/suite.pm b/storage/tokudb/mysql-test/tokudb/suite.pm
index e001340cd14..6c52d0110fe 100644
--- a/storage/tokudb/mysql-test/tokudb/suite.pm
+++ b/storage/tokudb/mysql-test/tokudb/suite.pm
@@ -7,5 +7,8 @@ $ENV{TOKU_HUGE_PAGES_OK}=1;
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
+
+sub is_default { not $::opt_embedded_server }
+
bless { };
diff --git a/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_1.test b/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_1.test
index 5728f6f2129..9ac4f525533 100644
--- a/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_1.test
+++ b/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_1.test
@@ -1,5 +1,6 @@
# generated from change_column_all.py
# test random column change on wide tables
+--source include/big_test.inc
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
diff --git a/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_10.test b/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_10.test
index 08cdb31ca1a..171502afcd0 100644
--- a/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_10.test
+++ b/storage/tokudb/mysql-test/tokudb/t/change_column_all_1000_10.test
@@ -1,5 +1,6 @@
# generated from change_all.py
# test random column change on wide tables
+--source include/big_test.inc
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
diff --git a/storage/tokudb/mysql-test/tokudb/t/hotindex-insert-bigchar.opt b/storage/tokudb/mysql-test/tokudb/t/hotindex-insert-bigchar.opt
new file mode 100644
index 00000000000..d76fda471ca
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/hotindex-insert-bigchar.opt
@@ -0,0 +1 @@
+--loose-tokudb-max-lock-memory=320M
diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test
index 1becf71a80a..b42c2dd9175 100644
--- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test
+++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test
@@ -1,4 +1,8 @@
# verify that information_schema.tokudb_locks gets populated with locks, information_schema.tokudb_lock_waits gets
+if (`select @@tokudb_version <= "7.1.0"`)
+{
+ --skip Not fixed in TokuDB 7.1.0 or earlier
+}
# populated with 1 lock_wait and all transactions are present in information_schema.tokudb_trx for 2 clients
source include/have_tokudb.inc;
diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test
index 87656f29395..8d21e601380 100644
--- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test
+++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test
@@ -1,3 +1,7 @@
+if (`select @@tokudb_version <= "7.1.0"`)
+{
+ --skip Not fixed in TokuDB 7.1.0 or earlier
+}
# verify that tokudb_locks and tokudb_lock_waits contents for 2 conflicting transactions with a lock timeout
source include/have_tokudb.inc;
diff --git a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test
index 52c09c1c049..6a1b96c53a2 100644
--- a/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test
+++ b/storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_locks_released.test
@@ -1,3 +1,7 @@
+if (`select @@tokudb_version <= "7.1.0"`)
+{
+ --skip Not fixed in TokuDB 7.1.0 or earlier
+}
# verify that information_schema.tokudb_locks gets populated with locks for 2 clients
source include/have_tokudb.inc;
diff --git a/storage/tokudb/mysql-test/tokudb_add_index/suite.pm b/storage/tokudb/mysql-test/tokudb_add_index/suite.pm
index 5fe44252ad6..ee1d1bde06b 100644
--- a/storage/tokudb/mysql-test/tokudb_add_index/suite.pm
+++ b/storage/tokudb/mysql-test/tokudb_add_index/suite.pm
@@ -2,7 +2,13 @@ package My::Suite::TokuDB_add_index;
use File::Basename;
@ISA = qw(My::Suite);
+# Ensure we can run the TokuDB tests even if hugepages are enabled
+$ENV{TOKU_HUGE_PAGES_OK}=1;
+
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
+
+sub is_default { not $::opt_embedded_server }
+
bless { };
diff --git a/storage/tokudb/mysql-test/tokudb_add_index/t/add_index_6.test b/storage/tokudb/mysql-test/tokudb_add_index/t/add_index_6.test
index 14b6079acc9..8fa44de9cae 100644
--- a/storage/tokudb/mysql-test/tokudb_add_index/t/add_index_6.test
+++ b/storage/tokudb/mysql-test/tokudb_add_index/t/add_index_6.test
@@ -1,3 +1,8 @@
+if (`select @@tokudb_version <= "7.1.0"`)
+{
+ --skip Not fixed in TokuDB 7.1.0 or earlier
+}
+
#--source include/have_tokudb.inc
SET DEFAULT_STORAGE_ENGINE='tokudb';
#
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/suite.pm b/storage/tokudb/mysql-test/tokudb_alter_table/suite.pm
index 3c42185a199..7981fad2c62 100644
--- a/storage/tokudb/mysql-test/tokudb_alter_table/suite.pm
+++ b/storage/tokudb/mysql-test/tokudb_alter_table/suite.pm
@@ -2,7 +2,13 @@ package My::Suite::TokuDB_alter_table;
use File::Basename;
@ISA = qw(My::Suite);
+# Ensure we can run the TokuDB tests even if hugepages are enabled
+$ENV{TOKU_HUGE_PAGES_OK}=1;
+
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
+
+sub is_default { not $::opt_embedded_server }
+
bless { };
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result
index 7532cddd97f..b572ac3b6e1 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result
@@ -1,20 +1,17 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set global tokudb_checkpoint_on_flush_logs=ON;
# Establish connection conn1 (user = root)
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
flush logs;
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
set tokudb_checkpoint_lock=1;
flush logs;;
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
-test Query executing select DB, command, state, info from information_schema.processlist
test Query NULL flush logs
set tokudb_checkpoint_lock=0;
set global tokudb_checkpoint_on_flush_logs=OFF;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_2.result b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_2.result
index 63a688ef11b..5ef3c001935 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_2.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_2.result
@@ -2,45 +2,39 @@ SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set GLOBAL tokudb_checkpoint_on_flush_logs=ON;
# Establish connection conn1 (user = root)
# should see nothing
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
flush logs;
# should see nothing
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
set session tokudb_checkpoint_lock=1;
flush logs;;
# should see a flush logs
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
-test Query executing select DB, command, state, info from information_schema.processlist
test Sleep NULL
test Query NULL flush logs
set session tokudb_checkpoint_lock=1;
# should still see a flush logs
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
-test Query executing select DB, command, state, info from information_schema.processlist
test Sleep NULL
test Query NULL flush logs
set session tokudb_checkpoint_lock=0;
# should still see a flush logs
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
test Query NULL flush logs
set session tokudb_checkpoint_lock=0;
# should see nothing
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
-test Query executing select DB, command, state, info from information_schema.processlist
test Sleep NULL
test Sleep NULL
set GLOBAL tokudb_checkpoint_on_flush_logs=OFF;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result
index a6c41e08570..968d86e5659 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result
@@ -1,18 +1,15 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
flush logs;
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
test Sleep NULL
-test Query executing select DB, command, state, info from information_schema.processlist
set tokudb_checkpoint_lock=1;
flush logs;;
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
DB command state info
-test Query executing select DB, command, state, info from information_schema.processlist
test Sleep NULL
set tokudb_checkpoint_lock=0;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/suite.pm b/storage/tokudb/mysql-test/tokudb_bugs/suite.pm
index 786adf7acd3..a6e01cd6dd4 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/suite.pm
+++ b/storage/tokudb/mysql-test/tokudb_bugs/suite.pm
@@ -2,7 +2,13 @@ package My::Suite::TokuDB_bugs;
use File::Basename;
@ISA = qw(My::Suite);
+# Ensure we can run the TokuDB tests even if hugepages are enabled
+$ENV{TOKU_HUGE_PAGES_OK}=1;
+
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
+
+sub is_default { not $::opt_embedded_server }
+
bless { };
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock.test b/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock.test
index be72c26b841..ac39ac569fd 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock.test
@@ -8,9 +8,9 @@ connect (conn1,localhost,root,,);
connection default;
--sleep 2
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
flush logs;
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
connection conn1;
set tokudb_checkpoint_lock=1;
@@ -20,7 +20,7 @@ connection default;
connection conn1;
--sleep 2
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
set tokudb_checkpoint_lock=0;
connection default;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_2.test b/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_2.test
index 44db2ca2f7c..c399dc24649 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_2.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_2.test
@@ -13,11 +13,11 @@ connect (conn2,localhost,root,,);
connection default;
--sleep 2
--echo # should see nothing
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
flush logs;
--echo # should see nothing
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
connection conn1;
@@ -29,25 +29,25 @@ connection default;
connection conn2;
--sleep 2
--echo # should see a flush logs
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
set session tokudb_checkpoint_lock=1;
--echo # should still see a flush logs
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
connection conn1;
--sleep 2
set session tokudb_checkpoint_lock=0;
--echo # should still see a flush logs
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
connection conn2;
set session tokudb_checkpoint_lock=0;
--sleep 2
--echo # should see nothing
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
connection default;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_3.test b/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_3.test
index 1bb70eab163..b21aef1f6bc 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_3.test
+++ b/storage/tokudb/mysql-test/tokudb_bugs/t/checkpoint_lock_3.test
@@ -7,9 +7,9 @@ connect (conn1,localhost,root,,);
connection default;
--sleep 2
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
flush logs;
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
connection conn1;
set tokudb_checkpoint_lock=1;
@@ -19,7 +19,7 @@ connection default;
connection conn1;
--sleep 2
-select DB, command, state, info from information_schema.processlist;
+select DB, command, state, info from information_schema.processlist where id!= connection_id();
set tokudb_checkpoint_lock=0;
connection default;
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/suite.pm b/storage/tokudb/mysql-test/tokudb_mariadb/suite.pm
index ee5a6d9cd57..ab3da8e6b03 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/suite.pm
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/suite.pm
@@ -2,7 +2,13 @@ package My::Suite::TokuDB_mariadb;
use File::Basename;
@ISA = qw(My::Suite);
+# Ensure we can run the TokuDB tests even if hugepages are enabled
+$ENV{TOKU_HUGE_PAGES_OK}=1;
+
#return "Not run for embedded server" if $::opt_embedded_server;
return "No TokuDB engine" unless $ENV{HA_TOKUDB_SO} or $::mysqld_variables{tokudb};
+
+sub is_default { not $::opt_embedded_server }
+
bless { };
diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c
index 69a151be45f..19e656dfd92 100644
--- a/storage/xtradb/fil/fil0fil.c
+++ b/storage/xtradb/fil/fil0fil.c
@@ -5027,10 +5027,20 @@ fil_extend_space_to_desired_size(
mem_free(buf2);
- fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
-
#ifdef HAVE_POSIX_FALLOCATE
complete_io:
+ /* If posix_fallocate was used to extent the file space
+ we need to complete the io. Because no actual writes were
+ dispatched read operation is enough here. Without this
+ there will be assertion at shutdown indicating that
+ all IO is not completed. */
+ if (srv_use_posix_fallocate) {
+ fil_node_complete_io(node, fil_system, OS_FILE_READ);
+ } else {
+ fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
+ }
+#else
+ fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
#endif
*actual_size = space->size;
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index db8a4792fd4..ef8d68a09d2 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -169,6 +169,11 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type
.*auth_pam\.c : initialization from incompatible pointer type : 100-200
#
+# jemalloc
+#
+jemalloc/src/jemalloc\.c: always_inline function might not be inlinable
+
+#
# Unexplanable (?) stuff
#
listener.cc : .*conversion from 'SOCKET' to 'int'.*
diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh
index b4d63815fe9..91885f73466 100644
--- a/support-files/rpm/server-postin.sh
+++ b/support-files/rpm/server-postin.sh
@@ -23,9 +23,9 @@ if [ $1 = 1 ] ; then
# Create a MySQL user and group. Do not report any problems if it already
# exists.
groupadd -r %{mysqld_group} 2> /dev/null || true
- useradd -M -r -d $datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
+ useradd -M -r --home $datadir --shell /sbin/nologin --comment "MySQL server" --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
- usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
+ usermod --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
diff --git a/tests/bug25714.c b/tests/bug25714.c
index 40c631d76a5..7e6be13624b 100644
--- a/tests/bug25714.c
+++ b/tests/bug25714.c
@@ -23,7 +23,7 @@
int main (int argc, char **argv)
{
MYSQL conn;
- int OK;
+ int OK __attribute__((unused));
const char* query4= "INSERT INTO federated.t1 SET Value=54";
const char* query5= "INSERT INTO federated.t1 SET Value=55";