Skip to content

Commit c04284e

Browse files
committed
Merge 10.10 into 10.11
2 parents e9fe39d + 82230aa commit c04284e

File tree

110 files changed

+3645
-1737
lines changed

Some content is hidden

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

110 files changed

+3645
-1737
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ variables:
4242
CMAKE_FLAGS: "-DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF"
4343
# Major version dictates which branches share the same ccache. E.g. 10.6-abc
4444
# and 10.6-xyz will have the same cache.
45-
MARIADB_MAJOR_VERSION: "10.8"
45+
MARIADB_MAJOR_VERSION: "10.9"
4646
# NOTE! Currently ccache is only used on the Centos8 build. As each job has
4747
# sufficiently different environments they are unable to benefit from each
4848
# other's ccaches. As each build generates about 1 GB of ccache, having

cmake/cpack_rpm.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ ELSEIF(RPM MATCHES "sles")
297297
ENDIF()
298298

299299
# MDEV-24629, we need it outside of ELSIFs
300-
IF(RPM MATCHES "fedora3[234]")
300+
IF(RPM MATCHES "fedora")
301301
ALTERNATIVE_NAME("common" "mariadb-connector-c-config" ${MARIADB_CONNECTOR_C_VERSION}-1)
302302
ENDIF()
303303

debian/additions/innotop/innotop

100644100755
Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# Street, Fifth Floor, Boston, MA 02110-1335 USA
2121

2222
use strict;
23+
use warnings;
24+
use utf8;
25+
use feature ':5.16';
2326
use warnings FATAL => 'all';
2427

2528
our $VERSION = '1.11.4';
@@ -265,7 +268,7 @@ sub get_dbh {
265268
$dbh->do($sql);
266269
MKDEBUG && _d('Enabling charset for STDOUT');
267270
if ( $charset eq 'utf8' ) {
268-
binmode(STDOUT, ':utf8')
271+
binmode(STDOUT, ':encoding(UTF-8)')
269272
or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR";
270273
}
271274
else {
@@ -612,6 +615,9 @@ sub ts_to_string {
612615

613616
sub parse_innodb_timestamp {
614617
my $text = shift;
618+
if ( ! defined $text ) {
619+
return (0, 0, 0, 0, 0, 0);
620+
}
615621
my ( $y, $m, $d, $h, $i, $s )
616622
= $text =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/;
617623
die("Can't get timestamp from $text\n") unless $y;
@@ -803,7 +809,8 @@ sub parse_fk_transaction_error {
803809
# TODO: write some tests for this
804810
sub parse_innodb_record_dump {
805811
my ( $dump, $complete, $debug ) = @_;
806-
return undef unless $dump;
812+
# Use bare return as recommend in page 199 of PBP
813+
return unless $dump;
807814

808815
my $result = {};
809816

@@ -6769,6 +6776,9 @@ sub set_precision {
67696776
my ( $num, $precision ) = @_;
67706777
$num = 0 unless defined $num;
67716778
$precision = $config{num_digits}->{val} if !defined $precision;
6779+
if ( $num eq "" ) {
6780+
$num = int(0);
6781+
}
67726782
sprintf("%.${precision}f", $num);
67736783
}
67746784

@@ -6777,6 +6787,9 @@ sub set_precision {
67776787
sub percent {
67786788
my ( $num ) = @_;
67796789
$num = 0 unless defined $num;
6790+
if ( $num eq "" ) {
6791+
$num = int(0);
6792+
}
67806793
my $digits = $config{num_digits}->{val};
67816794
return sprintf("%.${digits}f", $num * 100)
67826795
. ($config{show_percent}->{val} ? '%' : '');
@@ -6841,7 +6854,7 @@ sub make_color_func {
68416854
push @criteria,
68426855
"( defined \$set->{$spec->{col}} && \$set->{$spec->{col}} $spec->{op} $val ) { return '$spec->{color}'; }";
68436856
}
6844-
return undef unless @criteria;
6857+
return unless @criteria;
68456858
my $sub = eval 'sub { my ( $set ) = @_; if ' . join(" elsif ", @criteria) . '}';
68466859
die if $EVAL_ERROR;
68476860
return $sub;
@@ -7521,10 +7534,10 @@ sub choose_connections {
75217534
sub do_stmt {
75227535
my ( $cxn, $stmt_name, @args ) = @_;
75237536

7524-
return undef if $file;
7537+
return if $file;
75257538

75267539
# Test if the cxn should not even be tried
7527-
return undef if $dbhs{$cxn}
7540+
return if $dbhs{$cxn}
75287541
&& $dbhs{$cxn}->{failed}
75297542
&& ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} );
75307543

@@ -7596,10 +7609,10 @@ sub handle_cxn_error {
75967609
sub do_query {
75977610
my ( $cxn, $query ) = @_;
75987611

7599-
return undef if $file;
7612+
return if $file;
76007613

76017614
# Test if the cxn should not even be tried
7602-
return undef if $dbhs{$cxn}
7615+
return if $dbhs{$cxn}
76037616
&& $dbhs{$cxn}->{failed}
76047617
&& ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} );
76057618

@@ -7781,7 +7794,7 @@ sub compile_select_stmt {
77817794
sub compile_filter {
77827795
my ( $text ) = @_;
77837796
my ( $sub, $err );
7784-
eval "\$sub = sub { my \$set = shift; $text }";
7797+
eval { $sub = sub { my $set = shift; $text } };
77857798
if ( $EVAL_ERROR ) {
77867799
$EVAL_ERROR =~ s/at \(eval.*$//;
77877800
$sub = sub { return $EVAL_ERROR };
@@ -8013,7 +8026,7 @@ sub load_config_plugins {
80138026

80148027
# First, find a list of all plugins that exist on disk, and get information about them.
80158028
my $dir = $config{plugin_dir}->{val};
8016-
foreach my $p_file ( <$dir/*.pm> ) {
8029+
foreach my $p_file (glob($dir."/*.pm")) {
80178030
my ($package, $desc);
80188031
eval {
80198032
open my $p_in, "<", $p_file or die $OS_ERROR;
@@ -9192,7 +9205,7 @@ sub switch_var_set {
91929205
# edit_stmt_sleep_times {{{3
91939206
sub edit_stmt_sleep_times {
91949207
$clear_screen_sub->();
9195-
my $stmt = prompt_list('Specify a statement', '', sub { return sort keys %stmt_maker_for });
9208+
my $stmt = prompt_list('Specify a statement', '', sub { my @tmparray = sort keys %stmt_maker_for; return @tmparray });
91969209
return unless $stmt && exists $stmt_maker_for{$stmt};
91979210
$clear_screen_sub->();
91989211
my $curr_val = $stmt_sleep_time_for{$stmt} || 0;
@@ -9843,7 +9856,7 @@ sub get_slave_status {
98439856
sub is_func {
98449857
my ( $word ) = @_;
98459858
return defined(&$word)
9846-
|| eval "my \$x= sub { $word }; 1"
9859+
|| eval { my $x = sub { $word }; 1 }
98479860
|| $EVAL_ERROR !~ m/^Bareword/;
98489861
}
98499862

debian/mariadb-server.mariadb.init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ sanity_checks() {
8686
datadir=`mariadbd_get_param datadir`
8787
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
8888
# 4096 blocks is then lower than 4 MB
89-
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
89+
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$datadir" | tail -n 1)"
9090
if [ "$df_available_blocks" -lt "4096" ]; then
9191
log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
9292
echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER

debian/mariadb-server.preinst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,23 @@ then
223223
mkdir -Z $mysql_datadir
224224
fi
225225

226-
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
227-
# 4096 blocks is then lower than 4 MB
228-
df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1`
229-
if [ "$df_available_blocks" -lt "4096" ]
226+
# Check if MariaDB datadir is available if not fails.
227+
# There should be symlink or directory available or something will fail.
228+
if [ -d "$mysql_datadir" ] || [ -L "$mysql_datadir" ]
230229
then
231-
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
232-
db_stop
233-
exit 1
230+
# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024
231+
# 4096 blocks is then lower than 4 MB
232+
df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$mysql_datadir" | tail -n 1)"
233+
if [ "$df_available_blocks" -lt "4096" ]
234+
then
235+
echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2
236+
db_stop
237+
exit 1
238+
fi
239+
else
240+
echo "ERROR: There's no directory or symlink available: $mysql_datadir/" 1>&2
241+
db_stop
242+
exit 1
234243
fi
235244

236245
# Since the home directory was created before putting the user into

extra/mariabackup/xtrabackup.cc

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -847,27 +847,49 @@ void mdl_lock_all()
847847

848848

849849
// Convert non-null terminated filename to space name
850+
// Note that in 10.6 the filename may be an undo file name
850851
static std::string filename_to_spacename(const void *filename, size_t len)
851852
{
852-
// null- terminate filename
853-
char *f = (char *)malloc(len + 1);
854-
ut_a(f);
855-
memcpy(f, filename, len);
856-
f[len] = 0;
857-
for (size_t i = 0; i < len; i++)
858-
if (f[i] == '\\')
859-
f[i] = '/';
860-
char *p = strrchr(f, '.');
861-
ut_a(p);
862-
*p = 0;
863-
char *table = strrchr(f, '/');
864-
ut_a(table);
865-
*table = 0;
866-
char *db = strrchr(f, '/');
867-
*table = '/';
868-
std::string s(db ? db+1 : f);
869-
free(f);
870-
return s;
853+
char f[FN_REFLEN];
854+
char *p= 0, *table, *db;
855+
DBUG_ASSERT(len < FN_REFLEN);
856+
857+
strmake(f, (const char*) filename, len);
858+
859+
#ifdef _WIN32
860+
for (size_t i = 0; i < len; i++)
861+
{
862+
if (f[i] == '\\')
863+
f[i] = '/';
864+
}
865+
#endif
866+
867+
/* Remove extension, if exists */
868+
if (!(p= strrchr(f, '.')))
869+
goto err;
870+
*p= 0;
871+
872+
/* Find table name */
873+
if (!(table= strrchr(f, '/')))
874+
goto err;
875+
*table = 0;
876+
877+
/* Find database name */
878+
db= strrchr(f, '/');
879+
*table = '/';
880+
if (!db)
881+
goto err;
882+
{
883+
std::string s(db+1);
884+
return s;
885+
}
886+
887+
err:
888+
/* Not a database/table. Return original (converted) name */
889+
if (p)
890+
*p= '.'; // Restore removed extension
891+
std::string s(f);
892+
return s;
871893
}
872894

873895
/** Report an operation to create, delete, or rename a file during backup.
@@ -3146,7 +3168,7 @@ static bool xtrabackup_copy_logfile()
31463168
if (log_sys.buf[recv_sys.offset] <= 1)
31473169
break;
31483170

3149-
if (recv_sys.parse_mtr(STORE_NO) == recv_sys_t::OK)
3171+
if (recv_sys.parse_mtr<false>(false) == recv_sys_t::OK)
31503172
{
31513173
do
31523174
{
@@ -3156,7 +3178,7 @@ static bool xtrabackup_copy_logfile()
31563178
sequence_offset));
31573179
*seq= 1;
31583180
}
3159-
while ((r= recv_sys.parse_mtr(STORE_NO)) == recv_sys_t::OK);
3181+
while ((r= recv_sys.parse_mtr<false>(false)) == recv_sys_t::OK);
31603182

31613183
if (ds_write(dst_log_file, log_sys.buf + start_offset,
31623184
recv_sys.offset - start_offset))

include/m_string.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,15 @@ static inline void lex_string_set3(LEX_CSTRING *lex_str, const char *c_str,
249249
*/
250250
static inline int safe_strcpy(char *dst, size_t dst_size, const char *src)
251251
{
252-
memset(dst, '\0', dst_size);
253-
strncpy(dst, src, dst_size - 1);
254-
/*
255-
If the first condition is true, we are guaranteed to have src length
256-
>= (dst_size - 1), hence safe to access src[dst_size - 1].
257-
*/
258-
if (dst[dst_size - 2] != '\0' && src[dst_size - 1] != '\0')
259-
return 1; /* Truncation of src. */
252+
DBUG_ASSERT(dst_size > 0);
253+
/* Note, strncpy will zerofill end of dst if src shorter than dst_size */
254+
strncpy(dst, src, dst_size);
255+
if (dst[dst_size-1])
256+
{
257+
/* Ensure string is zero terminated */
258+
dst[dst_size-1]= 0;
259+
return 1;
260+
}
260261
return 0;
261262
}
262263

include/myisammrg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ typedef struct st_myrg_info
7171
ulong cache_size;
7272
uint merge_insert_method;
7373
uint tables,options,reclength,keys;
74+
uint key_parts;
7475
my_bool cache_in_use;
7576
/* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */
7677
my_bool children_attached;

include/mysql/service_wsrep.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ extern struct wsrep_service_st {
5757
my_bool (*wsrep_on_func)(const MYSQL_THD thd);
5858
bool (*wsrep_prepare_key_for_innodb_func)(MYSQL_THD thd, const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*);
5959
void (*wsrep_thd_LOCK_func)(const MYSQL_THD thd);
60+
int (*wsrep_thd_TRYLOCK_func)(const MYSQL_THD thd);
6061
void (*wsrep_thd_UNLOCK_func)(const MYSQL_THD thd);
6162
const char * (*wsrep_thd_query_func)(const MYSQL_THD thd);
6263
int (*wsrep_thd_retry_counter_func)(const MYSQL_THD thd);
@@ -89,7 +90,6 @@ extern struct wsrep_service_st {
8990
ulong (*wsrep_OSU_method_get_func)(const MYSQL_THD thd);
9091
my_bool (*wsrep_thd_has_ignored_error_func)(const MYSQL_THD thd);
9192
void (*wsrep_thd_set_ignored_error_func)(MYSQL_THD thd, my_bool val);
92-
bool (*wsrep_thd_set_wsrep_aborter_func)(MYSQL_THD bf_thd, MYSQL_THD thd);
9393
void (*wsrep_report_bf_lock_wait_func)(const MYSQL_THD thd,
9494
unsigned long long trx_id);
9595
void (*wsrep_thd_kill_LOCK_func)(const MYSQL_THD thd);
@@ -111,6 +111,7 @@ extern struct wsrep_service_st {
111111
#define wsrep_on(thd) (thd) && WSREP_ON && wsrep_service->wsrep_on_func(thd)
112112
#define wsrep_prepare_key_for_innodb(A,B,C,D,E,F,G) wsrep_service->wsrep_prepare_key_for_innodb_func(A,B,C,D,E,F,G)
113113
#define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T)
114+
#define wsrep_thd_TRYLOCK(T) wsrep_service->wsrep_thd_TRYLOCK_func(T)
114115
#define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T)
115116
#define wsrep_thd_kill_LOCK(T) wsrep_service->wsrep_thd_kill_LOCK_func(T)
116117
#define wsrep_thd_kill_UNLOCK(T) wsrep_service->wsrep_thd_kill_UNLOCK_func(T)
@@ -141,7 +142,6 @@ extern struct wsrep_service_st {
141142
#define wsrep_OSU_method_get(T) wsrep_service->wsrep_OSU_method_get_func(T)
142143
#define wsrep_thd_has_ignored_error(T) wsrep_service->wsrep_thd_has_ignored_error_func(T)
143144
#define wsrep_thd_set_ignored_error(T,V) wsrep_service->wsrep_thd_set_ignored_error_func(T,V)
144-
#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2)
145145
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
146146
#define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T)
147147
#else
@@ -175,6 +175,8 @@ void wsrep_set_data_home_dir(const char *data_dir);
175175
extern "C" my_bool wsrep_on(const MYSQL_THD thd);
176176
/* Lock thd wsrep lock */
177177
extern "C" void wsrep_thd_LOCK(const MYSQL_THD thd);
178+
/* Try thd wsrep lock. Return non-zero if lock could not be taken. */
179+
extern "C" int wsrep_thd_TRYLOCK(const MYSQL_THD thd);
178180
/* Unlock thd wsrep lock */
179181
extern "C" void wsrep_thd_UNLOCK(const MYSQL_THD thd);
180182

@@ -197,8 +199,6 @@ extern "C" my_bool wsrep_thd_is_local(const MYSQL_THD thd);
197199
/* Return true if thd is in high priority mode */
198200
/* todo: rename to is_high_priority() */
199201
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
200-
/* set wsrep_aborter for the target THD */
201-
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
202202
/* Return true if thd is in TOI mode */
203203
extern "C" my_bool wsrep_thd_is_toi(const MYSQL_THD thd);
204204
/* Return true if thd is in replicating TOI mode */
@@ -249,7 +249,6 @@ extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
249249
extern "C" ulong wsrep_OSU_method_get(const MYSQL_THD thd);
250250
extern "C" my_bool wsrep_thd_has_ignored_error(const MYSQL_THD thd);
251251
extern "C" void wsrep_thd_set_ignored_error(MYSQL_THD thd, my_bool val);
252-
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
253252
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
254253
unsigned long long trx_id);
255254
/* declare parallel applying unsafety for the THD */

0 commit comments

Comments
 (0)