Skip to content

Commit 521ff56

Browse files
committed
ANNOUNCEMENT
- Updated with the latest notes, and in addition a security note FindMySQL.cmake - Bug fix to set MYSQL_INCLUDE_DIR correctly - Bug fix to handle out-of-source builds CMakeLists.txt cppconn/CMakeLists.txt driver/CMakeLists.txt examples/CMakeLists.txt test/CJUnitTestsPort/CMakeLists.txt test/CMakeLists.txt test/framework/CMakeLists.txt test/unit/CMakeLists.txt - Changes to handle out-of-source builds - Exclude the generated "cppconn/version_info.h" from the source package - Rearranged the CMake INCLUDE_DIRECTORIES(..), needed to handle the out-of-source builds and the fact there are both "cppconn/version_info.h" and "driver/version_info.h" with different content, need to ensure the right one gets picked up win/CMakeLists.txt win/mysql-conncpp-msi-template.xml.in - Changes to handle out-of-source builds
1 parent 289edd6 commit 521ff56

File tree

13 files changed

+172
-97
lines changed

13 files changed

+172
-97
lines changed

ANNOUNCEMENT

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,51 @@ The MySQL driver for C++ offers an easy to use API derived from JDBC
2323

2424
The major changes in 1.1.6 are:
2525

26+
Security Notes
27+
28+
* Connector/C++ 1.1.6 Commercial upgrades the linked OpenSSL
29+
library to version 1.0.1m which has been publicly reported
30+
as not vulnerable to CVE-2015-0286
31+
(http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0286).
32+
33+
Functionality Added or Changed
34+
35+
* The std::auto_ptr class template is deprecated in C++11,
36+
and its usage has been replaced with
37+
boost::scoped_ptr/shared_ptr.
38+
The CMAKE_ENABLE_C++11 CMake option has been added to
39+
permit enabling C++11 support. (Bug #75251)
40+
41+
* Connector/C++ now provides macros to indicate the
42+
versions of libraries against which it was built:
43+
MYCPPCONN_STATIC_MYSQL_VERSION and
44+
MYCPPCONN_STATIC_MYSQL_VERSION_ID (MySQL client library
45+
version, string and numeric), and MYCPPCONN_BOOST_VERSION
46+
(Boost library version, numeric). (Bug #75250)
47+
48+
Bugs Fixed
49+
50+
* With defaultStatementResultType=FORWARD_ONLY and a row
51+
position after the last row, using getter methods such as
52+
getInt() or getString() resulted in a segmentation fault.
53+
(Bug #20085944)
54+
55+
* For prepared statements, calling wasNull() before
56+
fetching data resulted in an assertion failure.
57+
(Bug #19938873)
58+
59+
* Result sets from prepared statements were not freed.
60+
(Bug #18135088)
61+
62+
* MySQL Connector/C++ failed to build against
63+
Boost-devel-1.41.0-25 on OLE6.
64+
(Bug #75063, Bug #20125824)
65+
66+
* Configuration failed if the MYSQL_CONFIG_EXECUTABLE
2667
option was specified and the MySQL installation path
2768
contained the characters -m. Installation failed if the
28-
build directory was not in the top source directory. (Bug
29-
#73502, Bug #19447498)
69+
build directory was not in the top source directory.
70+
(Bug #73502, Bug #19447498)
3071

3172
* For prepared statements, getString() did not return the
3273
fractional seconds part from temporal columns that had a

CMakeLists.txt

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
33
#
44
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -45,7 +45,8 @@ ENDIF()
4545
SET(EDIT_WARNING_MESSAGE "Please do not edit this file - it is generated by cmake. Edit its source file instead.")
4646

4747
# Configuring header file with driver version info
48-
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/driver/version_info.h.cmake ${CMAKE_SOURCE_DIR}/driver/version_info.h @ONLY)
48+
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/driver/version_info.h.cmake
49+
${CMAKE_BINARY_DIR}/driver/version_info.h @ONLY)
4950

5051
# This is needed by windows installer and fro CPACK
5152
IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
@@ -57,8 +58,8 @@ ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
5758
# Creating file with version info that will be used for installer
5859
# We have to do this trick because of license filename that is looked in this CMAKE_SOURCE_DIR (installer's cmake is run separately)
5960
IF(WIN32)
60-
FILE(WRITE "${CMAKE_SOURCE_DIR}/win/config.cmake" "SET(CONNECTOR_PRODUCT_VERSION ${CONNECTOR_VERSION})
61-
SET( LICENSE_FILENAME "${LICENSE_FILENAME}")")
61+
FILE(WRITE "${CMAKE_BINARY_DIR}/win/config.cmake" "SET(CONNECTOR_PRODUCT_VERSION ${CONNECTOR_VERSION})\n"
62+
"SET(LICENSE_FILENAME \"${LICENSE_FILENAME}\")\n")
6263
ENDIF(WIN32)
6364

6465
#-----------------
@@ -232,7 +233,8 @@ IF(MYSQLCLIENT_STATIC_BINDING AND EXISTS "${CMAKE_SOURCE_DIR}/cmake/mysql_versio
232233
ENDIF()
233234

234235
# Configuring header file with DM version info
235-
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cppconn/version_info.h.cmake ${CMAKE_SOURCE_DIR}/cppconn/version_info.h @ONLY)
236+
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cppconn/version_info.h.cmake
237+
${CMAKE_BINARY_DIR}/cppconn/version_info.h @ONLY)
236238

237239
#
238240
# ----------------------------------------------------------------------
@@ -305,12 +307,38 @@ INSTALL(FILES
305307
"${CMAKE_SOURCE_DIR}/ANNOUNCEMENT"
306308
DESTINATION "." OPTIONAL)
307309

308-
SET(COMMON_IGNORE_FILES "/CMakeFiles/" "/Testing/" "/.bzr/" "_CPack_Packages/"
309-
"~" ".swp" ".log" ".gz" ".directory$" "CMakeCache.txt" "Makefile"
310-
"install_manifest.txt")
311-
SET(PRJ_COMMON_IGNORE_FILES ${COMMON_IGNORE_FILES} "ANNOUNCEMENT_102_ALPHA" "ANNOUNCEMENT_103_ALPHA" "ANNOUNCEMENT_104_BETA" "ANNOUNCEMENT_105_GA" "ANNOUNCEMENT_110_GA" "ANNOUNCEMENT_111_GA" "ANNOUNCEMENT_DRAFT" )
312-
313-
SET(CPACK_SOURCE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} "./cppconn/config.h$" "./driver/nativeapi/binding_config.h$" "./driver/version_info.h$")
310+
SET(COMMON_IGNORE_FILES
311+
"/CMakeFiles/"
312+
"/Testing/"
313+
"/.bzr/"
314+
"_CPack_Packages/"
315+
"~"
316+
".swp"
317+
".log"
318+
".gz"
319+
".directory$"
320+
"CMakeCache.txt"
321+
"Makefile"
322+
"install_manifest.txt"
323+
)
324+
SET(PRJ_COMMON_IGNORE_FILES
325+
${COMMON_IGNORE_FILES}
326+
"ANNOUNCEMENT_102_ALPHA"
327+
"ANNOUNCEMENT_103_ALPHA"
328+
"ANNOUNCEMENT_104_BETA"
329+
"ANNOUNCEMENT_105_GA"
330+
"ANNOUNCEMENT_110_GA"
331+
"ANNOUNCEMENT_111_GA"
332+
"ANNOUNCEMENT_DRAFT"
333+
)
334+
335+
SET(CPACK_SOURCE_IGNORE_FILES
336+
${PRJ_COMMON_IGNORE_FILES}
337+
"cppconn/config.h$"
338+
"cppconn/version_info.h$"
339+
"driver/nativeapi/binding_config.h$"
340+
"driver/version_info.h$"
341+
)
314342
SET(CPACK_PACKAGE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} "something_there" )
315343
SET(CPACK_SOURCE_GENERATOR "TGZ")
316344

@@ -331,7 +359,9 @@ ENDIF(WIN32)
331359
MESSAGE(STATUS "Installation path is: ${CMAKE_INSTALL_PREFIX} (overwrite with -DCMAKE_INSTALL_PREFIX=/your/path)")
332360

333361
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
362+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
334363
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/cppconn)
364+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/cppconn)
335365
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/driver/nativeapi)
336366

337367
ADD_SUBDIRECTORY(cppconn)

FindMySQL.cmake

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- indent-tabs-mode:nil; -*-
22
# vim: set expandtab:
33
#
4-
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
4+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
55
#
66
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
77
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -550,15 +550,13 @@ else()
550550
endif()
551551

552552
# No specific paths, try some common install paths
553-
find_path(_found_header mysql.h ${_include_fallback_path})
553+
find_path(MYSQL_INCLUDE_DIR mysql.h ${_include_fallback_path})
554554

555-
if(NOT _found_header)
555+
if(NOT MYSQL_INCLUDE_DIR)
556556
message(FATAL_ERROR "Could not find \"mysql.h\" from searching "
557557
"\"${_pp_include_fallback_path}\"")
558558
endif()
559559

560-
get_filename_component(MYSQL_INCLUDE_DIR ${_found_header} PATH)
561-
562560
endif()
563561

564562
if(FINDMYSQL_DEBUG)
@@ -567,17 +565,17 @@ endif()
567565

568566
if (MYSQL_INCLUDE_DIR AND NOT MYSQL_NUM_VERSION)
569567
try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
570-
"${CMAKE_SOURCE_DIR}"
568+
"${CMAKE_BINARY_DIR}"
571569
"${CMAKE_SOURCE_DIR}/cmake/getmysqlversion.c"
572570
CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${MYSQL_INCLUDE_DIR}
573-
ARGS "${CMAKE_SOURCE_DIR}/cmake/mysql_version_info.cmake"
571+
ARGS "${CMAKE_BINARY_DIR}/cmake/mysql_version_info.cmake"
574572
"MYSQL_SERVER_VERSION"
575573
"MYSQL_VERSION_ID"
576574
"LIBMYSQL_VERSION"
577575
"LIBMYSQL_VERSION_ID")
578576

579577
if(COMPILE_RESULT_VAR AND RUN_RESULT_VAR)
580-
include(${CMAKE_SOURCE_DIR}/cmake/mysql_version_info.cmake)
578+
include(${CMAKE_BINARY_DIR}/cmake/mysql_version_info.cmake)
581579
if(NOT LIBMYSQL_CPP_VERSION STREQUAL "")
582580
set(MYSQL_VERSION "${LIBMYSQL_CPP_VERSION}")
583581
elseif(NOT MYSQL_CPP_SERVER_VERSION STREQUAL "")
@@ -734,7 +732,8 @@ endif()
734732
##########################################################################
735733

736734
# FIXME needed?!
737-
if(NOT WIN32 AND MYSQLCLIENT_STATIC_LINKING AND
735+
if(MYSQLCLIENT_STATIC_LINKING AND
736+
NOT WIN32 AND
738737
NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
739738
list(APPEND MYSQL_LIBRARIES "rt")
740739
endif()

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ copy of the software is released under the version 2 of
77
the GNU General Public License. MySQL Connector/C++ is
88
brought to you by Oracle.
99

10-
Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
10+
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
1111

1212
License information can be found in the COPYING file.
1313

cppconn/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
33
#
44
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -53,12 +53,13 @@ CHECK_FUNCTION_EXISTS(strtoimax HAVE_FUNCTION_STRTOIMAX)
5353
CHECK_FUNCTION_EXISTS(strtoumax HAVE_FUNCTION_STRTOUMAX)
5454

5555

56-
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cm ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
56+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cm
57+
${CMAKE_CURRENT_BINARY_DIR}/config.h)
5758

5859

5960
SET(MYSQLCPPCONN_INSTALL_HEADERS
6061
build_config.h
61-
config.h
62+
${CMAKE_CURRENT_BINARY_DIR}/config.h
6263
connection.h
6364
datatype.h
6465
driver.h
@@ -71,7 +72,7 @@ SET(MYSQLCPPCONN_INSTALL_HEADERS
7172
statement.h
7273
sqlstring.h
7374
warning.h
74-
version_info.h
75+
${CMAKE_CURRENT_BINARY_DIR}/version_info.h
7576
variant.h)
7677

7778
INSTALL(FILES ${MYSQLCPPCONN_INSTALL_HEADERS} DESTINATION include/cppconn)

driver/CMakeLists.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@
2222
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
#
2424

25+
# There is a generated "version_info.h" in "cppconn/" as well,
26+
# specify that we want the one built from this directory
27+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
2528

2629
LINK_DIRECTORIES(${MYSQLCPPCONN_BOOST_LIBRARY_DIRS})
2730

28-
29-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
30-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR}/cppconn)
31-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_BOOST_INCLUDE_DIRS})
32-
MESSAGE(STATUS "BOOST_INCLUDE_DIRS=${MYSQLCPPCONN_BOOST_INCLUDE_DIRS}")
33-
34-
3531
SET(MYSQLCPPCONN_TRACE_ENABLE 0 CACHE BOOL "trace-enabled")
3632

3733
IF(MYSQLCPPCONN_TRACE_ENABLE)
@@ -88,7 +84,8 @@ ELSE(MYSQLCPPCONN_DT_RPATH)
8884
MESSAGE(STATUS "DT_RPATH will not be set")
8985
ENDIF(MYSQLCPPCONN_DT_RPATH)
9086

91-
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nativeapi/binding_config.h.cm ${CMAKE_CURRENT_SOURCE_DIR}/nativeapi/binding_config.h)
87+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nativeapi/binding_config.h.cm
88+
${CMAKE_CURRENT_BINARY_DIR}/nativeapi/binding_config.h)
9289

9390
SET(MYSQLCPPCONN_SOURCES
9491
mysql_art_resultset.cpp
@@ -141,7 +138,7 @@ IF(WIN32)
141138
mysql_util.h
142139
mysql_warning.h
143140
mysql_uri.h
144-
version_info.h
141+
${CMAKE_CURRENT_BINARY_DIR}/version_info.h
145142
nativeapi/mysql_client_api.h
146143
nativeapi/mysql_native_driver_wrapper.h
147144
nativeapi/native_driver_wrapper.h

examples/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
33
#
44
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -27,12 +27,9 @@ SET(CMAKE_VERBOSE_MAKEFILE 0)
2727

2828
SET(MYSQLCPPCONN_BUILD_EXAMPLES 1 CACHE BOOL "build-examples")
2929
IF(MYSQLCPPCONN_BUILD_EXAMPLES)
30-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
31-
LINK_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR}/cppconn)
30+
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/cppconn)
3231

3332
IF(WIN32)
34-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR/cppconn})
35-
3633
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
3734
LINK_DIRECTORIES(${MYSQL_DIR}/lib/debug)
3835
ELSEIF(CMAKE_BUILD_TYPE STREQUAL "")

test/CJUnitTestsPort/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
33
#
44
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -22,10 +22,6 @@
2222
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
#
2424

25-
26-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
27-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR}/cppconn)
28-
2925
IF(WIN32)
3026
LINK_DIRECTORIES(../framework/$(ConfigurationName))
3127
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn test_framework)

test/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
33
#
44
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -22,8 +22,6 @@
2222
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
#
2424

25-
26-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
2725
IF(WIN32)
2826
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
2927
LINK_DIRECTORIES(${MYSQL_DIR}/lib/debug)

test/framework/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
33
#
44
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
55
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -22,10 +22,6 @@
2222
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
#
2424

25-
26-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
27-
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR}/cppconn)
28-
2925
IF(WIN32)
3026
# LINK_DIRECTORIES(${MYSQL_DIR}/lib/$(ConfigurationName))
3127
# ADD_DEFINITIONS("-D_SECURE_SCL")

0 commit comments

Comments
 (0)