Skip to content

Commit

Permalink
Fix for ODBC-134, ODBC-145. SQLPutData does not advance param counter…
Browse files Browse the repository at this point in the history
… when SQL_NULL_DATA is passed - SQLParamData always returns SQL_NEED_DATA
  • Loading branch information
alexpotapchenko committed Aug 4, 2012
1 parent 6d7c3bf commit b3faed5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 0 additions & 6 deletions DescRecord.h
Expand Up @@ -47,12 +47,6 @@ class DescRecord
void putBlobSegmentData (int length, const void *bytes);
void endBlobDataTransfer();

void setNull()
{
if ( indicatorPtr )
*(short*)indicatorPtr = -1;
}

int getBufferLength()
{
return ( octetLength + 1 ) * headSqlVarPtr->getSqlMultiple();
Expand Down
7 changes: 1 addition & 6 deletions OdbcStatement.cpp
Expand Up @@ -3108,12 +3108,7 @@ SQLRETURN OdbcStatement::sqlPutData (SQLPOINTER value, SQLLEN valueSize)

DescRecord *binding = applicationParamDescriptor->getDescRecord (parameterNeedData);

if (valueSize == SQL_NULL_DATA)
{
binding->setNull();
*binding->indicatorPtr = SQL_NULL_DATA;
}
else if ( binding->isBlobOrArray )
if ( valueSize != SQL_NULL_DATA && binding->isBlobOrArray )
{
if ( !binding->startedTransfer )
binding->beginBlobDataTransfer();
Expand Down

0 comments on commit b3faed5

Please sign in to comment.