bk commit - MyODBC 3.51 (1.513)
am 21.09.2005 20:07:02 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.513
ChangeSet
1.513 05/09/21 11:06:56 pharvey@sun.codebydesign.com +4 -0
- handles malformed attribute string in call to ConfigDSN
util/MYODBCUtilReadDataSourceStr.c
1.14 05/09/21 11:06:56 pharvey@sun.codebydesign.com +22 -22
- added tiny sanity check
setup/setup.pro
1.27 05/09/21 11:06:56 pharvey@sun.codebydesign.com +2 -2
- no version on share lib required (its a plugin)
setup/MYODBCSetupDataSourceDialog.cpp
1.36 05/09/21 11:06:56 pharvey@sun.codebydesign.com +1 -1
- typo
setup/ConfigDSN.c
1.12 05/09/21 11:06:56 pharvey@sun.codebydesign.com +15 -1
- handles malformed attribute string in call to ConfigDSN
# 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: sun.codebydesign.com
# Root: /home/pharvey/SandBox/64/myodbc-3.51
--- 1.11/setup/ConfigDSN.c 2005-01-28 11:33:51 -08:00
+++ 1.12/setup/ConfigDSN.c 2005-09-21 11:06:56 -07:00
@@ -65,7 +65,21 @@
MYODBCUTIL_DATASOURCE * pDataSource = MYODBCUtilAllocDataSource( MYODBCUTIL_DATASOURCE_MODE_DSN_VIEW );
BOOL bReturn = FALSE;
- if ( !MYODBCUtilReadDataSourceStr( pDataSource, MYODBCUTIL_DELIM_NULL, pszAttributes ) )
+ /*
+ \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;
--- 1.35/setup/MYODBCSetupDataSourceDialog.cpp 2005-09-13 11:47:36 -07:00
+++ 1.36/setup/MYODBCSetupDataSourceDialog.cpp 2005-09-21 11:06:56 -07:00
@@ -358,7 +358,7 @@
playoutButtons->addWidget( ppushbuttonTest );
ppushbuttonDiagnostics = new QPushButton( "&Diagnostics >>", this );
// connecting to the database causes core on sparc for some reason (ld issue?)
-#ifndef __sparc
+#ifdef __sparc
ppushbuttonTest->hide();
ppushbuttonDiagnostics->hide();
#endif
--- 1.26/setup/setup.pro 2005-09-20 22:19:19 -07:00
+++ 1.27/setup/setup.pro 2005-09-21 11:06:56 -07:00
@@ -34,8 +34,8 @@
# LANGUAGE = C++
# CPP_ALWAYS_CREATE_SOURCE = TRUE
include( ../config.qmake )
-# CONFIG += qt plugin
-CONFIG += dll
+CONFIG += qt plugin
+# CONFIG += dll
include( ../defines.qmake )
include( ../odbc.qmake )
--- 1.13/util/MYODBCUtilReadDataSourceStr.c 2005-09-13 11:47:36 -07:00
+++ 1.14/util/MYODBCUtilReadDataSourceStr.c 2005-09-21 11:06:56 -07:00
@@ -30,6 +30,10 @@
return 0;
nAvail = min( strlen(s) + 1, n + 1 );
+
+ if ( nAvail < 1 )
+ return 0;
+
p = malloc( nAvail );
memcpy( p, s, nAvail );
p[nAvail - 1] = '\0';
@@ -43,17 +47,21 @@
switch ( nDelim )
{
case MYODBCUTIL_DELIM_NULL:
+ /* Terminator is a '\0'. */
if ( cChar == '\0' )
return TRUE;
break;
case MYODBCUTIL_DELIM_SEMI:
+ /* Terminator is a ';'. */
/* We check for '\0' to handle case where last value does not have a ';'. */
- /* In such a case the '\0' is the string terminator. */
- if ( cChar == ';' || cChar == '\0' )
+ /* In such a case the '\0' is the string terminator. This makes us */
+ /* effectively same as MYODBCUTIL_DELIM_BOTH. */
+ if ( cChar == ';' || cChar == '\0' )
return TRUE;
break;
case MYODBCUTIL_DELIM_BOTH:
- if ( cChar == '\0' || cChar == ';' )
+ /* Terminator can be either ';' or '\0'. */
+ if ( cChar == ';' || cChar == '\0' )
return TRUE;
break;
}
@@ -91,14 +99,6 @@
as a list of attributes in the form of keyword-value pairs.
\note This will not replace existing values in pDataSource.
-
- \note Linux
-
- 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.
*/
BOOL MYODBCUtilReadDataSourceStr( MYODBCUTIL_DATASOURCE *pDataSource, MYODBCUTIL_DELIM nDelim, LPCSTR pszStr )
{
@@ -178,7 +178,7 @@
pDataSource->pszDSN = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
else if ( strcasecmp( pszName, "OPTION" ) == 0 )
- {
+ {
if ( !pDataSource->pszOPTION )
pDataSource->pszOPTION = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
@@ -186,29 +186,29 @@
MYODBC RULE
We will 'read' variants on the standard keywords (but only write standard version).
- */
+ */
else if ( strcasecmp( pszName, "PWD" ) == 0 || strcasecmp( pszName, "PASSWORD" ) == 0 )
- {
+ {
if ( !pDataSource->pszPASSWORD )
pDataSource->pszPASSWORD = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
else if ( strcasecmp( pszName, "PORT" ) == 0 )
- {
+ {
if ( !pDataSource->pszPORT )
pDataSource->pszPORT = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
else if ( strcasecmp( pszName, "SERVER" ) == 0 )
- {
+ {
if ( !pDataSource->pszSERVER )
pDataSource->pszSERVER = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
else if ( strcasecmp( pszName, "SOCKET" ) == 0 )
- {
+ {
if ( !pDataSource->pszSOCKET )
pDataSource->pszSOCKET = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
else if ( strcasecmp( pszName, "STMT" ) == 0 )
- {
+ {
if ( !pDataSource->pszSTMT )
pDataSource->pszSTMT = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
@@ -216,9 +216,9 @@
MYODBC RULE
We will 'read' variants on the standard keywords (but only write standard version).
- */
+ */
else if ( strcasecmp( pszName, "UID" ) == 0 || strcasecmp( pszName, "USER" ) == 0 )
- {
+ {
if ( !pDataSource->pszUSER )
pDataSource->pszUSER = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar );
}
@@ -240,11 +240,11 @@
/* is attribute value term ? */
if ( MYODBCUtilReadDataSourceStrValTerm( nDelim, *pScanChar ) )
- nState = MYODBCUTIL_ATTR_PARSE_STATE_NAME_START;
+ nState = MYODBCUTIL_ATTR_PARSE_STATE_NAME_START;
/* is attribute list term ? */
if ( MYODBCUtilReadDataSourceStrTerm( nDelim, pScanChar ) )
- break;
+ break;
pScanChar++;
--
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