-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added error handling for LOB types as output parameters #584
Conversation
source/shared/core_stmt.cpp
Outdated
@@ -422,6 +422,12 @@ void core_sqlsrv_bind_param( _Inout_ sqlsrv_stmt* stmt, _In_ SQLUSMALLINT param_ | |||
|
|||
// if it's an output parameter and the user asks for a certain type, we have to convert the zval to that type so | |||
// when the buffer is filled, the type is correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should amend this comment to explain the error check that you added below. "But first, check that we are not using a LOB type with an output parameter" or something like that.
$initData = "ShortString"; | ||
$callResult = $initData; | ||
|
||
// Make sure not to specify the PHP type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why must you not specify the php type here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a copy of another test for issue #231. I can remove the comment if you like. It doesn't matter for this particular test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then may as well remove it...
Codecov Report
@@ Coverage Diff @@
## dev #584 +/- ##
==========================================
- Coverage 74.86% 74.84% -0.02%
==========================================
Files 50 50
Lines 14927 14933 +6
==========================================
+ Hits 11175 11177 +2
- Misses 3752 3756 +4
Continue to review full report at Codecov.
|
source/shared/core_stmt.cpp
Outdated
|| sql_type == SQL_WLONGVARCHAR || sql_type == SQL_LONGVARBINARY), | ||
// If the user specifies a certain type for an output parameter, we have to convert the zval | ||
// to that type so that when the buffer is filled, the type is correct. But first, | ||
// should check that if a LOB type is specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean '...should check if a LOB type is specified.'
#231
This change is