Skip to content

Commit 0ae1ae7

Browse files
lawrinlawrin
authored andcommitted
1) Static linking of mysqlclient
2) Complete version bump to 1.1.4
1 parent 5fd654c commit 0ae1ae7

File tree

14 files changed

+63
-56
lines changed

14 files changed

+63
-56
lines changed

ANNOUNCEMENT

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,24 @@ Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
1010

1111
Dear MySQL Users,
1212

13-
A new GA (general availability) version of MySQL Connector/C++ has been made available: MySQL Connector/C++ 1.1.2 GA. The MySQL Connector/C++ provides a C++ API for
13+
A new GA (general availability) version of MySQL Connector/C++ has been made available: MySQL Connector/C++ 1.1.4 GA. The MySQL Connector/C++ provides a C++ API for
1414
connecting client applications to the MySQL Server 5.1 or newer. You can download the production release at:
1515

1616
http://dev.mysql.com/downloads/connector/cpp/1.1.html
1717

1818
The MySQL driver for C++ offers an easy to use API derived from JDBC 4.0. MySQL Workbench is using it successfully since years.
1919

20-
The major changes in 1.1.2 are:
20+
The major changes in 1.1.4 are:
2121

22-
- Expired password support. Connection options
23-
OPT_CAN_HANDLE_EXPIRED_PASSWORDS(bool, application can deal with expired
24-
passwords), and preInit(string, commands to run prior to driver
25-
initialization commands) have been introduced. (Bug#15936764/67325)
22+
- Both static and dynamic driver libraries now linked against libmysql library
23+
statically(Bug#16664970 "Connector/C++ 1.1.3 will *not* wort with mysql 5.5" and
24+
Bug#16701312 "libmysqlcppconn-static.a has unresolved symbols for all libmysqlclient functions")
2625

27-
- postInit connection string has been introduced. Similar to preInit, but
28-
commands are run after driver's initialization.
29-
30-
- Statement::executeUpdate can now execute multiple statements.
31-
CLIENT_MULTI_STATEMENTS connection option still has to be selected.
32-
getUpdateCount will return data for the last executed statement.
33-
34-
- Built against libmysql 5.6.10
26+
- Built against libmysql 5.6.11
3527

3628
You can find further details, including usages examples, in the documentation at:
3729

38-
http://dev.mysql.com/doc/refman/5.5/en/connector-cpp.html
30+
http://dev.mysql.com/doc/en/connector-cpp.html
3931

4032

4133
You may also want to contribute to the MySQL Forum on C/C++ at http://forums.mysql.com/list.php?167 or join the MySQL Connector/C++ mailing list

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
*/
2424

25+
GA 1.1.4 - 2013-05-22
26+
- Both static and dynamic driver libraries are now linked statically against
27+
libmysql library
28+
- Built against libmysql 5.6.11
29+
2530
GA 1.1.3 - 2013-03-22
2631
- Added boolean connection option OPT_ENABLE_CLEARTEXT_PLUGIN allowing to
2732
enable cleartext libmysql plugin. That plugin is required for some

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ENDIF(WIN32)
3838

3939
if(COMMAND cmake_policy AND POLICY CMP0015)
4040
cmake_policy(SET CMP0015 NEW)
41-
endif(COMMAND cmake_policy)
41+
endif(COMMAND cmake_policy AND POLICY CMP0015)
4242

4343
#-----------------
4444
# CPPFLAGS, CXXFLAGS and LDFLAGS from the environment
@@ -170,7 +170,7 @@ ENDIF(MYSQLCPPCONN_STLPORT_ENABLE)
170170
# Make tests cover methods that throw not implemented to detect API changes?
171171
SET(MYSQLCPPCONN_TEST_NOT_IMPLEMENTED 0 CACHE BOOL "HEAD/trunk QA: invoke methods that should return not implemented to detect API changes")
172172

173-
INCLUDE(${CMAKE_SOURCE_DIR}/FindMySQL.cm)
173+
INCLUDE(${CMAKE_SOURCE_DIR}/FindMySQL.cmake)
174174

175175
# ----------------------------------------------------------------------
176176
# Create package script
@@ -205,7 +205,7 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
205205
"Connector/C++, a library for connecting to MySQL servers.")
206206
SET(CPACK_PACKAGE_VERSION_MAJOR 1)
207207
SET(CPACK_PACKAGE_VERSION_MINOR 1)
208-
SET(CPACK_PACKAGE_VERSION_PATCH 3)
208+
SET(CPACK_PACKAGE_VERSION_PATCH 4)
209209
SET(CPACK_PACKAGE_RELEASE_TYPE "")
210210
SET(CPACK_PACKAGE_VENDOR "Oracle and/or its affiliates")
211211
SET(CPACK_RPM_PACKAGE_DESCRIPTION

FindMySQL.cm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
22
#
33
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
44
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
@@ -136,7 +136,7 @@ ELSE (WIN32)
136136
STRING(REGEX REPLACE "[\r\n]$" "" __MYSQL_VERSION "${__MYSQL_VERSION}")
137137
STRING(REGEX MATCHALL "(4.1.[0-9]+|[5-9].[0-9]+.[0-9]+)" MYSQL_VERSION "${__MYSQL_VERSION}")
138138

139-
FIND_LIBRARY(MYSQLCPPCONN_DYNLOAD_MYSQL_LIB NAMES mysqlclient_r
139+
FIND_LIBRARY(MYSQLCPPCONN_DYNLOAD_MYSQL_LIB NAMES libmysqlclient_r.a
140140
PATHS
141141
$ENV{MYSQL_DIR}/libmysql_r/.libs
142142
$ENV{MYSQL_DIR}/lib
@@ -151,7 +151,7 @@ ELSE (WIN32)
151151
ADD_DEFINITIONS("-DDYNLOAD_MYSQL_LIB=\"${MYSQLCPPCONN_DYNLOAD_MYSQL_LIB}\"")
152152

153153
ELSE (MYSQL_CONFIG_EXECUTABLE)
154-
FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient_r
154+
FIND_LIBRARY(MYSQL_LIB NAMES libmysqlclient_r.a
155155
PATHS
156156
$ENV{MYSQL_DIR}/libmysql_r/.libs
157157
$ENV{MYSQL_DIR}/lib

driver/CMakeLists.txt

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,20 @@ IF(WIN32)
197197

198198
SET(MYSQLCPPCONN_SOURCES ${MYSQLCPPCONN_SOURCES} mysqlcppconn.def)
199199

200-
201200
ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
202201

203-
204202
#Disables bunch of pretty useless warnings on win
205203
ADD_DEFINITIONS("-D_SCL_SECURE_NO_WARNINGS")
206204

205+
ADD_LIBRARY(mysqlclient STATIC IMPORTED)
206+
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES IMPORTED_LOCATION "${MYSQL_LIB}" )
207+
207208
IF(MYSQLCLIENT_STATIC_BINDING)
208-
SET(MY_TARGET_LINK_LIBRARIES_DYNAMIC libmysql ws2_32)
209+
SET(MY_TARGET_LINK_LIBRARIES_DYNAMIC mysqlclient ws2_32)
209210
ELSE(MYSQLCLIENT_STATIC_BINDING)
210211
SET(MY_TARGET_LINK_LIBRARIES_DYNAMIC ws2_32)
211212
ENDIF(MYSQLCLIENT_STATIC_BINDING)
212213

213-
SET(MY_TARGET_LINK_LIBRARIES_STATIC mysqlclient ws2_32)
214214
ELSEIF(NOT WIN32)
215215

216216
IF(MYSQLCLIENT_STATIC_BINDING)
@@ -246,31 +246,44 @@ TARGET_LINK_LIBRARIES(mysqlcppconn ${MY_TARGET_LINK_LIBRARIES_DYNAMIC}
246246
# ADD_DEFINITIONS("-DCPPCONN_PUBLIC_FUNC=\"\"")
247247
#ENDIF(WIN32)
248248

249-
250249
TARGET_LINK_LIBRARIES(mysqlcppconn-static ${MY_TARGET_LINK_LIBRARIES_STATIC}
251250
${MY_GCOV_LINK_LIBRARIES}
252251
${MYSQLCPPCONN_STLPORT_LIB}
253252
${MYSQLCPPCONN_BOOST_SYSTEM_LIBS}
254253
${MYSQLCPPCONN_BOOST_THREAD_LIBS}
255254
${MYSQLCPPCONN_ICU_LIBRARY})
256255

257-
MESSAGE("$ENV{CPPFLAGS} ${MYSQL_CXXFLAGS} $ENV{CXXFLAGS}")
258-
259256
SET_TARGET_PROPERTIES(mysqlcppconn-static PROPERTIES
260257
LINK_FLAGS "${MYSQLCPPCONN_LINK_FLAGS_ENV} ${MYSQL_LINK_FLAGS}"
261258
COMPILE_FLAGS "${MYSQLCPPCONN_COMPILE_FLAGS_ENV} ${MYSQL_CXXFLAGS}"
262-
COMPILE_DEFINITIONS CPPCONN_LIB_BUILD="")
263-
259+
COMPILE_DEFINITIONS CPPCONN_LIB_BUILD=""
260+
STATIC_LIBRARY_FLAGS "${MYSQL_LIB}")
264261

265262
SET_TARGET_PROPERTIES(mysqlcppconn
266263
PROPERTIES
267264
SOVERSION "${MYSQLCPPCONN_SOVERSION}"
268265
VERSION "${MYSQLCPPCONN_SOVERSION}.${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}"
269-
LINK_FLAGS "${MYSQLCPPCONN_LINK_FLAGS_ENV} ${MYSQL_LINK_FLAGS}"
266+
LINK_FLAGS "${MYSQLCPPCONN_LINK_FLAGS_ENV} ${MYSQL_LINK_FLAGS}"
270267
COMPILE_FLAGS "${MYSQLCPPCONN_COMPILE_FLAGS_ENV} ${MYSQL_CXXFLAGS}"
271-
COMPILE_DEFINITIONS CPPCONN_SO_BUILD="")
268+
COMPILE_DEFINITIONS CPPCONN_SO_BUILD=""
269+
LINK_INTERFACE_LIBRARIES "")
272270

273271
IF(WIN32)
272+
SET_TARGET_PROPERTIES(mysqlcppconn PROPERTIES
273+
LINK_FLAGS_DEBUG "/NODEFAULTLIB:LIBCMTD"
274+
LINK_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:LIBCMT"
275+
LINK_FLAGS_RELEASE "/NODEFAULTLIB:LIBCMT")
276+
277+
SET_TARGET_PROPERTIES(mysqlcppconn-static PROPERTIES
278+
STATIC_LIBRARY_FLAGS_DEBUG "/NODEFAULTLIB:LIBCMTD"
279+
STATIC_LIBRARY_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:LIBCMT"
280+
STATIC_LIBRARY_FLAGS_RELEASE "/NODEFAULTLIB:LIBCMT")
281+
282+
# Changing CRT from dynamic to static
283+
INCLUDE(${CMAKE_SOURCE_DIR}/changeCrt.cmake)
284+
285+
#CHANGE_CRT("/MT")
286+
274287
INSTALL(TARGETS mysqlcppconn mysqlcppconn-static
275288
RUNTIME DESTINATION lib
276289
ARCHIVE DESTINATION lib

driver/mysql_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int MySQL_Driver::getMinorVersion()
143143

144144
int MySQL_Driver::getPatchVersion()
145145
{
146-
return 3;
146+
return 4;
147147
}
148148

149149
const sql::SQLString & MySQL_Driver::getName()

driver/mysql_metadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,7 +2331,7 @@ const sql::SQLString&
23312331
MySQL_ConnectionMetaData::getDriverVersion()
23322332
{
23332333
CPP_ENTER("MySQL_ConnectionMetaData::getDriverVersion");
2334-
static const sql::SQLString version("1.1.0-GA");
2334+
static const sql::SQLString version("1.1.4-GA");
23352335
return version;
23362336
}
23372337
/* }}} */

examples/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2013, 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,12 +45,12 @@ IF(MYSQLCPPCONN_BUILD_EXAMPLES)
4545

4646
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn)
4747
IF(MYSQLCLIENT_STATIC_BINDING)
48-
SET(MY_TARGET_LINK_LIBRARIES ${MY_TARGET_LINK_LIBRARIES} libmysql)
48+
SET(MY_TARGET_LINK_LIBRARIES ${MY_TARGET_LINK_LIBRARIES})
4949
ENDIF(MYSQLCLIENT_STATIC_BINDING)
5050
ELSEIF(NOT WIN32)
5151
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn-static)
5252
IF(MYSQLCLIENT_STATIC_BINDING)
53-
SET(MY_TARGET_LINK_LIBRARIES ${MY_TARGET_LINK_LIBRARIES} mysqlclient_r)
53+
SET(MY_TARGET_LINK_LIBRARIES ${MY_TARGET_LINK_LIBRARIES})
5454
ENDIF(MYSQLCLIENT_STATIC_BINDING)
5555
ENDIF(WIN32)
5656

test/CJUnitTestsPort/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2013, 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,15 +27,14 @@ INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR})
2727
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_SOURCE_DIR}/cppconn)
2828

2929
IF(WIN32)
30-
LINK_DIRECTORIES(${MYSQL_DIR}/lib/$(ConfigurationName))
3130
LINK_DIRECTORIES(../framework/$(ConfigurationName))
32-
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn libmysql test_framework)
31+
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn test_framework)
3332
# ADD_DEFINITIONS("-D_SECURE_SCL")
3433
ADD_DEFINITIONS("-D_SCL_SECURE_NO_WARNINGS")
3534
ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
3635

3736
ELSEIF(NOT WIN32)
38-
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn mysqlclient_r test_framework)
37+
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn test_framework)
3938
ENDIF(WIN32)
4039

4140
IF(CMAKE_COMPILER_IS_GNUCC AND MYSQLCPPCONN_GCOV_ENABLE)

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2008, 2013, 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
@@ -34,9 +34,9 @@ IF(WIN32)
3434
ADD_DEFINITIONS("-D_SCL_SECURE_NO_WARNINGS")
3535
ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
3636

37-
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn libmysql ${MYSQLCPPCONN_STLPORT_LIB})
37+
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn ${MYSQLCPPCONN_STLPORT_LIB})
3838
ELSEIF(NOT WIN32)
39-
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn mysqlclient_r ${MYSQLCPPCONN_STLPORT_LIB})
39+
SET(MY_TARGET_LINK_LIBRARIES mysqlcppconn ${MYSQLCPPCONN_STLPORT_LIB})
4040
ENDIF(WIN32)
4141

4242
IF(CMAKE_COMPILER_IS_GNUCC AND MYSQLCPPCONN_GCOV_ENABLE)

0 commit comments

Comments
 (0)