Skip to content

Commit 27eaa96

Browse files
committed
Merge 10.6 into 10.7
2 parents 320de65 + e56c12b commit 27eaa96

File tree

75 files changed

+1001
-990
lines changed

Some content is hidden

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

75 files changed

+1001
-990
lines changed

client/mysqltest.cc

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,8 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
17481748
len= (size_t) my_seek(fd, 0, SEEK_END, MYF(0));
17491749
my_seek(fd, 0, SEEK_SET, MYF(0));
17501750
if (len == (size_t)MY_FILEPOS_ERROR ||
1751-
!(buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, len + 1, MYF(0))))
1751+
!(buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, len + 1,
1752+
MYF(MY_WME|MY_FAE))))
17521753
{
17531754
my_close(fd, MYF(0));
17541755
return 1;
@@ -2407,7 +2408,7 @@ VAR *var_init(VAR *v, const char *name, size_t name_len, const char *val, size_t
24072408
val_len= 0;
24082409
val_alloc_len = val_len + 16; /* room to grow */
24092410
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*tmp_var)
2410-
+ name_len+2, MYF(MY_WME))))
2411+
+ name_len+2, MYF(MY_WME|MY_FAE))))
24112412
die("Out of memory");
24122413

24132414
if (name != NULL)
@@ -2421,7 +2422,8 @@ VAR *var_init(VAR *v, const char *name, size_t name_len, const char *val, size_t
24212422

24222423
tmp_var->alloced = (v == 0);
24232424

2424-
if (!(tmp_var->str_val = (char*)my_malloc(PSI_NOT_INSTRUMENTED, val_alloc_len+1, MYF(MY_WME))))
2425+
if (!(tmp_var->str_val = (char*)my_malloc(PSI_NOT_INSTRUMENTED,
2426+
val_alloc_len+1, MYF(MY_WME|MY_FAE))))
24252427
die("Out of memory");
24262428

24272429
if (val)
@@ -2969,8 +2971,10 @@ void var_copy(VAR *dest, VAR *src)
29692971
/* Alloc/realloc data for str_val in dest */
29702972
if (dest->alloced_len < src->alloced_len &&
29712973
!(dest->str_val= dest->str_val
2972-
? (char*)my_realloc(PSI_NOT_INSTRUMENTED, dest->str_val, src->alloced_len, MYF(MY_WME))
2973-
: (char*)my_malloc(PSI_NOT_INSTRUMENTED, src->alloced_len, MYF(MY_WME))))
2974+
? (char*)my_realloc(PSI_NOT_INSTRUMENTED, dest->str_val, src->alloced_len,
2975+
MYF(MY_WME|MY_FAE))
2976+
: (char*)my_malloc(PSI_NOT_INSTRUMENTED, src->alloced_len,
2977+
MYF(MY_WME|MY_FAE))))
29742978
die("Out of memory");
29752979
else
29762980
dest->alloced_len= src->alloced_len;
@@ -3047,8 +3051,10 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
30473051
MIN_VAR_ALLOC : new_val_len + 1;
30483052
if (!(v->str_val =
30493053
v->str_val ?
3050-
(char*)my_realloc(PSI_NOT_INSTRUMENTED, v->str_val, v->alloced_len+1, MYF(MY_WME)) :
3051-
(char*)my_malloc(PSI_NOT_INSTRUMENTED, v->alloced_len+1, MYF(MY_WME))))
3054+
(char*)my_realloc(PSI_NOT_INSTRUMENTED, v->str_val, v->alloced_len+1,
3055+
MYF(MY_WME|MY_FAE)) :
3056+
(char*)my_malloc(PSI_NOT_INSTRUMENTED, v->alloced_len+1,
3057+
MYF(MY_WME|MY_FAE))))
30523058
die("Out of memory");
30533059
}
30543060
v->str_val_len = new_val_len;
@@ -4783,7 +4789,8 @@ void do_sync_with_master(struct st_command *command)
47834789
p++;
47844790
while (*p && my_isspace(charset_info, *p))
47854791
p++;
4786-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,MYF(MY_WME | MY_FAE));
4792+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,
4793+
MYF(MY_WME|MY_FAE));
47874794
get_string(&buff, &p, command);
47884795
}
47894796
command->last_argument= p;
@@ -6923,7 +6930,7 @@ int read_command(struct st_command** command_ptr)
69236930
}
69246931
if (!(*command_ptr= command=
69256932
(struct st_command*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*command),
6926-
MYF(MY_WME|MY_ZEROFILL))) ||
6933+
MYF(MY_WME|MY_FAE|MY_ZEROFILL))) ||
69276934
insert_dynamic(&q_lines, &command))
69286935
die("Out of memory");
69296936
command->type= Q_UNKNOWN;
@@ -7631,18 +7638,19 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
76317638

76327639
/* Allocate array with bind structs, lengths and NULL flags */
76337640
my_bind= (MYSQL_BIND*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(MYSQL_BIND),
7634-
MYF(MY_WME | MY_FAE | MY_ZEROFILL));
7641+
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
76357642
length= (ulong*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(ulong),
7636-
MYF(MY_WME | MY_FAE));
7643+
MYF(MY_WME|MY_FAE));
76377644
is_null= (my_bool*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(my_bool),
7638-
MYF(MY_WME | MY_FAE));
7645+
MYF(MY_WME|MY_FAE));
76397646

76407647
/* Allocate data for the result of each field */
76417648
for (i= 0; i < num_fields; i++)
76427649
{
76437650
uint max_length= fields[i].max_length + 1;
76447651
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
7645-
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length, MYF(MY_WME | MY_FAE));
7652+
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length,
7653+
MYF(MY_WME|MY_FAE));
76467654
my_bind[i].buffer_length= max_length;
76477655
my_bind[i].is_null= &is_null[i];
76487656
my_bind[i].length= &length[i];
@@ -8666,7 +8674,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
86668674
cn->ps_params= ps_params = (MYSQL_BIND*)my_malloc(PSI_NOT_INSTRUMENTED,
86678675
sizeof(MYSQL_BIND) *
86688676
stmt->param_count,
8669-
MYF(MY_WME));
8677+
MYF(MY_WME|MY_FAE));
86708678
bzero((char *) ps_params, sizeof(MYSQL_BIND) * stmt->param_count);
86718679

86728680
int i=0;
@@ -8681,7 +8689,8 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
86818689
if (!*c)
86828690
{
86838691
ps_params[i].buffer_type= MYSQL_TYPE_LONG;
8684-
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long), MYF(MY_WME));
8692+
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long),
8693+
MYF(MY_WME|MY_FAE));
86858694
*l= strtol(p, &c, 10);
86868695
ps_params[i].buffer= (void*)l;
86878696
ps_params[i].buffer_length= 8;
@@ -8693,15 +8702,16 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
86938702
{
86948703
ps_params[i].buffer_type= MYSQL_TYPE_DECIMAL;
86958704
d= (double*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(double),
8696-
MYF(MY_WME));
8705+
MYF(MY_WME|MY_FAE));
86978706
*d= strtod(p, &c);
86988707
ps_params[i].buffer= (void*)d;
86998708
ps_params[i].buffer_length= 8;
87008709
}
87018710
else
87028711
{
87038712
ps_params[i].buffer_type= MYSQL_TYPE_STRING;
8704-
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME));
8713+
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p,
8714+
MYF(MY_WME|MY_FAE));
87058715
ps_params[i].buffer_length= (unsigned long)strlen(p);
87068716
}
87078717
}
@@ -9739,7 +9749,7 @@ int main(int argc, char **argv)
97399749
/* Init connections, allocate 1 extra as buffer + 1 for default */
97409750
connections= (struct st_connection*)
97419751
my_malloc(PSI_NOT_INSTRUMENTED, (opt_max_connections+2) * sizeof(struct st_connection),
9742-
MYF(MY_WME | MY_ZEROFILL));
9752+
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
97439753
connections_end= connections + opt_max_connections +1;
97449754
next_con= connections + 1;
97459755

@@ -10461,7 +10471,8 @@ void do_get_replace_column(struct st_command *command)
1046110471
die("Missing argument in %s", command->query);
1046210472

1046310473
/* Allocate a buffer for results */
10464-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
10474+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
10475+
MYF(MY_WME|MY_FAE));
1046510476
while (*from)
1046610477
{
1046710478
char *to;
@@ -10474,7 +10485,8 @@ void do_get_replace_column(struct st_command *command)
1047410485
command->query);
1047510486
to= get_string(&buff, &from, command);
1047610487
my_free(replace_column[column_number-1]);
10477-
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to, MYF(MY_WME | MY_FAE));
10488+
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to,
10489+
MYF(MY_WME|MY_FAE));
1047810490
set_if_bigger(max_replace_column, column_number);
1047910491
}
1048010492
my_free(start);
@@ -10541,7 +10553,8 @@ void do_get_replace(struct st_command *command)
1054110553
bzero(&from_array,sizeof(from_array));
1054210554
if (!*from)
1054310555
die("Missing argument in %s", command->query);
10544-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
10556+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
10557+
MYF(MY_WME|MY_FAE));
1054510558
while (*from)
1054610559
{
1054710560
char *to= buff;
@@ -11199,7 +11212,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1119911212
DBUG_RETURN(0);
1120011213
found_sets=0;
1120111214
if (!(found_set= (FOUND_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(FOUND_SET)*max_length*count,
11202-
MYF(MY_WME))))
11215+
MYF(MY_WME|MY_FAE))))
1120311216
{
1120411217
free_sets(&sets);
1120511218
DBUG_RETURN(0);
@@ -11209,7 +11222,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1120911222
used_sets=-1;
1121011223
word_states=make_new_set(&sets); /* Start of new word */
1121111224
start_states=make_new_set(&sets); /* This is first state */
11212-
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
11225+
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME|MY_FAE))))
1121311226
{
1121411227
free_sets(&sets);
1121511228
my_free(found_set);
@@ -11376,7 +11389,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1137611389
if ((replace=(REPLACE*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REPLACE)*(sets.count)+
1137711390
sizeof(REPLACE_STRING)*(found_sets+1)+
1137811391
sizeof(char *)*count+result_len,
11379-
MYF(MY_WME | MY_ZEROFILL))))
11392+
MYF(MY_WME|MY_FAE|MY_ZEROFILL))))
1138011393
{
1138111394
rep_str=(REPLACE_STRING*) (replace+sets.count);
1138211395
to_array= (char **) (rep_str+found_sets+1);
@@ -11419,10 +11432,10 @@ int init_sets(REP_SETS *sets,uint states)
1141911432
bzero(sets, sizeof(*sets));
1142011433
sets->size_of_bits=((states+7)/8);
1142111434
if (!(sets->set_buffer=(REP_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REP_SET)*SET_MALLOC_HUNC,
11422-
MYF(MY_WME))))
11435+
MYF(MY_WME|MY_FAE))))
1142311436
return 1;
1142411437
if (!(sets->bit_buffer=(uint*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(uint)*sets->size_of_bits*
11425-
SET_MALLOC_HUNC,MYF(MY_WME))))
11438+
SET_MALLOC_HUNC,MYF(MY_WME|MY_FAE))))
1142611439
{
1142711440
my_free(sets->set);
1142811441
return 1;
@@ -11618,10 +11631,10 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name)
1161811631
if (!(pa->typelib.type_names=(const char **)
1161911632
my_malloc(PSI_NOT_INSTRUMENTED, ((PC_MALLOC-MALLOC_OVERHEAD)/
1162011633
(sizeof(char *)+sizeof(*pa->flag))*
11621-
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
11634+
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME|MY_FAE))))
1162211635
DBUG_RETURN(-1);
1162311636
if (!(pa->str= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, PS_MALLOC - MALLOC_OVERHEAD,
11624-
MYF(MY_WME))))
11637+
MYF(MY_WME|MY_FAE))))
1162511638
{
1162611639
my_free(pa->typelib.type_names);
1162711640
DBUG_RETURN (-1);

extra/mariabackup/xtrabackup.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,10 +3818,6 @@ static dberr_t xb_assign_undo_space_start()
38183818
uint32_t fsp_flags;
38193819
int n_retries = 5;
38203820

3821-
if (srv_undo_tablespaces == 0) {
3822-
return error;
3823-
}
3824-
38253821
file = os_file_create(0, srv_sys_space.first_datafile()->filepath(),
38263822
OS_FILE_OPEN, OS_FILE_NORMAL, OS_DATA_FILE, true, &ret);
38273823

include/my_alarm.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ extern ulong my_time_to_wait_for_lock;
3131
#include <signal.h>
3232
#ifdef HAVE_SIGHANDLER_T
3333
#define sig_return sighandler_t
34-
#elif defined(SOLARIS) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(_AIX)
34+
#elif defined(SOLARIS) || defined(__sun) || defined(__APPLE__) || \
35+
defined(_AIX) || \
36+
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
37+
defined(__DragonFly__)
3538
typedef void (*sig_return)(int); /* Returns type from signal */
3639
#else
3740
typedef void (*sig_return)(void); /* Returns type from signal */

man/mysqld_safe.1

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ program to set the server\'s scheduling priority to the given value\&.
340340
.\}
341341
.\" mysqld_safe: no-auto-restart option
342342
.\" no-auto-restart option: mysqld_safe
343-
\fB\-\-no\-auto\-restart\fR
343+
\fB\-\-no\-auto\-restart\fR,
344+
\fB\-\-nowatch\fR,
345+
\fB\-\-no\-watch\fR
344346
.sp
345347
Exit after starting mysqld\&.
346348
.RE
@@ -368,21 +370,6 @@ Do not read any option files\&. This must be the first option on the command lin
368370
.sp -1
369371
.IP \(bu 2.3
370372
.\}
371-
.\" mysqld_safe: no-watch option
372-
.\" no-watch option: mysqld_safe
373-
\fB\-\-no\-auto\-restart\fR
374-
.sp
375-
Exit after starting mysqld\&.
376-
.RE
377-
.sp
378-
.RS 4
379-
.ie n \{\
380-
\h'-04'\(bu\h'+03'\c
381-
.\}
382-
.el \{\
383-
.sp -1
384-
.IP \(bu 2.3
385-
.\}
386373
.\" mysqld_safe: numa-interleave option
387374
.\" numa-interleave option: mysqld_safe
388375
\fB\-\-numa\-interleave\fR

mysql-test/include/rowid_filter_debug_kill.inc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
--source include/have_debug.inc
22
--source include/have_debug_sync.inc
3+
--source include/have_sequence.inc
34
--source include/count_sessions.inc
45

56
--echo #
67
--echo # MDEV-22761 KILL QUERY during rowid_filter, crashes
78
--echo #
89

9-
create table t0(a int);
10-
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
11-
12-
# 100 rows
1310
create table t2(a int);
14-
insert into t2 select A.a + B.a* 10 from t0 A, t0 B;
11+
insert into t2 select * from seq_0_to_99;
1512

1613
# 10K rows
1714
CREATE TABLE t3 (
@@ -26,11 +23,10 @@ where table_schema=database() and table_name='t3';
2623

2724
insert into t3
2825
select
29-
A.a,
30-
B.a,
26+
A.seq,
27+
B.seq,
3128
'filler-data-filler-data'
32-
from
33-
t2 A, t2 B;
29+
from seq_0_to_99 A, seq_0_to_99 B;
3430

3531
analyze table t2,t3;
3632

@@ -48,7 +44,6 @@ where
4844
t3.key1=t2.a and t3.key2 in (2,3);
4945

5046
connect (con1, localhost, root,,);
51-
connection con1;
5247
set debug_sync='now WAIT_FOR at_rowid_filter_check';
5348
evalp kill query $target_id;
5449
set debug_sync='now SIGNAL go';
@@ -60,6 +55,5 @@ disconnect con1;
6055
reap;
6156
set debug_sync='RESET';
6257

63-
drop table t0,t2,t3;
58+
drop table t2,t3;
6459
--source include/wait_until_count_sessions.inc
65-

mysql-test/main/long_unique_bugs.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,15 @@ ERROR 23000: Duplicate entry '1' for key 'v2'
317317
update t1,t2 set v1 = v2 , v5 = 0;
318318
ERROR 23000: Duplicate entry '-128' for key 'v1'
319319
drop table t1, t2;
320+
CREATE TABLE t1 (f TEXT UNIQUE);
321+
INSERT INTO t1 VALUES (NULL),(NULL);
322+
UPDATE t1 SET f = '';
323+
ERROR 23000: Duplicate entry '' for key 'f'
324+
SELECT * FROM t1;
325+
f
326+
327+
NULL
328+
DROP TABLE t1;
320329
#
321330
# MDEV-21540 Initialization of already inited long unique index on reorganize partition
322331
#

mysql-test/main/long_unique_bugs.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@ update t1 set v2 = 1, v3 = -128;
397397
update t1,t2 set v1 = v2 , v5 = 0;
398398
drop table t1, t2;
399399

400+
#
401+
# MDEV-23264 Unique blobs allow duplicate values upon UPDATE
402+
#
403+
404+
CREATE TABLE t1 (f TEXT UNIQUE);
405+
INSERT INTO t1 VALUES (NULL),(NULL);
406+
--error ER_DUP_ENTRY
407+
UPDATE t1 SET f = '';
408+
SELECT * FROM t1;
409+
DROP TABLE t1;
410+
400411
--echo #
401412
--echo # MDEV-21540 Initialization of already inited long unique index on reorganize partition
402413
--echo #

mysql-test/main/mysql_upgrade.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,10 +1319,6 @@ partition p2008 values less than (2009)
13191319
);
13201320
select length(table_name) from mysql.innodb_table_stats;
13211321
length(table_name)
1322-
79
1323-
79
1324-
79
1325-
79
13261322
drop table extralongname_extralongname_extralongname_extralongname_ext;
13271323
# End of 10.0 tests
13281324
set sql_mode=default;

0 commit comments

Comments
 (0)