5.5 merge

This commit is contained in:
Sergei Golubchik 2013-12-15 15:57:26 +01:00
commit 6bf10fac44
71 changed files with 584 additions and 182 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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()

View file

@ -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()

View file

@ -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);

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -3,6 +3,7 @@
package My::Suite;
sub is_default { 0 }
sub config_files { () }
sub servers { () }
sub skip_combinations { () }

View file

@ -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");
}
@ -315,11 +329,33 @@ 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";

View file

@ -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.

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 );

View file

@ -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,

View file

@ -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 #

View file

@ -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'));

View file

@ -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 #

View file

@ -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

View file

@ -543,6 +543,37 @@ EXPLAIN SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
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 #

View file

@ -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 #

View file

@ -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');

View file

@ -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 { };

View file

@ -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];

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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();

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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)

View file

@ -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;
}

View file

@ -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,

View file

@ -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)
{

View file

@ -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 */

View file

@ -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;

View file

@ -1,2 +0,0 @@
cons_snapshot_serializable : MySQL:65146 (CONSISTENT SNAPSHOT does not work with SERIALIZABLE)

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);
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;
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;
if (!(ptr= (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
goto err;
create_info->merge_list.elements++;
(*create_info->merge_list.next) = ptr;
create_info->merge_list.next= &ptr->next_local;
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;
}

View file

@ -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)

View file

@ -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 "")

View file

@ -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)

View file

@ -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 { };

View file

@ -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 { };

View file

@ -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

View file

@ -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

View file

@ -0,0 +1 @@
--loose-tokudb-max-lock-memory=320M

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 { };

View file

@ -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';
#

View file

@ -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 { };

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 { };

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 { };

View file

@ -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;

View file

@ -168,6 +168,11 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type
/usr/include/sys/feature_tests.h : this is the location of the previous definition
.*auth_pam\.c : initialization from incompatible pointer type : 100-200
#
# jemalloc
#
jemalloc/src/jemalloc\.c: always_inline function might not be inlinable
#
# Unexplanable (?) stuff
#

View file

@ -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.

View file

@ -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";