MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jbalint Date:February 23 2008 10:45pm
Subject:Connector/ODBC 3.51 commit: r1047 - trunk/driver
View as plain text  
Modified:
   trunk/driver/options.c
Log:
Fix patch commit for bug#16653 (this file was missed)


Modified: trunk/driver/options.c
===================================================================
--- trunk/driver/options.c	2008-02-23 17:53:52 UTC (rev 1046)
+++ trunk/driver/options.c	2008-02-23 22:45:54 UTC (rev 1047)
@@ -488,16 +488,18 @@
 
         case SQL_ATTR_CURRENT_CATALOG:
 
-            if (reget_current_catalog(dbc))
+            if (is_connected(dbc) && reget_current_catalog(dbc))
             {
                 result= SQL_ERROR;
             }
             else
             {
-                *StringLengthPtr= (SQLSMALLINT)
(strmake((char*)ValuePtr,dbc->database,
-                                                         BufferLength) -
-                                                 (char*) ValuePtr);
-            }
+                char *end= strmake((char*)ValuePtr,
+                                   dbc->database ? dbc->database : "null",
+                                   BufferLength);
+                *StringLengthPtr= (SQLSMALLINT) (end - (char*) ValuePtr);
+             }
+
             break;
 
         case SQL_ATTR_LOGIN_TIMEOUT:

Thread
Connector/ODBC 3.51 commit: r1047 - trunk/driverjbalint23 Feb