Merge 10.1 into 10.2

This commit is contained in:
Marko Mäkelä 2020-05-13 11:12:31 +03:00
commit 6bc4444d7c
10 changed files with 61 additions and 91 deletions

View File

@ -466,17 +466,21 @@ sub mtr_report_stats ($$$$) {
}
$test_time = sprintf("%.3f", $test->{timer} / 1000);
$test->{'name'} =~ s/$current_suite\.//;
$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test->{'result'}" time="$test_time");
my $comment = $test->{'comment'};
$comment =~ s/[\"]//g;
if ($test->{'result'} eq "MTR_RES_FAILED") {
$xml_report .= qq(>\n\t\t\t<failure message="" type="$test->{'result'}">\n<![CDATA[$test->{'logfile'}]]>\n\t\t\t</failure>\n\t\t</testcase>\n);
# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'}) {
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
$xml_report .= qq(>\n\t\t\t<failure message="" type="MTR_RES_FAILED">\n<![CDATA[$logcontents]]>\n\t\t\t</failure>\n\t\t</testcase>\n);
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED" && $test->{'disable'}) {
$xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
$xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED") {
$xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
$xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
} else {
$xml_report .= " />\n";
}

View File

@ -382,7 +382,7 @@ my $set_titlebar;
};
eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }';
} else {
sub HAVE_WIN32_CONSOLE { 0 };
eval 'sub HAVE_WIN32_CONSOLE { 0 }';
}
}
@ -390,7 +390,7 @@ if (-t STDOUT) {
if (IS_WINDOWS and HAVE_WIN32_CONSOLE) {
$set_titlebar = sub {Win32::Console::Title $_[0];};
} elsif (defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
$set_titlebar = sub { print "\e];$_[0]\a"; };
$set_titlebar = sub { syswrite STDOUT, "\e];$_[0]\a"; };
}
}
@ -941,6 +941,7 @@ sub run_test_server ($$$) {
if ( $result->is_failed() ) {
my $worker_logdir= $result->{savedir};
my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
$result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20);
rename $log_file_name,$log_file_name.".failed";
}
delete($result->{result});

View File

@ -109,7 +109,7 @@ End of 5.0 tests
# Start of 10.0 tests
#
#
# MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns
# MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns
#
CREATE TABLE t1 (c1 DATE PRIMARY KEY);
INSERT INTO t1 VALUES ('2001-01-01');

View File

@ -613,7 +613,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT InnoDB system tablespace size to be set in recovery.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_MAX_VALUE 268435456
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES

View File

@ -102,7 +102,7 @@ DROP TABLE t1;
--echo #
--echo #
--echo # MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns
--echo # MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns
--echo #
CREATE TABLE t1 (c1 DATE PRIMARY KEY);

View File

@ -14,7 +14,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
/*
Code for handling dubble-linked lists in C
Code for handling doubly linked lists in C
*/
#include "mysys_priv.h"
@ -22,7 +22,7 @@
/* Add a element to start of list */
/* Add an element to start of list */
LIST *list_add(LIST *root, LIST *element)
{

View File

@ -20961,7 +20961,7 @@ static MYSQL_SYSVAR_UINT(data_file_size_debug,
srv_sys_space_size_debug,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"InnoDB system tablespace size to be set in recovery.",
NULL, NULL, 0, 0, UINT_MAX32, 0);
NULL, NULL, 0, 0, 256U << 20, 0);
static MYSQL_SYSVAR_ULONG(fil_make_page_dirty_debug,
srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG,

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2020 MariaDB Corporation.
Copyright (c) 2016, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -2746,42 +2746,28 @@ ibuf_contract_after_insert(
} while (size > 0 && sum_sizes < entry_size);
}
/*********************************************************************//**
Determine if an insert buffer record has been encountered already.
@return TRUE if a new record, FALSE if possible duplicate */
static
ibool
ibuf_get_volume_buffered_hash(
/*==========================*/
const rec_t* rec, /*!< in: ibuf record in post-4.1 format */
const byte* types, /*!< in: fields */
const byte* data, /*!< in: start of user record data */
ulint comp, /*!< in: 0=ROW_FORMAT=REDUNDANT,
nonzero=ROW_FORMAT=COMPACT */
ulint* hash, /*!< in/out: hash array */
ulint size) /*!< in: number of elements in hash array */
/** Determine if a change buffer record has been encountered already.
@param rec change buffer record in the MySQL 5.5 format
@param hash hash table of encountered records
@param size number of elements in hash
@retval true if a distinct record
@retval false if this may be duplicating an earlier record */
static bool ibuf_get_volume_buffered_hash(const rec_t *rec, ulint *hash,
ulint size)
{
ulint len;
ulint fold;
ulint bitmask;
ut_ad(rec_get_n_fields_old(rec) > IBUF_REC_FIELD_USER);
const ulint start= rec_get_field_start_offs(rec, IBUF_REC_FIELD_USER);
const ulint len= rec_get_data_size_old(rec) - start;
const uint32_t fold= ut_crc32(rec + start, len);
hash+= (fold / (CHAR_BIT * sizeof *hash)) % size;
ulint bitmask= static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
len = ibuf_rec_get_size(
rec, types,
rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp);
fold = ut_fold_binary(data, len);
if (*hash & bitmask)
return false;
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
if (*hash & bitmask) {
return(FALSE);
}
/* We have not seen this record yet. Insert it. */
*hash |= bitmask;
return(TRUE);
/* We have not seen this record yet. Remember it. */
*hash|= bitmask;
return true;
}
#ifdef UNIV_DEBUG
@ -2874,11 +2860,7 @@ ibuf_get_volume_buffered_count_func(
case IBUF_OP_DELETE_MARK:
/* There must be a record to delete-mark.
See if this record has been already buffered. */
if (n_recs && ibuf_get_volume_buffered_hash(
rec, types + IBUF_REC_INFO_SIZE,
types + len,
types[IBUF_REC_OFFSET_FLAGS] & IBUF_REC_COMPACT,
hash, size)) {
if (n_recs && ibuf_get_volume_buffered_hash(rec, hash, size)) {
(*n_recs)++;
}

View File

@ -20998,7 +20998,7 @@ static MYSQL_SYSVAR_UINT(data_file_size_debug,
srv_sys_space_size_debug,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"InnoDB system tablespace size to be set in recovery.",
NULL, NULL, 0, 0, UINT_MAX32, 0);
NULL, NULL, 0, 0, 256U << 20, 0);
static MYSQL_SYSVAR_ULONG(fil_make_page_dirty_debug,
srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG,

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2019, MariaDB Corporation.
Copyright (c) 2016, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -63,6 +63,7 @@ UNIV_INTERN my_bool srv_ibuf_disable_background_merge;
#include "que0que.h"
#include "srv0start.h" /* srv_shutdown_state */
#include "ha_prototypes.h"
#include "ut0crc32.h"
#include "rem0cmp.h"
/* STRUCTURE OF AN INSERT BUFFER RECORD
@ -2925,42 +2926,28 @@ ibuf_contract_after_insert(
} while (size > 0 && sum_sizes < entry_size);
}
/*********************************************************************//**
Determine if an insert buffer record has been encountered already.
@return TRUE if a new record, FALSE if possible duplicate */
static
ibool
ibuf_get_volume_buffered_hash(
/*==========================*/
const rec_t* rec, /*!< in: ibuf record in post-4.1 format */
const byte* types, /*!< in: fields */
const byte* data, /*!< in: start of user record data */
ulint comp, /*!< in: 0=ROW_FORMAT=REDUNDANT,
nonzero=ROW_FORMAT=COMPACT */
ulint* hash, /*!< in/out: hash array */
ulint size) /*!< in: number of elements in hash array */
/** Determine if a change buffer record has been encountered already.
@param rec change buffer record in the MySQL 5.5 format
@param hash hash table of encountered records
@param size number of elements in hash
@retval true if a distinct record
@retval false if this may be duplicating an earlier record */
static bool ibuf_get_volume_buffered_hash(const rec_t *rec, ulint *hash,
ulint size)
{
ulint len;
ulint fold;
ulint bitmask;
ut_ad(rec_get_n_fields_old(rec) > IBUF_REC_FIELD_USER);
const ulint start= rec_get_field_start_offs(rec, IBUF_REC_FIELD_USER);
const ulint len= rec_get_data_size_old(rec) - start;
const uint32_t fold= ut_crc32(rec + start, len);
hash+= (fold / (CHAR_BIT * sizeof *hash)) % size;
ulint bitmask= static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
len = ibuf_rec_get_size(
rec, types,
rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp);
fold = ut_fold_binary(data, len);
if (*hash & bitmask)
return false;
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
if (*hash & bitmask) {
return(FALSE);
}
/* We have not seen this record yet. Insert it. */
*hash |= bitmask;
return(TRUE);
/* We have not seen this record yet. Remember it. */
*hash|= bitmask;
return true;
}
#ifdef UNIV_DEBUG
@ -3052,11 +3039,7 @@ ibuf_get_volume_buffered_count_func(
case IBUF_OP_DELETE_MARK:
/* There must be a record to delete-mark.
See if this record has been already buffered. */
if (n_recs && ibuf_get_volume_buffered_hash(
rec, types + IBUF_REC_INFO_SIZE,
types + len,
types[IBUF_REC_OFFSET_FLAGS] & IBUF_REC_COMPACT,
hash, size)) {
if (n_recs && ibuf_get_volume_buffered_hash(rec, hash, size)) {
(*n_recs)++;
}