Skip to content

Commit 7933367

Browse files
committed
Merge 10.10 into 10.11
2 parents 8283948 + bebe193 commit 7933367

File tree

175 files changed

+4084
-4560
lines changed

Some content is hidden

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

175 files changed

+4084
-4560
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;
@@ -4834,7 +4840,8 @@ void do_sync_with_master(struct st_command *command)
48344840
p++;
48354841
while (*p && my_isspace(charset_info, *p))
48364842
p++;
4837-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,MYF(MY_WME | MY_FAE));
4843+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(p)+1,
4844+
MYF(MY_WME|MY_FAE));
48384845
get_string(&buff, &p, command);
48394846
}
48404847
command->last_argument= p;
@@ -6987,7 +6994,7 @@ int read_command(struct st_command** command_ptr)
69876994
}
69886995
if (!(*command_ptr= command=
69896996
(struct st_command*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*command),
6990-
MYF(MY_WME|MY_ZEROFILL))) ||
6997+
MYF(MY_WME|MY_FAE|MY_ZEROFILL))) ||
69916998
insert_dynamic(&q_lines, &command))
69926999
die("Out of memory");
69937000
command->type= Q_UNKNOWN;
@@ -7695,18 +7702,19 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
76957702

76967703
/* Allocate array with bind structs, lengths and NULL flags */
76977704
my_bind= (MYSQL_BIND*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(MYSQL_BIND),
7698-
MYF(MY_WME | MY_FAE | MY_ZEROFILL));
7705+
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
76997706
length= (ulong*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(ulong),
7700-
MYF(MY_WME | MY_FAE));
7707+
MYF(MY_WME|MY_FAE));
77017708
is_null= (my_bool*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(my_bool),
7702-
MYF(MY_WME | MY_FAE));
7709+
MYF(MY_WME|MY_FAE));
77037710

77047711
/* Allocate data for the result of each field */
77057712
for (i= 0; i < num_fields; i++)
77067713
{
77077714
uint max_length= fields[i].max_length + 1;
77087715
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
7709-
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length, MYF(MY_WME | MY_FAE));
7716+
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length,
7717+
MYF(MY_WME|MY_FAE));
77107718
my_bind[i].buffer_length= max_length;
77117719
my_bind[i].is_null= &is_null[i];
77127720
my_bind[i].length= &length[i];
@@ -8730,7 +8738,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
87308738
cn->ps_params= ps_params = (MYSQL_BIND*)my_malloc(PSI_NOT_INSTRUMENTED,
87318739
sizeof(MYSQL_BIND) *
87328740
stmt->param_count,
8733-
MYF(MY_WME));
8741+
MYF(MY_WME|MY_FAE));
87348742
bzero((char *) ps_params, sizeof(MYSQL_BIND) * stmt->param_count);
87358743

87368744
int i=0;
@@ -8745,7 +8753,8 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
87458753
if (!*c)
87468754
{
87478755
ps_params[i].buffer_type= MYSQL_TYPE_LONG;
8748-
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long), MYF(MY_WME));
8756+
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long),
8757+
MYF(MY_WME|MY_FAE));
87498758
*l= strtol(p, &c, 10);
87508759
ps_params[i].buffer= (void*)l;
87518760
ps_params[i].buffer_length= 8;
@@ -8757,15 +8766,16 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
87578766
{
87588767
ps_params[i].buffer_type= MYSQL_TYPE_DECIMAL;
87598768
d= (double*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(double),
8760-
MYF(MY_WME));
8769+
MYF(MY_WME|MY_FAE));
87618770
*d= strtod(p, &c);
87628771
ps_params[i].buffer= (void*)d;
87638772
ps_params[i].buffer_length= 8;
87648773
}
87658774
else
87668775
{
87678776
ps_params[i].buffer_type= MYSQL_TYPE_STRING;
8768-
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME));
8777+
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p,
8778+
MYF(MY_WME|MY_FAE));
87698779
ps_params[i].buffer_length= (unsigned long)strlen(p);
87708780
}
87718781
}
@@ -9803,7 +9813,7 @@ int main(int argc, char **argv)
98039813
/* Init connections, allocate 1 extra as buffer + 1 for default */
98049814
connections= (struct st_connection*)
98059815
my_malloc(PSI_NOT_INSTRUMENTED, (opt_max_connections+2) * sizeof(struct st_connection),
9806-
MYF(MY_WME | MY_ZEROFILL));
9816+
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
98079817
connections_end= connections + opt_max_connections +1;
98089818
next_con= connections + 1;
98099819

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

1052310533
/* Allocate a buffer for results */
10524-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
10534+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
10535+
MYF(MY_WME|MY_FAE));
1052510536
while (*from)
1052610537
{
1052710538
char *to;
@@ -10534,7 +10545,8 @@ void do_get_replace_column(struct st_command *command)
1053410545
command->query);
1053510546
to= get_string(&buff, &from, command);
1053610547
my_free(replace_column[column_number-1]);
10537-
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to, MYF(MY_WME | MY_FAE));
10548+
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to,
10549+
MYF(MY_WME|MY_FAE));
1053810550
set_if_bigger(max_replace_column, column_number);
1053910551
}
1054010552
my_free(start);
@@ -10601,7 +10613,8 @@ void do_get_replace(struct st_command *command)
1060110613
bzero(&from_array,sizeof(from_array));
1060210614
if (!*from)
1060310615
die("Missing argument in %s", command->query);
10604-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
10616+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
10617+
MYF(MY_WME|MY_FAE));
1060510618
while (*from)
1060610619
{
1060710620
char *to= buff;
@@ -11259,7 +11272,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1125911272
DBUG_RETURN(0);
1126011273
found_sets=0;
1126111274
if (!(found_set= (FOUND_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(FOUND_SET)*max_length*count,
11262-
MYF(MY_WME))))
11275+
MYF(MY_WME|MY_FAE))))
1126311276
{
1126411277
free_sets(&sets);
1126511278
DBUG_RETURN(0);
@@ -11269,7 +11282,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1126911282
used_sets=-1;
1127011283
word_states=make_new_set(&sets); /* Start of new word */
1127111284
start_states=make_new_set(&sets); /* This is first state */
11272-
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
11285+
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME|MY_FAE))))
1127311286
{
1127411287
free_sets(&sets);
1127511288
my_free(found_set);
@@ -11436,7 +11449,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1143611449
if ((replace=(REPLACE*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REPLACE)*(sets.count)+
1143711450
sizeof(REPLACE_STRING)*(found_sets+1)+
1143811451
sizeof(char *)*count+result_len,
11439-
MYF(MY_WME | MY_ZEROFILL))))
11452+
MYF(MY_WME|MY_FAE|MY_ZEROFILL))))
1144011453
{
1144111454
rep_str=(REPLACE_STRING*) (replace+sets.count);
1144211455
to_array= (char **) (rep_str+found_sets+1);
@@ -11479,10 +11492,10 @@ int init_sets(REP_SETS *sets,uint states)
1147911492
bzero(sets, sizeof(*sets));
1148011493
sets->size_of_bits=((states+7)/8);
1148111494
if (!(sets->set_buffer=(REP_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REP_SET)*SET_MALLOC_HUNC,
11482-
MYF(MY_WME))))
11495+
MYF(MY_WME|MY_FAE))))
1148311496
return 1;
1148411497
if (!(sets->bit_buffer=(uint*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(uint)*sets->size_of_bits*
11485-
SET_MALLOC_HUNC,MYF(MY_WME))))
11498+
SET_MALLOC_HUNC,MYF(MY_WME|MY_FAE))))
1148611499
{
1148711500
my_free(sets->set);
1148811501
return 1;
@@ -11678,10 +11691,10 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name)
1167811691
if (!(pa->typelib.type_names=(const char **)
1167911692
my_malloc(PSI_NOT_INSTRUMENTED, ((PC_MALLOC-MALLOC_OVERHEAD)/
1168011693
(sizeof(char *)+sizeof(*pa->flag))*
11681-
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
11694+
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME|MY_FAE))))
1168211695
DBUG_RETURN(-1);
1168311696
if (!(pa->str= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, PS_MALLOC - MALLOC_OVERHEAD,
11684-
MYF(MY_WME))))
11697+
MYF(MY_WME|MY_FAE))))
1168511698
{
1168611699
my_free(pa->typelib.type_names);
1168711700
DBUG_RETURN (-1);

debian/autobake-deb.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ then
2626
sed '/Add support for verbose builds/,/^$/d' -i debian/rules
2727
elif [ -d storage/columnstore/columnstore/debian ]
2828
then
29-
# ColumnStore is explicitly disabled in the native Debian build, so allow it
29+
# ColumnStore is explicitly disabled in the native Debian build. Enable it
3030
# now when build is triggered by autobake-deb.sh (MariaDB.org) and when the
31-
# build is not running on Travis or Gitlab-CI
31+
# build is not running on Gitlab-CI.
3232
sed '/-DPLUGIN_COLUMNSTORE=NO/d' -i debian/rules
3333
# Take the files and part of control from MCS directory
3434
if [ ! -f debian/mariadb-plugin-columnstore.install ]
@@ -59,13 +59,13 @@ replace_uring_with_aio()
5959
{
6060
sed 's/liburing-dev/libaio-dev/g' -i debian/control
6161
sed -e '/-DIGNORE_AIO_CHECK=YES/d' \
62-
-e '/-DWITH_URING=yes/d' -i debian/rules
62+
-e '/-DWITH_URING=YES/d' -i debian/rules
6363
}
6464

6565
disable_pmem()
6666
{
6767
sed '/libpmem-dev/d' -i debian/control
68-
sed '/-DWITH_PMEM=yes/d' -i debian/rules
68+
sed '/-DWITH_PMEM=YES/d' -i debian/rules
6969
}
7070

7171
disable_libfmt()
@@ -76,15 +76,34 @@ disable_libfmt()
7676

7777
architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
7878

79+
# Parse release name and number from Linux standard base release
80+
# Example:
81+
# $ lsb_release -a
82+
# No LSB modules are available.
83+
# Distributor ID: Debian
84+
# Description: Debian GNU/Linux bookworm/sid
85+
# Release: n/a
86+
# Codename: n/a
7987
LSBID="$(lsb_release -si | tr '[:upper:]' '[:lower:]')"
8088
LSBVERSION="$(lsb_release -sr | sed -e "s#\.##g")"
8189
LSBNAME="$(lsb_release -sc)"
8290

91+
# If 'n/a', assume 'sid'
92+
if [ "${LSBVERSION}" == "n/a" ] || [ "${LSBNAME}" == "n/a" ]
93+
then
94+
LSBVERSION="sid"
95+
LSBNAME="sid"
96+
fi
97+
98+
# If not known, use 'unknown' in .deb version identifier
8399
if [ -z "${LSBID}" ]
84100
then
85101
LSBID="unknown"
86102
fi
87-
case "${LSBNAME}" in
103+
104+
case "${LSBNAME}"
105+
in
106+
# Debian
88107
stretch)
89108
# MDEV-16525 libzstd-dev-1.1.3 minimum version
90109
sed -e '/libzstd-dev/d' \
@@ -113,10 +132,10 @@ case "${LSBNAME}" in
113132
fi
114133
;&
115134
sid)
116-
# should always be empty here.
117-
# need to match here to avoid the default Error however
135+
# The default packaging should always target Debian Sid, so in this case
136+
# there is intentionally no customizations whatsoever.
118137
;;
119-
# UBUNTU
138+
# Ubuntu
120139
bionic)
121140
remove_rocksdb_tools
122141
[ "$architecture" != amd64 ] && disable_pmem
@@ -143,7 +162,7 @@ case "${LSBNAME}" in
143162
fi
144163
;;
145164
*)
146-
echo "Error - unknown release codename $LSBNAME" >&2
165+
echo "Error: Unknown release '$LSBNAME'" >&2
147166
exit 1
148167
esac
149168

@@ -162,7 +181,7 @@ LOGSTRING="MariaDB build"
162181
EPOCH="1:"
163182
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${LSBID:0:3}${LSBVERSION}"
164183

165-
dch -b -D ${LSBNAME} -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint
184+
dch -b -D "${LSBNAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint
166185

167186
echo "Creating package version ${VERSION} ... "
168187

debian/mariadb-server.mariadb.init

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ test -x /usr/sbin/mariadbd || exit 0
2121

2222
. /lib/lsb/init-functions
2323

24-
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
25-
26-
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
24+
SELF=$(cd "$(dirname $0)"; pwd -P)/$(basename $0)
25+
26+
if [ -f /usr/bin/mariadb-admin ]
27+
then
28+
MYADMIN="/usr/bin/mariadb-admin --defaults-file=/etc/mysql/debian.cnf"
29+
elif [ -f /usr/bin/mysqladmin ]
30+
then
31+
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
32+
else
33+
log_failure_msg "Command mariadb-admin/mysqladmin not found! This SysV init script depends on it."
34+
exit -1
35+
fi
2736

2837
# priority can be overridden and "-s" adds output to stderr
2938
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i"

0 commit comments

Comments
 (0)