Skip to content

Commit

Permalink
Fix for 596 (#605)
Browse files Browse the repository at this point in the history
* Merging updates. (#1)

Merging updates.

* fix for smalldatetime issue

* Fixed a bad merge

* Fix for inserting high unicode chars

* merge with main branch

* Fix for function sequence error

* reverted unnecessary file changes

* removed obsolete include

* fix for 540

* fix for TVP type mismatch issue

* Combined the IFs
  • Loading branch information
v-makouz authored and mkleehammer committed Oct 10, 2019
1 parent fd9fe87 commit 6f48af5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,15 @@ static PyObject* execute(Cursor* cur, PyObject* pSql, PyObject* params, bool ski
FreeParameterData(cur);
return NULL;
}
if (newParam.ValueType != prevParam->ValueType ||
newParam.ParameterType != prevParam->ParameterType)

if((newParam.ValueType != SQL_C_DEFAULT && prevParam->ValueType != SQL_C_DEFAULT) &&
(newParam.ValueType != prevParam->ValueType ||
newParam.ParameterType != prevParam->ParameterType))
{
FreeParameterData(cur);
return RaiseErrorV(0, ProgrammingError, "Type mismatch between TVP row values");
}

if (prevParam->allocated)
pyodbc_free(prevParam->ParameterValuePtr);
Py_XDECREF(prevParam->pObject);
Expand Down

0 comments on commit 6f48af5

Please sign in to comment.