MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jbalint Date:July 13 2007 7:15pm
Subject:Connector/ODBC 3.51 commit: r579 - in trunk: . installer util
View as plain text  
Modified:
   trunk/ChangeLog
   trunk/installer/myodbc3i.c
   trunk/util/MYODBCUtilWriteDataSourceStr.c
Log:
Fixed calling convention of functor in myodbc3i.c.
Fixed using non-global free on DSN member in myodbc3i.c.
Fixed not putting two NULLs when creating null-delimited DSN string.

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-07-13 18:04:31 UTC (rev 578)
+++ trunk/ChangeLog	2007-07-13 19:15:10 UTC (rev 579)
@@ -7,6 +7,8 @@
     to Bug #6667 and Bug #9498.)
   * Dis-allow NULL ptr for null indicator when calling SQLGetData()
     if value is null. Now returns SQL_ERROR w/state 22002.
+  * Fixed calling convention ptr and wrong free in myodbc3i, and fixed
+    the null terminating (was only one, not two) when writing DSN to string.
 
   Bugs fixed:
   * myodbc3i did not correctly format driver info, which could cause the

Modified: trunk/installer/myodbc3i.c
===================================================================
--- trunk/installer/myodbc3i.c	2007-07-13 18:04:31 UTC (rev 578)
+++ trunk/installer/myodbc3i.c	2007-07-13 19:15:10 UTC (rev 579)
@@ -60,6 +60,8 @@
 #include <odbcinst.h>
 #endif
 
+typedef BOOL (INSTAPI *ConfigDSNFunctor)(HWND, WORD, LPCSTR, LPCSTR);
+
 /*! Our syntax. This is likely to expand over time. */
 char *szSyntax =
 "\n" \
@@ -812,7 +814,7 @@
     MYODBCUTIL_DRIVER *     pDriver             = MYODBCUtilAllocDriver();
     MYODBCUTIL_DATASOURCE * pDataSourceGiven    = MYODBCUtilAllocDataSource(
MYODBCUTIL_DATASOURCE_MODE_DSN_VIEW );
     MYODBCUTIL_DATASOURCE * pDataSource         = MYODBCUtilAllocDataSource(
MYODBCUTIL_DATASOURCE_MODE_DSN_VIEW );
-    BOOL                    (*pFunc)( HWND, WORD, LPCSTR, LPCSTR );
+    ConfigDSNFunctor        pFunc;
 #if defined(WIN32)
     HINSTANCE               hLib                = 0;
 #else
@@ -843,7 +845,7 @@
         {
             /* pull driver from attributes as we can not have it in there for ConfigDSN()
*/
             sprintf( szDriver, "%s", pDataSourceGiven->pszDRIVER );
-            free( pDataSourceGiven->pszDRIVER );
+            _global_free( pDataSourceGiven->pszDRIVER );
             pDataSourceGiven->pszDRIVER = NULL;
         }
         else
@@ -891,7 +893,7 @@
     }
 
     /* lookup ConfigDSN */
-    pFunc = (BOOL (*)(HWND, WORD, LPCSTR, LPCSTR )) GetProcAddress( hLib, "ConfigDSN" );
+    pFunc = (ConfigDSNFunctor) GetProcAddress( hLib, "ConfigDSN" );
     if ( !pFunc )
     {
         doPrintLastErrorString();
@@ -917,7 +919,7 @@
     }
 
     /* lookup ConfigDSN */
-    pFunc = (BOOL (*)(HWND, WORD, LPCSTR, LPCSTR )) lt_dlsym( hLib, "ConfigDSN" );
+    pFunc = (ConfigDSNFunctor) lt_dlsym( hLib, "ConfigDSN" );
     if ( !pFunc )
     {
         fprintf( stderr, "[%s][%d][ERROR] Could not find ConfigDSN in (%s). Error is
%s\n", __FILE__, __LINE__, pDriver->pszSETUP, lt_dlerror() );

Modified: trunk/util/MYODBCUtilWriteDataSourceStr.c
===================================================================
--- trunk/util/MYODBCUtilWriteDataSourceStr.c	2007-07-13 18:04:31 UTC (rev 578)
+++ trunk/util/MYODBCUtilWriteDataSourceStr.c	2007-07-13 19:15:10 UTC (rev 579)
@@ -226,6 +226,7 @@
     if ( nDelim == MYODBCUTIL_DELIM_NULL )
     {
         MYODBCUTILWRITEDATASOURCESTR_DELIM;
+        MYODBCUTILWRITEDATASOURCESTR_DELIM;
     }
 
     return TRUE;

Thread
Connector/ODBC 3.51 commit: r579 - in trunk: . installer utiljbalint13 Jul