diff --git a/source/shared/core_stmt.cpp b/source/shared/core_stmt.cpp index fe69c58a1..feb67329c 100644 --- a/source/shared/core_stmt.cpp +++ b/source/shared/core_stmt.cpp @@ -2508,6 +2508,9 @@ void sqlsrv_param::bind_param(_Inout_ sqlsrv_stmt* stmt) } core::SQLBindParameter(stmt, param_pos + 1, direction, c_data_type, sql_data_type, column_size, decimal_digits, buffer, buffer_length, &strlen_or_indptr); + if (!stmt->conn->ce_option.enabled && !stmt->format_decimals) { + sql_data_type = SQL_UNKNOWN_TYPE; + } } void sqlsrv_param::init_data_from_zval(_Inout_ sqlsrv_stmt* stmt) diff --git a/test/functional/sqlsrv/sqlsrv_github_1448.phpt b/test/functional/sqlsrv/sqlsrv_github_1448.phpt new file mode 100644 index 000000000..6250eb5c3 --- /dev/null +++ b/test/functional/sqlsrv/sqlsrv_github_1448.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test for Github Issue 1448 +--DESCRIPTION-- +Prepare and execute with int, then execute with string caused "Invalid character value for cast specification" error. +Repro script provided by thsmrtone1 +--FILE-- + +--EXPECT-- +NULL