diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-13 11:12:31 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-13 11:12:31 +0300 |
commit | 6bc4444d7ca81786de98f27669891692c2d2e21c (patch) | |
tree | 329efac8c8caeb0f1644b8cea9772d33ab3948eb | |
parent | 218d20ffe3d4e833eb20a75d880fec1c1507b221 (diff) | |
parent | 23d3d180ca47954c8138fee2a4356e0f7e531fc3 (diff) | |
download | mariadb-git-6bc4444d7ca81786de98f27669891692c2d2e21c.tar.gz |
Merge 10.1 into 10.2
-rw-r--r-- | mysql-test/lib/mtr_report.pm | 12 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 5 | ||||
-rw-r--r-- | mysql-test/r/type_set.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/sysvars_innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/t/type_set.test | 2 | ||||
-rw-r--r-- | mysys/list.c | 4 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | storage/innobase/ibuf/ibuf0ibuf.cc | 64 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | storage/xtradb/ibuf/ibuf0ibuf.cc | 65 |
10 files changed, 65 insertions, 95 deletions
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index a3282704dd2..0b99eafa4cf 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -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"; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f584529e608..fad066c1c0f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -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}); diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 742ee5a33e9..73e59bf211c 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -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'); diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 4be85752cc7..08739f6bf28 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -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 diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index 7a79cd12f70..31dc7a11e2d 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -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); diff --git a/mysys/list.c b/mysys/list.c index 10dfd7ec6ef..65da5d452cc 100644 --- a/mysys/list.c +++ b/mysys/list.c @@ -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) { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 8cf867458e2..68011147bc5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -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, diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index cfb4b954d55..e02958b4ac3 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -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; - - len = ibuf_rec_get_size( - rec, types, - rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp); - fold = ut_fold_binary(data, len); - - 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); + 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))); + + if (*hash & bitmask) + return false; + + /* 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)++; } diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 1ef71954cf8..d10c967c3bd 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -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, diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc index 264d1677afa..cd65ea15729 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.cc +++ b/storage/xtradb/ibuf/ibuf0ibuf.cc @@ -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; - - len = ibuf_rec_get_size( - rec, types, - rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp); - fold = ut_fold_binary(data, len); - - 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); + 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))); + + if (*hash & bitmask) + return false; + + /* 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)++; } |