bk commit - MyODBC 3.51 (1.517)
am 26.09.2005 07:08:11 von pharveyBelow 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.517
ChangeSet
1.517 05/09/25 22:08:10 pharvey@g5.local +5 -0
- backed out many goodies (dev and end-user) to get this out including all GUI
- made a 3.51.12 release for OSX 10.4 with this
BitKeeper/etc/logging_ok
1.53 05/09/25 22:08:01 pharvey@g5.local +1 -0
Logging to off accepted
util/MYODBCUtilReadDataSource.c
1.13 05/09/25 22:07:43 pharvey@g5.local +4 -3
- backed out many goodies (dev and end-user) to get this out including all GUI
- made a 3.51.12 release for OSX 10.4 with this
setup/ConfigDSN.c
1.13 05/09/25 22:07:43 pharvey@g5.local +0 -1
- backed out many goodies (dev and end-user) to get this out including all GUI
- made a 3.51.12 release for OSX 10.4 with this
myodbcinst/myodbcinst.c
1.39 05/09/25 22:07:43 pharvey@g5.local +334 -8
- backed out many goodies (dev and end-user) to get this out including all GUI
- made a 3.51.12 release for OSX 10.4 with this
driver/connect.c
1.77 05/09/25 22:07:42 pharvey@g5.local +9 -7
- backed out many goodies (dev and end-user) to get this out including all GUI
- made a 3.51.12 release for OSX 10.4 with this
# 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: g5.local
# Root: /Users/pharvey/SandBox/32/myodbc-3.51
--- 1.52/BitKeeper/etc/logging_ok 2005-09-22 10:54:50 -07:00
+++ 1.53/BitKeeper/etc/logging_ok 2005-09-25 22:08:01 -07:00
@@ -19,6 +19,7 @@
paul@onyx.snake.net
paul@teton.kitebird.com
peterh@mysql.com
+pharvey@g5.local
pharvey@linux.site
pharvey@mercury.
pharvey@mysql.com
--- 1.76/driver/connect.c 2005-09-25 20:12:00 -07:00
+++ 1.77/driver/connect.c 2005-09-25 22:07:42 -07:00
@@ -427,13 +427,6 @@
DBUG_PRINT( "enter",( "fDriverCompletion: %d", fDriverCompletion ) );
#endif
-#ifdef __APPLE__
- if ( fDriverCompletion != SQL_DRIVER_NOPROMPT && !hwnd )
- {
- hwnd = 1;
- }
-#endif
-
/*!
MYODBC RULE
@@ -522,6 +515,15 @@
goto exitDriverConnect;
}
}
+
+#ifdef __APPLE__
+ if ( bPrompt )
+ {
+ set_dbc_error( hdbc, "HY000", "Prompting not supported on this platform. Please provide all required connect information.", 0 );
+ nReturn = SQL_ERROR;
+ goto exitDriverConnect;
+ }
+#endif
if ( bPrompt )
{
--- 1.38/myodbcinst/myodbcinst.c 2005-09-25 20:12:00 -07:00
+++ 1.39/myodbcinst/myodbcinst.c 2005-09-25 22:07:43 -07:00
@@ -232,6 +232,7 @@
int doRemoveDataSource();
int doRemoveDataSourceName();
int doConfigDataSource( WORD nRequest );
+BOOL INSTAPI AppleConfigDSN( HWND hWnd, WORD nRequest, LPCSTR pszDriver, LPCSTR pszAttributes );
/*!
\brief This is the entry point to this program.
@@ -912,6 +913,8 @@
fprintf( stderr, "[%s][%d][ERROR] Could not find ConfigDSN in (%s).\n", __FILE__, __LINE__, pDriver->pszSETUP );
goto doConfigDataSourceExit1;
}
+#elif defined( __APPLE__ )
+
#else
/* load it */
lt_dlinit();
@@ -932,14 +935,7 @@
/* make call */
#if defined(__APPLE__)
- /*!
- OSX
-
- There are focus and Z-order problems invoking the GUI this way on OSX. These may
- be solvable but this has not been explored as of yet. User should use MYODBCConfig.app
- instead.
- */
- if ( !pFunc( (HWND)NULL, nRequest, szDriver, szAttributes ) )
+ if ( !AppleConfigDSN( (HWND)NULL, nRequest, szDriver, szAttributes ) )
#else
/*!
\note
@@ -976,5 +972,335 @@
+#ifdef __APPLE__
+/*!
+ \internal
+ \brief Adds a new DSN.
+
+ \note This function uses the current SQLSetConfigMode().
+*/
+BOOL MYODBCSetupConfigDSNAdd( HWND hWnd, MYODBCUTIL_DATASOURCE *pDataSource )
+{
+ pDataSource->nMode = MYODBCUTIL_DATASOURCE_MODE_DSN_ADD;
+
+ /*!
+ ODBC RULE
+
+ We must have a driver name.
+ */
+ if ( !pDataSource->pszDRIVER )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_NAME, "Missing driver name." );
+ return FALSE;
+ }
+ if ( !(*pDataSource->pszDRIVER) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing driver name value." );
+ return FALSE;
+ }
+
+ /*!
+ \todo
+
+ Use pDataSource->pszDriverFileName to get pDataSource->pszDRIVER
+ */
+
+ /*!
+ ODBC RULE
+
+ If a data source name is passed to ConfigDSN in lpszAttributes, ConfigDSN
+ checks that the name is valid.
+ */
+ if ( pDataSource->pszDSN )
+ {
+ /*!
+ ODBC RULE
+
+ ConfigDSN should call SQLValidDSN to check the length of the data source
+ name and to verify that no invalid characters are included in the name.
+ */
+ /*!
+ MYODBC RULE
+
+ Assumption is that this also checks to ensure we are not trying to create
+ a DSN using an odbc.ini reserved section name.
+ */
+ if ( !SQLValidDSN( pDataSource->pszDSN ) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_REQUEST_FAILED, "DSN contains illegal characters or length does not make sense." );
+ return FALSE;
+ }
+ }
+
+ /*!
+ ODBC RULE
+
+ If lpszAttributes contains enough information to connect to a data source,
+ ConfigDSN can add the data source or display a dialog box with which the user
+ can change the connection information. If lpszAttributes does not contain
+ enough information to connect to a data source, ConfigDSN must determine the
+ necessary information; if hwndParent is not null, it displays a dialog box to
+ retrieve the information from the user.
+ */
+
+ /*!
+ ODBC RULE
+
+ If ConfigDSN cannot get complete connection information for a data source, it
+ returns FALSE.
+ */
+ /*!
+ MYODBC RULE
+
+ We want pszDriver and a DSN attribute - we can default the rest.
+ */
+ if ( !pDataSource->pszDSN )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing DSN attribute." );
+ return FALSE;
+ }
+
+ if ( !(*pDataSource->pszDSN) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing DSN attribute value." );
+ return FALSE;
+ }
+
+ /*!
+ ODBC RULE
+
+ If the data source name matches an existing data source name and hwndParent is null,
+ ConfigDSN overwrites the existing name. If it matches an existing name and hwndParent
+ is not null, ConfigDSN prompts the user to overwrite the existing name.
+ */
+ return MYODBCUtilWriteDataSource( pDataSource );
+}
+
+/*!
+ \internal
+ \brief Configure an existing DSN.
+
+ \note This function uses the current SQLSetConfigMode().
+*/
+BOOL MYODBCSetupConfigDSNEdit( HWND hWnd, MYODBCUTIL_DATASOURCE *pDataSource )
+{
+ pDataSource->nMode = MYODBCUTIL_DATASOURCE_MODE_DSN_EDIT;
+
+ /*!
+ ODBC RULE
+
+ To modify a data source, a data source name must be passed to ConfigDSN in
+ lpszAttributes.
+ */
+ if ( !pDataSource->pszDSN )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing DSN attribute." );
+ return FALSE;
+ }
+
+ if ( !(*pDataSource->pszDSN) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing DSN attribute value." );
+ return FALSE;
+ }
+
+ /*!
+ ODBC RULE
+
+ ConfigDSN should call SQLValidDSN to check the length of the data source
+ name and to verify that no invalid characters are included in the name.
+ */
+ /*!
+ MYODBC RULE
+
+ Assumption is that this also checks to ensure we are not trying to create
+ a DSN using an odbc.ini reserved section name.
+ */
+ if ( !SQLValidDSN( pDataSource->pszDSN ) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_REQUEST_FAILED, "DSN contains illegal characters or length does not make sense." );
+ return FALSE;
+ }
+
+ /*!
+ ODBC RULE
+
+ ConfigDSN checks that the data source name is in the Odbc.ini file (or
+ registry).
+ */
+ if ( !MYODBCUtilDSNExists( pDataSource->pszDSN ) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_REQUEST_FAILED, "DSN does not exist." );
+ return FALSE;
+ }
+
+ /* merge in any missing attributes we can find in the system information */
+ MYODBCUtilReadDataSource( pDataSource, pDataSource->pszDSN );
+
+ /*!
+ ODBC RULE
+
+ If the data source name was not changed, ConfigDSN calls
+ SQLWritePrivateProfileString in the installer DLL to make any other changes.
+ */
+ /*!
+ MYODBC RULE
+
+ We do not support changing the DSN name.
+ */
+ return MYODBCUtilWriteDataSource( pDataSource );
+}
+
+/*!
+ \internal
+ \brief Remove given DSN.
+
+ \note This function uses the current SQLSetConfigMode().
+*/
+BOOL MYODBCSetupConfigDSNRemove( MYODBCUTIL_DATASOURCE *pDataSource )
+{
+ /*!
+ ODBC RULE
+
+ To delete a data source, a data source name must be passed to ConfigDSN
+ in lpszAttributes.
+ */
+ if ( !pDataSource->pszDSN )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing DSN attribute." );
+ return FALSE;
+ }
+
+ if ( !(*pDataSource->pszDSN) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Missing DSN attribute value." );
+ return FALSE;
+ }
+ /*!
+ ODBC RULE
+
+ ConfigDSN should call SQLValidDSN to check the length of the data source
+ name and to verify that no invalid characters are included in the name.
+ */
+ /*!
+ MYODBC RULE
+
+ Assumption is that this also checks to ensure we are not trying to create
+ a DSN using an odbc.ini reserved section name.
+ */
+ if ( !SQLValidDSN( pDataSource->pszDSN ) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_REQUEST_FAILED, "DSN contains illegal characters or length does not make sense." );
+ return FALSE;
+ }
+
+ /*!
+ ODBC RULE
+
+ ConfigDSN checks that the data source name is in the Odbc.ini file (or
+ registry).
+ */
+ if ( !MYODBCUtilDSNExists( pDataSource->pszDSN ) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_REQUEST_FAILED, "DSN does not exist." );
+ return FALSE;
+ }
+
+ /*!
+ ODBC RULE
+
+ It then calls SQLRemoveDSNFromIni in the installer DLL to remove the
+ data source.
+ */
+ return SQLRemoveDSNFromIni( pDataSource->pszDSN );
+}
+
+
+/*!
+ \brief Add, edit, or remove a Data Source Name (DSN).
+
+ This function should be called from the ODBC Administrator
+ program when our driver is being used during a request to
+ add, edit or remove a DSN. This allows us to do driver
+ specific stuff such as use our dialogs to work with our
+ driver.
+
+ This function is also a viable entry point and a public API
+ for use by special function code such as an installer or an
+ application which has embedded the driver functionality.
+*/
+BOOL INSTAPI AppleConfigDSN( HWND hWnd, WORD nRequest, LPCSTR pszDriver, LPCSTR pszAttributes )
+{
+ MYODBCUTIL_DATASOURCE * pDataSource = MYODBCUtilAllocDataSource( MYODBCUTIL_DATASOURCE_MODE_DSN_VIEW );
+ BOOL bReturn = FALSE;
+
+ /*
+ \note unixODBC
+
+ In some cases on unixODBC a semi-colon will be used
+ to indicate the end of name/value pair. This is like
+ in SQLDriverConnect(). This is incorrect but we try
+ to simply ignore semi-colon and hope rest of format
+ is ok.
+
+ So we should call this with MYODBCUTIL_DELIM_NULL but we use
+ MYODBCUTIL_DELIM_BOTH instead.
+
+ This was tested with pszAttributes "DSN=test;".
+ */
+ if ( !MYODBCUtilReadDataSourceStr( pDataSource, MYODBCUTIL_DELIM_BOTH, pszAttributes ) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Data Source string seems invalid." );
+ goto exitConfigDSN;
+ }
+
+ /*!
+ ODBC RULE
+
+ DRIVER is not a valid attribute for ConfigDSN().
+ Also; ConfigDSN may not delete or change the value of the Driver keyword...
+ when ODBC_CONFIG_DSN.
+ */
+ if ( pDataSource->pszDRIVER )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "DRIVER is an invalid attribute." );
+ goto exitConfigDSN;
+ }
+
+ /*!
+ ODBC RULE
+
+ Driver description (usually the name of the associated DBMS) presented to users
+ instead of the physical driver name.
+ */
+ if ( !pszDriver || !(*pszDriver) )
+ {
+ SQLPostInstallerError( ODBC_ERROR_INVALID_KEYWORD_VALUE, "Need driver name." );
+ goto exitConfigDSN;
+ }
+
+ pDataSource->pszDRIVER = (char *)strdup( pszDriver );
+
+ switch ( nRequest )
+ {
+ case ODBC_ADD_DSN:
+ bReturn = MYODBCSetupConfigDSNAdd( hWnd, pDataSource );
+ break;
+ case ODBC_CONFIG_DSN:
+ bReturn = MYODBCSetupConfigDSNEdit( hWnd, pDataSource );
+ break;
+ case ODBC_REMOVE_DSN:
+ bReturn = MYODBCSetupConfigDSNRemove( pDataSource );
+ break;
+ default:
+ SQLPostInstallerError( ODBC_ERROR_INVALID_REQUEST_TYPE, "Invalid request." );
+ }
+
+exitConfigDSN:
+ MYODBCUtilFreeDataSource( pDataSource );
+ return bReturn;
+}
+
+#endif
--- 1.12/setup/ConfigDSN.c 2005-09-21 11:06:56 -07:00
+++ 1.13/setup/ConfigDSN.c 2005-09-25 22:07:43 -07:00
@@ -129,7 +129,6 @@
exitConfigDSN:
MYODBCUtilFreeDataSource( pDataSource );
-
return bReturn;
}
--- 1.12/util/MYODBCUtilReadDataSource.c 2005-09-25 20:12:00 -07:00
+++ 1.13/util/MYODBCUtilReadDataSource.c 2005-09-25 22:07:43 -07:00
@@ -45,7 +45,6 @@
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;
@@ -57,7 +56,6 @@
}
#endif
-printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
if ( !pszDSN || !(*pszDSN) )
return TRUE;
@@ -78,7 +76,6 @@
if ( ( nChars = SQLGetPrivateProfileString( pszDSN, NULL, NULL, szEntryNames, sizeof( szEntryNames ) - 1, "ODBC.INI" ) ) < 1 )
#endif
{
-printf( "[PAH][%s][%d]\n", __FILE__, __LINE__ );
return FALSE;
}
@@ -234,10 +231,14 @@
{
#if defined(__APPLE__) && 0
if ( GetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, NULL, NULL, szEntryNames, sizeof( szEntryNames ) - 1, "odbc.ini" ) < 1 )
+#elif defined(__APPLE__)
+ if ( SQLGetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, "", "", szEntryNames, sizeof( szEntryNames ) - 1, "odbc.ini" ) < 1 )
#else
if ( SQLGetPrivateProfileString( MYODBCUTIL_ODBCINI_HEADER_SECTION, NULL, NULL, szEntryNames, sizeof( szEntryNames ) - 1, "ODBC.INI" ) < 1 )
#endif
+ {
return FALSE;
+ }
pszEntryName = szEntryNames;
while ( *pszEntryName )
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org