Skip to content

Commit

Permalink
Merge pull request #3611 from inikep/merge-mysql-5.7.29-part2
Browse files Browse the repository at this point in the history
Implemented PS-5937 (Merge MySQL 5.7.29) part 2
  • Loading branch information
inikep authored Jan 20, 2020
2 parents e12228e + 6d54f49 commit 56bce88
Show file tree
Hide file tree
Showing 17 changed files with 433 additions and 232 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ IF(WITH_DEFAULT_FEATURE_SET)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/build_configurations/feature_set.cmake)
ENDIF()

INCLUDE(CMakePushCheckState)

# Add macros
INCLUDE(character_sets)
INCLUDE(cpu_info)
Expand All @@ -275,6 +277,7 @@ INCLUDE(lz4)
INCLUDE(libevent)
INCLUDE(ssl)
INCLUDE(sasl)
INCLUDE(ldap)
INCLUDE(rpc)
INCLUDE(readline)
INCLUDE(protobuf)
Expand Down Expand Up @@ -316,6 +319,9 @@ ENDIF()
IF(NOT WITHOUT_SERVER)
OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
ENDIF()
OPTION(WITH_AUTHENTICATION_LDAP
"Report error if the LDAP authentication plugin cannot be built." OFF)

OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" OFF)
MARK_AS_ADVANCED(WITHOUT_SERVER DISABLE_SHARED FORCE_UNSUPPORTED_COMPILER)

Expand Down Expand Up @@ -586,6 +592,8 @@ MYSQL_CHECK_LIBEVENT()
MYSQL_CHECK_LZ4()
# Add SASL library
MYSQL_CHECK_SASL()
# Add LDAP library
MYSQL_CHECK_LDAP()
# Add protoc and libprotobuf
IF(NOT WITHOUT_SERVER)
MYSQL_CHECK_PROTOBUF()
Expand Down
114 changes: 21 additions & 93 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Introduction
third-party software which may be included in this distribution of
MySQL 5.7.28 (and later).

Last updated: September 2019
Last updated: November 2019

Licensing Information

Expand Down Expand Up @@ -550,7 +550,6 @@ PSF LICENSE AGREEMENT FOR PYTHON 2.7.11
8. By copying, installing or otherwise using Python 2.7.11, Licensee agrees
to be bound by the terms and conditions of this License Agreement.


Boost Library

The following software may be included in this product:
Expand Down Expand Up @@ -819,71 +818,6 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Some files are:
Copyright (c) 1998 The NetBSD Foundation, Inc.
All rights reserved.

This code is derived from software contributed to The NetBSD
Foundation by Christos Zoulas.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Some files are:
Copyright (c) 2009 The NetBSD Foundation, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
This product includes software developed by the NetBSD
Foundation, Inc. and its contributors.
4. Neither the name of The NetBSD Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Facebook Fast Checksum Patch

The following software may be included in this product:
Expand Down Expand Up @@ -1773,7 +1707,6 @@ SUCH DAMAGE.
libevent

The following software may be included in this product:

Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
Copyright (c) 2007-2012 Niels Provos and Nick Mathewson

Expand Down Expand Up @@ -1841,7 +1774,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


libgcc & libstdc++ Libraries

The following software may be included in this product:
Expand Down Expand Up @@ -3709,32 +3641,30 @@ LZ4

The following software may be included in this product:
LZ4 Library
Copyright (c) 2011-2014, Yann Collet
Copyright (c) 2011-2016, Yann Collet
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAG
ES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

md5 (Message-Digest Algorithm 5)

Expand Down Expand Up @@ -4033,16 +3963,14 @@ OpenSSL License

The OpenSSL toolkit stays under a double license, i.e. both the conditions of
the OpenSSL License and the original SSLeay license apply to the toolkit.
See below for the actual license texts. Actually both licenses are BSD-style
Open Source licenses. In case of any license issues related to OpenSSL
please contact openssl-core@openssl.org.
See below for the actual license texts.

OpenSSL License
---------------

/* ====================================================================

* Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
* Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.
*

* Redistribution and use in source and binary forms, with or without
Expand Down
150 changes: 150 additions & 0 deletions cmake/ldap.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# 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, version 2.0, 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 St, Fifth Floor, Boston, MA 02110-1301 USA

# cmake -DWITH_LDAP=system|</path/to/custom/installation>
# system is the default

INCLUDE (CheckIncludeFile)
INCLUDE (CheckIncludeFiles)

SET(WITH_LDAP_DOC "\nsystem (use the OS ldap library)")
STRING_APPEND(WITH_LDAP_DOC ", \n</path/to/custom/installation>")

STRING(REPLACE "\n" "| " WITH_LDAP_DOC_STRING "${WITH_LDAP_DOC}")

MACRO(FIND_SYSTEM_LDAP)
IF(WIN32)
SET(LDAP_SYSTEM_LIBRARY Wldap32 CACHE INTERNAL
"LDAP library is /c/Windows/system32/Wldap32.dll"
)
ELSE()
FIND_LIBRARY(LDAP_SYSTEM_LIBRARY
NAMES ldap_r ldap
)
FIND_LIBRARY(LBER_SYSTEM_LIBRARY
NAMES lber
)
ENDIF()
IF(LDAP_SYSTEM_LIBRARY AND (WIN32 OR LBER_SYSTEM_LIBRARY))
SET(LDAP_LIBRARY ${LDAP_SYSTEM_LIBRARY})
SET(LBER_LIBRARY ${LBER_SYSTEM_LIBRARY})
MESSAGE(STATUS "LBER_LIBRARY ${LBER_LIBRARY}")
MESSAGE(STATUS "LDAP_LIBRARY ${LDAP_LIBRARY}")
ENDIF()

IF(WIN32)
# LDAP system header is Winldap.h and is in some Windows SDK
ELSE()
CMAKE_PUSH_CHECK_STATE()

# For Solaris 11.3 we need to explicitly search here:
IF(SOLARIS)
INCLUDE_DIRECTORIES(BEFORE SYSTEM /usr/include/openldap)
SET(CMAKE_REQUIRED_INCLUDES "/usr/include/openldap")
ENDIF()

CHECK_INCLUDE_FILE(lber.h HAVE_LBER_H)
CHECK_INCLUDE_FILE(ldap.h HAVE_LDAP_H)
CMAKE_POP_CHECK_STATE()
ENDIF()

ENDMACRO()

MACRO(FIND_CUSTOM_LDAP)
FIND_PATH(LDAP_INCLUDE_DIR
NAMES ldap.h
PATHS ${WITH_LDAP_PATH}/include
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)

# On mac this list is <.dylib;.so;.a>
# We prefer static libraries, so we reverse it here.
LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)

FIND_LIBRARY(LDAP_CUSTOM_LIBRARY
NAMES ldap_r ldap
PATHS ${WITH_LDAP_PATH}/lib
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_LIBRARY(LBER_CUSTOM_LIBRARY
NAMES lber
PATHS ${WITH_LDAP_PATH}/lib
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)

LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)

IF(LDAP_INCLUDE_DIR)
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${LDAP_INCLUDE_DIR})

CMAKE_PUSH_CHECK_STATE()
SET(CMAKE_REQUIRED_INCLUDES ${LDAP_INCLUDE_DIR})
CHECK_INCLUDE_FILE(lber.h HAVE_LBER_H)
CHECK_INCLUDE_FILE(ldap.h HAVE_LDAP_H)
CMAKE_POP_CHECK_STATE()
ENDIF()

IF(LDAP_CUSTOM_LIBRARY AND LBER_CUSTOM_LIBRARY)
SET(LDAP_LIBRARY ${LDAP_CUSTOM_LIBRARY})
SET(LBER_LIBRARY ${LBER_CUSTOM_LIBRARY})
GET_FILENAME_COMPONENT(LDAP_LIBRARY_EXT ${LDAP_LIBRARY} EXT)
IF(LDAP_LIBRARY_EXT STREQUAL ".a")
SET(STATIC_LDAP_LIBRARY 1)
ENDIF()
MESSAGE(STATUS "LDAP_LIBRARY ${LDAP_LIBRARY}")
MESSAGE(STATUS "LBER_LIBRARY ${LBER_LIBRARY}")
ENDIF()
ENDMACRO()

MACRO(MYSQL_CHECK_LDAP)
IF(NOT WITH_LDAP)
SET(WITH_LDAP "system" CACHE STRING ${WITH_LDAP_DOC_STRING} FORCE)
ENDIF()

# See if WITH_LDAP is of the form </path/to/custom/installation>
FILE(GLOB WITH_LDAP_HEADER ${WITH_LDAP}/include/ldap.h)
IF (WITH_LDAP_HEADER)
FILE(TO_CMAKE_PATH "${WITH_LDAP}" WITH_LDAP)
SET(WITH_LDAP_PATH ${WITH_LDAP})
ENDIF()

IF(WITH_LDAP STREQUAL "system")
FIND_SYSTEM_LDAP()
ELSE()
FIND_CUSTOM_LDAP()
ENDIF()

IF(WIN32 AND WITH_LDAP STREQUAL "system")
SET(LDAP_FOUND 1)
ELSEIF(HAVE_LBER_H AND HAVE_LDAP_H AND LDAP_LIBRARY AND LBER_LIBRARY)
SET(LDAP_FOUND 1)
ELSE()
SET(LDAP_FOUND 0)
ENDIF()

ENDMACRO()
14 changes: 10 additions & 4 deletions cmake/os/FreeBSD.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand All @@ -19,12 +18,19 @@
#
# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# This file includes FreeBSD specific options and quirks, related to system checks
# This file includes FreeBSD specific options and quirks,
# related to system checks

INCLUDE(CheckCSourceRuns)

SET(FREEBSD 1)

# On FreeBSD some includes, e.g. sasl/sasl.h, is in /usr/local/include
INCLUDE_DIRECTORIES(SYSTEM /usr/local/include)
LIST(APPEND CMAKE_REQUIRED_INCLUDES "/usr/local/include")

# We require at least Clang 3.3.
IF(NOT FORCE_UNSUPPORTED_COMPILER)
IF(CMAKE_C_COMPILER_ID MATCHES "Clang")
Expand Down
Loading

0 comments on commit 56bce88

Please sign in to comment.