Commit a9500860 authored by Daniel Black's avatar Daniel Black

Merge 10.2 (part) into 10.3

commit '6de482a6'

10.3 no longer errors in truncate_notembedded.test
but per comments, a non-crash is all that we are after.
parents bfed2c7d 6de482a6
...@@ -6,35 +6,10 @@ ...@@ -6,35 +6,10 @@
# Exit immediately on any error # Exit immediately on any error
set -e set -e
# This file is invocated from Buildbot and Travis-CI to build deb packages. # On Buildbot, don't run the mysql-test-run test suite as part of build.
# As both of those CI systems have many parallel jobs that include different # It takes a lot of time, and we will do a better test anyway in
# parts of the test suite, we don't need to run the mysql-test-run at all when # Buildbot, running the test suite from installed .debs on a clean VM.
# building the deb packages here. export DEB_BUILD_OPTIONS="nocheck"
export DEB_BUILD_OPTIONS="nocheck $DEB_BUILD_OPTIONS"
# Travis-CI optimizations
if [[ $TRAVIS ]]
then
# On Travis-CI, the log must stay under 4MB so make the build less verbose
sed -i -e '/Add support for verbose builds/,+2d' debian/rules
# Don't include test suite package on Travis-CI to make the build time shorter
sed '/Package: mariadb-test-data/,/^$/d' -i debian/control
sed '/Package: mariadb-test/,/^$/d' -i debian/control
# Don't build the test package at all to save time and disk space
sed 's|DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test|DINSTALL_MYSQLTESTDIR=false|' -i debian/rules
# Also skip building RocksDB and TokuDB to save even more time and disk space
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
fi
# Convert gcc version to numberical value. Format is Mmmpp where M is Major
# version, mm is minor version and p is patch.
# -dumpfullversion & -dumpversion to make it uniform across old and new (>=7)
GCCVERSION=$(gcc -dumpfullversion -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' \
-e 's/\.\([0-9]\)/0\1/g' \
-e 's/^[0-9]\{3,4\}$/&00/')
# Look up distro-version specific stuff # Look up distro-version specific stuff
# #
...@@ -50,49 +25,8 @@ case "${CODENAME}" in ...@@ -50,49 +25,8 @@ case "${CODENAME}" in
;; ;;
esac esac
# If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty) # Don't build rocksdb package on x86 32 bit.
# clean away the cracklib stanzas so the package can build without them. if [[ $(arch) =~ i[346]86 ]]
if ! apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1
then
sed '/libcrack2-dev/d' -i debian/control
sed '/Package: mariadb-plugin-cracklib/,/^$/d' -i debian/control
fi
# If libpcre3-dev (>= 2:8.35-3.2~) is not available (before Debian Jessie or Ubuntu Wily)
# clean away the PCRE3 stanzas so the package can build without them.
# Update check when version 2:8.40 or newer is available.
if ! apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1
then
sed '/libpcre3-dev/d' -i debian/control
fi
# If libsystemd-dev is not available (before Debian Jessie or Ubuntu Wily)
# clean away the systemd stanzas so the package can build without them.
if ! apt-cache madison libsystemd-dev | grep 'libsystemd-dev' >/dev/null 2>&1
then
sed '/dh-systemd/d' -i debian/control
sed '/libsystemd-dev/d' -i debian/control
sed 's/ --with systemd//' -i debian/rules
sed '/systemd/d' -i debian/rules
sed '/\.service/d' -i debian/rules
sed '/galera_new_cluster/d' -i debian/mariadb-server-10.3.install
sed '/galera_recovery/d' -i debian/mariadb-server-10.3.install
sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.3.install
fi
# The binaries should be fully hardened by default. However TokuDB compilation seems to fail on
# Debian Jessie and older and on Ubuntu Xenial and older with the following error message:
# /usr/bin/ld.bfd.real: /tmp/ccOIwjFo.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol
# `toku_product_name_strings' can not be used when making a shared object; recompile with -fPIC
# Therefore we need to disable PIE on those releases using gcc as proxy for detection.
if [[ $GCCVERSION -lt 60000 ]]
then
sed 's/hardening=+all$/hardening=+all,-pie/' -i debian/rules
fi
# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
# x86 32 bit.
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
then then
sed '/Package: mariadb-plugin-rocksdb/,/^$/d' -i debian/control sed '/Package: mariadb-plugin-rocksdb/,/^$/d' -i debian/control
fi fi
...@@ -112,26 +46,6 @@ then ...@@ -112,26 +46,6 @@ then
sed '/Package: mariadb-plugin-cassandra/,/^$/d' -i debian/control sed '/Package: mariadb-plugin-cassandra/,/^$/d' -i debian/control
fi fi
# From Debian Stretch/Ubuntu Bionic onwards dh-systemd is just an empty
# transitional metapackage and the functionality was merged into debhelper.
# In Ubuntu Hirsute is was completely removed, so it can't be referenced anymore.
# Keep using it only on Debian Jessie and Ubuntu Xenial.
if apt-cache madison dh-systemd | grep 'dh-systemd' >/dev/null 2>&1
then
sed 's/debhelper (>= 9.20160709~),/debhelper (>= 9), dh-systemd,/' -i debian/control
fi
# Mroonga, TokuDB never built on Travis CI anyway, see build flags above
if [[ $TRAVIS ]]
then
sed -i -e "/Package: mariadb-plugin-tokudb/,/^$/d" debian/control
sed -i -e "/Package: mariadb-plugin-mroonga/,/^$/d" debian/control
sed -i -e "/Package: mariadb-plugin-spider/,/^$/d" debian/control
sed -i -e "/Package: mariadb-plugin-oqgraph/,/^$/d" debian/control
sed -i -e "/usr\/lib\/mysql\/plugin\/ha_sphinx.so/d" debian/mariadb-server-10.3.install
sed -i -e "/Package: libmariadbd-dev/,/^$/d" debian/control
fi
# Adjust changelog, add new version # Adjust changelog, add new version
echo "Incrementing changelog and starting build scripts" echo "Incrementing changelog and starting build scripts"
...@@ -146,13 +60,6 @@ dch -b -D ${CODENAME} -v "${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automat ...@@ -146,13 +60,6 @@ dch -b -D ${CODENAME} -v "${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automat
echo "Creating package version ${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... " echo "Creating package version ${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... "
# On Travis CI, use -b to build binary only packages as there is no need to
# waste time on generating the source package.
if [[ $TRAVIS ]]
then
BUILDPACKAGE_FLAGS="-b"
fi
# Build the package # Build the package
# Pass -I so that .git and other unnecessary temporary and source control files # Pass -I so that .git and other unnecessary temporary and source control files
# will be ignored by dpkg-source when creating the tar.gz source package. # 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) ...@@ -161,17 +68,13 @@ fakeroot dpkg-buildpackage -us -uc -I $BUILDPACKAGE_FLAGS -j$(nproc)
# If the step above fails due to missing dependencies, you can manually run # If the step above fails due to missing dependencies, you can manually run
# sudo mk-build-deps debian/control -r -i # sudo mk-build-deps debian/control -r -i
# Don't log package contents on Travis-CI to save time and log size echo "List package contents ..."
if [[ ! $TRAVIS ]] cd ..
then for package in `ls *.deb`
echo "List package contents ..." do
cd .. echo $package | cut -d '_' -f 1
for package in `ls *.deb` dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3
do echo "------------------------------------------------"
echo $package | cut -d '_' -f 1 done
dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3
echo "------------------------------------------------"
done
fi
echo "Build complete" echo "Build complete"
...@@ -5,10 +5,9 @@ Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net> ...@@ -5,10 +5,9 @@ Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: bison, Build-Depends: bison,
chrpath, chrpath,
cmake (>= 2.7), cmake (>= 2.7),
debhelper (>= 9.20160709~), debhelper (>= 10),
dh-apparmor, dh-apparmor,
dh-exec, dh-exec,
dh-systemd,
gdb, gdb,
libaio-dev [linux-any], libaio-dev [linux-any],
libboost-dev, libboost-dev,
...@@ -427,7 +426,7 @@ Pre-Depends: adduser (>= 3.40), ...@@ -427,7 +426,7 @@ Pre-Depends: adduser (>= 3.40),
mariadb-common (>= ${source:Version}) mariadb-common (>= ${source:Version})
Depends: galera-3 (>=25.3), Depends: galera-3 (>=25.3),
gawk, gawk,
iproute | iproute2, iproute2,
libdbi-perl, libdbi-perl,
lsb-base (>= 3.0-10), lsb-base (>= 3.0-10),
lsof, lsof,
......
...@@ -128,3 +128,13 @@ SELECT f1(1); ...@@ -128,3 +128,13 @@ SELECT f1(1);
Got one of the listed errors Got one of the listed errors
DROP FUNCTION f1; DROP FUNCTION f1;
SET debug_dbug= @saved_dbug; SET debug_dbug= @saved_dbug;
#
# MDEV-27978 wrong option name in error when exceeding max_session_mem_used
#
SET SESSION max_session_mem_used = 8192;
SELECT * FROM information_schema.processlist;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
SET SESSION max_session_mem_used = DEFAULT;
#
# End of 10.2 tests
#
...@@ -158,3 +158,16 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory"; ...@@ -158,3 +158,16 @@ SET SESSION debug_dbug="+d,simulate_create_virtual_tmp_table_out_of_memory";
SELECT f1(1); SELECT f1(1);
DROP FUNCTION f1; DROP FUNCTION f1;
SET debug_dbug= @saved_dbug; SET debug_dbug= @saved_dbug;
--echo #
--echo # MDEV-27978 wrong option name in error when exceeding max_session_mem_used
--echo #
SET SESSION max_session_mem_used = 8192;
--error ER_OPTION_PREVENTS_STATEMENT
SELECT * FROM information_schema.processlist;
SET SESSION max_session_mem_used = DEFAULT;
--echo #
--echo # End of 10.2 tests
--echo #
...@@ -4137,13 +4137,18 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific) ...@@ -4137,13 +4137,18 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
/* Ensure we don't get called here again */ /* Ensure we don't get called here again */
char buf[50], *buf2; char buf[50], *buf2;
thd->set_killed(KILL_QUERY); thd->set_killed(KILL_QUERY);
my_snprintf(buf, sizeof(buf), "--max-thread-mem-used=%llu", my_snprintf(buf, sizeof(buf), "--max-session-mem-used=%llu",
thd->variables.max_mem_used); thd->variables.max_mem_used);
if ((buf2= (char*) thd->alloc(256))) if ((buf2= (char*) thd->alloc(256)))
{ {
my_snprintf(buf2, 256, ER_THD(thd, ER_OPTION_PREVENTS_STATEMENT), buf); my_snprintf(buf2, 256, ER_THD(thd, ER_OPTION_PREVENTS_STATEMENT), buf);
thd->set_killed(KILL_QUERY, ER_OPTION_PREVENTS_STATEMENT, buf2); thd->set_killed(KILL_QUERY, ER_OPTION_PREVENTS_STATEMENT, buf2);
} }
else
{
thd->set_killed(KILL_QUERY, ER_OPTION_PREVENTS_STATEMENT,
"--max-session-mem-used");
}
} }
DBUG_ASSERT((longlong) thd->status_var.local_memory_used >= 0 || DBUG_ASSERT((longlong) thd->status_var.local_memory_used >= 0 ||
!debug_assert_on_not_freed_memory); !debug_assert_on_not_freed_memory);
......
...@@ -6145,7 +6145,7 @@ static Sys_var_ulong Sys_log_tc_size( ...@@ -6145,7 +6145,7 @@ static Sys_var_ulong Sys_log_tc_size(
BLOCK_SIZE(my_getpagesize())); BLOCK_SIZE(my_getpagesize()));
#endif #endif
static Sys_var_ulonglong Sys_max_thread_mem( static Sys_var_ulonglong Sys_max_session_mem_used(
"max_session_mem_used", "Amount of memory a single user session " "max_session_mem_used", "Amount of memory a single user session "
"is allowed to allocate. This limits the value of the " "is allowed to allocate. This limits the value of the "
"session variable MEM_USED", SESSION_VAR(max_mem_used), "session variable MEM_USED", SESSION_VAR(max_mem_used),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment