[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-odbc
Subject:    bk commit - MyODBC 3.51 (1.515)
From:       pharvey () mysql ! com
Date:       2005-09-26 3:12:03
Message-ID: 20050926031203.6F1B4210F2 () mercury ! codebydesign ! com
[Download RAW message or body]

Below is the list of changes that have just been commited into a local
MyODBC 3.51 repository of 'pharvey'. When 'pharvey' does a push, they will
be propogaged to the main repository and within 2 hours after the push
into the public repository. 

For more information on how to access the public repository see:
http://www.mysql.com/products/myodbc/faq_2.html#Development_source

You can also browse the changes from public repository:
Complete repository: http://mysql.bkbits.net:8080/myodbc3/
This changeset     : http://mysql.bkbits.net:8080/myodbc3/cset@1.515

ChangeSet
  1.515 05/09/25 20:12:02 pharvey@mercury.codebydesign.com +28 -0
  - work to fix some bugs on OSX 10.4

  util/MYODBCUtilReadDriver.c
    1.6 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +70 -25
    - work to fix some bugs on OSX 10.4

  util/MYODBCUtilReadDataSource.c
    1.12 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +13 -5
    - work to fix some bugs on OSX 10.4

  util/MYODBCUtilGetDriverNames.c
    1.3 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -1
    - work to fix some bugs on OSX 10.4

  util/MYODBCUtilGetDataSourceNames.c
    1.4 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -1
    - work to fix some bugs on OSX 10.4

  util/MYODBCUtilDSNExists.c
    1.4 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -1
    - work to fix some bugs on OSX 10.4

  util/MYODBCUtil.h
    1.15 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +2 -2
    - work to fix some bugs on OSX 10.4

  setup/setup.pro
    1.28 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -3
    - work to fix some bugs on OSX 10.4

  setup/MYODBCSetupDriverConnectPrompt.cpp
    1.9 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +3 -1
    - work to fix some bugs on OSX 10.4

  setup/MYODBCSetupDriverConnect.c
    1.5 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +5 -1
    - work to fix some bugs on OSX 10.4

  setup/MYODBCSetupDataSourceDialog.cpp
    1.37 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +2 -0
    - work to fix some bugs on OSX 10.4

  setup/MYODBCSetupDataSourceConfig.cpp
    1.21 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +0 -1
    - work to fix some bugs on OSX 10.4

  qmake.pro
    1.8 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -0
    - work to fix some bugs on OSX 10.4

  odbc.qmake
    1.3 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +2 -2
    - work to fix some bugs on OSX 10.4

  myodbcinst/myodbcinst.c
    1.38 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +2 -2
    - work to fix some bugs on OSX 10.4

  imyodbc/imyodbc.c
    1.10 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +2 -0
    - work to fix some bugs on OSX 10.4

  imyodbc/Makefile.osx
    1.5 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +2 -2
    - work to fix some bugs on OSX 10.4

  driver/results.c
    1.62 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +10 -1
    - work to fix some bugs on OSX 10.4

  driver/options.c
    1.47 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +0 -1
    - work to fix some bugs on OSX 10.4

  driver/myodbc3.h
    1.50 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +13 -1
    - work to fix some bugs on OSX 10.4

  driver/driver.pro
    1.6 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -1
    - work to fix some bugs on OSX 10.4

  driver/connect.c
    1.76 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +18 -4
    - work to fix some bugs on OSX 10.4

  driver/Makefile.am
    1.23 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -2
    - work to fix some bugs on OSX 10.4

  dltest/dltest.pro
    1.5 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +0 -1
    - work to fix some bugs on OSX 10.4

  dltest/Makefile.osx
    1.2 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -1
    - work to fix some bugs on OSX 10.4

  defines.qmake
    1.7 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +1 -1
    - work to fix some bugs on OSX 10.4

  config.qmake
    1.5 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +3 -1
    - work to fix some bugs on OSX 10.4

  MYODBCConfig/main.cpp
    1.13 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +9 -2
    - work to fix some bugs on OSX 10.4

  MYODBCConfig/MYODBCConfig.pro
    1.17 05/09/25 20:12:00 pharvey@mercury.codebydesign.com +4 -2
    - work to fix some bugs on OSX 10.4

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pharvey
# Host:	mercury.codebydesign.com
# Root:	/home/pharvey/myodbc-3.51

--- 1.75/driver/connect.c	2005-08-22 02:27:52 -07:00
+++ 1.76/driver/connect.c	2005-09-25 20:12:00 -07:00
@@ -277,6 +277,7 @@
   dbc->password= my_strdup(passwd,MYF(MY_WME));
   dbc->port= port_nr;
   dbc->flag= flag_nr;
+
   DBUG_RETURN_STATUS(set_connect_defaults(dbc));
 }
 
@@ -379,6 +380,7 @@
 #endif
 
     DBUG_ENTER("SQLDriverConnect");
+
     /* parse incoming string */
     if ( !MYODBCUtilReadConnectStr( pDataSource, (LPCSTR)szConnStrIn ) )
     {
@@ -425,6 +427,13 @@
     DBUG_PRINT( "enter",( "fDriverCompletion: %d", fDriverCompletion ) );
 #endif
 
+#ifdef __APPLE__
+    if ( fDriverCompletion != SQL_DRIVER_NOPROMPT && !hwnd ) 
+    {
+        hwnd = 1;
+    }
+#endif
+
     /*!
        MYODBC RULE
 
@@ -441,7 +450,7 @@
        if the DSN does not exist the app can at least provide the driver
        name for us in the connection string.
     */
-    if ( !pDataSource->pszDRIVER && fDriverCompletion != SQL_DRIVER_NOPROMPT )
+    if ( !pDataSource->pszDRIVER && !pDataSource->pszDriverFileName && \
fDriverCompletion != SQL_DRIVER_NOPROMPT )  {
         sprintf( szError, "Could not determine the driver name; could not lookup \
setup library. DSN=(%s)\n", pDataSource->pszDSN );  set_dbc_error( hdbc, "HY000", \
szError, 0 ); @@ -524,10 +533,13 @@
            library file name (better to not assume name). We read from ODBC system 
            info. This allows someone configure for a custom setup interface.
         */
-        if ( !MYODBCUtilReadDriver( pDriver, pDataSource->pszDRIVER ) )
+        if ( !MYODBCUtilReadDriver( pDriver, pDataSource->pszDRIVER, \
pDataSource->pszDriverFileName ) )  {
             char sz[1024];
-            sprintf( sz, "Could not find driver %s in system information.", \
pDataSource->pszDRIVER ); +            if ( pDataSource->pszDRIVER && \
*(pDataSource->pszDRIVER) ) +                sprintf( sz, "Could not find driver %s \
in system information.", pDataSource->pszDRIVER ); +            else
+                sprintf( sz, "Could not find driver %s in system information.", \
pDataSource->pszDriverFileName );  set_dbc_error( hdbc, "HY000", sz, 0 );
             nReturn = SQL_ERROR;
             goto exitDriverConnect;
@@ -552,7 +564,9 @@
         if ( !(hModule = (void *)lt_dlopen( pDriver->pszSETUP ))  )
 #endif
         {
-            set_dbc_error( hdbc, "HY000", "Could not load the setup library.", 0 );
+            char sz[1024];
+            sprintf( sz, "Could not load the setup library (%s).", pDriver->pszSETUP \
); +            set_dbc_error( hdbc, "HY000", sz, 0 );
             nReturn = SQL_ERROR;
             goto exitDriverConnect;
         }

--- 1.22/driver/Makefile.am	2005-01-28 11:33:49 -08:00
+++ 1.23/driver/Makefile.am	2005-09-25 20:12:00 -07:00
@@ -62,8 +62,7 @@
 ###################################################################
 if ENABLE_BUNDLES
         libmyodbc3_la_LDFLAGS = \
-        -release \
-	@myodbc_version@ \
+        -release @myodbc_version@ \
         -module 
 else
         libmyodbc3_la_LDFLAGS = -release @myodbc_version@

--- 1.46/driver/options.c	2005-08-08 11:11:02 -07:00
+++ 1.47/driver/options.c	2005-09-25 20:12:00 -07:00
@@ -918,7 +918,6 @@
 				 SQLPOINTER ValuePtr,
 				 SQLINTEGER StringLength)
 {
-
   return set_stmt_attr(hstmt, Attribute, ValuePtr, StringLength);
 }
 

--- 1.61/driver/results.c	2005-09-11 11:59:45 -07:00
+++ 1.62/driver/results.c	2005-09-25 20:12:00 -07:00
@@ -543,6 +543,15 @@
   @purpose : rerunrs column atribute values
 */
 
+#if defined(__APPLE__)
+SQLRETURN SQL_API SQLColAttribute( SQLHSTMT  StatementHandle,
+                                   SQLUSMALLINT ColumnNumber,
+                                   SQLUSMALLINT FieldIdentifier,
+                                   SQLPOINTER  CharacterAttributePtr,
+                                   SQLSMALLINT BufferLength,
+                                   SQLSMALLINT *StringLengthPtr,
+                                   SQLLEN *  NumericAttributePtr )
+#else
 SQLRETURN SQL_API SQLColAttribute( SQLHSTMT  StatementHandle,
                                    SQLUSMALLINT ColumnNumber,
                                    SQLUSMALLINT FieldIdentifier,
@@ -550,7 +559,7 @@
                                    SQLSMALLINT BufferLength,
                                    SQLSMALLINT *StringLengthPtr,
                                    SQLPOINTER  NumericAttributePtr )
-/*                                   SQLLEN *  NumericAttributePtr ) */
+#endif
 {
     return get_col_attr( StatementHandle, 
                          ColumnNumber,

--- 1.16/MYODBCConfig/MYODBCConfig.pro	2005-09-20 22:19:19 -07:00
+++ 1.17/MYODBCConfig/MYODBCConfig.pro	2005-09-25 20:12:00 -07:00
@@ -37,8 +37,9 @@
 # #########################################################
 # UNIX
 # #########################################################
-unix {
-        INCLUDEPATH     += ../util ../setup /usr/include
+mac {
+} else:unix {
+#        INCLUDEPATH     += ../util ../setup /usr/include
         LIBS            += -L../util -lmyodbcutil
 }
 
@@ -54,6 +55,7 @@
 #        DEFINES		-= HAVE_ODBCINST_H
 #        DEFINES		+= HAVE_IODBCINST_H
         LIBS            -= -lmyodbc3S
+        LIBS            += -L../util -lmyodbcutil
         LIBS            += -lltdl -framework Carbon -framework QuickTime -lz \
-framework OpenGL -framework AGL -lz  RC_FILE         = MYODBCConfig.icns
 }

--- 1.12/MYODBCConfig/main.cpp	2005-08-21 14:01:04 -07:00
+++ 1.13/MYODBCConfig/main.cpp	2005-09-25 20:12:00 -07:00
@@ -35,11 +35,16 @@
     int                             nResult;
     MYODBCUTIL_DATASOURCE *         pDataSource = MYODBCUtilAllocDataSource( \
MYODBCUTIL_DATASOURCE_MODE_DSN_EDIT );  
-    printf( "[%s][%d]INFO: $ MYODBCConfig [dsn-name]\n", __FILE__, __LINE__ );
     if ( argc > 1 )
         pszDataSourceName = argv[1];
+    else
+    {
+        printf( "[%s][%d]INFO: $ myodbc3c [dsn-name]\n", __FILE__, __LINE__ );
+        printf( "[%s][%d]INFO: defaulting dsn-name to %s\n", __FILE__, __LINE__, \
pszDataSourceName ); +    }
 
-    MYODBCUtilReadDataSource( pDataSource, pszDataSourceName );
+    if ( !MYODBCUtilReadDataSource( pDataSource, pszDataSourceName ) )
+        printf( "[%s][%d]INFO: %s does not seem to exist.\n", __FILE__, __LINE__, \
pszDataSourceName );  
     MYODBCSetupDataSourceDialog dialog( NULL, pDataSource );
 
@@ -48,7 +53,9 @@
     nResult = dialog.exec();
 
     if ( nResult == QDialog::Accepted )
+    {
         MYODBCUtilWriteDataSource( pDataSource );
+    }
 
     MYODBCUtilFreeDataSource( pDataSource );
 

--- 1.1/dltest/Makefile.osx	2004-08-04 08:25:59 -07:00
+++ 1.2/dltest/Makefile.osx	2005-09-25 20:12:00 -07:00
@@ -1,5 +1,5 @@
 all:
-	gcc -c dltest.c -D_OSX_
+	gcc -c dltest.c 
 	gcc dltest.o -o dltest -lltdl
 
 clean:

--- 1.4/imyodbc/Makefile.osx	2004-11-16 12:18:04 -08:00
+++ 1.5/imyodbc/Makefile.osx	2005-09-25 20:12:00 -07:00
@@ -29,7 +29,7 @@
 # Driver lib type should be "Mach-O bundle ppc".
 #
 all:
-	gcc -c imyodbc.c -D_OSX_
+	gcc -c imyodbc.c 
 	gcc imyodbc.o -o imyodbc -liodbc 
 #
 # Link directly to the driver.
@@ -37,7 +37,7 @@
 # Driver lib type should be "Mach-O dynamically linked shared library ppc".
 #
 todriver:
-	gcc -c imyodbc.c -D_OSX_
+	gcc -c imyodbc.c 
 	gcc imyodbc.o -o imyodbc -L/usr/local/lib -lmyodbc3
 
 clean: 

--- 1.37/myodbcinst/myodbcinst.c	2005-08-22 02:27:52 -07:00
+++ 1.38/myodbcinst/myodbcinst.c	2005-09-25 20:12:00 -07:00
@@ -383,7 +383,7 @@
     int bReturn = 0; 
     MYODBCUTIL_DRIVER *pDriver = MYODBCUtilAllocDriver();
 
-    if ( !MYODBCUtilReadDriver( pDriver, pszName ) )
+    if ( !MYODBCUtilReadDriver( pDriver, pszName, NULL ) )
     {
         fprintf( stderr, "[%s][%d][WARNING] Could not load (%s)\n", __FILE__, \
__LINE__, pszName );  goto doQueryDriverNameExit1;   
@@ -885,7 +885,7 @@
     }
 
     /* get setup library name */
-    if ( !MYODBCUtilReadDriver( pDriver, szDriver ) )
+    if ( !MYODBCUtilReadDriver( pDriver, szDriver, NULL ) )
     {
         fprintf( stderr, "[%s][%d][ERROR] Could not load driver info (%s)\n", \
__FILE__, __LINE__, szDriver );  goto doConfigDataSourceExit2;   

--- 1.20/setup/MYODBCSetupDataSourceConfig.cpp	2005-09-10 10:14:21 -07:00
+++ 1.21/setup/MYODBCSetupDataSourceConfig.cpp	2005-09-25 20:12:00 -07:00
@@ -101,7 +101,6 @@
             bReturn = TRUE; 
     }
 
-
     return bReturn;
 }
 

--- 1.36/setup/MYODBCSetupDataSourceDialog.cpp	2005-09-21 11:06:56 -07:00
+++ 1.37/setup/MYODBCSetupDataSourceDialog.cpp	2005-09-25 20:12:00 -07:00
@@ -362,6 +362,7 @@
     ppushbuttonTest->hide();
     ppushbuttonDiagnostics->hide();
 #endif
+
 #if QT_VERSION >= 0x040000
     ppushbuttonDiagnostics->setCheckable( TRUE );
 #else
@@ -503,6 +504,7 @@
 #endif
             ptextbrowserAssist->setDefaultHtml( tr("<B>Connector/ODBC \
Configuration</B><HR><P>This dialog is used to connect to a Data Source Name (DSN).") \
);  ppushbuttonTest->hide();
+            ppushbuttonDiagnostics->hide();
             switch ( pDataSource->nPrompt )
             {
                 case MYODBCUTIL_DATASOURCE_PROMPT_COMPLETE:

--- 1.27/setup/setup.pro	2005-09-21 11:06:56 -07:00
+++ 1.28/setup/setup.pro	2005-09-25 20:12:00 -07:00
@@ -31,11 +31,8 @@
 UI_DIR                  = .tmp
 MOC_DIR                 = .tmp
 OBJECTS_DIR             = .tmp
-# LANGUAGE                = C++
-# CPP_ALWAYS_CREATE_SOURCE = TRUE
 include( ../config.qmake )
 CONFIG                  += qt plugin
-# CONFIG                  += dll
 include( ../defines.qmake )
 include( ../odbc.qmake )
 
@@ -64,6 +61,7 @@
 # OSX
 # #########################################################
 mac {
+#	QMAKE_LFLAGS_PLUGIN	+= -bundle -flat_namespace -undefined suppress
         libraries.path          = /usr/lib
         libraries.files         = libmyodbc3S.dylib
 }

--- 1.14/util/MYODBCUtil.h	2005-08-22 02:27:52 -07:00
+++ 1.15/util/MYODBCUtil.h	2005-09-25 20:12:00 -07:00
@@ -187,7 +187,7 @@
 extern "C" {
 #endif
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && 0
 int GetPrivateProfileString( LPCSTR lpszSection, LPCSTR lpszEntry, LPCSTR \
lpszDefault, LPSTR lpszRetBuffer, int cbRetBuffer, LPCSTR lpszFilename );  #endif
 
@@ -199,7 +199,7 @@
 MYODBCUTIL_DRIVER *     MYODBCUtilAllocDriver();
 void                    MYODBCUtilClearDriver( MYODBCUTIL_DRIVER *pDriver );
 void                    MYODBCUtilFreeDriver( MYODBCUTIL_DRIVER *pDriver );
-BOOL                    MYODBCUtilReadDriver( MYODBCUTIL_DRIVER *pDriver, LPCSTR \
pszName ); +BOOL                    MYODBCUtilReadDriver( MYODBCUTIL_DRIVER *pDriver, \
LPCSTR pszName, LPCSTR pszFileName );  BOOL                    MYODBCUtilWriteDriver( \
MYODBCUTIL_DRIVER *pDriver );  
 /* MYODBCUTIL_DATASOURCE */

--- 1.3/util/MYODBCUtilDSNExists.c	2005-01-28 11:33:53 -08:00
+++ 1.4/util/MYODBCUtilDSNExists.c	2005-09-25 20:12:00 -07:00
@@ -52,7 +52,7 @@
     if ( SQLGetPrivateProfileString( pszDataSourceName, NULL, "", szSectionNames, \
sizeof( szSectionNames ) - 1, "ODBC.INI" ) > 0 )  return TRUE;
     else
-#elif defined(__OSX__)    
+#elif defined(__APPLE__) && 0    
     /*!
         \note   OSX
 

--- 1.3/util/MYODBCUtilGetDataSourceNames.c	2005-01-28 11:33:53 -08:00
+++ 1.4/util/MYODBCUtilGetDataSourceNames.c	2005-09-25 20:12:00 -07:00
@@ -75,7 +75,7 @@
             return FALSE;
     }
 
-#if defined(__APPLE__)
+#if defined(__APPLE__) && 0
     nChars = GetPrivateProfileString( NULL, NULL, "", pszBuffer, nBuffer - 1, \
"ODBC.INI" );  #elif defined(WIN32)
     /* 

--- 1.2/util/MYODBCUtilGetDriverNames.c	2005-01-28 11:33:53 -08:00
+++ 1.3/util/MYODBCUtilGetDriverNames.c	2005-09-25 20:12:00 -07:00
@@ -49,7 +49,7 @@
     }
 
 
-#if defined(__APPLE__)
+#if defined(__APPLE__) && 0
     nChars = GetPrivateProfileString( NULL, NULL, "", pszBuffer, nBuffer - 1, \
"ODBCINST.INI" );  #elif defined(WIN32)
     nChars = ( SQLGetInstalledDrivers( pszBuffer, nBuffer - 1, NULL ) ? 1 : 0 );

--- 1.11/util/MYODBCUtilReadDataSource.c	2005-03-08 08:50:56 -08:00
+++ 1.12/util/MYODBCUtilReadDataSource.c	2005-09-25 20:12:00 -07:00
@@ -45,6 +45,7 @@
     char    szEntryNames[SQL_MAX_DSN_LENGTH * MYODBCUTIL_MAX_DSN_NAMES];
     char *  pszEntryName;
     char    szValue[4096];
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
     int     nChars  = 0;
 #if defined(WIN32)
     UWORD   nMode   = ODBC_BOTH_DSN;
@@ -56,12 +57,13 @@
     }
 #endif
 
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
     if ( !pszDSN || !(*pszDSN) )
         return TRUE;
 
     *szEntryNames = '\0';
 
-#if defined(__APPLE__)    
+#if defined(__APPLE__) && 0
     /*!
         \note   OSX
 
@@ -70,10 +72,15 @@
                 instead. 
     */
     if ( ( nChars = GetPrivateProfileString( pszDSN, NULL, NULL, szEntryNames, \
sizeof( szEntryNames ) - 1, "odbc.ini" ) ) < 1 ) +#elif defined(__APPLE__)
+    if ( ( nChars = SQLGetPrivateProfileString( pszDSN, "", "", szEntryNames, \
sizeof( szEntryNames ) - 1, "odbc.ini" ) ) < 1 )  #else
     if ( ( nChars = SQLGetPrivateProfileString( pszDSN, NULL, NULL, szEntryNames, \
sizeof( szEntryNames ) - 1, "ODBC.INI" ) ) < 1 )  #endif
+    {
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
         return FALSE;
+    }
 
 #if defined(WIN32)
     {
@@ -104,7 +111,6 @@
     }
 #endif
 
-
     /*!
         Looks like things are going to work. Lets set DSN.
     */        
@@ -118,8 +124,10 @@
     while ( *pszEntryName )
     {
         *szValue = '\0';
-#if defined(__APPLE__)    
+#if defined(__APPLE__) && 0
         if ( GetPrivateProfileString( pszDSN, pszEntryName, NULL, szValue, sizeof( \
szValue ) - 1, "odbc.ini" ) > 0 ) +#elif defined(__APPLE__)
+        if ( SQLGetPrivateProfileString( pszDSN, pszEntryName, "", szValue, sizeof( \
szValue ) - 1, "odbc.ini" ) > 0 )  #elif defined(WIN32)
         if ( SQLGetPrivateProfileString( pszDSN, pszEntryName, NULL, szValue, \
sizeof( szValue ) - 1, "ODBC.INI" ) > 0 )  #else
@@ -224,7 +232,7 @@
     /* try harder to get the friendly driver name */
     if ( !pDataSource->pszDRIVER )
     {
-#if defined(__APPLE__)    
+#if defined(__APPLE__) && 0
         if ( GetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, NULL, NULL, \
szEntryNames, sizeof( szEntryNames ) - 1, "odbc.ini" ) < 1 )  #else
         if ( SQLGetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, NULL, \
NULL, szEntryNames, sizeof( szEntryNames ) - 1, "ODBC.INI" ) < 1 ) @@ -235,7 +243,7 \
@@  while ( *pszEntryName )
         {
             *szValue = '\0';
-#if defined(__APPLE__)    
+#if defined(__APPLE__) && 0
             if ( GetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, \
pszEntryName, NULL, szValue, sizeof( szValue ) - 1, "odbc.ini" ) > 0 )  #else
             if ( SQLGetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, \
pszEntryName, NULL, szValue, sizeof( szValue ) - 1, "ODBC.INI" ) > 0 )

--- 1.5/util/MYODBCUtilReadDriver.c	2005-01-28 11:33:54 -08:00
+++ 1.6/util/MYODBCUtilReadDriver.c	2005-09-25 20:12:00 -07:00
@@ -23,48 +23,86 @@
 /*!
     \brief  Read driver from system information.
 
-    \param  pDriver Driver struct.
-    \param  pszName User friendly name of driver such as "MySQL ODBC 3.51 Driver (32 \
                bit)"
-    
+    \param  pDriver     Driver struct.
+    \param  pszName     User friendly name of driver such as "MySQL ODBC 3.51 Driver \
(32 bit)" +    \param  pszFileName File name such as value found in DSN->Driver; \
"/usr/lib/libmyodbc3.dylib" +        
     \note   This will not replace existing values in pDriver.
 */            
-BOOL MYODBCUtilReadDriver( MYODBCUTIL_DRIVER *pDriver, LPCSTR pszName )
+BOOL MYODBCUtilReadDriver( MYODBCUTIL_DRIVER *pDriver, LPCSTR pszName, LPCSTR \
pszFileName )  {
+    char    szSectionNames[SQL_MAX_DSN_LENGTH * MYODBCUTIL_MAX_DSN_NAMES];
+    char *  pszSectionName  = NULL;
     char    szEntryNames[SQL_MAX_DSN_LENGTH * MYODBCUTIL_MAX_DSN_NAMES];
-    char *  pszEntryName;
+    char *  pszEntryName    = NULL;
     char    szValue[4096];
 
-    if ( !pszName || !(*pszName) )
-        return FALSE;
+    /*
+     * Ensure that we have the friendly name of the driver...
+     *
+     */
+    if ( pszName && *pszName )
+    {
+        pszSectionName = pszName;
+    }
+    else if ( pszFileName && *pszFileName )
+    {
+        /* get list of sections (friendly driver names)... */
+        if ( !MYODBCUtilGetDriverNames( szSectionNames, sizeof(szSectionNames) ) )
+            return FALSE;
 
-    if ( !pDriver->pszName )
-        pDriver->pszName = strdup( pszName ) ;
+        /* get value of DRIVER entry... */
+        pszSectionName = szSectionNames;
+        while ( *pszSectionName )
+        {
+#if defined(__APPLE__) && 0
+            /*!
+                \note   OSX
+    
+                        SQLGetPrivateProfileString is the proper call and is \
available - but +                        at this time it appears utterly broken. So \
we call an alternative +                        instead. 
+            */
+            if ( GetPrivateProfileString( pszSectionName, "DRIVER", NULL, szValue, \
sizeof( szValue ) - 1, "ODBCINST.INI" ) > 0 ) +#else
+            if ( SQLGetPrivateProfileString( pszSectionName, "DRIVER", "", szValue, \
sizeof( szValue ) - 1, "ODBCINST.INI" ) > 0 ) +#endif
+            {
+                if ( strcmp( szValue, pszFileName ) == 0 )
+                    break;
+            }
+    
+            pszSectionName += strlen( pszSectionName ) + 1;
+        } /* while */
+    }
+
+    /*
+     * No friendly driver name - no joy!
+     *
+     */
+    if ( !pszSectionName )
+        return FALSE;
 
-#if defined(__APPLE__)
-    /*!
-        \note   OSX
-
-                SQLGetPrivateProfileString is the proper call and is available - but
-                at this time it appears utterly broken. So we call an alternative
-                instead. 
-    */
-    if ( GetPrivateProfileString( pszName, NULL, NULL, szEntryNames, sizeof( \
szEntryNames ) - 1, "ODBCINST.INI" ) < 1 ) +#if defined(__APPLE__) && 0
+    if ( GetPrivateProfileString( pszSectionName, NULL, NULL, szEntryNames, sizeof( \
szEntryNames ) - 1, "ODBCINST.INI" ) < 1 ) +#elif defined(__APPLE__)
+    if ( SQLGetPrivateProfileString( pszSectionName, "", "", szEntryNames, sizeof( \
szEntryNames ) - 1, "ODBCINST.INI" ) < 1 )  #else
-    if ( SQLGetPrivateProfileString( pszName, NULL, "", szEntryNames, sizeof( \
szEntryNames ) - 1, "ODBCINST.INI" ) < 1 ) +    if ( SQLGetPrivateProfileString( \
pszSectionName, NULL, NULL, szEntryNames, sizeof( szEntryNames ) - 1, "ODBCINST.INI" \
) < 1 )  #endif
+    {
         return FALSE;
+    }
 
-    /*!
-        Scan result and return TRUE if we find a match.
-    */
     pszEntryName = szEntryNames;
     while ( *pszEntryName )
     {
         *szValue = '\0';
-#if defined(__APPLE__)    
-        if ( GetPrivateProfileString( pszName, pszEntryName, NULL, szValue, sizeof( \
szValue ) - 1, "ODBCINST.INI" ) > 0 ) +
+#if defined(__APPLE__) && 0
+        if ( GetPrivateProfileString( pszSectionName, pszEntryName, NULL, szValue, \
sizeof( szValue ) - 1, "ODBCINST.INI" ) > 0 )  #else
-        if ( SQLGetPrivateProfileString( pszName, pszEntryName, "", szValue, sizeof( \
szValue ) - 1, "ODBCINST.INI" ) > 0 ) +        if ( SQLGetPrivateProfileString( \
pszSectionName, pszEntryName, "", szValue, sizeof( szValue ) - 1, "ODBCINST.INI" ) > \
0 )  #endif
         {
             if ( strcasecmp( pszEntryName, "DRIVER" ) == 0 )
@@ -84,6 +122,13 @@
         }
         pszEntryName += strlen( pszEntryName ) + 1;
     } /* while */
+
+    /*
+     * Success!
+     *
+     */
+    if ( !pDriver->pszName )
+        pDriver->pszName = strdup( pszSectionName );
 
     return TRUE;
 }

--- 1.4/config.qmake	2005-09-21 00:04:52 -07:00
+++ 1.5/config.qmake	2005-09-25 20:12:00 -07:00
@@ -23,7 +23,9 @@
 CONFIG		+= thread warn_on release
 CONFIG          -= debug
 
-unix {
+mac {
+#	CONFIG		-= thread	
+} else:unix {
 	INCLUDEPATH	+= $(LIBTOOL_DIR)/include
 	LIBS		+= -L$(LIBTOOL_DIR)/lib
 }

--- 1.6/defines.qmake	2005-09-22 10:54:43 -07:00
+++ 1.7/defines.qmake	2005-09-25 20:12:00 -07:00
@@ -11,7 +11,7 @@
 # #########################################################
 
 # DEFINES += PORTABLE_GUI
-# DEFINES += SETUP_VERSION=\"3.51.12\"
+DEFINES += SETUP_VERSION=\"3.51.12\"
 
 win32 {
         DEFINES -= UNICODE

--- 1.4/dltest/dltest.pro	2005-09-20 22:19:19 -07:00
+++ 1.5/dltest/dltest.pro	2005-09-25 20:12:00 -07:00
@@ -39,7 +39,6 @@
 # OSX
 # #########################################################
 mac {
-        DEFINES		+= _OSX_
 }
 
 # #########################################################

--- 1.5/driver/driver.pro	2005-09-20 22:19:19 -07:00
+++ 1.6/driver/driver.pro	2005-09-25 20:12:00 -07:00
@@ -66,7 +66,6 @@
         RC_FILE                 = myodbc3.rc
         libraries.path	        = /windows/system32
         libraries.files	        = myodbc3*.dll myodbc3*.lib
-
 }
 
 # #########################################################
@@ -84,6 +83,7 @@
 # OSX
 # #########################################################
 mac {
+#	QMAKE_LFLAGS_PLUGIN	+= -bundle -flat_namespace -undefined suppress
         libraries.path          = /usr/lib
         libraries.files         = libmyodbc3.dylib
 }

--- 1.7/qmake.pro	2005-08-25 00:06:32 -07:00
+++ 1.8/qmake.pro	2005-09-25 20:12:00 -07:00
@@ -1,5 +1,6 @@
 # #########################################################
 # 
+#
 # \brief
 #	This is a qmake project file for building when Qt
 #       is being used to build GUI bits. 

--- 1.4/setup/MYODBCSetupDriverConnect.c	2005-01-28 11:33:52 -08:00
+++ 1.5/setup/MYODBCSetupDriverConnect.c	2005-09-25 20:12:00 -07:00
@@ -35,7 +35,11 @@
 */  
 BOOL MYODBCSetupDriverConnect( SQLHDBC hDBC, SQLHWND hWnd, MYODBCUTIL_DATASOURCE \
*pDataSource )  {
-    return MYODBCSetupDriverConnectPrompt( hDBC, hWnd, pDataSource );
+    BOOL b;
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
+    b = MYODBCSetupDriverConnectPrompt( hDBC, hWnd, pDataSource );
+printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
+    return b;
 }     
 
 

--- 1.8/setup/MYODBCSetupDriverConnectPrompt.cpp	2005-08-19 02:28:46 -07:00
+++ 1.9/setup/MYODBCSetupDriverConnectPrompt.cpp	2005-09-25 20:12:00 -07:00
@@ -29,7 +29,7 @@
     so we make one up. Perhaps the real app name can be found
     but this seems to work. (busy busy so moveon.org)
 */
-static char *pszAppName = "/myodbcinst";
+static char *pszAppName = "/usr/bin/myodbc3c";
 
 BOOL MYODBCSetupDriverConnectPrompt( SQLHDBC hDBC, HWND hWnd, MYODBCUTIL_DATASOURCE \
*pDataSource )  {
@@ -59,6 +59,8 @@
 
         // We are most likely to come in this route as caller is unlikely to have a \
                qApp */ 
         MYODBCSetupDataSourceDialog dialogDataSource( NULL, hDBC, pDataSource );
+
+        app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );
 
         dialogDataSource.show();
         if ( app.exec() == QDialog::Accepted )

--- 1.9/imyodbc/imyodbc.c	2005-03-17 12:48:19 -08:00
+++ 1.10/imyodbc/imyodbc.c	2005-09-25 20:12:00 -07:00
@@ -347,7 +347,9 @@
         nReturn = SQLDriverConnect( *phDbc, hWnd, (SQLCHAR*)szDSN, strlen(szDSN), \
szOut, 4096, &nLen, SQL_DRIVER_NOPROMPT );  }
     else
+    {
         nReturn = SQLConnect( *phDbc, (SQLCHAR*)szDSN, SQL_NTS, (SQLCHAR*)szUID, \
SQL_NTS, (SQLCHAR*)szPWD, SQL_NTS ); +    }
     if ( !SQL_SUCCEEDED( nReturn ) )
     {
         if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 );

--- 1.2/odbc.qmake	2005-09-21 00:04:52 -07:00
+++ 1.3/odbc.qmake	2005-09-25 20:12:00 -07:00
@@ -26,7 +26,8 @@
 # #########################################################
 # UNIX
 # #########################################################
-unix {
+mac {
+} else:unix {
 	INCLUDEPATH	+= $(UNIXODBC_DIR)/include
 	LIBS		+= -L$(UNIXODBC_DIR)/lib -lodbc -lodbcinst
 }
@@ -35,7 +36,6 @@
 # OSX
 # #########################################################
 mac {
-        LIBS		        -= -lodbc -lodbcinst
         LIBS		        += -liodbc -liodbcinst
 }
 

--- 1.49/driver/myodbc3.h	2005-08-25 09:03:51 -07:00
+++ 1.50/driver/myodbc3.h	2005-09-25 20:12:00 -07:00
@@ -107,6 +107,7 @@
 #define BOTH_ODBC_INI ODBC_BOTH_DSN
 #define USER_ODBC_INI ODBC_USER_DSN
 #define SYSTEM_ODBC_INI ODBC_SYSTEM_DSN
+
 #endif
 
 /*
@@ -141,16 +142,27 @@
 #define DRIVER_NAME	  "MySQL ODBC 3.51 Driver"
 #define DRIVER_NONDSN_TAG "DRIVER={MySQL ODBC 3.51 Driver}"
 
-#ifndef _UNIX_
+#if defined(__APPLE__)
+
+#define DRIVER_DLL_NAME   "libmyodbc3.dylib"
+#ifndef DBUG_OFF
+#define DRIVER_QUERY_LOGFILE "/tmp/myodbc.sql"
+#endif
+
+#elif defined(_UNIX_)
+
 #define DRIVER_DLL_NAME   "myodbc3.dll"
 #ifndef DBUG_OFF
 #define DRIVER_QUERY_LOGFILE "c:\\myodbc.sql"
 #endif
+
 #else
+
 #define DRIVER_DLL_NAME   "libmyodbc3.so"
 #ifndef DBUG_OFF
 #define DRIVER_QUERY_LOGFILE "/tmp/myodbc.sql"
 #endif
+
 #endif
 
 #ifndef DBUG_OFF

-- 
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/myodbc?unsub=mysql-odbc@progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic