=== modified file 'ChangeLog' --- ChangeLog 2012-08-31 21:23:58 +0000 +++ ChangeLog 2012-09-25 12:57:53 +0000 @@ -13,6 +13,8 @@ * SQLColumns and possibly other catalog functions that are not using I_S could work incorrectly if called on the same statement handle after a query returning resultset. (Bug#14338051) + * Version 5.1 exports symbols SQLInstallDriverEx and SQLInstallDriverExW + (Bug# 11766724/59900) ---- === modified file 'installer/myodbc3i.c' --- installer/myodbc3i.c 2012-08-09 11:14:17 +0000 +++ installer/myodbc3i.c 2012-09-25 13:23:05 +0000 @@ -1,25 +1,26 @@ -/* Copyright (c) 2007, 2008 MySQL AB, 2009, 2010 Sun Microsystems, Inc. - Use is subject to license terms. - - The MySQL Connector/ODBC is licensed under the terms of the GPLv2 - , like most - MySQL Connectors. There are special exceptions to the terms and - conditions of the GPLv2 as it is applied to this software, see the - FLOSS License Exception - . - - 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 St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* + Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + + The MySQL Connector/ODBC is licensed under the terms of the GPLv2 + , like most + MySQL Connectors. There are special exceptions to the terms and + conditions of the GPLv2 as it is applied to this software, see the + FLOSS License Exception + . + + 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 St, Fifth Floor, Boston, MA 02110-1301 USA +*/ /*! @brief This program will aid installers when installing/uninstalling @@ -242,6 +243,73 @@ } +#if !defined(HAVE_SQLGETPRIVATEPROFILESTRINGW) && !defined(_WIN32) +/** + The version of iODBC that shipped with Mac OS X 10.4 does not implement + the Unicode versions of various installer API functions, so we have to + do it ourselves. This function is only needed in this module, so we do + not define it on the global level to avoid conflicts +*/ + +BOOL INSTAPI +SQLInstallDriverExW(const MyODBC_LPCWSTR lpszDriver, const MyODBC_LPCWSTR lpszPathIn, + LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, + WORD fRequest, LPDWORD lpdwUsageCount) +{ + const SQLWCHAR *pos; + SQLINTEGER len; + BOOL rc; + char *driver, *pathin, *pathout; + WORD out; + + if (!pcbPathOut) + pcbPathOut= &out; + + /* Calculate length of double-\0 terminated string */ + pos= lpszDriver; + while (*pos) + pos+= sqlwcharlen(pos) + 1; + len= pos - lpszDriver + 1; + driver= (char *)sqlwchar_as_utf8(lpszDriver, &len); + + len= SQL_NTS; + pathin= (char *)sqlwchar_as_utf8(lpszPathIn, &len); + + if (cbPathOutMax > 0) + pathout= (char *)malloc(cbPathOutMax * 4 + 1); /* 4 = max utf8 charlen */ + + rc= SQLInstallDriverEx(driver, pathin, pathout, cbPathOutMax * 4, + pcbPathOut, fRequest, lpdwUsageCount); + + if (rc == TRUE && cbPathOutMax) + *pcbPathOut= utf8_as_sqlwchar(lpszPathOut, cbPathOutMax, + (SQLCHAR *)pathout, *pcbPathOut); + + x_free(driver); + x_free(pathin); + x_free(pathout); + + return rc; +} + + +BOOL INSTAPI +SQLRemoveDriverW(const MyODBC_LPCWSTR lpszDriver, BOOL fRemoveDSN, + LPDWORD lpdwUsageCount) +{ + BOOL ret; + SQLINTEGER len= SQL_NTS; + char *driver= (char *)sqlwchar_as_utf8(lpszDriver, &len); + + ret= SQLRemoveDriver(driver, fRemoveDSN, lpdwUsageCount); + + x_free(driver); + + return ret; +} +#endif + + /* * Handler for "add driver" command (-d -a -n drivername -t attrs) */ === modified file 'util/odbcinstw.c' --- util/odbcinstw.c 2012-08-09 11:14:17 +0000 +++ util/odbcinstw.c 2012-09-25 13:22:47 +0000 @@ -1,26 +1,26 @@ -/* - Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. - - The MySQL Connector/ODBC is licensed under the terms of the GPLv2 - , like most - MySQL Connectors. There are special exceptions to the terms and - conditions of the GPLv2 as it is applied to this software, see the - FLOSS License Exception - . - - 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 St, Fifth Floor, Boston, MA 02110-1301 USA -*/ +/* + Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + + The MySQL Connector/ODBC is licensed under the terms of the GPLv2 + , like most + MySQL Connectors. There are special exceptions to the terms and + conditions of the GPLv2 as it is applied to this software, see the + FLOSS License Exception + . + + 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 St, Fifth Floor, Boston, MA 02110-1301 USA +*/ /** @file odbcinstw.c @@ -47,12 +47,6 @@ # define FALSE 0 #endif -#ifdef HAVE_LPCWSTR -# define MyODBC_LPCWSTR LPCWSTR -#else -# define MyODBC_LPCWSTR LPWSTR -#endif - #if !defined(HAVE_SQLGETPRIVATEPROFILESTRINGW) || defined(USE_UNIXODBC) int INSTAPI MySQLGetPrivateProfileStringW(const MyODBC_LPCWSTR lpszSection, const MyODBC_LPCWSTR lpszEntry, @@ -122,53 +116,6 @@ lpszFilename); } -/** - The version of iODBC that shipped with Mac OS X 10.4 does not implement - the Unicode versions of various installer API functions, so we have to - do it ourselves. -*/ - -BOOL INSTAPI -SQLInstallDriverExW(const MyODBC_LPCWSTR lpszDriver, const MyODBC_LPCWSTR lpszPathIn, - LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, - WORD fRequest, LPDWORD lpdwUsageCount) -{ - const SQLWCHAR *pos; - SQLINTEGER len; - BOOL rc; - char *driver, *pathin, *pathout; - WORD out; - - if (!pcbPathOut) - pcbPathOut= &out; - - /* Calculate length of double-\0 terminated string */ - pos= lpszDriver; - while (*pos) - pos+= sqlwcharlen(pos) + 1; - len= pos - lpszDriver + 1; - driver= (char *)sqlwchar_as_utf8(lpszDriver, &len); - - len= SQL_NTS; - pathin= (char *)sqlwchar_as_utf8(lpszPathIn, &len); - - if (cbPathOutMax > 0) - pathout= (char *)malloc(cbPathOutMax * 4 + 1); /* 4 = max utf8 charlen */ - - rc= SQLInstallDriverEx(driver, pathin, pathout, cbPathOutMax * 4, - pcbPathOut, fRequest, lpdwUsageCount); - - if (rc == TRUE && cbPathOutMax) - *pcbPathOut= utf8_as_sqlwchar(lpszPathOut, cbPathOutMax, - (SQLCHAR *)pathout, *pcbPathOut); - - x_free(driver); - x_free(pathin); - x_free(pathout); - - return rc; -} - BOOL INSTAPI SQLValidDSNW(const MyODBC_LPCWSTR lpszDSN) @@ -241,22 +188,6 @@ BOOL INSTAPI -SQLRemoveDriverW(const MyODBC_LPCWSTR lpszDriver, BOOL fRemoveDSN, - LPDWORD lpdwUsageCount) -{ - BOOL ret; - SQLINTEGER len= SQL_NTS; - char *driver= (char *)sqlwchar_as_utf8(lpszDriver, &len); - - ret= SQLRemoveDriver(driver, fRemoveDSN, lpdwUsageCount); - - x_free(driver); - - return ret; -} - - -BOOL INSTAPI SQLWritePrivateProfileStringW(const MyODBC_LPCWSTR lpszSection, const MyODBC_LPCWSTR lpszEntry, const MyODBC_LPCWSTR lpszString, const MyODBC_LPCWSTR lpszFilename) === modified file 'util/stringutil.h' --- util/stringutil.h 2011-09-28 09:21:45 +0000 +++ util/stringutil.h 2012-09-25 12:32:40 +0000 @@ -51,6 +51,12 @@ #define myodbc_min(a, b) ((a) < (b) ? (a) : (b)) #define myodbc_max(a, b) ((a) > (b) ? (a) : (b)) +#ifdef HAVE_LPCWSTR +# define MyODBC_LPCWSTR LPCWSTR +#else +# define MyODBC_LPCWSTR LPWSTR +#endif + #define MAX_BYTES_PER_UTF8_CP 4 /* max 4 bytes per utf8 codepoint */ /* Unicode transcoding */