Skip to content
Permalink
Browse files
Merge branch '10.2' into 10.3
  • Loading branch information
vuvova committed Jul 21, 2021
2 parents cf6d83e + 4c38794 commit 6190a02
Show file tree
Hide file tree
Showing 80 changed files with 2,384 additions and 222 deletions.
@@ -21,7 +21,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
FOREACH(lib ${${target}_LIB_DEPENDS})
# Filter out "general", it is not a library, just CMake hint
# Also, remove duplicates
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} " AND NOT lib STREQUAL "zlib")
IF (lib MATCHES "^\\-")
SET(${var} "${${var}} ${lib} ")
ELSEIF(lib MATCHES "^/")
@@ -224,14 +224,14 @@ Architecture: all
Depends: mysql-common,
${misc:Depends},
${shlibs:Depends}
Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
Description: MariaDB database common files (e.g. /etc/mysql/mariadb.conf.d/)
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MariaDB are speed, robustness and
ease of use.
.
This package includes files needed by all versions of the client library
(e.g. /etc/mysql/conf.d/mariadb.cnf).
(e.g. /etc/mysql/mariadb.conf.d/ or /etc/mysql/mariadb.cnf).

Package: mariadb-client-core-10.3
Architecture: any
@@ -815,6 +815,16 @@ write_file(
return(true);
}

// checks using current xdes page whether the page is free
static bool page_is_free(const byte *xdes, page_size_t page_size,
ulonglong page_no)
{
const byte *des=
xdes + XDES_ARR_OFFSET +
XDES_SIZE * ((page_no & (page_size.physical() - 1)) / FSP_EXTENT_SIZE);
return xdes_get_bit(des, XDES_FREE_BIT, page_no % FSP_EXTENT_SIZE);
}

/*
Parse the page and collect/dump the information about page type
@param [in] page buffer page
@@ -900,17 +910,8 @@ parse_page(
}
/* update per-index statistics */
{
if (index_ids.count(id) == 0) {
index_ids[id] = per_index_stats();
}
std::map<unsigned long long, per_index_stats>::iterator it;
it = index_ids.find(id);
per_index_stats &index = (it->second);
const byte* des = xdes + XDES_ARR_OFFSET
+ XDES_SIZE * ((page_no & (page_size.physical() - 1))
/ FSP_EXTENT_SIZE);
if (xdes_get_bit(des, XDES_FREE_BIT,
page_no % FSP_EXTENT_SIZE)) {
per_index_stats &index = index_ids[id];
if (page_is_free(xdes, page_size, page_no)) {
index.free_pages++;
return;
}
@@ -1048,7 +1049,6 @@ parse_page(

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

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

memcpy(xdes, buf, physical_page_size);

if (page_type_summary || page_type_dump) {
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
}
@@ -1962,6 +1963,7 @@ int main(
/* If no-check is enabled, skip the
checksum verification.*/
if (!no_check
&& !page_is_free(xdes, page_size, cur_page_num)
&& !skip_page
&& (exit_status = verify_checksum(
buf, page_size,
@@ -1984,6 +1986,10 @@ int main(
printf("page %llu ", cur_page_num);
}

if (page_get_page_no(buf) % physical_page_size == 0) {
memcpy(xdes, buf, physical_page_size);
}

if (page_type_summary || page_type_dump) {
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
}
@@ -307,7 +307,7 @@ static struct my_option ibx_long_options[] =
{"force-non-empty-directories", OPT_FORCE_NON_EMPTY_DIRS, "This "
"option, when specified, makes --copy-back or --move-back transfer "
"files to non-empty directories. Note that no existing files will be "
"overwritten. If --copy-back or --nove-back has to copy a file from "
"overwritten. If --copy-back or --move-back has to copy a file from "
"the backup directory which already exists in the destination "
"directory, it will still fail with an error.",
(uchar *) &opt_ibx_force_non_empty_dirs,
@@ -1277,7 +1277,7 @@ struct my_option xb_client_options[]= {
"This "
"option, when specified, makes --copy-back or --move-back transfer "
"files to non-empty directories. Note that no existing files will be "
"overwritten. If --copy-back or --nove-back has to copy a file from "
"overwritten. If --copy-back or --move-back has to copy a file from "
"the backup directory which already exists in the destination "
"directory, it will still fail with an error.",
(uchar *) &opt_force_non_empty_dirs, (uchar *) &opt_force_non_empty_dirs,
@@ -155,32 +155,34 @@ END
sub gcov_one_file {
return unless /\.gcda$/;
unless ($opt_skip_gcov) {
$cmd= "gcov -i '$_' 2>/dev/null >/dev/null";
$cmd= "gcov -il '$_' 2>/dev/null >/dev/null";
print STDERR ++$file_no,"\r" if not $opt_verbose and -t STDERR;
logv "Running: $cmd";
system($cmd)==0 or die "system($cmd): $? $!";
}

# now, read the generated file
open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!";
my $fname;
while (<FH>) {
chomp;
if (/^function:/) {
next;
}
if (/^file:/) {
$fname=realpath($');
next;
}
next if /^lcount:\d+,-\d+/; # whatever that means
unless (/^lcount:(\d+),(\d+)/ and $fname) {
warn "unknown line '$_' after running '$cmd'";
next;
for my $gcov_file (<$_*.gcov>) {
open FH, '<', "$gcov_file" or die "open(<$gcov_file): $!";
my $fname;
while (<FH>) {
chomp;
if (/^function:/) {
next;
}
if (/^file:/) {
$fname=realpath(-f $' ? $' : $root.$');
next;
}
next if /^lcount:\d+,-\d+/; # whatever that means
unless (/^lcount:(\d+),(\d+)/ and $fname) {
warn "unknown line '$_' in $gcov_file";
next;
}
$cov{$fname}->{$1}+=$2;
}
$cov{$fname}->{$1}+=$2;
close(FH);
}
close(FH);
}

sub write_coverage {
@@ -395,10 +395,10 @@ sub _collect {
# 1 Still running
#
sub wait_one {
my ($self, $timeout)= @_;
croak "usage: \$safe_proc->wait_one([timeout])" unless ref $self;
my ($self, $timeout, $keep)= @_;
croak "usage: \$safe_proc->wait_one([timeout] [, keep])" unless ref $self;

_verbose("wait_one $self, $timeout");
_verbose("wait_one $self, $timeout, $keep");

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

if ( not $blocking and $retpid == -1 ) {
# still running
_verbose("still running");
return 1;
}
#if ( not $blocking and $retpid == -1 ) {
# # still running
# _verbose("still running");
# return 1;
#}

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

$self->_collect($exit_code);
$self->_collect($exit_code) unless $keep;
return 0;
}

@@ -40,7 +40,7 @@ BEGIN
eval 'sub USE_NETPING { $use_netping }';
}

sub sleep_until_file_created ($$$$);
sub sleep_until_file_created ($$$$$);
sub mtr_ping_port ($);

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

# FIXME check that the pidfile contains the expected pid!

sub sleep_until_file_created ($$$$) {
sub sleep_until_file_created ($$$$$) {
my $pidfile= shift;
my $expectfile = shift;
my $timeout= shift;
my $proc= shift;
my $warn_seconds = shift;
@@ -120,8 +121,9 @@ ($$$$)
my $seconds= ($loop * $sleeptime) / 1000;

# Check if it died after the fork() was successful
if ( defined $proc and ! $proc->wait_one(0) )
if ( defined $proc and ! $proc->wait_one(0, 1) )
{
return 1 if -r $expectfile;
mtr_warning("Process $proc died after mysql-test-run waited $seconds " .
"seconds for $pidfile to be created.");
return 0;
@@ -2019,6 +2019,73 @@ drop procedure sp1;
drop procedure sp2;
drop procedure sp3;
drop table t1;
#
# MDEV-26095: missing RECURSIVE for the recursive definition of CTE
# embedded into another CTE definition
#
create table t1 (a int);
insert into t1 values (5), (7);
with cte_e as (
with recursive cte_r as (
select a from t1 union select a+1 as a from cte_r r where a < 10
) select * from cte_r
) select * from cte_e;
a
5
7
6
8
9
10
with cte_e as (
with cte_r as (
select a from t1 union select a+1 as a from cte_r r where a < 10
) select * from cte_r
) select * from cte_e;
ERROR 42S02: Table 'test.cte_r' doesn't exist
drop table t1;
#
# MDEV-26025: query with two usage of a CTE executing via PS /SP
#
create table t1 (a int, b int);
insert into t1 value (1,3), (3,2), (1,3), (4,1);
prepare stmt from "with
cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
cte2 as ( select a,b from cte1 ),
cte3 as ( select a,b from cte2 )
select * from cte3, cte2";
execute stmt;
a b a b
1 3 1 3
1 3 1 3
1 3 1 3
1 3 1 3
execute stmt;
a b a b
1 3 1 3
1 3 1 3
1 3 1 3
1 3 1 3
deallocate prepare stmt;
create procedure sp() with
cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
cte2 as ( select a,b from cte1 ),
cte3 as ( select a,b from cte2 )
select * from cte3, cte2;
call sp();
a b a b
1 3 1 3
1 3 1 3
1 3 1 3
1 3 1 3
call sp();
a b a b
1 3 1 3
1 3 1 3
1 3 1 3
1 3 1 3
drop procedure sp;
drop table t1;
# End of 10.2 tests
#
# MDEV-21673: several references to CTE that uses
@@ -1492,6 +1492,56 @@ drop procedure sp3;

drop table t1;

--echo #
--echo # MDEV-26095: missing RECURSIVE for the recursive definition of CTE
--echo # embedded into another CTE definition
--echo #

create table t1 (a int);
insert into t1 values (5), (7);

with cte_e as (
with recursive cte_r as (
select a from t1 union select a+1 as a from cte_r r where a < 10
) select * from cte_r
) select * from cte_e;

--ERROR ER_NO_SUCH_TABLE
with cte_e as (
with cte_r as (
select a from t1 union select a+1 as a from cte_r r where a < 10
) select * from cte_r
) select * from cte_e;

drop table t1;

--echo #
--echo # MDEV-26025: query with two usage of a CTE executing via PS /SP
--echo #

create table t1 (a int, b int);
insert into t1 value (1,3), (3,2), (1,3), (4,1);

let $q=
with
cte1 as ( select a,b from t1 where a = 1 AND b = 3 ),
cte2 as ( select a,b from cte1 ),
cte3 as ( select a,b from cte2 )
select * from cte3, cte2;

eval prepare stmt from "$q";
execute stmt;
execute stmt;
deallocate prepare stmt;

eval create procedure sp() $q;

call sp();
call sp();

drop procedure sp;
drop table t1;

--echo # End of 10.2 tests

--echo #

0 comments on commit 6190a02

Please sign in to comment.