Skip to content

Commit e62120c

Browse files
committed
Merge 10.4 into 10.5
2 parents 1a69e15 + 0464761 commit e62120c

File tree

15 files changed

+75
-44
lines changed

15 files changed

+75
-44
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3341,7 +3341,7 @@ static void xb_load_single_table_tablespace(const char *dirname,
33413341
delete file;
33423342

33433343
if (err != DB_SUCCESS && xtrabackup_backup && !is_empty_file) {
3344-
die("Failed to not validate first page of the file %s, error %d",name, (int)err);
3344+
die("Failed to validate first page of the file %s, error %d",name, (int)err);
33453345
}
33463346

33473347
ut_free(name);

include/mysql/psi/psi.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ typedef void (*register_socket_v1_t)
14421442
@return an instrumented mutex
14431443
*/
14441444
typedef struct PSI_mutex* (*init_mutex_v1_t)
1445-
(PSI_mutex_key key, const void *identity);
1445+
(PSI_mutex_key key, void *identity);
14461446

14471447
/**
14481448
Mutex instrumentation destruction API.
@@ -1457,7 +1457,7 @@ typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);
14571457
@return an instrumented rwlock
14581458
*/
14591459
typedef struct PSI_rwlock* (*init_rwlock_v1_t)
1460-
(PSI_rwlock_key key, const void *identity);
1460+
(PSI_rwlock_key key, void *identity);
14611461

14621462
/**
14631463
Rwlock instrumentation destruction API.
@@ -1472,7 +1472,7 @@ typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);
14721472
@return an instrumented cond
14731473
*/
14741474
typedef struct PSI_cond* (*init_cond_v1_t)
1475-
(PSI_cond_key key, const void *identity);
1475+
(PSI_cond_key key, void *identity);
14761476

14771477
/**
14781478
Cond instrumentation destruction API.

include/mysql/psi/psi_abi_v1.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,13 @@
409409
typedef void (*register_socket_v1_t)
410410
(const char *category, struct PSI_socket_info_v1 *info, int count);
411411
typedef struct PSI_mutex* (*init_mutex_v1_t)
412-
(PSI_mutex_key key, const void *identity);
412+
(PSI_mutex_key key, void *identity);
413413
typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);
414414
typedef struct PSI_rwlock* (*init_rwlock_v1_t)
415-
(PSI_rwlock_key key, const void *identity);
415+
(PSI_rwlock_key key, void *identity);
416416
typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);
417417
typedef struct PSI_cond* (*init_cond_v1_t)
418-
(PSI_cond_key key, const void *identity);
418+
(PSI_cond_key key, void *identity);
419419
typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond);
420420
typedef struct PSI_socket* (*init_socket_v1_t)
421421
(PSI_socket_key key, const my_socket *fd,

include/pfs_thread_provider.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ void pfs_register_thread_v1(const char *category,
5252
int count);
5353

5454
PSI_mutex*
55-
pfs_init_mutex_v1(PSI_mutex_key key, const void *identity);
55+
pfs_init_mutex_v1(PSI_mutex_key key, void *identity);
5656

5757
void pfs_destroy_mutex_v1(PSI_mutex* mutex);
5858

5959
PSI_rwlock*
60-
pfs_init_rwlock_v1(PSI_rwlock_key key, const void *identity);
60+
pfs_init_rwlock_v1(PSI_rwlock_key key, void *identity);
6161

6262
void pfs_destroy_rwlock_v1(PSI_rwlock* rwlock);
6363

6464
PSI_cond*
65-
pfs_init_cond_v1(PSI_cond_key key, const void *identity);
65+
pfs_init_cond_v1(PSI_cond_key key, void *identity);
6666

6767
void pfs_destroy_cond_v1(PSI_cond* cond);
6868

libmariadb

mysql-test/lib/My/Options.pm

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,16 @@ sub diff {
140140
}
141141

142142

143-
sub is_set {
144-
my ($opts, $set_opts)= @_;
143+
sub is_subset {
144+
my ($set, $subset)= @_;
145+
my %cache = map { _split_option($_) } @$set;
145146

146-
foreach my $opt (@$opts){
147-
148-
my ($opt_name1, $value1)= _split_option($opt);
149-
150-
foreach my $set_opt (@$set_opts){
151-
my ($opt_name2, $value2)= _split_option($set_opt);
152-
153-
if ($opt_name1 eq $opt_name2 and $value1 eq $value2){
154-
# Option already set
155-
return 1;
156-
}
157-
}
147+
for (@$subset){
148+
my ($name, $value)= _split_option($_);
149+
return 0 unless exists $cache{$name} and $cache{$name} eq $value;
158150
}
159151

160-
return 0;
152+
return 1;
161153
}
162154

163155

mysql-test/lib/mtr_cases.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,10 @@ sub make_combinations($$@)
626626
{
627627
# Skip all other combinations if the values they change
628628
# are already fixed in master_opt or slave_opt
629-
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
630-
My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
629+
# (empty combinations are not considered a subset of anything)
630+
if (@{$comb->{comb_opt}} &&
631+
My::Options::is_subset($test->{master_opt}, $comb->{comb_opt}) &&
632+
My::Options::is_subset($test->{slave_opt}, $comb->{comb_opt}) ){
631633

632634
$test_combs->{$comb->{name}} = 2;
633635

mysql-test/suite/sql_sequence/default.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,13 @@ ALTER TABLE t1 add column d int default next value for s_not_exits;
183183
ERROR 42S02: Table 'test.s_not_exits' doesn't exist
184184
drop table t1;
185185
drop sequence s1;
186+
#
187+
# MDEV 22785 Crash with prepared statements and NEXTVAL()
188+
#
189+
CREATE SEQUENCE s;
190+
CREATE TABLE t1 (id int NOT NULL DEFAULT NEXTVAL(s), PRIMARY KEY (id));
191+
PREPARE stmt FROM " INSERT INTO t1 () values ()";
192+
INSERT INTO t1 () values ();
193+
EXECUTE stmt;
194+
DROP TABLE t1;
195+
DROP SEQUENCE s;

mysql-test/suite/sql_sequence/default.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,15 @@ ALTER TABLE t1 add column c int;
123123
ALTER TABLE t1 add column d int default next value for s_not_exits;
124124
drop table t1;
125125
drop sequence s1;
126+
127+
--echo #
128+
--echo # MDEV 22785 Crash with prepared statements and NEXTVAL()
129+
--echo #
130+
CREATE SEQUENCE s;
131+
CREATE TABLE t1 (id int NOT NULL DEFAULT NEXTVAL(s), PRIMARY KEY (id));
132+
PREPARE stmt FROM " INSERT INTO t1 () values ()";
133+
INSERT INTO t1 () values ();
134+
EXECUTE stmt;
135+
# Cleanup
136+
DROP TABLE t1;
137+
DROP SEQUENCE s;

mysys/psi_noop.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void register_socket_noop(const char *category NNN,
8686
}
8787

8888
static PSI_mutex*
89-
init_mutex_noop(PSI_mutex_key key NNN, const void *identity NNN)
89+
init_mutex_noop(PSI_mutex_key key NNN, void *identity NNN)
9090
{
9191
return NULL;
9292
}
@@ -97,7 +97,7 @@ static void destroy_mutex_noop(PSI_mutex* mutex NNN)
9797
}
9898

9999
static PSI_rwlock*
100-
init_rwlock_noop(PSI_rwlock_key key NNN, const void *identity NNN)
100+
init_rwlock_noop(PSI_rwlock_key key NNN, void *identity NNN)
101101
{
102102
return NULL;
103103
}
@@ -108,7 +108,7 @@ static void destroy_rwlock_noop(PSI_rwlock* rwlock NNN)
108108
}
109109

110110
static PSI_cond*
111-
init_cond_noop(PSI_cond_key key NNN, const void *identity NNN)
111+
init_cond_noop(PSI_cond_key key NNN, void *identity NNN)
112112
{
113113
return NULL;
114114
}

0 commit comments

Comments
 (0)