Skip to content

Commit a950086

Browse files
committed
Merge 10.2 (part) into 10.3
commit '6de482a6fefac0c21daf33ed465644151cdf879f' 10.3 no longer errors in truncate_notembedded.test but per comments, a non-crash is all that we are after.
2 parents bfed2c7 + 6de482a commit a950086

File tree

6 files changed

+46
-116
lines changed

6 files changed

+46
-116
lines changed

debian/autobake-deb.sh

Lines changed: 14 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,10 @@
66
# Exit immediately on any error
77
set -e
88

9-
# This file is invocated from Buildbot and Travis-CI to build deb packages.
10-
# As both of those CI systems have many parallel jobs that include different
11-
# parts of the test suite, we don't need to run the mysql-test-run at all when
12-
# building the deb packages here.
13-
export DEB_BUILD_OPTIONS="nocheck $DEB_BUILD_OPTIONS"
14-
15-
# Travis-CI optimizations
16-
if [[ $TRAVIS ]]
17-
then
18-
# On Travis-CI, the log must stay under 4MB so make the build less verbose
19-
sed -i -e '/Add support for verbose builds/,+2d' debian/rules
20-
21-
# Don't include test suite package on Travis-CI to make the build time shorter
22-
sed '/Package: mariadb-test-data/,/^$/d' -i debian/control
23-
sed '/Package: mariadb-test/,/^$/d' -i debian/control
24-
25-
# Don't build the test package at all to save time and disk space
26-
sed 's|DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test|DINSTALL_MYSQLTESTDIR=false|' -i debian/rules
27-
28-
# Also skip building RocksDB and TokuDB to save even more time and disk space
29-
sed 's|-DDEB|-DPLUGIN_TOKUDB=NO -DPLUGIN_MROONGA=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_SPIDER=NO -DPLUGIN_OQGRAPH=NO -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_SPHINX=NO -WITH_EMBEDDED_SERVER=OFF -DDEB|' -i debian/rules
30-
fi
31-
32-
# Convert gcc version to numberical value. Format is Mmmpp where M is Major
33-
# version, mm is minor version and p is patch.
34-
# -dumpfullversion & -dumpversion to make it uniform across old and new (>=7)
35-
GCCVERSION=$(gcc -dumpfullversion -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' \
36-
-e 's/\.\([0-9]\)/0\1/g' \
37-
-e 's/^[0-9]\{3,4\}$/&00/')
9+
# On Buildbot, don't run the mysql-test-run test suite as part of build.
10+
# It takes a lot of time, and we will do a better test anyway in
11+
# Buildbot, running the test suite from installed .debs on a clean VM.
12+
export DEB_BUILD_OPTIONS="nocheck"
3813

3914
# Look up distro-version specific stuff
4015
#
@@ -50,49 +25,8 @@ case "${CODENAME}" in
5025
;;
5126
esac
5227

53-
# If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty)
54-
# clean away the cracklib stanzas so the package can build without them.
55-
if ! apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1
56-
then
57-
sed '/libcrack2-dev/d' -i debian/control
58-
sed '/Package: mariadb-plugin-cracklib/,/^$/d' -i debian/control
59-
fi
60-
61-
# If libpcre3-dev (>= 2:8.35-3.2~) is not available (before Debian Jessie or Ubuntu Wily)
62-
# clean away the PCRE3 stanzas so the package can build without them.
63-
# Update check when version 2:8.40 or newer is available.
64-
if ! apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1
65-
then
66-
sed '/libpcre3-dev/d' -i debian/control
67-
fi
68-
69-
# If libsystemd-dev is not available (before Debian Jessie or Ubuntu Wily)
70-
# clean away the systemd stanzas so the package can build without them.
71-
if ! apt-cache madison libsystemd-dev | grep 'libsystemd-dev' >/dev/null 2>&1
72-
then
73-
sed '/dh-systemd/d' -i debian/control
74-
sed '/libsystemd-dev/d' -i debian/control
75-
sed 's/ --with systemd//' -i debian/rules
76-
sed '/systemd/d' -i debian/rules
77-
sed '/\.service/d' -i debian/rules
78-
sed '/galera_new_cluster/d' -i debian/mariadb-server-10.3.install
79-
sed '/galera_recovery/d' -i debian/mariadb-server-10.3.install
80-
sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.3.install
81-
fi
82-
83-
# The binaries should be fully hardened by default. However TokuDB compilation seems to fail on
84-
# Debian Jessie and older and on Ubuntu Xenial and older with the following error message:
85-
# /usr/bin/ld.bfd.real: /tmp/ccOIwjFo.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol
86-
# `toku_product_name_strings' can not be used when making a shared object; recompile with -fPIC
87-
# Therefore we need to disable PIE on those releases using gcc as proxy for detection.
88-
if [[ $GCCVERSION -lt 60000 ]]
89-
then
90-
sed 's/hardening=+all$/hardening=+all,-pie/' -i debian/rules
91-
fi
92-
93-
# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
94-
# x86 32 bit.
95-
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
28+
# Don't build rocksdb package on x86 32 bit.
29+
if [[ $(arch) =~ i[346]86 ]]
9630
then
9731
sed '/Package: mariadb-plugin-rocksdb/,/^$/d' -i debian/control
9832
fi
@@ -112,26 +46,6 @@ then
11246
sed '/Package: mariadb-plugin-cassandra/,/^$/d' -i debian/control
11347
fi
11448

115-
# From Debian Stretch/Ubuntu Bionic onwards dh-systemd is just an empty
116-
# transitional metapackage and the functionality was merged into debhelper.
117-
# In Ubuntu Hirsute is was completely removed, so it can't be referenced anymore.
118-
# Keep using it only on Debian Jessie and Ubuntu Xenial.
119-
if apt-cache madison dh-systemd | grep 'dh-systemd' >/dev/null 2>&1
120-
then
121-
sed 's/debhelper (>= 9.20160709~),/debhelper (>= 9), dh-systemd,/' -i debian/control
122-
fi
123-
124-
# Mroonga, TokuDB never built on Travis CI anyway, see build flags above
125-
if [[ $TRAVIS ]]
126-
then
127-
sed -i -e "/Package: mariadb-plugin-tokudb/,/^$/d" debian/control
128-
sed -i -e "/Package: mariadb-plugin-mroonga/,/^$/d" debian/control
129-
sed -i -e "/Package: mariadb-plugin-spider/,/^$/d" debian/control
130-
sed -i -e "/Package: mariadb-plugin-oqgraph/,/^$/d" debian/control
131-
sed -i -e "/usr\/lib\/mysql\/plugin\/ha_sphinx.so/d" debian/mariadb-server-10.3.install
132-
sed -i -e "/Package: libmariadbd-dev/,/^$/d" debian/control
133-
fi
134-
13549
# Adjust changelog, add new version
13650
echo "Incrementing changelog and starting build scripts"
13751

@@ -146,13 +60,6 @@ dch -b -D ${CODENAME} -v "${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automat
14660

14761
echo "Creating package version ${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... "
14862

149-
# On Travis CI, use -b to build binary only packages as there is no need to
150-
# waste time on generating the source package.
151-
if [[ $TRAVIS ]]
152-
then
153-
BUILDPACKAGE_FLAGS="-b"
154-
fi
155-
15663
# Build the package
15764
# Pass -I so that .git and other unnecessary temporary and source control files
15865
# will be ignored by dpkg-source when creating the tar.gz source package.
@@ -161,17 +68,13 @@ fakeroot dpkg-buildpackage -us -uc -I $BUILDPACKAGE_FLAGS -j$(nproc)
16168
# If the step above fails due to missing dependencies, you can manually run
16269
# sudo mk-build-deps debian/control -r -i
16370

164-
# Don't log package contents on Travis-CI to save time and log size
165-
if [[ ! $TRAVIS ]]
166-
then
167-
echo "List package contents ..."
168-
cd ..
169-
for package in `ls *.deb`
170-
do
171-
echo $package | cut -d '_' -f 1
172-
dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3
173-
echo "------------------------------------------------"
174-
done
175-
fi
71+
echo "List package contents ..."
72+
cd ..
73+
for package in `ls *.deb`
74+
do
75+
echo $package | cut -d '_' -f 1
76+
dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3
77+
echo "------------------------------------------------"
78+
done
17679

17780
echo "Build complete"

debian/control

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
55
Build-Depends: bison,
66
chrpath,
77
cmake (>= 2.7),
8-
debhelper (>= 9.20160709~),
8+
debhelper (>= 10),
99
dh-apparmor,
1010
dh-exec,
11-
dh-systemd,
1211
gdb,
1312
libaio-dev [linux-any],
1413
libboost-dev,
@@ -427,7 +426,7 @@ Pre-Depends: adduser (>= 3.40),
427426
mariadb-common (>= ${source:Version})
428427
Depends: galera-3 (>=25.3),
429428
gawk,
430-
iproute | iproute2,
429+
iproute2,
431430
libdbi-perl,
432431
lsb-base (>= 3.0-10),
433432
lsof,

mysql-test/main/error_simulation.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,13 @@ SELECT f1(1);
128128
Got one of the listed errors
129129
DROP FUNCTION f1;
130130
SET debug_dbug= @saved_dbug;
131+
#
132+
# MDEV-27978 wrong option name in error when exceeding max_session_mem_used
133+
#
134+
SET SESSION max_session_mem_used = 8192;
135+
SELECT * FROM information_schema.processlist;
136+
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
137+
SET SESSION max_session_mem_used = DEFAULT;
138+
#
139+
# End of 10.2 tests
140+
#

mysql-test/main/error_simulation.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,16 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory";
158158
SELECT f1(1);
159159
DROP FUNCTION f1;
160160
SET debug_dbug= @saved_dbug;
161+
162+
--echo #
163+
--echo # MDEV-27978 wrong option name in error when exceeding max_session_mem_used
164+
--echo #
165+
SET SESSION max_session_mem_used = 8192;
166+
--error ER_OPTION_PREVENTS_STATEMENT
167+
SELECT * FROM information_schema.processlist;
168+
SET SESSION max_session_mem_used = DEFAULT;
169+
170+
171+
--echo #
172+
--echo # End of 10.2 tests
173+
--echo #

sql/mysqld.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4137,13 +4137,18 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
41374137
/* Ensure we don't get called here again */
41384138
char buf[50], *buf2;
41394139
thd->set_killed(KILL_QUERY);
4140-
my_snprintf(buf, sizeof(buf), "--max-thread-mem-used=%llu",
4140+
my_snprintf(buf, sizeof(buf), "--max-session-mem-used=%llu",
41414141
thd->variables.max_mem_used);
41424142
if ((buf2= (char*) thd->alloc(256)))
41434143
{
41444144
my_snprintf(buf2, 256, ER_THD(thd, ER_OPTION_PREVENTS_STATEMENT), buf);
41454145
thd->set_killed(KILL_QUERY, ER_OPTION_PREVENTS_STATEMENT, buf2);
41464146
}
4147+
else
4148+
{
4149+
thd->set_killed(KILL_QUERY, ER_OPTION_PREVENTS_STATEMENT,
4150+
"--max-session-mem-used");
4151+
}
41474152
}
41484153
DBUG_ASSERT((longlong) thd->status_var.local_memory_used >= 0 ||
41494154
!debug_assert_on_not_freed_memory);

sql/sys_vars.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6145,7 +6145,7 @@ static Sys_var_ulong Sys_log_tc_size(
61456145
BLOCK_SIZE(my_getpagesize()));
61466146
#endif
61476147

6148-
static Sys_var_ulonglong Sys_max_thread_mem(
6148+
static Sys_var_ulonglong Sys_max_session_mem_used(
61496149
"max_session_mem_used", "Amount of memory a single user session "
61506150
"is allowed to allocate. This limits the value of the "
61516151
"session variable MEM_USED", SESSION_VAR(max_mem_used),

0 commit comments

Comments
 (0)