Skip to content

Commit bebe193

Browse files
committed
Merge 10.9 into 10.10
2 parents bb894f2 + b35a048 commit bebe193

File tree

176 files changed

+4082
-4564
lines changed

Some content is hidden

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

176 files changed

+4082
-4564
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;
@@ -6970,7 +6977,7 @@ int read_command(struct st_command** command_ptr)
69706977
}
69716978
if (!(*command_ptr= command=
69726979
(struct st_command*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(*command),
6973-
MYF(MY_WME|MY_ZEROFILL))) ||
6980+
MYF(MY_WME|MY_FAE|MY_ZEROFILL))) ||
69746981
insert_dynamic(&q_lines, &command))
69756982
die("Out of memory");
69766983
command->type= Q_UNKNOWN;
@@ -7678,18 +7685,19 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
76787685

76797686
/* Allocate array with bind structs, lengths and NULL flags */
76807687
my_bind= (MYSQL_BIND*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(MYSQL_BIND),
7681-
MYF(MY_WME | MY_FAE | MY_ZEROFILL));
7688+
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
76827689
length= (ulong*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(ulong),
7683-
MYF(MY_WME | MY_FAE));
7690+
MYF(MY_WME|MY_FAE));
76847691
is_null= (my_bool*) my_malloc(PSI_NOT_INSTRUMENTED, num_fields * sizeof(my_bool),
7685-
MYF(MY_WME | MY_FAE));
7692+
MYF(MY_WME|MY_FAE));
76867693

76877694
/* Allocate data for the result of each field */
76887695
for (i= 0; i < num_fields; i++)
76897696
{
76907697
uint max_length= fields[i].max_length + 1;
76917698
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
7692-
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length, MYF(MY_WME | MY_FAE));
7699+
my_bind[i].buffer= my_malloc(PSI_NOT_INSTRUMENTED, max_length,
7700+
MYF(MY_WME|MY_FAE));
76937701
my_bind[i].buffer_length= max_length;
76947702
my_bind[i].is_null= &is_null[i];
76957703
my_bind[i].length= &length[i];
@@ -8713,7 +8721,7 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
87138721
cn->ps_params= ps_params = (MYSQL_BIND*)my_malloc(PSI_NOT_INSTRUMENTED,
87148722
sizeof(MYSQL_BIND) *
87158723
stmt->param_count,
8716-
MYF(MY_WME));
8724+
MYF(MY_WME|MY_FAE));
87178725
bzero((char *) ps_params, sizeof(MYSQL_BIND) * stmt->param_count);
87188726

87198727
int i=0;
@@ -8728,7 +8736,8 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
87288736
if (!*c)
87298737
{
87308738
ps_params[i].buffer_type= MYSQL_TYPE_LONG;
8731-
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long), MYF(MY_WME));
8739+
l= (long*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(long),
8740+
MYF(MY_WME|MY_FAE));
87328741
*l= strtol(p, &c, 10);
87338742
ps_params[i].buffer= (void*)l;
87348743
ps_params[i].buffer_length= 8;
@@ -8740,15 +8749,16 @@ void run_bind_stmt(struct st_connection *cn, struct st_command *command,
87408749
{
87418750
ps_params[i].buffer_type= MYSQL_TYPE_DECIMAL;
87428751
d= (double*)my_malloc(PSI_NOT_INSTRUMENTED, sizeof(double),
8743-
MYF(MY_WME));
8752+
MYF(MY_WME|MY_FAE));
87448753
*d= strtod(p, &c);
87458754
ps_params[i].buffer= (void*)d;
87468755
ps_params[i].buffer_length= 8;
87478756
}
87488757
else
87498758
{
87508759
ps_params[i].buffer_type= MYSQL_TYPE_STRING;
8751-
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME));
8760+
ps_params[i].buffer= my_strdup(PSI_NOT_INSTRUMENTED, p,
8761+
MYF(MY_WME|MY_FAE));
87528762
ps_params[i].buffer_length= (unsigned long)strlen(p);
87538763
}
87548764
}
@@ -9786,7 +9796,7 @@ int main(int argc, char **argv)
97869796
/* Init connections, allocate 1 extra as buffer + 1 for default */
97879797
connections= (struct st_connection*)
97889798
my_malloc(PSI_NOT_INSTRUMENTED, (opt_max_connections+2) * sizeof(struct st_connection),
9789-
MYF(MY_WME | MY_ZEROFILL));
9799+
MYF(MY_WME|MY_FAE|MY_ZEROFILL));
97909800
connections_end= connections + opt_max_connections +1;
97919801
next_con= connections + 1;
97929802

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

1050610516
/* Allocate a buffer for results */
10507-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
10517+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
10518+
MYF(MY_WME|MY_FAE));
1050810519
while (*from)
1050910520
{
1051010521
char *to;
@@ -10517,7 +10528,8 @@ void do_get_replace_column(struct st_command *command)
1051710528
command->query);
1051810529
to= get_string(&buff, &from, command);
1051910530
my_free(replace_column[column_number-1]);
10520-
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to, MYF(MY_WME | MY_FAE));
10531+
replace_column[column_number-1]= my_strdup(PSI_NOT_INSTRUMENTED, to,
10532+
MYF(MY_WME|MY_FAE));
1052110533
set_if_bigger(max_replace_column, column_number);
1052210534
}
1052310535
my_free(start);
@@ -10584,7 +10596,8 @@ void do_get_replace(struct st_command *command)
1058410596
bzero(&from_array,sizeof(from_array));
1058510597
if (!*from)
1058610598
die("Missing argument in %s", command->query);
10587-
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,MYF(MY_WME | MY_FAE));
10599+
start= buff= (char*)my_malloc(PSI_NOT_INSTRUMENTED, strlen(from)+1,
10600+
MYF(MY_WME|MY_FAE));
1058810601
while (*from)
1058910602
{
1059010603
char *to= buff;
@@ -11242,7 +11255,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1124211255
DBUG_RETURN(0);
1124311256
found_sets=0;
1124411257
if (!(found_set= (FOUND_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(FOUND_SET)*max_length*count,
11245-
MYF(MY_WME))))
11258+
MYF(MY_WME|MY_FAE))))
1124611259
{
1124711260
free_sets(&sets);
1124811261
DBUG_RETURN(0);
@@ -11252,7 +11265,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1125211265
used_sets=-1;
1125311266
word_states=make_new_set(&sets); /* Start of new word */
1125411267
start_states=make_new_set(&sets); /* This is first state */
11255-
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
11268+
if (!(follow=(FOLLOWS*) my_malloc(PSI_NOT_INSTRUMENTED, (states+2)*sizeof(FOLLOWS),MYF(MY_WME|MY_FAE))))
1125611269
{
1125711270
free_sets(&sets);
1125811271
my_free(found_set);
@@ -11419,7 +11432,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
1141911432
if ((replace=(REPLACE*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REPLACE)*(sets.count)+
1142011433
sizeof(REPLACE_STRING)*(found_sets+1)+
1142111434
sizeof(char *)*count+result_len,
11422-
MYF(MY_WME | MY_ZEROFILL))))
11435+
MYF(MY_WME|MY_FAE|MY_ZEROFILL))))
1142311436
{
1142411437
rep_str=(REPLACE_STRING*) (replace+sets.count);
1142511438
to_array= (char **) (rep_str+found_sets+1);
@@ -11462,10 +11475,10 @@ int init_sets(REP_SETS *sets,uint states)
1146211475
bzero(sets, sizeof(*sets));
1146311476
sets->size_of_bits=((states+7)/8);
1146411477
if (!(sets->set_buffer=(REP_SET*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(REP_SET)*SET_MALLOC_HUNC,
11465-
MYF(MY_WME))))
11478+
MYF(MY_WME|MY_FAE))))
1146611479
return 1;
1146711480
if (!(sets->bit_buffer=(uint*) my_malloc(PSI_NOT_INSTRUMENTED, sizeof(uint)*sets->size_of_bits*
11468-
SET_MALLOC_HUNC,MYF(MY_WME))))
11481+
SET_MALLOC_HUNC,MYF(MY_WME|MY_FAE))))
1146911482
{
1147011483
my_free(sets->set);
1147111484
return 1;
@@ -11661,10 +11674,10 @@ int insert_pointer_name(POINTER_ARRAY *pa,char * name)
1166111674
if (!(pa->typelib.type_names=(const char **)
1166211675
my_malloc(PSI_NOT_INSTRUMENTED, ((PC_MALLOC-MALLOC_OVERHEAD)/
1166311676
(sizeof(char *)+sizeof(*pa->flag))*
11664-
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
11677+
(sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME|MY_FAE))))
1166511678
DBUG_RETURN(-1);
1166611679
if (!(pa->str= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED, PS_MALLOC - MALLOC_OVERHEAD,
11667-
MYF(MY_WME))))
11680+
MYF(MY_WME|MY_FAE))))
1166811681
{
1166911682
my_free(pa->typelib.type_names);
1167011683
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)