Skip to content

Commit 6190a02

Browse files
committed
Merge branch '10.2' into 10.3
2 parents cf6d83e + 4c38794 commit 6190a02

File tree

80 files changed

+2384
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2384
-222
lines changed

cmake/for_clients.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
2121
FOREACH(lib ${${target}_LIB_DEPENDS})
2222
# Filter out "general", it is not a library, just CMake hint
2323
# Also, remove duplicates
24-
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
24+
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} " AND NOT lib STREQUAL "zlib")
2525
IF (lib MATCHES "^\\-")
2626
SET(${var} "${${var}} ${lib} ")
2727
ELSEIF(lib MATCHES "^/")

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,14 @@ Architecture: all
224224
Depends: mysql-common,
225225
${misc:Depends},
226226
${shlibs:Depends}
227-
Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
227+
Description: MariaDB database common files (e.g. /etc/mysql/mariadb.conf.d/)
228228
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
229229
server. SQL (Structured Query Language) is the most popular database query
230230
language in the world. The main goals of MariaDB are speed, robustness and
231231
ease of use.
232232
.
233233
This package includes files needed by all versions of the client library
234-
(e.g. /etc/mysql/conf.d/mariadb.cnf).
234+
(e.g. /etc/mysql/mariadb.conf.d/ or /etc/mysql/mariadb.cnf).
235235

236236
Package: mariadb-client-core-10.3
237237
Architecture: any

extra/innochecksum.cc

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,16 @@ write_file(
815815
return(true);
816816
}
817817

818+
// checks using current xdes page whether the page is free
819+
static bool page_is_free(const byte *xdes, page_size_t page_size,
820+
ulonglong page_no)
821+
{
822+
const byte *des=
823+
xdes + XDES_ARR_OFFSET +
824+
XDES_SIZE * ((page_no & (page_size.physical() - 1)) / FSP_EXTENT_SIZE);
825+
return xdes_get_bit(des, XDES_FREE_BIT, page_no % FSP_EXTENT_SIZE);
826+
}
827+
818828
/*
819829
Parse the page and collect/dump the information about page type
820830
@param [in] page buffer page
@@ -900,17 +910,8 @@ parse_page(
900910
}
901911
/* update per-index statistics */
902912
{
903-
if (index_ids.count(id) == 0) {
904-
index_ids[id] = per_index_stats();
905-
}
906-
std::map<unsigned long long, per_index_stats>::iterator it;
907-
it = index_ids.find(id);
908-
per_index_stats &index = (it->second);
909-
const byte* des = xdes + XDES_ARR_OFFSET
910-
+ XDES_SIZE * ((page_no & (page_size.physical() - 1))
911-
/ FSP_EXTENT_SIZE);
912-
if (xdes_get_bit(des, XDES_FREE_BIT,
913-
page_no % FSP_EXTENT_SIZE)) {
913+
per_index_stats &index = index_ids[id];
914+
if (page_is_free(xdes, page_size, page_no)) {
914915
index.free_pages++;
915916
return;
916917
}
@@ -1048,7 +1049,6 @@ parse_page(
10481049

10491050
case FIL_PAGE_TYPE_FSP_HDR:
10501051
page_type.n_fil_page_type_fsp_hdr++;
1051-
memcpy(xdes, page, page_size.physical());
10521052
if (page_type_dump) {
10531053
fprintf(file, "#::%llu\t\t|\t\tFile Space "
10541054
"Header\t\t|\t%s\n", cur_page_num, str);
@@ -1057,7 +1057,6 @@ parse_page(
10571057

10581058
case FIL_PAGE_TYPE_XDES:
10591059
page_type.n_fil_page_type_xdes++;
1060-
memcpy(xdes, page, page_size.physical());
10611060
if (page_type_dump) {
10621061
fprintf(file, "#::%llu\t\t|\t\tExtent descriptor "
10631062
"page\t\t|\t%s\n", cur_page_num, str);
@@ -1784,6 +1783,8 @@ int main(
17841783
printf("page %llu ", cur_page_num);
17851784
}
17861785

1786+
memcpy(xdes, buf, physical_page_size);
1787+
17871788
if (page_type_summary || page_type_dump) {
17881789
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
17891790
}
@@ -1962,6 +1963,7 @@ int main(
19621963
/* If no-check is enabled, skip the
19631964
checksum verification.*/
19641965
if (!no_check
1966+
&& !page_is_free(xdes, page_size, cur_page_num)
19651967
&& !skip_page
19661968
&& (exit_status = verify_checksum(
19671969
buf, page_size,
@@ -1984,6 +1986,10 @@ int main(
19841986
printf("page %llu ", cur_page_num);
19851987
}
19861988

1989+
if (page_get_page_no(buf) % physical_page_size == 0) {
1990+
memcpy(xdes, buf, physical_page_size);
1991+
}
1992+
19871993
if (page_type_summary || page_type_dump) {
19881994
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
19891995
}

extra/mariabackup/innobackupex.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static struct my_option ibx_long_options[] =
307307
{"force-non-empty-directories", OPT_FORCE_NON_EMPTY_DIRS, "This "
308308
"option, when specified, makes --copy-back or --move-back transfer "
309309
"files to non-empty directories. Note that no existing files will be "
310-
"overwritten. If --copy-back or --nove-back has to copy a file from "
310+
"overwritten. If --copy-back or --move-back has to copy a file from "
311311
"the backup directory which already exists in the destination "
312312
"directory, it will still fail with an error.",
313313
(uchar *) &opt_ibx_force_non_empty_dirs,

extra/mariabackup/xtrabackup.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ struct my_option xb_client_options[]= {
12771277
"This "
12781278
"option, when specified, makes --copy-back or --move-back transfer "
12791279
"files to non-empty directories. Note that no existing files will be "
1280-
"overwritten. If --copy-back or --nove-back has to copy a file from "
1280+
"overwritten. If --copy-back or --move-back has to copy a file from "
12811281
"the backup directory which already exists in the destination "
12821282
"directory, it will still fail with an error.",
12831283
(uchar *) &opt_force_non_empty_dirs, (uchar *) &opt_force_non_empty_dirs,

libmariadb

mysql-test/dgcov.pl

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -155,32 +155,34 @@ END
155155
sub gcov_one_file {
156156
return unless /\.gcda$/;
157157
unless ($opt_skip_gcov) {
158-
$cmd= "gcov -i '$_' 2>/dev/null >/dev/null";
158+
$cmd= "gcov -il '$_' 2>/dev/null >/dev/null";
159159
print STDERR ++$file_no,"\r" if not $opt_verbose and -t STDERR;
160160
logv "Running: $cmd";
161161
system($cmd)==0 or die "system($cmd): $? $!";
162162
}
163163

164164
# now, read the generated file
165-
open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!";
166-
my $fname;
167-
while (<FH>) {
168-
chomp;
169-
if (/^function:/) {
170-
next;
171-
}
172-
if (/^file:/) {
173-
$fname=realpath($');
174-
next;
175-
}
176-
next if /^lcount:\d+,-\d+/; # whatever that means
177-
unless (/^lcount:(\d+),(\d+)/ and $fname) {
178-
warn "unknown line '$_' after running '$cmd'";
179-
next;
165+
for my $gcov_file (<$_*.gcov>) {
166+
open FH, '<', "$gcov_file" or die "open(<$gcov_file): $!";
167+
my $fname;
168+
while (<FH>) {
169+
chomp;
170+
if (/^function:/) {
171+
next;
172+
}
173+
if (/^file:/) {
174+
$fname=realpath(-f $' ? $' : $root.$');
175+
next;
176+
}
177+
next if /^lcount:\d+,-\d+/; # whatever that means
178+
unless (/^lcount:(\d+),(\d+)/ and $fname) {
179+
warn "unknown line '$_' in $gcov_file";
180+
next;
181+
}
182+
$cov{$fname}->{$1}+=$2;
180183
}
181-
$cov{$fname}->{$1}+=$2;
184+
close(FH);
182185
}
183-
close(FH);
184186
}
185187

186188
sub write_coverage {

mysql-test/lib/My/SafeProcess.pm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ sub _collect {
395395
# 1 Still running
396396
#
397397
sub wait_one {
398-
my ($self, $timeout)= @_;
399-
croak "usage: \$safe_proc->wait_one([timeout])" unless ref $self;
398+
my ($self, $timeout, $keep)= @_;
399+
croak "usage: \$safe_proc->wait_one([timeout] [, keep])" unless ref $self;
400400

401-
_verbose("wait_one $self, $timeout");
401+
_verbose("wait_one $self, $timeout, $keep");
402402

403403
if ( ! defined($self->{SAFE_PID}) ) {
404404
# No pid => not running
@@ -472,16 +472,16 @@ sub wait_one {
472472
return 1;
473473
}
474474

475-
if ( not $blocking and $retpid == -1 ) {
476-
# still running
477-
_verbose("still running");
478-
return 1;
479-
}
475+
#if ( not $blocking and $retpid == -1 ) {
476+
# # still running
477+
# _verbose("still running");
478+
# return 1;
479+
#}
480480

481481
#warn "wait_one: expected pid $pid but got $retpid"
482482
# unless( $retpid == $pid );
483483

484-
$self->_collect($exit_code);
484+
$self->_collect($exit_code) unless $keep;
485485
return 0;
486486
}
487487

mysql-test/lib/mtr_process.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ BEGIN
4040
eval 'sub USE_NETPING { $use_netping }';
4141
}
4242

43-
sub sleep_until_file_created ($$$$);
43+
sub sleep_until_file_created ($$$$$);
4444
sub mtr_ping_port ($);
4545

4646
sub mtr_ping_port ($) {
@@ -102,8 +102,9 @@ ($)
102102

103103
# FIXME check that the pidfile contains the expected pid!
104104

105-
sub sleep_until_file_created ($$$$) {
105+
sub sleep_until_file_created ($$$$$) {
106106
my $pidfile= shift;
107+
my $expectfile = shift;
107108
my $timeout= shift;
108109
my $proc= shift;
109110
my $warn_seconds = shift;
@@ -120,8 +121,9 @@ ($$$$)
120121
my $seconds= ($loop * $sleeptime) / 1000;
121122

122123
# Check if it died after the fork() was successful
123-
if ( defined $proc and ! $proc->wait_one(0) )
124+
if ( defined $proc and ! $proc->wait_one(0, 1) )
124125
{
126+
return 1 if -r $expectfile;
125127
mtr_warning("Process $proc died after mysql-test-run waited $seconds " .
126128
"seconds for $pidfile to be created.");
127129
return 0;

mysql-test/main/cte_nonrecursive.result

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,73 @@ drop procedure sp1;
20192019
drop procedure sp2;
20202020
drop procedure sp3;
20212021
drop table t1;
2022+
#
2023+
# MDEV-26095: missing RECURSIVE for the recursive definition of CTE
2024+
# embedded into another CTE definition
2025+
#
2026+
create table t1 (a int);
2027+
insert into t1 values (5), (7);
2028+
with cte_e as (
2029+
with recursive cte_r as (
2030+
select a from t1 union select a+1 as a from cte_r r where a < 10
2031+
) select * from cte_r
2032+
) select * from cte_e;
2033+
a
2034+
5
2035+
7
2036+
6
2037+
8
2038+
9
2039+
10
2040+
with cte_e as (
2041+
with cte_r as (
2042+
select a from t1 union select a+1 as a from cte_r r where a < 10
2043+
) select * from cte_r
2044+
) select * from cte_e;
2045+
ERROR 42S02: Table 'test.cte_r' doesn't exist
2046+
drop table t1;
2047+
#
2048+
# MDEV-26025: query with two usage of a CTE executing via PS /SP
2049+
#
2050+
create table t1 (a int, b int);
2051+
insert into t1 value (1,3), (3,2), (1,3), (4,1);
2052+
prepare stmt from "with
2053+
cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
2054+
cte2 as ( select a,b from cte1 ),
2055+
cte3 as ( select a,b from cte2 )
2056+
select * from cte3, cte2";
2057+
execute stmt;
2058+
a b a b
2059+
1 3 1 3
2060+
1 3 1 3
2061+
1 3 1 3
2062+
1 3 1 3
2063+
execute stmt;
2064+
a b a b
2065+
1 3 1 3
2066+
1 3 1 3
2067+
1 3 1 3
2068+
1 3 1 3
2069+
deallocate prepare stmt;
2070+
create procedure sp() with
2071+
cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
2072+
cte2 as ( select a,b from cte1 ),
2073+
cte3 as ( select a,b from cte2 )
2074+
select * from cte3, cte2;
2075+
call sp();
2076+
a b a b
2077+
1 3 1 3
2078+
1 3 1 3
2079+
1 3 1 3
2080+
1 3 1 3
2081+
call sp();
2082+
a b a b
2083+
1 3 1 3
2084+
1 3 1 3
2085+
1 3 1 3
2086+
1 3 1 3
2087+
drop procedure sp;
2088+
drop table t1;
20222089
# End of 10.2 tests
20232090
#
20242091
# MDEV-21673: several references to CTE that uses

0 commit comments

Comments
 (0)