Skip to content

Commit d27f013

Browse files
lawrinlawrin
authored andcommitted
Fix for Bug#15936764/67325, i.e. support of expired passwords(wl#6587 in particular) in c/c++.
The patch introduces 3 new connection options: - OPT_CAN_HANDLE_EXPIRED_PASSWORDS(bool) with which application signals driver it can handle expired pwd - preInit(string) - postInit(string) - queries to run before and after driver's initialization. For preInit MYSQL_INIT_COMMAND is used. preInit is what should be used to change a password in case of expiration. Otherwise connection can't be obtained. There is one special case when application specifies OPT_CAN_HANDLE_EXPIRED_PASSWORDS, but underying libmysql library does not support it. In such case when a password actually expires driver will return deCLIENT_DOESNT_SUPPORT_FEATURE(820) deCL_CANT_HANDLE_EXP_PWDis defined in the introduced enum DRIVER_ERROR, which is stored in the introduced file driver/mysql_error.h This file is being added to the MSI. Along with solving main problem the patch is containing some other changes - Changed bug in Statement::executeUpdate - if it executed multiple statements connection would become unusable. Also there would be no exception if one of queries was returning a resultset. executeUpdate returns update count for the last executed query. - Introduced statement object as connection class property for executing queries initiated by the driv er. Changed other classes to use that object for queries they run - mostly that is about connection metadata class, which also lost some redundan t objects creation. In future we might want to make a separate class for running such statements - Some rather minor refactoring like combining 2 passes of connection options map into one, moving con nection flags reading into separate function, changing interface of statement's private method do_query, and some other small changes.
1 parent 853311c commit d27f013

18 files changed

+536
-237
lines changed

CHANGES

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2008, 2012, 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
@@ -22,6 +22,21 @@
2222
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
*/
2424

25+
GA 1.1.2 - 2013-01-16
26+
- Expired password support. Connection options
27+
OPT_CAN_HANDLE_EXPIRED_PASSWORDS(bool, application can deal with expired
28+
passwords), and preInit(string, commands to run prior to driver
29+
initialization commands) have been introduced. (Bug#15936764/67325)
30+
31+
- postInit connection string has been introduced. Similar to preInit, but
32+
commands are run after driver's initialization.
33+
34+
- Statement::executeUpdate can now execute multiple statements.
35+
CLIENT_MULTI_STATEMENTS connection option still has to be selected.
36+
getUpdateCount will return data for the last executed statement.
37+
38+
- Built against libmysql 5.6.10
39+
2540
GA 1.1.1 - 2012-08-06
2641

2742
- DatabaseMetaData::getSQLKeywords() updated to match MySQL 5.5. Note

driver/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
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
@@ -130,8 +130,10 @@ IF(WIN32)
130130
mysql_art_resultset.h
131131
mysql_art_rset_metadata.h
132132
mysql_connection.h
133+
mysql_connection_options.h
133134
mysql_debug.h
134135
mysql_driver.h
136+
mysql_error.h
135137
mysql_metadata.h
136138
mysql_parameter_metadata.h
137139
mysql_prepared_statement.h

0 commit comments

Comments
 (0)