Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nevis2us/mariadb-10.5
  • bigon/mariadb-10.5
  • gps-guest/mariadb-10.5
  • ina/mariadb-10.5
  • santiago/mariadb-10.5
  • faust/mariadb-10.5
  • mariadb-team/mariadb-10.5
7 results
Show changes
Commits on Source (122)
/debian @ottok
......@@ -101,6 +101,7 @@ packaging/rpm-uln/mysql.10.0.11.spec
packaging/solaris/postinstall-solaris
extra/pcre2
plugin/auth_pam/auth_pam_tool
plugin/auth_pam/config_auth_pam.h
plugin/aws_key_management/aws-sdk-cpp
plugin/aws_key_management/aws_sdk_cpp
plugin/aws_key_management/aws_sdk_cpp-prefix
......@@ -195,11 +196,12 @@ sql/lex_hash.h
sql/mysql_tzinfo_to_sql
sql/mysqld
sql/sql_builtin.cc
sql/sql_yacc.cc
sql/sql_yacc.hh
sql/sql_yacc_ora.cc
sql/sql_yacc_ora.hh
sql/sql_yacc_ora.yy
sql/yy_mariadb.cc
sql/yy_mariadb.hh
sql/yy_mariadb.yy
sql/yy_oracle.cc
sql/yy_oracle.hh
sql/yy_oracle.yy
storage/heap/hp_test1
storage/heap/hp_test2
storage/maria/aria_chk
......@@ -559,6 +561,9 @@ compile_commands.json
# Clion && other JetBrains ides
.idea
.cache/clangd
client/mariadb
client/mariadb-admin
client/mariadb-binlog
......
# vim ft=yaml
# travis-ci.org definition
dist: bionic
# NOTE TO MERGERS: Most of the contents in the Travis-CI configuration has been
# tailored for a specific release or MariaDB. As a general rule, do not merge
# changes in this file across MariaDB branches to avoid breaking the CI. Updates
# the the Travis-CI pipeline are most of the time better done manually.
dist: focal
git:
depth: 2
......@@ -12,34 +17,31 @@ cache:
timeout: 500
apt: true
ccache: true
directories:
- /usr/local/Cellar # Fails do to permission error: https://github.com/travis-ci/travis-ci/issues/8092
addons:
apt:
# NOTE: Travis-CI Ubuntu Xenial builders have GCC 5 and Clang 7 available by default
# NOTE: Travis-CI Ubuntu Ubuntu builders have GCC 7 and Clang 7 available by default
sources: &add-sources
- ubuntu-toolchain-r-test # Includes e.g. gcc4-9 for xenial, gcc9 for bionic
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages?field.name_filter=&field.status_filter=published&field.series_filter=xenial
- llvm-toolchain-xenial-7 # NOTE: This repo has no clang-7 for s390x
# Remember to document well what packages each extra repository is used for
- ubuntu-toolchain-r-test
# => gcc-9 and gcc-10 for Ubuntu Bionic
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages?field.name_filter=&field.status_filter=published&field.series_filter=bionic
- sourceline: 'ppa:maria-captains/travis-ci-helper-repo'
# https://launchpad.net/~maria-captains/+archive/ubuntu/travis-ci-helper-repo/+packages
# => galera-4 for Ubuntu Bionic
# https://launchpad.net/~maria-captains/+archive/ubuntu/travis-ci-helper-repo/+packages?field.name_filter=&field.status_filter=published&field.series_filter=bionic
packages: &common-packages
# make sure these include all compilers and all build dependencies (see list above)
# Remember to update this list if the Debian build dependencies are updated
- bison
- chrpath
- clang-7 # bionic-updates, llvm-toolchain-xenial-6.0 (amd64 only, not s390x)
- clang-8 # xenial, bionic
- clang-7 # In suites: focal, bionic-updates
- clang-10 # In suites: focal, bionic
- cmake
- cracklib-runtime
- galera-4
- g++-5 # xenial, bionic, ubuntu-toolchain-r/test (xenial)
- g++-7 # bionic, ubuntu-toolchain-r/test (xenial)
- g++-8 # bionic, ubuntu-toolchain-r/test (xenial)
- g++-9 # ubuntu-toolchain-r/test (xenial and bionic)
- galera-4 # In suites: focal, bionic (via ppa:maria-captains/travis-ci-helper-repo)
- g++-7 # In suites: focal, bionic
- g++-10 # In suites: focal, bionic (via ppa:ubuntu-toolchain-r/test)
- gdb
- libaio-dev
- libarchive-dev
- libboost-atomic-dev
- libboost-chrono-dev
- libboost-date-time-dev
......@@ -49,11 +51,12 @@ addons:
- libboost-system-dev
- libboost-thread-dev
- libcrack2-dev
- libcurl3-dev
- libcurl4-openssl-dev
- libdbd-mysql
- libedit-dev
- libjemalloc-dev
- libjudy-dev
- libkrb5-dev
- liblz4-dev
- libncurses5-dev
- libnuma-dev
......@@ -62,7 +65,6 @@ addons:
- libreadline-gplv2-dev
- libsnappy-dev
- libssl-dev
- libstemmer-dev
- libxml2-dev
- lsb-release
- perl
......@@ -71,9 +73,6 @@ addons:
- zlib1g-dev
# libsystemd-daemon-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3882
homebrew:
# Temporary workaround, remove when this is solved:
# https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/20
update: true
# OSX builds are not properly maintained on Travis-CI nor buildbot and
# thus this list of dependencies is likely to be inaccurate.
packages:
......@@ -106,9 +105,9 @@ addons:
# and 'env'. Ensure there is a good variation of architectures and at least the
# main suite is run on all architectures, as the main test suite needs to pass
# on all architectures (amd64, arm64, ppc64le, s390x) before a release is made.
# All test suites should also run on the clang build at least on one
# arch/platform. In gcc and clang versions prefer 7, which is very widely used,
# and after that prioritize newer versions (8, 9 etc) above older versions (5, 6).
#
# In gcc and clang use a fairly old version and one very recent and assume that
# if both of them built successfully all the intermediate version work as well.
arch: amd64
os: linux
compiler:
......@@ -116,17 +115,16 @@ compiler:
- clang
env:
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption,rocksdb,versioning,rpl
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
- CC_VERSION=8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,rocksdb,versioning,rpl
- CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles,encryption
- CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
jobs:
# Define extra jobs that are run in addition to the main jobs matrix
include:
- os: linux
dist: xenial
compiler: gcc
env: DebPackages=xenial
env: DebPackages=focal
addons: &deb-addons
apt:
sources: *add-sources
......@@ -139,15 +137,16 @@ jobs:
- dh-exec
- dh-systemd
- fakeroot
- libdistro-info-perl
- libsystemd-dev
- libzstd-dev
- po-debconf
- unixodbc-dev
script: &deb-script
- ${CC} --version ; ${CXX} --version
- apt-cache policy
- env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh;
- os: linux
dist: bionic
arch: s390x
compiler: gcc
env: DebPackages=bionic
......@@ -155,14 +154,14 @@ jobs:
script: *deb-script
# Just one OS X build is enough
- os: osx
osx_image: xcode11.3
osx_image: xcode12u
compiler: clang
env: CC_VERSION=8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
# Some chosen ones with s390x and gcc
- os: linux
arch: s390x
compiler: gcc
env: CC_VERSION=8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
- os: linux
arch: s390x
compiler: gcc
......@@ -175,7 +174,7 @@ jobs:
- os: linux
arch: s390x
compiler: clang
env: CC_VERSION=8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles
# Extra tests to ensure IBM Power and ARM 64 work
- os: linux
arch: ppc64le
......@@ -187,16 +186,15 @@ jobs:
env: CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
allow_failures:
# Permanently fails on main.thread_pool_info test (MDEV-20372)
# Permanently fails on main.column_compression 'innodb' test (MDEV-23954)
- os: linux
arch: amd64
compiler: clang
env: CC_VERSION=8 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
# Sporadically fails on main.thread_pool_info test (MDEV-20372)
- arch: ppc64le
- arch: arm64
arch: s390x
compiler: gcc
env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main
# Until OSX becomes a bit more stable
- os: osx
# ppc64el builder frequently runs out of memory
- arch: ppc64le
before_install:
- if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then
......
......@@ -44,7 +44,13 @@ cd ../storage/rocksdb/rocksdb
git submodule update
cd ../../maria/libmarias3
git submodule update
cd ../../.."
cd ../../..
cd storage/columnstore/columnstore
git submodule update
cd ../../..
cd wsrep-lib
git submodule update
cd .."
fi
commands="$commands
path=`dirname $0`
......
......@@ -32,6 +32,7 @@ Usage: $0 [-h|-n] [configure-options]
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
Combined with --just-print shows configure options.
--just-clean Clean up compilation files and update sub modules
--extra-configs=xxx Add this to configure options
--extra-flags=xxx Add this C and CXX flags
--extra-cflags=xxx Add this to C flags
......@@ -71,6 +72,8 @@ parse_options()
just_configure=1;;
-n | --just-print | --print)
just_print=1;;
--just-clean)
just_clean=1;;
--verbose)
verbose_make=1;;
-h | --help)
......@@ -94,6 +97,7 @@ fi
prefix="/usr/local/mysql"
just_print=
just_clean=
just_configure=
warning_mode=
maintainer_mode=
......@@ -141,7 +145,7 @@ elif [ "x$warning_mode" = "xmaintainer" ]; then
debug_extra_cflags="-g3"
else
# Both C and C++ warnings
warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing"
warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing -Wimplicit-fallthrough=2 -Wformat-security -Wvla"
# For more warnings, uncomment the following line
# warnings="$warnings -Wshadow"
......@@ -315,10 +319,11 @@ gcov_configs="--with-gcov"
# gprof
gprof_compile_flags="-O2 -pg -g"
gprof_compile_flags="-O2"
# Rest of the flags are set in CmakeFile.txt
gprof_link_flags="--disable-shared $static_link"
disable_gprof_plugins="--with-zlib-dir=bundled --without-plugin-oqgraph --without-plugin-mroonga"
disable_gprof_plugins="--with-zlib-dir=bundled --without-plugin-oqgraph --without-plugin-mroonga --with-gprof"
disable_asan_plugins="--without-plugin-rocksdb"
#! /bin/sh
# Copyright (c) 2018, MariaDB Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
# Compilation with UBSAN, The Undefined Behavior Sanitizer
# We have to use -Wno-uninitialized and -Wno-unitialized we get a lot of false
# positive warnings for this when compiling with -fsanitize=undefined.
# We also have to compile without Spider as linking with Spider library does
# not work. (errno: 11, undefined symbol: _ZTI12ha_partition)
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized"
extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider --without-tokudb"
. "$path/FINISH.sh"
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
# Copyright (c) 2008, 2020, MariaDB Corporation.
# Copyright (c) 2008, 2021, MariaDB Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -14,7 +14,20 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# Setting build type to RelWithDebInfo as none was specified.
# Must occur before PROJECT
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel"
FORCE)
# Set the possible values of build type for cmake-gui
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF()
PROJECT(MySQL)
# Remove the following comment if you don't want to have striped binaries
# in RPM's:
......@@ -49,9 +62,6 @@ IF(NOT DEFINED MANUFACTURER)
MARK_AS_ADVANCED(MANUFACTURER)
ENDIF()
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")
# MAX_INDEXES - Set the maximum number of indexes per table, default 64
SET(MAX_INDEXES 64 CACHE STRING "Max number of indexes")
IF (${MAX_INDEXES} GREATER 128)
......@@ -76,18 +86,8 @@ IF(UNIX AND NOT APPLE)
MARK_AS_ADVANCED(WITH_PIC)
ENDIF()
# Optionally set project name, e.g.
# foo.xcodeproj (mac) or foo.sln (windows)
# This is used by TokuDB only
SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name")
IF(DEFINED MYSQL_PROJECT_NAME)
SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
ELSE()
SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING
${MYSQL_PROJECT_NAME_DOCSTRING} FORCE)
MARK_AS_ADVANCED(MYSQL_PROJECT_NAME)
ENDIF()
PROJECT(${MYSQL_PROJECT_NAME})
IF(CMAKE_VERSION VERSION_LESS "3.1")
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
......@@ -123,11 +123,13 @@ FOREACH(_base
ENDIF()
ENDFOREACH()
IF(NOT RPM AND NOT DEB)
FOREACH(tool gtar tar)
STRING(TOUPPER ${tool} TOOL)
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
ENDFOREACH()
ENDIF()
FIND_PACKAGE(Git)
......@@ -140,7 +142,7 @@ ENDIF()
# NUMA
SET(WITH_NUMA "AUTO" CACHE STRING "Build with non-uniform memory access, allowing --innodb-numa-interleave. Options are ON|OFF|AUTO. ON = enabled (requires NUMA library), OFF = disabled, AUTO = enabled if NUMA library found.")
SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "Enable MariaDB maintainer-specific warnings. One of: NO (warnings are disabled) WARN (warnings are enabled) ERR (warnings are errors) AUTO (warnings are errors in Debug only)")
# Packaging
IF (NOT CPACK_GENERATOR)
......@@ -151,6 +153,7 @@ IF (NOT CPACK_GENERATOR)
ENDIF(WIN32)
ENDIF(NOT CPACK_GENERATOR)
INCLUDE(FeatureSummary)
INCLUDE(misc)
INCLUDE(mysql_version)
INCLUDE(cpack_source_ignore_files)
......@@ -204,21 +207,17 @@ OPTION(WITH_ASAN "Enable address sanitizer" OFF)
IF (WITH_ASAN AND NOT MSVC)
# this flag might be set by default on some OS
MY_CHECK_AND_SET_COMPILER_FLAG("-U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
# gcc 4.8.1 and new versions of clang
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fPIC"
DEBUG RELWITHDEBINFO)
SET(HAVE_C_FSANITIZE ${have_C__fsanitize_address__fPIC})
SET(HAVE_CXX_FSANITIZE ${have_CXX__fsanitize_address__fPIC})
IF(HAVE_C_FSANITIZE AND HAVE_CXX_FSANITIZE)
OPTION(WITH_ASAN_SCOPE "Enable -fsanitize-address-use-after-scope" OFF)
SET(WITH_ASAN_OK 1)
ELSE()
# older versions of clang
MY_CHECK_AND_SET_COMPILER_FLAG("-faddress-sanitizer -fPIC"
DEBUG RELWITHDEBINFO)
SET(HAVE_C_FADDRESS ${have_C__faddress_sanitizer__fPIC})
SET(HAVE_CXX_FADDRESS ${have_CXX__faddress_sanitizer__fPIC})
IF(HAVE_C_FADDRESS AND HAVE_CXX_FADDRESS)
SET(WITH_ASAN_OK 1)
IF(WITH_ASAN_SCOPE)
MY_CHECK_AND_SET_COMPILER_FLAG(
"-fsanitize=address -fsanitize-address-use-after-scope"
DEBUG RELWITHDEBINFO)
ENDIF()
ENDIF()
......@@ -242,13 +241,18 @@ IF (WITH_MSAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
ENDIF()
OPTION(WITH_GPROF "Enable profilingg with gprof" OFF)
IF (WITH_GPROF)
MY_CHECK_AND_SET_COMPILER_FLAG("-pg -g -no-pie -fPIC")
ENDIF()
# Be nice to profilers etc
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-omit-frame-pointer" RELWITHDEBINFO)
# enable security hardening features, like most distributions do
# in our benchmarks that costs about ~1% of performance, depending on the load
OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protector, relro, etc)" ON)
IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN)
IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN AND NOT WITH_GPROF)
# security-enhancing flags
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
MY_CHECK_AND_SET_LINKER_FLAG("-Wl,-z,relro,-z,now")
......@@ -392,7 +396,7 @@ CHECK_PCRE()
CHECK_SYSTEMD()
IF(CMAKE_CROSSCOMPILING)
IF(CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
INCLUDE(${IMPORT_EXECUTABLES})
ENDIF()
......@@ -447,12 +451,15 @@ ADD_SUBDIRECTORY(tpool)
IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(sql)
OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples)
ADD_SUBDIRECTORY(unittest/embedded)
OPTION (WITH_EMBEDDED_SERVER "Compile MariaDB with embedded server" OFF)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples)
ADD_SUBDIRECTORY(unittest/embedded)
ENDIF(WITH_EMBEDDED_SERVER)
IF(NOT WIN32)
ADD_FEATURE_INFO(EMBEDDED_SERVER WITH_EMBEDDED_SERVER "Embedded MariaDB Server Library")
ENDIF()
ADD_SUBDIRECTORY(mysql-test)
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
......@@ -474,7 +481,7 @@ ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(support-files)
ADD_SUBDIRECTORY(extra/aws_sdk)
IF(NOT CMAKE_CROSSCOMPILING)
IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
SET(EXPORTED comp_err comp_sql factorial)
IF(NOT WITHOUT_SERVER)
SET(EXPORTED ${EXPORTED} gen_lex_hash gen_lex_token)
......@@ -526,8 +533,7 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY
EXCEPTIONS-CLIENT COMPONENT Readme)
INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY COMPONENT Readme)
# MDEV-6526 these files are not installed anymore
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
......@@ -547,6 +553,13 @@ IF(WIN32 AND SIGNCODE)
INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/sign.cmake)
ENDIF()
FEATURE_SUMMARY(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES VAR MARIADB_FEATURE_SUMMARY)
OPTION(FEATURE_SUMMARY "Print feature summary at the end of configure step" ON)
IF (FEATURE_SUMMARY)
MESSAGE_ONCE(SUMMARY "${MARIADB_FEATURE_SUMMARY}")
ENDIF()
IF(NON_DISTRIBUTABLE_WARNING)
MESSAGE(WARNING "
You have linked MariaDB with ${NON_DISTRIBUTABLE_WARNING} libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with the Free Software Foundation.")
......
......@@ -4,24 +4,19 @@ organization registered in the USA.
The current main sponsors of the MariaDB Foundation are:
Alibaba Cloud https://www.alibabacloud.com/ (2017)
Booking.com https://www.booking.com (2013)
MariaDB Corporation https://www.mariadb.com (2013)
Microsoft https://microsoft.com/ (2017)
ServiceNow https://servicenow.com (2019)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
Tencent Games http://game.qq.com/ (2018)
Visma https://visma.com (2015)
Acronis https://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
Automattic https://automattic.com (2019)
Galera Cluster https://galeracluster.com (2020)
Percona https://www.percona.com (2018)
Tencent Game DBA http://tencentdba.com/about (2016)
Tencent TDSQL http://tdsql.org (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015)
Virtuozzo https://virtuozzo.com (2016)
For a full list of sponsors, see
https://mariadb.org/about/supporters/
https://mariadb.org/about/#sponsors
and for individual contributors, see
https://mariadb.org/donate/individual-sponsors/
......
commit: 5b3d3792e28fc7a875c7060f772e42a9cd922f83
date: 2020-08-07 13:43:08 +0200
build-date: 2020-08-07 12:57:39 +0000
short: 5b3d379
commit: b5569b62408375f35e2fe851158a7ff17e378ed1
date: 2021-08-02 20:45:40 +0200
build-date: 2021-08-03 08:29:11 +0000
short: b5569b6
branch: HEAD
MariaDB source 10.5.5
MariaDB source 10.5.12
FOSS License Exception
http://www.mysql.com/about/legal/licensing/foss-exception/
Updated February 23, 2012
What is the FOSS License Exception?
Oracle's Free and Open Source Software ("FOSS") License Exception
(formerly known as the FLOSS License Exception) allows developers of FOSS
applications to include Oracle's MySQL Client Libraries (also referred to
as "MySQL Drivers" or "MySQL Connectors") with their FOSS applications.
MySQL Client Libraries are typically licensed pursuant to version 2 of the
General Public License ("GPL"), but this exception permits distribution of
certain MySQL Client Libraries with a developer's FOSS applications
licensed under the terms of another FOSS license listed below, even though
such other FOSS license may be incompatible with the GPL.
The following terms and conditions describe the circumstances under which
Oracle's FOSS License Exception applies.
Oracle's FOSS License Exception Terms and Conditions
1. Definitions. "Derivative Work" means a derivative work, as defined
under applicable copyright law, formed entirely from the Program and
one or more FOSS Applications.
"FOSS Application" means a free and open source software application
distributed subject to a license listed in the section below titled
"FOSS License List."
"FOSS Notice" means a notice placed by Oracle or MySQL in a copy of
the MySQL Client Libraries stating that such copy of the MySQL Client
Libraries may be distributed under Oracle's or MySQL's FOSS (or FLOSS)
License Exception.
"Independent Work" means portions of the Derivative Work that are not
derived from the Program and can reasonably be considered independent
and separate works.
"Program" means a copy of Oracle's MySQL Client Libraries that
contains a FOSS Notice.
2. A FOSS application developer ("you" or "your") may distribute a
Derivative Work provided that you and the Derivative Work meet all of
the following conditions:
a. You obey the GPL in all respects for the Program and all portions
(including modifications) of the Program included in the
Derivative Work (provided that this condition does not apply to
Independent Works);
b. The Derivative Work does not include any work licensed under the
GPL other than the Program;
c. You distribute Independent Works subject to a license listed in
the section below titled "FOSS License List";
d. You distribute Independent Works in object code or executable
form with the complete corresponding machine-readable source code
on the same medium and under the same FOSS license applying to
the object code or executable forms;
e. All works that are aggregated with the Program or the Derivative
Work on a medium or volume of storage are not derivative works of
the Program, Derivative Work or FOSS Application, and must
reasonably be considered independent and separate works.
3. Oracle reserves all rights not expressly granted in these terms and
conditions. If all of the above conditions are not met, then this FOSS
License Exception does not apply to you or your Derivative Work.
FOSS License List
+------------------------------------------------------------------------+
|License Name |Version(s)/Copyright Date|
|----------------------------------------------+-------------------------|
|Academic Free License |2.0 |
|----------------------------------------------+-------------------------|
|Apache Software License |1.0/1.1/2.0 |
|----------------------------------------------+-------------------------|
|Apple Public Source License |2.0 |
|----------------------------------------------+-------------------------|
|Artistic license |From Perl 5.8.0 |
|----------------------------------------------+-------------------------|
|BSD license |"July 22 1999" |
|----------------------------------------------+-------------------------|
|Common Development and Distribution License |1.0 |
|(CDDL) | |
|----------------------------------------------+-------------------------|
|Common Public License |1.0 |
|----------------------------------------------+-------------------------|
|Eclipse Public License |1.0 |
|----------------------------------------------+-------------------------|
|European Union Public License (EUPL)¹ |1.1 |
|----------------------------------------------+-------------------------|
|GNU Affero General Public License (AGPL) |3.0 |
|----------------------------------------------+-------------------------|
|GNU Library or "Lesser" General Public License|2.0/2.1/3.0 |
|(LGPL) | |
|----------------------------------------------+-------------------------|
|GNU General Public License (GPL) |3.0 |
|----------------------------------------------+-------------------------|
|IBM Public License |1.0 |
|----------------------------------------------+-------------------------|
|Jabber Open Source License |1.0 |
|----------------------------------------------+-------------------------|
|MIT License (As listed in file |- |
|MIT-License.txt) | |
|----------------------------------------------+-------------------------|
|Mozilla Public License (MPL) |1.0/1.1 |
|----------------------------------------------+-------------------------|
|Open Software License |2.0 |
|----------------------------------------------+-------------------------|
|OpenSSL license (with original SSLeay license)|"2003" ("1998") |
|----------------------------------------------+-------------------------|
|PHP License |3.0/3.01 |
|----------------------------------------------+-------------------------|
|Python license (CNRI Python License) |- |
|----------------------------------------------+-------------------------|
|Python Software Foundation License |2.1.1 |
|----------------------------------------------+-------------------------|
|Sleepycat License |"1999" |
|----------------------------------------------+-------------------------|
|University of Illinois/NCSA Open Source |- |
|License | |
|----------------------------------------------+-------------------------|
|W3C License |"2001" |
|----------------------------------------------+-------------------------|
|X11 License |"2001" |
|----------------------------------------------+-------------------------|
|Zlib/libpng License |- |
|----------------------------------------------+-------------------------|
|Zope Public License |2.0 |
+------------------------------------------------------------------------+
¹) When an Independent Work is licensed under a "Compatible License"
pursuant to the EUPL, the Compatible License rather than the EUPL is the
applicable license for purposes of these FOSS License Exception Terms and
Conditions.
Code status:
------------
* [![Travis CI status](https://secure.travis-ci.org/MariaDB/server.png?branch=10.5)](https://travis-ci.org/MariaDB/server) travis-ci.org (10.5 branch)
* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com
## MariaDB: The open source relational database
......@@ -78,5 +77,3 @@ https://mariadb.org/about/security-policy/
The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server
***************************************************************************
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=5
MYSQL_VERSION_PATCH=12
SERVER_MATURITY=stable
......@@ -3,7 +3,7 @@ version: build-{build}~branch-{branch}
before_build:
- md %APPVEYOR_BUILD_FOLDER%\win_build
- cd %APPVEYOR_BUILD_FOLDER%\win_build
- cmake .. -G "Visual Studio 15 2017 Win64" -DWITH_UNIT_TESTS=0 -DWITH_MARIABACKUP=0 -DMYSQL_MAINTAINER_MODE=ERR -DPLUGIN_ROCKSDB=NO -DPLUGIN_CONNECT=NO -DBISON_EXECUTABLE=C:\cygwin64\bin\bison
- cmake .. -DWITH_UNIT_TESTS=0 -DWITH_MARIABACKUP=0 -DMYSQL_MAINTAINER_MODE=ERR -DPLUGIN_ROCKSDB=NO -DPLUGIN_CONNECT=NO -DBISON_EXECUTABLE=C:\cygwin64\bin\bison
build:
project: win_build\MySQL.sln
......@@ -14,8 +14,8 @@ configuration: RelWithDebInfo
platform: x64
test_script:
- set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
- set PATH=C:\Strawberry\perl\bin;%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
- cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
- perl mysql-test-run.pl --force --max-test-fail=10 --parallel=4 --testcase-timeout=10 --skip-test-list=unstable-tests --suite=main
image: Visual Studio 2017
image: Visual Studio 2019
......@@ -205,7 +205,8 @@ Bucket *find_longest_match(HashTable *ht, char *str, uint length,
void completion_hash_clean(HashTable *ht)
{
free_root(&ht->mem_root,MYF(0));
bzero((char*) ht->arBuckets,ht->nTableSize*sizeof(Bucket *));
if (size_t s= ht->nTableSize)
bzero((char*) ht->arBuckets, s * sizeof(Bucket *));
}
......
......@@ -76,7 +76,7 @@ static struct my_option long_options[] =
my_bool
get_one_option(const struct my_option *opt,
char *value, const char *filename)
const char *value, const char *filename)
{
return 0;
}
......
......@@ -218,7 +218,7 @@ static void tee_print_sized_data(const char *, unsigned int, unsigned int, bool)
/* The names of functions that actually do the manipulation. */
static int get_options(int argc,char **argv);
extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
char *argument);
const char *argument);
static int com_quit(String *str,char*),
com_go(String *str,char*), com_ego(String *str,char*),
com_print(String *str,char*),
......@@ -1715,7 +1715,7 @@ static void usage(int version)
my_bool
get_one_option(const struct my_option *opt, char *argument, const char *)
get_one_option(const struct my_option *opt, const char *argument, const char *)
{
switch(opt->id) {
case OPT_CHARSETS_DIR:
......@@ -1816,7 +1816,8 @@ get_one_option(const struct my_option *opt, char *argument, const char *)
status.add_to_history= 0;
if (!status.line_buff)
ignore_errors= 0; // do it for the first -e only
if (!(status.line_buff= batch_readline_command(status.line_buff, argument)))
if (!(status.line_buff= batch_readline_command(status.line_buff,
(char*) argument)))
return 1;
break;
case 'o':
......@@ -1830,10 +1831,15 @@ get_one_option(const struct my_option *opt, char *argument, const char *)
argument= (char*) ""; // Don't require password
if (argument)
{
char *start= argument;
/*
One should not really change the argument, but we make an
exception for passwords
*/
char *start= (char*) argument;
my_free(opt_password);
opt_password= my_strdup(PSI_NOT_INSTRUMENTED, argument, MYF(MY_FAE));
while (*argument) *argument++= 'x'; // Destroy argument
while (*argument)
*(char*)argument++= 'x'; // Destroy argument
if (*start)
start[1]=0 ;
tty_password= 0;
......@@ -4710,7 +4716,11 @@ sql_real_connect(char *host,char *database,char *user,char *password,
return -1; // Retryable
}
charset_info= get_charset_by_name(mysql.charset->name, MYF(0));
if (!(charset_info= get_charset_by_name(mysql.charset->name, MYF(0))))
{
put_info("Unknown default character set", INFO_ERROR);
return 1;
}
connected=1;
......
......@@ -475,7 +475,8 @@ static void print_default_values(void)
static my_bool
get_one_option(const struct my_option *opt,
char *argument, const char *filename __attribute__((unused)))
const char *argument,
const char *filename __attribute__((unused)))
{
switch(opt->id) {
case 'n':
......
......@@ -18,7 +18,7 @@
#include "client_priv.h"
#include <sslopt-vars.h>
#include "../scripts/mysql_fix_privilege_tables_sql.c"
#include <../scripts/mysql_fix_privilege_tables_sql.c>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
......@@ -51,6 +51,7 @@ static my_bool upgrade_from_mysql;
static DYNAMIC_STRING ds_args;
static DYNAMIC_STRING conn_args;
static DYNAMIC_STRING ds_plugin_data_types;
static char *opt_password= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
......@@ -187,6 +188,7 @@ static void free_used_memory(void)
dynstr_free(&ds_args);
dynstr_free(&conn_args);
dynstr_free(&ds_plugin_data_types);
if (cnf_file_path)
my_delete(cnf_file_path, MYF(MY_WME));
}
......@@ -268,7 +270,7 @@ static void add_one_option_cnf_file(DYNAMIC_STRING *ds,
}
static my_bool
get_one_option(const struct my_option *opt, char *argument,
get_one_option(const struct my_option *opt, const char *argument,
const char *filename __attribute__((unused)))
{
my_bool add_option= TRUE;
......@@ -299,10 +301,17 @@ get_one_option(const struct my_option *opt, char *argument,
add_option= FALSE;
if (argument)
{
/*
One should not really change the argument, but we make an
exception for passwords
*/
char *start= (char*) argument;
/* Add password to ds_args before overwriting the arg with x's */
add_one_option_cnf_file(&ds_args, opt, argument);
while (*argument)
*argument++= 'x'; /* Destroy argument */
*(char*)argument++= 'x'; /* Destroy argument */
if (*start)
start[1]= 0;
tty_password= 0;
}
else
......@@ -965,6 +974,73 @@ static my_bool from_before_10_1()
}
static void uninstall_plugins(void)
{
if (ds_plugin_data_types.length)
{
char *plugins= ds_plugin_data_types.str;
char *next= get_line(plugins);
char buff[512];
while(*plugins)
{
if (next[-1] == '\n')
next[-1]= 0;
verbose("uninstalling plugin for %s data type", plugins);
strxnmov(buff, sizeof(buff)-1, "UNINSTALL SONAME ", plugins,"", NULL);
run_query(buff, NULL, TRUE);
plugins= next;
next= get_line(next);
}
}
}
/**
@brief Install plugins for missing data types
@details Check for entries with "Unknown data type" in I_S.TABLES,
try to load plugins for these tables if available (MDEV-24093)
@return Operation status
@retval TRUE - error
@retval FALSE - success
*/
static int install_used_plugin_data_types(void)
{
DYNAMIC_STRING ds_result;
const char *query = "SELECT table_comment FROM information_schema.tables"
" WHERE table_comment LIKE 'Unknown data type: %'";
if (init_dynamic_string(&ds_result, "", 512, 512))
die("Out of memory");
run_query(query, &ds_result, TRUE);
if (ds_result.length)
{
char *line= ds_result.str;
char *next= get_line(line);
while(*line)
{
if (next[-1] == '\n')
next[-1]= 0;
if (strstr(line, "'MYSQL_JSON'"))
{
verbose("installing plugin for MYSQL_JSON data type");
if(!run_query("INSTALL SONAME 'type_mysql_json'", NULL, TRUE))
{
dynstr_append(&ds_plugin_data_types, "'type_mysql_json'");
dynstr_append(&ds_plugin_data_types, "\n");
break;
}
else
{
fprintf(stderr, "... can't %s\n", "INSTALL SONAME 'type_mysql_json'");
return 1;
}
}
line= next;
next= get_line(next);
}
}
dynstr_free(&ds_result);
return 0;
}
/*
Check for entries with "Unknown storage engine" in I_S.TABLES,
try to load plugins for these tables if available (MDEV-11942)
......@@ -1218,7 +1294,8 @@ int main(int argc, char **argv)
}
if (init_dynamic_string(&ds_args, "", 512, 256) ||
init_dynamic_string(&conn_args, "", 512, 256))
init_dynamic_string(&conn_args, "", 512, 256) ||
init_dynamic_string(&ds_plugin_data_types, "", 512, 256))
die("Out of memory");
if (handle_options(&argc, &argv, my_long_options, get_one_option))
......@@ -1281,6 +1358,7 @@ int main(int argc, char **argv)
*/
if (run_mysqlcheck_upgrade(TRUE) ||
install_used_engines() ||
install_used_plugin_data_types() ||
run_mysqlcheck_views() ||
run_sql_fix_privilege_tables() ||
run_mysqlcheck_fixnames() ||
......@@ -1288,6 +1366,7 @@ int main(int argc, char **argv)
check_slave_repositories())
die("Upgrade failed" );
uninstall_plugins();
verbose("Phase %d/%d: Running 'FLUSH PRIVILEGES'", ++phase, phases_total);
if (run_query("FLUSH PRIVILEGES", NULL, TRUE))
die("Upgrade failed" );
......
......@@ -69,7 +69,7 @@ static uint ex_var_count, max_var_length, max_val_length;
static void print_version(void);
static void usage(void);
extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
char *argument);
const char *argument);
static my_bool sql_connect(MYSQL *mysql, uint wait);
static int execute_commands(MYSQL *mysql,int argc, char **argv);
static char **mask_password(int argc, char ***argv);
......@@ -241,7 +241,7 @@ static const char *load_default_groups[]=
0 };
my_bool
get_one_option(const struct my_option *opt, char *argument, const char *)
get_one_option(const struct my_option *opt, const char *argument, const char *)
{
switch(opt->id) {
case 'c':
......@@ -252,10 +252,15 @@ get_one_option(const struct my_option *opt, char *argument, const char *)
argument= (char*) ""; // Don't require password
if (argument)
{
char *start=argument;
/*
One should not really change the argument, but we make an
exception for passwords
*/
char *start= (char*) argument;
my_free(opt_password);
opt_password=my_strdup(PSI_NOT_INSTRUMENTED, argument,MYF(MY_FAE));
while (*argument) *argument++= 'x'; /* Destroy argument */
while (*argument)
*(char*) argument++= 'x'; /* Destroy argument */
if (*start)
start[1]=0; /* Cut length of argument */
tty_password= 0;
......
......@@ -95,6 +95,8 @@ static uint opt_protocol= 0;
static FILE *result_file;
static char *result_file_name= 0;
static const char *output_prefix= "";
static char **defaults_argv= 0;
static MEM_ROOT glob_root;
#ifndef DBUG_OFF
static const char *default_dbug_option = "d:t:o,/tmp/mariadb-binlog.trace";
......@@ -110,7 +112,7 @@ static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
static bool one_database=0, one_table=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 0, opt_version= 0;
const char *base64_output_mode_names[]=
{"NEVER", "AUTO", "ALWAYS", "UNSPEC", "DECODE-ROWS", NullS};
{"NEVER", "AUTO", "UNSPEC", "DECODE-ROWS", NullS};
TYPELIB base64_output_mode_typelib=
{ array_elements(base64_output_mode_names) - 1, "",
base64_output_mode_names, NULL };
......@@ -832,53 +834,6 @@ static bool shall_skip_table(const char *log_tblname)
strcmp(log_tblname, table);
}
/**
Prints the given event in base64 format.
The header is printed to the head cache and the body is printed to
the body cache of the print_event_info structure. This allows all
base64 events corresponding to the same statement to be joined into
one BINLOG statement.
@param[in] ev Log_event to print.
@param[in,out] result_file FILE to which the output will be written.
@param[in,out] print_event_info Parameters and context state
determining how to print.
@retval ERROR_STOP An error occurred - the program should terminate.
@retval OK_CONTINUE No error, the program should continue.
*/
static Exit_status
write_event_header_and_base64(Log_event *ev, FILE *result_file,
PRINT_EVENT_INFO *print_event_info)
{
IO_CACHE *head= &print_event_info->head_cache;
IO_CACHE *body= &print_event_info->body_cache;
DBUG_ENTER("write_event_header_and_base64");
/* Write header and base64 output to cache */
if (ev->print_header(head, print_event_info, FALSE))
DBUG_RETURN(ERROR_STOP);
DBUG_ASSERT(print_event_info->base64_output_mode == BASE64_OUTPUT_ALWAYS);
if (ev->print_base64(body, print_event_info,
print_event_info->base64_output_mode !=
BASE64_OUTPUT_DECODE_ROWS))
DBUG_RETURN(ERROR_STOP);
/* Read data from cache and write to result file */
if (copy_event_cache_to_file_and_reinit(head, result_file) ||
copy_event_cache_to_file_and_reinit(body, result_file))
{
error("Error writing event to file.");
DBUG_RETURN(ERROR_STOP);
}
DBUG_RETURN(OK_CONTINUE);
}
static bool print_base64(PRINT_EVENT_INFO *print_event_info, Log_event *ev)
{
/*
......@@ -975,8 +930,12 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
my_b_printf(body_cache, "'%s\n", print_event_info->delimiter);
// flush cache
if ((copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, result_file) ||
copy_event_cache_to_file_and_reinit(&print_event_info->body_cache, result_file)))
if ((copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
result_file) ||
copy_event_cache_to_file_and_reinit(&print_event_info->body_cache,
result_file) ||
copy_event_cache_to_file_and_reinit(&print_event_info->tail_cache,
result_file)))
return 1;
}
}
......@@ -1126,19 +1085,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
qe->flags|= LOG_EVENT_SUPPRESS_USE_F;
}
print_use_stmt(print_event_info, qe);
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{
if ((retval= write_event_header_and_base64(ev, result_file,
print_event_info)) !=
OK_CONTINUE)
goto end;
}
else
{
print_skip_replication_statement(print_event_info, ev);
if (ev->print(result_file, print_event_info))
goto err;
}
print_skip_replication_statement(print_event_info, ev);
if (ev->print(result_file, print_event_info))
goto err;
if (head->error == -1)
goto err;
break;
......@@ -1162,19 +1111,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
below.
*/
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{
if ((retval= write_event_header_and_base64(ce, result_file,
print_event_info)) !=
OK_CONTINUE)
goto end;
}
else
{
print_skip_replication_statement(print_event_info, ev);
if (ce->print(result_file, print_event_info, TRUE))
goto err;
}
print_skip_replication_statement(print_event_info, ev);
if (ce->print(result_file, print_event_info, TRUE))
goto err;
// If this binlog is not 3.23 ; why this test??
if (glob_description_event->binlog_version >= 3)
{
......@@ -1581,12 +1520,10 @@ static struct my_option my_options[] =
"--verbose option is also given; "
"'auto' prints base64 only when necessary (i.e., for row-based events and "
"format description events); "
"'always' prints base64 whenever possible. "
"--base64-output with no 'name' argument is equivalent to "
"--base64-output=always and is also deprecated. If no "
"--base64-output[=name] option is given at all, the default is 'auto'.",
"If no --base64-output=name option is given at all, the default is "
"'auto'.",
&opt_base64_output_mode_str, &opt_base64_output_mode_str,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
/*
mysqlbinlog needs charsets knowledge, to be able to convert a charset
number found in binlog to a charset name (to be able to print things
......@@ -1884,18 +1821,32 @@ static void cleanup()
my_free(const_cast<char*>(dirname_for_local_load));
my_free(start_datetime_str);
my_free(stop_datetime_str);
free_root(&glob_root, MYF(0));
delete binlog_filter;
delete glob_description_event;
if (mysql)
mysql_close(mysql);
free_defaults(defaults_argv);
free_annotate_event();
my_free_open_file_info();
load_processor.destroy();
mysql_server_end();
DBUG_VOID_RETURN;
}
static void die()
{
cleanup();
my_end(MY_DONT_FREE_DBUG);
exit(1);
}
static void print_version()
{
printf("%s Ver 3.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
printf("%s Ver 3.5 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
}
......@@ -1926,7 +1877,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings)
{
error("Incorrect date and time argument: %s", str);
exit(1);
die();
}
/*
Note that Feb 30th, Apr 31st cause no error messages and are mapped to
......@@ -1939,7 +1890,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
extern "C" my_bool
get_one_option(const struct my_option *opt, char *argument, const char *)
get_one_option(const struct my_option *opt, const char *argument, const char *)
{
bool tty_password=0;
switch (opt->id) {
......@@ -1963,10 +1914,15 @@ get_one_option(const struct my_option *opt, char *argument, const char *)
argument= (char*) ""; // Don't require password
if (argument)
{
/*
One should not really change the argument, but we make an
exception for passwords
*/
my_free(pass);
char *start=argument;
char *start= (char*) argument;
pass= my_strdup(PSI_NOT_INSTRUMENTED, argument,MYF(MY_FAE));
while (*argument) *argument++= 'x'; /* Destroy argument */
while (*argument)
*(char*)argument++= 'x'; /* Destroy argument */
if (*start)
start[1]=0; /* Cut length of argument */
}
......@@ -1984,7 +1940,7 @@ get_one_option(const struct my_option *opt, char *argument, const char *)
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
die();
}
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
......@@ -1999,64 +1955,59 @@ get_one_option(const struct my_option *opt, char *argument, const char *)
stop_datetime= convert_str_to_timestamp(stop_datetime_str);
break;
case OPT_BASE64_OUTPUT_MODE:
if (argument == NULL)
opt_base64_output_mode= BASE64_OUTPUT_ALWAYS;
else
{
int val;
int val;
if ((val= find_type_with_warning(argument, &base64_output_mode_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
opt_base64_output_mode= (enum_base64_output_mode) (val - 1);
if ((val= find_type_with_warning(argument, &base64_output_mode_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
die();
}
opt_base64_output_mode= (enum_base64_output_mode)(val - 1);
break;
case OPT_REWRITE_DB: // db_from->db_to
{
/* See also handling of OPT_REPLICATE_REWRITE_DB in sql/mysqld.cc */
char* ptr;
char* key= argument; // db-from
char* val; // db-to
const char* ptr;
const char* key= argument; // db-from
const char* val; // db-to
// Where key begins
// Skipp pre-space in key
while (*key && my_isspace(&my_charset_latin1, *key))
key++;
// Where val begins
if (!(ptr= strstr(argument, "->")))
if (!(ptr= strstr(key, "->")))
{
sql_print_error("Bad syntax in rewrite-db: missing '->'!\n");
sql_print_error("Bad syntax in rewrite-db: missing '->'\n");
return 1;
}
val= ptr + 2;
while (*val && my_isspace(&my_charset_latin1, *val))
val++;
// Write \0 and skip blanks at the end of key
*ptr-- = 0;
while (my_isspace(&my_charset_latin1, *ptr) && ptr > argument)
*ptr-- = 0;
// Skip blanks at the end of key
while (ptr > key && my_isspace(&my_charset_latin1, ptr[-1]))
ptr--;
if (!*key)
if (ptr == key)
{
sql_print_error("Bad syntax in rewrite-db: empty db-from!\n");
sql_print_error("Bad syntax in rewrite-db: empty FROM db\n");
return 1;
}
key= strmake_root(&glob_root, key, (size_t) (ptr-key));
// Skip blanks at the end of val
ptr= val;
while (*ptr && !my_isspace(&my_charset_latin1, *ptr))
ptr++;
*ptr= 0;
/* Skipp pre space in value */
while (*val && my_isspace(&my_charset_latin1, *val))
val++;
if (!*val)
// Value ends with \0 or space
for (ptr= val; *ptr && !my_isspace(&my_charset_latin1, *ptr) ; ptr++)
{}
if (ptr == val)
{
sql_print_error("Bad syntax in rewrite-db: empty db-to!\n");
sql_print_error("Bad syntax in rewrite-db: empty TO db\n");
return 1;
}
val= strmake_root(&glob_root, val, (size_t) (ptr-val));
binlog_filter->add_db_rewrite(key, val);
break;
......@@ -2094,7 +2045,9 @@ static int parse_args(int *argc, char*** argv)
int ho_error;
if ((ho_error=handle_options(argc, argv, my_options, get_one_option)))
exit(ho_error);
{
die();
}
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
else if (debug_check_flag)
......@@ -2828,8 +2781,7 @@ static Exit_status check_header(IO_CACHE* file,
(ulonglong)tmp_pos);
return ERROR_STOP;
}
if (opt_base64_output_mode == BASE64_OUTPUT_AUTO
|| opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
if (opt_base64_output_mode == BASE64_OUTPUT_AUTO)
{
/*
process_event will delete *description_event and set it to
......@@ -3013,7 +2965,6 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
int main(int argc, char** argv)
{
char **defaults_argv;
Exit_status retval= OK_CONTINUE;
ulonglong save_stop_position;
MY_INIT(argv[0]);
......@@ -3026,6 +2977,8 @@ int main(int argc, char** argv)
load_defaults_or_exit("my", load_groups, &argc, &argv);
defaults_argv= argv;
init_alloc_root(PSI_NOT_INSTRUMENTED, &glob_root, 1024, 0, MYF(0));
if (!(binlog_filter= new Rpl_filter))
{
error("Failed to create Rpl_filter");
......@@ -3064,7 +3017,7 @@ int main(int argc, char** argv)
if (!remote_opt)
{
error("The --raw mode only works with --read-from-remote-server");
exit(1);
die();
}
if (one_database)
warning("The --database option is ignored in raw mode");
......@@ -3086,7 +3039,7 @@ int main(int argc, char** argv)
O_WRONLY | O_BINARY, MYF(MY_WME))))
{
error("Could not create log file '%s'", result_file_name);
exit(1);
die();
}
}
else
......@@ -3207,11 +3160,6 @@ int main(int argc, char** argv)
if (result_file && result_file != stdout)
my_fclose(result_file, MYF(0));
cleanup();
free_annotate_event();
free_defaults(defaults_argv);
my_free_open_file_info();
load_processor.destroy();
mysql_server_end();
/* We cannot free DBUG, it is used in global destructors after exit(). */
my_end(my_end_arg | MY_DONT_FREE_DBUG);
......@@ -3221,7 +3169,6 @@ int main(int argc, char** argv)
err:
cleanup();
free_defaults(defaults_argv);
my_end(my_end_arg);
exit(retval == ERROR_STOP ? 1 : 0);
DBUG_RETURN(retval == ERROR_STOP ? 1 : 0);
......