Skip to content

Commit

Permalink
This is a work around suggested by microsoft#1310
Browse files Browse the repository at this point in the history
with a very specific limited scope.
  • Loading branch information
George Carrette committed Oct 4, 2021
1 parent 36d2704 commit 93d1aae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/shared/core_stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2496,6 +2496,12 @@ void sqlsrv_param::bind_param(_Inout_ sqlsrv_stmt* stmt)
{
if (was_null) {
strlen_or_indptr = SQL_NULL_DATA;
if ((sql_data_type == SQL_CHAR) && (column_size == 1)) {
// This is a work-around for a bug in Microsoft SQL Server and/or unixODBC and/or msodbcsql;
// as to how the T-SQL operator ISNULL likes to see a NULL.
sql_data_type = SQL_VARCHAR;
column_size = 0;
}
}

core::SQLBindParameter(stmt, param_pos + 1, direction, c_data_type, sql_data_type, column_size, decimal_digits, buffer, buffer_length, &strlen_or_indptr);
Expand Down

0 comments on commit 93d1aae

Please sign in to comment.