Skip to content
Permalink
Browse files
Merge 10.7 into 10.8
  • Loading branch information
dr-m committed Nov 9, 2022
2 parents d6d8a49 + 27eaa96 commit fe9412d
Show file tree
Hide file tree
Showing 81 changed files with 1,123 additions and 1,030 deletions.
@@ -1748,7 +1748,8 @@ int cat_file(DYNAMIC_STRING* ds, const char* filename)
len= (size_t) my_seek(fd, 0, SEEK_END, MYF(0));
my_seek(fd, 0, SEEK_SET, MYF(0));
if (len == (size_t)MY_FILEPOS_ERROR ||
!(buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, len + 1, MYF(0))))
!(buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, len + 1,
MYF(MY_WME|MY_FAE))))
{
my_close(fd, MYF(0));
return 1;
@@ -2407,7 +2408,7 @@ VAR *var_init(VAR *v, const char *name, size_t name_len, const char *val, size_t
val_len= 0;
val_alloc_len = val_len + 16; /* room to grow */
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*tmp_var)
+ name_len+2, MYF(MY_WME))))
+ name_len+2, MYF(MY_WME|MY_FAE))))
die("Out of memory");

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

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

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

if (val)
@@ -2969,8 +2971,10 @@ void var_copy(VAR *dest, VAR *src)
/* Alloc/realloc data for str_val in dest */
if (dest->alloced_len < src->alloced_len &&
!(dest->str_val= dest->str_val
? (char*)my_realloc(PSI_NOT_INSTRUMENTED, dest->str_val, src->alloced_len, MYF(MY_WME))
: (char*)my_malloc(PSI_NOT_INSTRUMENTED, src->alloced_len, MYF(MY_WME))))
? (char*)my_realloc(PSI_NOT_INSTRUMENTED, dest->str_val, src->alloced_len,
MYF(MY_WME|MY_FAE))
: (char*)my_malloc(PSI_NOT_INSTRUMENTED, src->alloced_len,
MYF(MY_WME|MY_FAE))))
die("Out of memory");
else
dest->alloced_len= src->alloced_len;
@@ -3047,8 +3051,10 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
MIN_VAR_ALLOC : new_val_len + 1;
if (!(v->str_val =
v->str_val ?
(char*)my_realloc(PSI_NOT_INSTRUMENTED, v->str_val, v->alloced_len+1, MYF(MY_WME)) :
(char*)my_malloc(PSI_NOT_INSTRUMENTED, v->alloced_len+1, MYF(MY_WME))))
(char*)my_realloc(PSI_NOT_INSTRUMENTED, v->str_val, v->alloced_len+1,
MYF(MY_WME|MY_FAE)) :
(char*)my_malloc(PSI_NOT_INSTRUMENTED, v->alloced_len+1,
MYF(MY_WME|MY_FAE))))
die("Out of memory");
}
v->str_val_len = new_val_len;
@@ -4834,7 +4840,8 @@ void do_sync_with_master(struct st_command *command)
p++;
while (*p && my_isspace(charset_info, *p))
p++;
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,MYF(MY_WME | MY_FAE));
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,
MYF(MY_WME|MY_FAE));
get_string(&buff, &p, command);
}
command->last_argument= p;
@@ -6974,7 +6981,7 @@ int read_command(struct st_command** command_ptr)
}
if (!(*command_ptr= command=
(struct st_command*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*command),
MYF(MY_WME|MY_ZEROFILL))) ||
MYF(MY_WME|MY_FAE|MY_ZEROFILL))) ||
insert_dynamic(&q_lines, &command))
die("Out of memory");
command->type= Q_UNKNOWN;
@@ -7682,18 +7689,19 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,

/* Allocate array with bind structs, lengths and NULL flags */
my_bind= (MYSQL_BIND*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(MYSQL_BIND),
MYF(MY_WME | MY_FAE | MY_ZEROFILL));
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
length= (ulong*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(ulong),
MYF(MY_WME | MY_FAE));
MYF(MY_WME|MY_FAE));
is_null= (my_bool*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(my_bool),
MYF(MY_WME | MY_FAE));
MYF(MY_WME|MY_FAE));

/* Allocate data for the result of each field */
for (i= 0; i < num_fields; i++)
{
uint max_length= fields[i].max_length + 1;
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length, MYF(MY_WME | MY_FAE));
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length,
MYF(MY_WME|MY_FAE));
my_bind[i].buffer_length= max_length;
my_bind[i].is_null= &is_null[i];
my_bind[i].length= &length[i];
@@ -8717,7 +8725,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
cn->ps_params= ps_params = (MYSQL_BIND*)my_malloc(PSI_NOT_INSTRUMENTED,
sizeof(MYSQL_BIND) *
stmt->param_count,
MYF(MY_WME));
MYF(MY_WME|MY_FAE));
bzero((char *) ps_params, sizeof(MYSQL_BIND) * stmt->param_count);

int i=0;
@@ -8732,7 +8740,8 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
if (!*c)
{
ps_params[i].buffer_type= MYSQL_TYPE_LONG;
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long), MYF(MY_WME));
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long),
MYF(MY_WME|MY_FAE));
*l= strtol(p, &c, 10);
ps_params[i].buffer= (void*)l;
ps_params[i].buffer_length= 8;
@@ -8744,15 +8753,16 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
{
ps_params[i].buffer_type= MYSQL_TYPE_DECIMAL;
d= (double*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(double),
MYF(MY_WME));
MYF(MY_WME|MY_FAE));
*d= strtod(p, &c);
ps_params[i].buffer= (void*)d;
ps_params[i].buffer_length= 8;
}
else
{
ps_params[i].buffer_type= MYSQL_TYPE_STRING;
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME));
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p,
MYF(MY_WME|MY_FAE));
ps_params[i].buffer_length= (unsigned long)strlen(p);
}
}
@@ -9790,7 +9800,7 @@ int main(int argc, char **argv)
/* Init connections, allocate 1 extra as buffer + 1 for default */
connections= (struct st_connection*)
my_malloc(PSI_NOT_INSTRUMENTED, (opt_max_connections+2) * sizeof(struct st_connection),
MYF(MY_WME | MY_ZEROFILL));
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
connections_end= connections + opt_max_connections +1;
next_con= connections + 1;

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

/* Allocate a buffer for results */
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
MYF(MY_WME|MY_FAE));
while (*from)
{
char *to;
@@ -10525,7 +10536,8 @@ void do_get_replace_column(struct st_command *command)
command->query);
to= get_string(&buff, &from, command);
my_free(replace_column[column_number-1]);
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to, MYF(MY_WME | MY_FAE));
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to,
MYF(MY_WME|MY_FAE));
set_if_bigger(max_replace_column, column_number);
}
my_free(start);
@@ -10592,7 +10604,8 @@ void do_get_replace(struct st_command *command)
bzero(&from_array,sizeof(from_array));
if (!*from)
die("Missing argument in %s", command->query);
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
MYF(MY_WME|MY_FAE));
while (*from)
{
char *to= buff;
@@ -11250,7 +11263,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
DBUG_RETURN(0);
found_sets=0;
if (!(found_set= (FOUND_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(FOUND_SET)*max_length*count,
MYF(MY_WME))))
MYF(MY_WME|MY_FAE))))
{
free_sets(&sets);
DBUG_RETURN(0);
@@ -11260,7 +11273,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
used_sets=-1;
word_states=make_new_set(&sets); /* Start of new word */
start_states=make_new_set(&sets); /* This is first state */
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME|MY_FAE))))
{
free_sets(&sets);
my_free(found_set);
@@ -11427,7 +11440,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
if ((replace=(REPLACE*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REPLACE)*(sets.count)+
sizeof(REPLACE_STRING)*(found_sets+1)+
sizeof(char *)*count+result_len,
MYF(MY_WME | MY_ZEROFILL))))
MYF(MY_WME|MY_FAE|MY_ZEROFILL))))
{
rep_str=(REPLACE_STRING*) (replace+sets.count);
to_array= (char **) (rep_str+found_sets+1);
@@ -11470,10 +11483,10 @@ int init_sets(REP_SETS *sets,uint states)
bzero(sets, sizeof(*sets));
sets->size_of_bits=((states+7)/8);
if (!(sets->set_buffer=(REP_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REP_SET)*SET_MALLOC_HUNC,
MYF(MY_WME))))
MYF(MY_WME|MY_FAE))))
return 1;
if (!(sets->bit_buffer=(uint*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(uint)*sets->size_of_bits*
SET_MALLOC_HUNC,MYF(MY_WME))))
SET_MALLOC_HUNC,MYF(MY_WME|MY_FAE))))
{
my_free(sets->set);
return 1;
@@ -11669,10 +11682,10 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name)
if (!(pa->typelib.type_names=(const char **)
my_malloc(PSI_NOT_INSTRUMENTED, ((PC_MALLOC-MALLOC_OVERHEAD)/
(sizeof(char *)+sizeof(*pa->flag))*
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME|MY_FAE))))
DBUG_RETURN(-1);
if (!(pa->str= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, PS_MALLOC - MALLOC_OVERHEAD,
MYF(MY_WME))))
MYF(MY_WME|MY_FAE))))
{
my_free(pa->typelib.type_names);
DBUG_RETURN (-1);
@@ -3846,10 +3846,6 @@ static dberr_t xb_assign_undo_space_start()
uint32_t fsp_flags;
int n_retries = 5;

if (srv_undo_tablespaces == 0) {
return error;
}

file = os_file_create(0, srv_sys_space.first_datafile()->filepath(),
OS_FILE_OPEN, OS_FILE_NORMAL, OS_DATA_FILE, true, &ret);

@@ -31,7 +31,10 @@ extern ulong my_time_to_wait_for_lock;
#include <signal.h>
#ifdef HAVE_SIGHANDLER_T
#define sig_return sighandler_t
#elif defined(SOLARIS) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(_AIX)
#elif defined(SOLARIS) || defined(__sun) || defined(__APPLE__) || \
defined(_AIX) || \
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__DragonFly__)
typedef void (*sig_return)(int); /* Returns type from signal */
#else
typedef void (*sig_return)(void); /* Returns type from signal */
@@ -340,7 +340,9 @@ program to set the server\'s scheduling priority to the given value\&.
.\}
.\" mysqld_safe: no-auto-restart option
.\" no-auto-restart option: mysqld_safe
\fB\-\-no\-auto\-restart\fR
\fB\-\-no\-auto\-restart\fR,
\fB\-\-nowatch\fR,
\fB\-\-no\-watch\fR
.sp
Exit after starting mysqld\&.
.RE
@@ -368,21 +370,6 @@ Do not read any option files\&. This must be the first option on the command lin
.sp -1
.IP \(bu 2.3
.\}
.\" mysqld_safe: no-watch option
.\" no-watch option: mysqld_safe
\fB\-\-no\-auto\-restart\fR
.sp
Exit after starting mysqld\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqld_safe: numa-interleave option
.\" numa-interleave option: mysqld_safe
\fB\-\-numa\-interleave\fR
@@ -1,17 +1,14 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/have_sequence.inc
--source include/count_sessions.inc

--echo #
--echo # MDEV-22761 KILL QUERY during rowid_filter, crashes
--echo #

create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

# 100 rows
create table t2(a int);
insert into t2 select A.a + B.a* 10 from t0 A, t0 B;
insert into t2 select * from seq_0_to_99;

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

insert into t3
select
A.a,
B.a,
A.seq,
B.seq,
'filler-data-filler-data'
from
t2 A, t2 B;
from seq_0_to_99 A, seq_0_to_99 B;

analyze table t2,t3;

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

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

drop table t0,t2,t3;
drop table t2,t3;
--source include/wait_until_count_sessions.inc

@@ -317,6 +317,15 @@ ERROR 23000: Duplicate entry '1' for key 'v2'
update t1,t2 set v1 = v2 , v5 = 0;
ERROR 23000: Duplicate entry '-128' for key 'v1'
drop table t1, t2;
CREATE TABLE t1 (f TEXT UNIQUE);
INSERT INTO t1 VALUES (NULL),(NULL);
UPDATE t1 SET f = '';
ERROR 23000: Duplicate entry '' for key 'f'
SELECT * FROM t1;
f

NULL
DROP TABLE t1;
#
# MDEV-21540 Initialization of already inited long unique index on reorganize partition
#
@@ -397,6 +397,17 @@ update t1 set v2 = 1, v3 = -128;
update t1,t2 set v1 = v2 , v5 = 0;
drop table t1, t2;

#
# MDEV-23264 Unique blobs allow duplicate values upon UPDATE
#

CREATE TABLE t1 (f TEXT UNIQUE);
INSERT INTO t1 VALUES (NULL),(NULL);
--error ER_DUP_ENTRY
UPDATE t1 SET f = '';
SELECT * FROM t1;
DROP TABLE t1;

--echo #
--echo # MDEV-21540 Initialization of already inited long unique index on reorganize partition
--echo #
@@ -1320,10 +1320,6 @@ partition p2008 values less than (2009)
);
select length(table_name) from mysql.innodb_table_stats;
length(table_name)
79
79
79
79
drop table extralongname_extralongname_extralongname_extralongname_ext;
# End of 10.0 tests
set sql_mode=default;

0 comments on commit fe9412d

Please sign in to comment.