Skip to content

Commit 6bc4444

Browse files
committed
Merge 10.1 into 10.2
2 parents 218d20f + 23d3d18 commit 6bc4444

File tree

10 files changed

+65
-95
lines changed

10 files changed

+65
-95
lines changed

mysql-test/lib/mtr_report.pm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,21 @@ sub mtr_report_stats ($$$$) {
466466
}
467467

468468
$test_time = sprintf("%.3f", $test->{timer} / 1000);
469+
$test->{'name'} =~ s/$current_suite\.//;
469470
$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test->{'result'}" time="$test_time");
470471

471472
my $comment = $test->{'comment'};
472473
$comment =~ s/[\"]//g;
473474

474-
if ($test->{'result'} eq "MTR_RES_FAILED") {
475-
$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);
475+
# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
476+
if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'}) {
477+
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
478+
479+
$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);
476480
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED" && $test->{'disable'}) {
477-
$xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
481+
$xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
478482
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED") {
479-
$xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
483+
$xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
480484
} else {
481485
$xml_report .= " />\n";
482486
}

mysql-test/mysql-test-run.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,15 @@ ($)
382382
};
383383
eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }';
384384
} else {
385-
sub HAVE_WIN32_CONSOLE { 0 };
385+
eval 'sub HAVE_WIN32_CONSOLE { 0 }';
386386
}
387387
}
388388

389389
if (-t STDOUT) {
390390
if (IS_WINDOWS and HAVE_WIN32_CONSOLE) {
391391
$set_titlebar = sub {Win32::Console::Title $_[0];};
392392
} elsif (defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
393-
$set_titlebar = sub { print "\e];$_[0]\a"; };
393+
$set_titlebar = sub { syswrite STDOUT, "\e];$_[0]\a"; };
394394
}
395395
}
396396

@@ -941,6 +941,7 @@ ($$$)
941941
if ( $result->is_failed() ) {
942942
my $worker_logdir= $result->{savedir};
943943
my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
944+
$result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20);
944945
rename $log_file_name,$log_file_name.".failed";
945946
}
946947
delete($result->{result});

mysql-test/r/type_set.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ End of 5.0 tests
109109
# Start of 10.0 tests
110110
#
111111
#
112-
# MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns
112+
# MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns
113113
#
114114
CREATE TABLE t1 (c1 DATE PRIMARY KEY);
115115
INSERT INTO t1 VALUES ('2001-01-01');

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ VARIABLE_SCOPE GLOBAL
613613
VARIABLE_TYPE INT UNSIGNED
614614
VARIABLE_COMMENT InnoDB system tablespace size to be set in recovery.
615615
NUMERIC_MIN_VALUE 0
616-
NUMERIC_MAX_VALUE4294967295
616+
NUMERIC_MAX_VALUE268435456
617617
NUMERIC_BLOCK_SIZE 0
618618
ENUM_VALUE_LIST NULL
619619
READ_ONLY YES

mysql-test/t/type_set.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ DROP TABLE t1;
102102
--echo #
103103

104104
--echo #
105-
--echo # MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns
105+
--echo # MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns
106106
--echo #
107107

108108
CREATE TABLE t1 (c1 DATE PRIMARY KEY);

mysys/list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
1515

1616
/*
17-
Code for handling dubble-linked lists in C
17+
Code for handling doubly linked lists in C
1818
*/
1919

2020
#include "mysys_priv.h"
2121
#include <my_list.h>
2222

2323

2424

25-
/* Add a element to start of list */
25+
/* Add an element to start of list */
2626

2727
LIST *list_add(LIST *root, LIST *element)
2828
{

storage/innobase/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20961,7 +20961,7 @@ static MYSQL_SYSVAR_UINT(data_file_size_debug,
2096120961
srv_sys_space_size_debug,
2096220962
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
2096320963
"InnoDB system tablespace size to be set in recovery.",
20964-
NULL, NULL, 0, 0, UINT_MAX32, 0);
20964+
NULL, NULL, 0, 0, 256U << 20, 0);
2096520965

2096620966
static MYSQL_SYSVAR_ULONG(fil_make_page_dirty_debug,
2096720967
srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG,

storage/innobase/ibuf/ibuf0ibuf.cc

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2016, 2020 MariaDB Corporation.
4+
Copyright (c) 2016, 2020, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -2746,42 +2746,28 @@ ibuf_contract_after_insert(
27462746
} while (size > 0 && sum_sizes < entry_size);
27472747
}
27482748

2749-
/*********************************************************************//**
2750-
Determine if an insert buffer record has been encountered already.
2751-
@return TRUE if a new record, FALSE if possible duplicate */
2752-
static
2753-
ibool
2754-
ibuf_get_volume_buffered_hash(
2755-
/*==========================*/
2756-
const rec_t* rec,/*!< in: ibuf record in post-4.1 format */
2757-
const byte* types,/*!< in: fields */
2758-
const byte* data,/*!< in: start of user record data */
2759-
ulint comp,/*!< in: 0=ROW_FORMAT=REDUNDANT,
2760-
nonzero=ROW_FORMAT=COMPACT */
2761-
ulint* hash,/*!< in/out: hash array */
2762-
ulint size)/*!< in: number of elements in hash array */
2749+
/** Determine if a change buffer record has been encountered already.
2750+
@param rec change buffer record in the MySQL 5.5 format
2751+
@param hash hash table of encountered records
2752+
@param size number of elements in hash
2753+
@retval true if a distinct record
2754+
@retval false if this may be duplicating an earlier record */
2755+
static bool ibuf_get_volume_buffered_hash(const rec_t *rec, ulint *hash,
2756+
ulint size)
27632757
{
2764-
ulint len;
2765-
ulint fold;
2766-
ulint bitmask;
2767-
2768-
len = ibuf_rec_get_size(
2769-
rec, types,
2770-
rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp);
2771-
fold = ut_fold_binary(data, len);
2772-
2773-
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
2774-
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
2775-
2776-
if (*hash & bitmask) {
2777-
2778-
return(FALSE);
2779-
}
2780-
2781-
/* We have not seen this record yet. Insert it. */
2782-
*hash |= bitmask;
2783-
2784-
return(TRUE);
2758+
ut_ad(rec_get_n_fields_old(rec) > IBUF_REC_FIELD_USER);
2759+
const ulint start= rec_get_field_start_offs(rec, IBUF_REC_FIELD_USER);
2760+
const ulint len= rec_get_data_size_old(rec) - start;
2761+
const uint32_t fold= ut_crc32(rec + start, len);
2762+
hash+= (fold / (CHAR_BIT * sizeof *hash)) % size;
2763+
ulint bitmask= static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
2764+
2765+
if (*hash & bitmask)
2766+
return false;
2767+
2768+
/* We have not seen this record yet. Remember it. */
2769+
*hash|= bitmask;
2770+
return true;
27852771
}
27862772

27872773
#ifdef UNIV_DEBUG
@@ -2874,11 +2860,7 @@ ibuf_get_volume_buffered_count_func(
28742860
case IBUF_OP_DELETE_MARK:
28752861
/* There must be a record to delete-mark.
28762862
See if this record has been already buffered. */
2877-
if (n_recs && ibuf_get_volume_buffered_hash(
2878-
rec, types + IBUF_REC_INFO_SIZE,
2879-
types + len,
2880-
types[IBUF_REC_OFFSET_FLAGS] & IBUF_REC_COMPACT,
2881-
hash, size)) {
2863+
if (n_recs && ibuf_get_volume_buffered_hash(rec, hash, size)) {
28822864
(*n_recs)++;
28832865
}
28842866

storage/xtradb/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20998,7 +20998,7 @@ static MYSQL_SYSVAR_UINT(data_file_size_debug,
2099820998
srv_sys_space_size_debug,
2099920999
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
2100021000
"InnoDB system tablespace size to be set in recovery.",
21001-
NULL, NULL, 0, 0, UINT_MAX32, 0);
21001+
NULL, NULL, 0, 0, 256U << 20, 0);
2100221002

2100321003
static MYSQL_SYSVAR_ULONG(fil_make_page_dirty_debug,
2100421004
srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG,

storage/xtradb/ibuf/ibuf0ibuf.cc

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2016, 2019, MariaDB Corporation.
4+
Copyright (c) 2016, 2020, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
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;
6363
#include "que0que.h"
6464
#include "srv0start.h" /* srv_shutdown_state */
6565
#include "ha_prototypes.h"
66+
#include "ut0crc32.h"
6667
#include "rem0cmp.h"
6768

6869
/*STRUCTURE OF AN INSERT BUFFER RECORD
@@ -2925,42 +2926,28 @@ ibuf_contract_after_insert(
29252926
} while (size > 0 && sum_sizes < entry_size);
29262927
}
29272928

2928-
/*********************************************************************//**
2929-
Determine if an insert buffer record has been encountered already.
2930-
@return TRUE if a new record, FALSE if possible duplicate */
2931-
static
2932-
ibool
2933-
ibuf_get_volume_buffered_hash(
2934-
/*==========================*/
2935-
const rec_t* rec,/*!< in: ibuf record in post-4.1 format */
2936-
const byte* types,/*!< in: fields */
2937-
const byte* data,/*!< in: start of user record data */
2938-
ulint comp,/*!< in: 0=ROW_FORMAT=REDUNDANT,
2939-
nonzero=ROW_FORMAT=COMPACT */
2940-
ulint* hash,/*!< in/out: hash array */
2941-
ulint size)/*!< in: number of elements in hash array */
2929+
/** Determine if a change buffer record has been encountered already.
2930+
@param rec change buffer record in the MySQL 5.5 format
2931+
@param hash hash table of encountered records
2932+
@param size number of elements in hash
2933+
@retval true if a distinct record
2934+
@retval false if this may be duplicating an earlier record */
2935+
static bool ibuf_get_volume_buffered_hash(const rec_t *rec, ulint *hash,
2936+
ulint size)
29422937
{
2943-
ulint len;
2944-
ulint fold;
2945-
ulint bitmask;
2946-
2947-
len = ibuf_rec_get_size(
2948-
rec, types,
2949-
rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp);
2950-
fold = ut_fold_binary(data, len);
2951-
2952-
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
2953-
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
2954-
2955-
if (*hash & bitmask) {
2956-
2957-
return(FALSE);
2958-
}
2959-
2960-
/* We have not seen this record yet. Insert it. */
2961-
*hash |= bitmask;
2962-
2963-
return(TRUE);
2938+
ut_ad(rec_get_n_fields_old(rec) > IBUF_REC_FIELD_USER);
2939+
const ulint start= rec_get_field_start_offs(rec, IBUF_REC_FIELD_USER);
2940+
const ulint len= rec_get_data_size_old(rec) - start;
2941+
const uint32_t fold= ut_crc32(rec + start, len);
2942+
hash+= (fold / (CHAR_BIT * sizeof *hash)) % size;
2943+
ulint bitmask= static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
2944+
2945+
if (*hash & bitmask)
2946+
return false;
2947+
2948+
/* We have not seen this record yet. Remember it. */
2949+
*hash|= bitmask;
2950+
return true;
29642951
}
29652952

29662953
#ifdef UNIV_DEBUG
@@ -3052,11 +3039,7 @@ ibuf_get_volume_buffered_count_func(
30523039
case IBUF_OP_DELETE_MARK:
30533040
/* There must be a record to delete-mark.
30543041
See if this record has been already buffered. */
3055-
if (n_recs && ibuf_get_volume_buffered_hash(
3056-
rec, types + IBUF_REC_INFO_SIZE,
3057-
types + len,
3058-
types[IBUF_REC_OFFSET_FLAGS] & IBUF_REC_COMPACT,
3059-
hash, size)) {
3042+
if (n_recs && ibuf_get_volume_buffered_hash(rec, hash, size)) {
30603043
(*n_recs)++;
30613044
}
30623045

0 commit comments

Comments
 (0)