Skip to content

Commit

Permalink
Merge branch '10.2' of github.com:MariaDB/server into 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrunia committed Nov 16, 2016
2 parents 951ca5d + ded4cd1 commit dace5f9
Show file tree
Hide file tree
Showing 282 changed files with 10,160 additions and 3,600 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -21,6 +21,7 @@ addons:
- debhelper
- dh-apparmor
- dpatch
- gdb
- libaio-dev
- libboost-dev
- libjudy-dev
Expand Down
7 changes: 0 additions & 7 deletions CMakeLists.txt
Expand Up @@ -162,7 +162,6 @@ INCLUDE(install_macros)
INCLUDE(systemd)
INCLUDE(mysql_add_executable)
INCLUDE(crc32-vpmsum)
INCLUDE(numa)

# Handle options
OPTION(DISABLE_SHARED
Expand Down Expand Up @@ -435,12 +434,6 @@ CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in
${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)

IF(DEB)
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.files.in
${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.files)
ENDIF(DEB)

# Handle the "INFO_*" files.
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
# Source: This can be done during the cmake phase, all information is
Expand Down
2 changes: 1 addition & 1 deletion client/mysql.cc
Expand Up @@ -5129,7 +5129,7 @@ static const char *construct_prompt()
{
const char *prompt;
prompt= connected ? mysql_get_host_info(&mysql) : "not_connected";
if (strstr(prompt, "Localhost"))
if (strstr(prompt, "Localhost") || strstr(prompt, "localhost "))
{
if (*c == 'h')
processed_prompt.append("localhost");
Expand Down
7 changes: 7 additions & 0 deletions client/mysqlbinlog.cc
Expand Up @@ -1002,6 +1002,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,

switch (ev_type) {
case QUERY_EVENT:
case QUERY_COMPRESSED_EVENT:
{
Query_log_event *qe= (Query_log_event*)ev;
if (!qe->is_trans_keyword())
Expand Down Expand Up @@ -1243,6 +1244,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case WRITE_ROWS_EVENT_V1:
case UPDATE_ROWS_EVENT_V1:
case DELETE_ROWS_EVENT_V1:
case WRITE_ROWS_COMPRESSED_EVENT:
case DELETE_ROWS_COMPRESSED_EVENT:
case UPDATE_ROWS_COMPRESSED_EVENT:
case WRITE_ROWS_COMPRESSED_EVENT_V1:
case UPDATE_ROWS_COMPRESSED_EVENT_V1:
case DELETE_ROWS_COMPRESSED_EVENT_V1:
{
Rows_log_event *e= (Rows_log_event*) ev;
if (print_row_event(print_event_info, ev, e->get_table_id(),
Expand Down
37 changes: 21 additions & 16 deletions cmake/numa.cmake
@@ -1,5 +1,6 @@
MACRO (MYSQL_CHECK_NUMA)

IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H)
CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H)

Expand All @@ -10,29 +11,33 @@ MACRO (MYSQL_CHECK_NUMA)
ENDIF()

IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H)
SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa)
CHECK_C_SOURCE_COMPILES(
"
#include <numa.h>
#include <numaif.h>
int main()
{
struct bitmask *all_nodes= numa_all_nodes_ptr;
set_mempolicy(MPOL_DEFAULT, 0, 0);
return all_nodes != NULL;
}"
HAVE_LIBNUMA)
SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
ELSE()
SET(HAVE_LIBNUMA 0)
SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa)
CHECK_C_SOURCE_COMPILES(
"
#include <numa.h>
#include <numaif.h>
int main()
{
struct bitmask *all_nodes= numa_all_nodes_ptr;
set_mempolicy(MPOL_DEFAULT, 0, 0);
return all_nodes != NULL;
}"
HAVE_LIBNUMA)
SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
IF(HAVE_LIBNUMA)
ADD_DEFINITIONS(-DHAVE_LIBNUMA=1)
SET(NUMA_LIBRARY "numa")
ENDIF()
ENDIF()

IF(WITH_NUMA AND NOT HAVE_LIBNUMA)
# Forget it in cache, abort the build.
UNSET(WITH_NUMA CACHE)
UNSET(NUMA_LIBRARY CACHE)
MESSAGE(FATAL_ERROR "Could not find numa headers/libraries")
ENDIF()
ENDIF()

ENDMACRO()

6 changes: 0 additions & 6 deletions cmake/systemd.cmake
Expand Up @@ -56,12 +56,6 @@ MACRO(CHECK_SYSTEMD)
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
ADD_DEFINITIONS(-DHAVE_SYSTEMD)
SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery)
SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert
usr/bin/galera_new_cluster
usr/bin/galera_recovery
${INSTALL_SYSTEMD_UNITDIR}/mariadb.service
${INSTALL_SYSTEMD_UNITDIR}/mariadb@.service
${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/use_galera_new_cluster.conf")
IF(DEB)
SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start")
Expand Down
1 change: 0 additions & 1 deletion config.h.cmake
Expand Up @@ -106,7 +106,6 @@
#cmakedefine HAVE_LIBWRAP 1
#cmakedefine HAVE_SYSTEMD 1
#cmakedefine HAVE_CRC32_VPMSUM 1
#cmakedefine HAVE_LIBNUMA 1

/* Does "struct timespec" have a "sec" and "nsec" field? */
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
Expand Down
13 changes: 9 additions & 4 deletions debian/additions/debian-start 100644 → 100755
@@ -1,27 +1,32 @@
#!/bin/bash
#
# This script is executed by "/etc/init.d/mysql" on every (re)start.
#
#
# Changes to this file will be preserved when updating the Debian package.
#

source /usr/share/mysql/debian-start.inc.sh

if [ -f /etc/default/mysql ]; then
. /etc/default/mysql
fi

MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
MYCHECK_PARAMS="--all-databases --fast --silent"
MYCHECK_RCPT="root"
MYCHECK_RCPT="${MYCHECK_RCPT:-root}"

## Checking for corrupt, not cleanly closed (only for MyISAM and Aria engines) and upgrade needing tables.

# The following commands should be run when the server is up but in background
# where they do not block the server start and in one shell instance so that
# they run sequentially. They are supposed not to echo anything to stdout.
# If you want to disable the check for crashed tables comment
# "check_for_crashed_tables" out.
# "check_for_crashed_tables" out.
# (There may be no output to stdout inside the background process!)
echo "Checking for corrupt, not cleanly closed and upgrade needing tables."

# Need to ignore SIGHUP, as otherwise a SIGHUP can sometimes abort the upgrade
# process in the middle.
Expand Down
21 changes: 14 additions & 7 deletions debian/additions/debian-start.inc.sh 100644 → 100755
Expand Up @@ -3,28 +3,35 @@
# This file is included by /etc/mysql/debian-start
#

## Check all unclosed tables.
## Check MyISAM and Aria unclosed tables.
# - Requires the server to be up.
# - Is supposed to run silently in background.
function check_for_crashed_tables() {
set -e
set -u

# But do it in the background to not stall the boot process.
logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables"
logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables"

# Checking for $? is unreliable so the size of the output is checked.
# Some table handlers like HEAP do not support CHECK TABLE.
tempfile=`tempfile`
# We have to use xargs in this case, because a for loop barfs on the
# spaces in the thing to be looped over.

# We have to use xargs in this case, because a for loop barfs on the
# spaces in the thing to be looped over.

# If a crashed table is encountered, the "mysql" command will return with a status different from 0
set +e

LC_ALL=C $MYSQL --skip-column-names --batch -e '
select concat('\''select count(*) into @discard from `'\'',
TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'')
from information_schema.TABLES where ENGINE='\''MyISAM'\' | \
from information_schema.TABLES where TABLE_SCHEMA<>'\''INFORMATION_SCHEMA'\'' and TABLE_SCHEMA<>'\''PERFORMANCE_SCHEMA'\'' and ( ENGINE='\''MyISAM'\'' or ENGINE='\''Aria'\'' )' | \
xargs -i $MYSQL --skip-column-names --silent --batch \
--force -e "{}" >$tempfile
if [ -s $tempfile ]; then
--force -e "{}" &>$tempfile
set -e

if [ -s "$tempfile" ]; then
(
/bin/echo -e "\n" \
"Improperly closed tables are also reported if clients are accessing\n" \
Expand Down
Empty file modified debian/additions/echo_stderr 100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions debian/additions/mariadb.cnf
Expand Up @@ -15,3 +15,5 @@
#collation-server = utf8_general_ci
#character_set_server = utf8
#collation_server = utf8_general_ci
# Import all .cnf files from configuration directory
!includedir /etc/mysql/mariadb.conf.d/
116 changes: 66 additions & 50 deletions debian/autobake-deb.sh
@@ -1,15 +1,11 @@
#!/bin/bash

# Build MariaDB .deb packages.
# Based on OurDelta .deb packaging scripts, which are in turn based on Debian
# MySQL packages.
#
# Build MariaDB .deb packages for test and release at mariadb.org
#

# Exit immediately on any error
set -e

# Debug script and command lines
#set -x

# On Buildbot, don't run the mysql-test-run test suite as part of build.
# It takes a lot of time, and we will do a better test anyway in
# Buildbot, running the test suite from installed .debs on a clean VM.
Expand All @@ -21,65 +17,85 @@ then
export DEB_BUILD_OPTIONS="nocheck"
fi

export MARIADB_OPTIONAL_DEBS=""

# Find major.minor version.
#
source ./VERSION
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
RELEASE_EXTRA=""
# 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

RELEASE_NAME=""
PATCHLEVEL="+maria"
LOGSTRING="MariaDB build"
# Don't include test suite package on Travis-CI to make the build time shorter
sed '/Package: mariadb-test-data/,+26d' -i debian/control
sed '/Package: mariadb-test/,+34d' -i debian/control
fi

# Look up distro-version specific stuff.

CODENAME="$(lsb_release -sc)"
# Look up distro-version specific stuff
# Always keep the actual packaging as up-to-date as possible following the latest
# Debian policy and targetting Debian Sid. Then case-by-case run in autobake-deb.sh
# tests for backwards compatibility and strip away parts on older builders.

# Add libcrack2 (>= 2.9.0) as a build dependency if available in the distribution
# This matches Debian Jessie, Stretch and Ubuntu Trusty, Wily, Xenial, Yakkety
# Update check when version 2.10 or newer is available.
if apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1
# If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty)
# clean away the cracklib stanzas so the package can build without them.
if ! apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1
then
sed 's/Standards-Version/,libcrack2-dev (>= 2.9.0)\nStandards-Version/' debian/control
cat <<EOT >> debian/control
Package: mariadb-cracklib-password-check-10.2
Architecture: any
Depends: libcrack2 (>= 2.9.0),
mariadb-server-10.2,
\${misc:Depends},
\${shlibs:Depends}
Description: CrackLib Password Validation Plugin for MariaDB
This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.
EOT
sed '/libcrack2-dev/d' -i debian/control
sed '/Package: mariadb-plugin-cracklib/,+10d' -i debian/control
fi

# Add libpcre3-dev (>= 2:8.35-3.2~) as a build dependency if available in the distribution
# This matches Debian Jessie, Stretch and Ubuntu Wily, Xenial, Yakkety
# 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
if ! apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1
then
sed 's/Standards-Version/,libpcre3-dev (>= 2:8.35-3.2~)\nStandards-Version/' debian/control
sed '/libpcre3-dev/d' -i debian/control
fi

# Adjust changelog, add new version.
#
# 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.2.install
sed '/galera_recovery/d' -i debian/mariadb-server-10.2.install
sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.2.install
fi

# Adjust changelog, add new version
echo "Incrementing changelog and starting build scripts"

dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME}" "Automatic build with ${LOGSTRING}."
# Find major.minor version
source ./VERSION
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
PATCHLEVEL="+maria"
LOGSTRING="MariaDB build"
CODENAME="$(lsb_release -sc)"

dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automatic build with ${LOGSTRING}."

echo "Creating package version ${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME} ... "
echo "Creating package version ${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... "

# Build the package.
# Build the package
# Pass -I so that .git and other unnecessary temporary and source control files
# will be ignored by dpkg-source when createing the tar.gz source package
fakeroot dpkg-buildpackage -us -uc -I
# will be ignored by dpkg-source when creating the tar.gz source package.
# Use -b to build binary only packages as there is no need to waste time on
# generating the source package.
fakeroot dpkg-buildpackage -us -uc -I -b

[ -e debian/autorm-file ] && rm -vf `cat debian/autorm-file`
# Don't log package contents on Travis-CI to save time and log size
if [[ ! $TRAVIS ]]
then
echo "List package contents ..."
cd ..
for package in `ls *.deb`
do
echo $package | cut -d '_' -f 1
dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3
echo "------------------------------------------------"
done
fi

echo "Build complete"

# end of autobake script
2 changes: 1 addition & 1 deletion debian/compat
@@ -1 +1 @@
5
9

0 comments on commit dace5f9

Please sign in to comment.