Modified:
MYODBCShell/MYODBCShell.cpp
MYSQLPlus/MYSQLPlusLib/MDescriptor.cpp
MYSQLPlus/MYSQLPlusLib/MResult.cpp
MYSQLPlus/MYSQLPlusLib/MResultPlus.cpp
MYSQLPlus/MYSQLPlusLib/MStatement.cpp
Log:
Modified: MYODBCShell/MYODBCShell.cpp
===================================================================
--- MYODBCShell/MYODBCShell.cpp 2006-06-02 05:56:39 UTC (rev 312)
+++ MYODBCShell/MYODBCShell.cpp 2006-06-02 14:05:09 UTC (rev 313)
@@ -210,11 +210,11 @@
return false;
}
- if ( stringCommand == "help" )
+ if ( stringCommand.startsWith( "help" ) )
return doHelp( stringCommand );
- else if ( stringCommand == "SQLTables" )
+ else if ( stringCommand.startsWith( "SQLTables" ) )
return doTables( stringCommand );
- else if ( stringCommand == "SQLColumns" )
+ else if ( stringCommand.startsWith( "SQLColumns" ) )
return doColumns( stringCommand );
else
return doSubmit( stringCommand );
@@ -607,6 +607,8 @@
for ( nColumn = 1; nColumn <= nColumns; nColumn++ )
{
+ sColumnName[0] = '\0';
+
if ( !SQL_SUCCEEDED( SQLColAttribute( hStm, nColumn, SQL_DESC_LABEL, sColumnName,
sizeof(sColumnName), NULL, NULL ) ) && bVerbose )
doErrors( NULL, NULL, hStm );
Modified: MYSQLPlus/MYSQLPlusLib/MDescriptor.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MDescriptor.cpp 2006-06-02 05:56:39 UTC (rev 312)
+++ MYSQLPlus/MYSQLPlusLib/MDescriptor.cpp 2006-06-02 14:05:09 UTC (rev 313)
@@ -36,8 +36,15 @@
nAllocType = SQL_DESC_ALLOC_USER;
doInit();
- /* derived classes must create bookmark as needed */
+ /*!
+ \internal
+ \note
+ Derived classes must create bookmark as needed. We can not do it here because
+ we do not know the record class to create. Alternative; make doInit virtual
+ and have derived classes stick it in there.
+ */
+
MYODBCDbgReturn2();
}
@@ -213,7 +220,7 @@
SQL_NO_DATA is returned if RecNumber is greater than the current number of
descriptor records.
*/
- if ( nRecNumber >= getCount() )
+ if ( nRecNumber > getCount() )
MYODBCDbgReturn( SQL_NO_DATA );
/* push down to record for further processing */
@@ -448,6 +455,8 @@
This SQLSMALLINT header field specifies the 1-based index of the highest-numbered
record that contains data.
+ \note
+
0 is returned if only the bookmark record exists (this makes the bookmark
record something of a hidden record).
*/
Modified: MYSQLPlus/MYSQLPlusLib/MResult.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MResult.cpp 2006-06-02 05:56:39 UTC (rev 312)
+++ MYSQLPlus/MYSQLPlusLib/MResult.cpp 2006-06-02 14:05:09 UTC (rev 313)
@@ -2016,6 +2016,7 @@
pDescriptorRecord->setConciseType( SQL_TYPE_TIMESTAMP );
break;
case MYSQL_TYPE_DECIMAL:
+ case MYSQL_TYPE_NEWDECIMAL:
pDescriptorRecord->setDisplaySize( max( pField->length,
pField->max_length ) - test( !( pField->flags & UNSIGNED_FLAG ) ) - test(
pField->decimals ) );
pDescriptorRecord->setFixedPrecScale( pField->decimals ? SQL_TRUE :
SQL_FALSE );
pDescriptorRecord->setLength( pField->max_length );
Modified: MYSQLPlus/MYSQLPlusLib/MResultPlus.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MResultPlus.cpp 2006-06-02 05:56:39 UTC (rev 312)
+++ MYSQLPlus/MYSQLPlusLib/MResultPlus.cpp 2006-06-02 14:05:09 UTC (rev 313)
@@ -342,8 +342,14 @@
resultGetData.doClear();
- SQLSMALLINT nColumns = getImpRowDesc()->getCount() - 1;
- listResults.append( QVector<QVariant>( nColumns ) );
+ /*!
+ \internal
+ \note
+
+ We do not actually store a bookmark column (we just use row number for that) so
listResults[nRow][0] is
+ the first data cell.
+ */
+ listResults.append( QVector<QVariant>( getImpRowDesc()->getCount() ) );
nRow = listResults.count();
MYODBCDbgReturn( SQL_SUCCESS );
@@ -898,6 +904,7 @@
MYODBCDbgEnter();
doAppend();
+ /* 1 based - setData will make it 0 based */
setData( 1, stringTypeName );
setData( 2, nDataType );
setData( 3, nColumnSize );
@@ -1175,10 +1182,12 @@
MYODBCDbgEnter();
doAppend();
+ /* 1 based - setData will make it 0 based */
setData( 1, stringCatalog );
setData( 2, stringSchema );
setData( 3, stringTable );
setData( 4, stringTableType );
+ setData( 5, QVariant() ); // REMARK is always null; we set here just so one knows
what is going on :)
MYODBCDbgReturn( SQL_SUCCESS );
}
@@ -1560,7 +1569,7 @@
if ( bMatch )
{
- nReturn = doAppendColumnsTables( stringCatalog, stringSchema,
stringlistTables[n], stringColumnFilter );
+ nReturn = doAppendColumnsColumns( stringCatalog, stringSchema,
stringlistTables[n], stringColumnFilter );
if ( !SQL_SUCCEEDED( nReturn ) )
break;
}
@@ -1629,8 +1638,8 @@
*/
MDescriptorRecord *pDescriptorRecord = descriptor.getRecord( nField + 1 );
- doAppendColumns( pDescriptorRecord->getCatalogName(),
- pDescriptorRecord->getSchemaName(),
+ doAppendColumns( stringCatalog, // pDescriptorRecord->getCatalogName(),
+ stringSchema, // pDescriptorRecord->getSchemaName(),
pDescriptorRecord->getBaseTableName(),
pDescriptorRecord->getBaseColumnName(),
pDescriptorRecord->getConciseType(),
@@ -1676,6 +1685,7 @@
MYODBCDbgEnter();
doAppend();
+ /* 1 based - setData will make it 0 based */
setData( 1, stringTableCat );
setData( 2, stringTableSchem );
setData( 3, stringTableName );
Modified: MYSQLPlus/MYSQLPlusLib/MStatement.cpp
===================================================================
--- MYSQLPlus/MYSQLPlusLib/MStatement.cpp 2006-06-02 05:56:39 UTC (rev 312)
+++ MYSQLPlus/MYSQLPlusLib/MStatement.cpp 2006-06-02 14:05:09 UTC (rev 313)
@@ -2210,7 +2210,7 @@
The number of columns returned by SQLNumResultCols is the same value as the
SQL_DESC_COUNT field
of the IRD.
*/
- *pnColumnCount = max( getImpRowDesc()->getCount() - 1, 0 );
+ *pnColumnCount = max( getImpRowDesc()->getCount(), 0 );
MYODBCDbgReturn( SQL_SUCCESS );
}
| Thread |
|---|
| • Connector/ODBC 5 commit: r313 - MYODBCShell MYSQLPlus/MYSQLPlusLib | pharvey | 2 Jun |