-
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
Issue 228. sqlsrv ClientBufferMaxKBSize setting - positive integer. #254
Issue 228. sqlsrv ClientBufferMaxKBSize setting - positive integer. #254
Conversation
Add new tests for sqlsrv and pdo.
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.
Overall looks good except again I wonder why a new database is needed for each test
@@ -592,7 +592,7 @@ PHP_FUNCTION( sqlsrv_configure ) | |||
|
|||
zend_long buffered_query_limit = Z_LVAL_P( value_z ); | |||
|
|||
CHECK_CUSTOM_ERROR( buffered_query_limit < 0, error_ctx, SQLSRV_ERROR_INVALID_BUFFER_LIMIT, _FN_ ) { |
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.
Should we update the MSDN doc to specify that buffer size limit must be positive? Just a suggestion.
echo ("Number of rows: $numRows\n"); | ||
|
||
$size = 3; | ||
$stmt = $conn->prepare("SELECT * FROM ".$dbName.".[dbo].[php_test_table_2]", array(constant('PDO::ATTR_CURSOR') => PDO::CURSOR_SCROLL,PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE => PDO::SQLSRV_CURSOR_BUFFERED,PDO::SQLSRV_ATTR_CLIENT_BUFFER_MAX_KB_SIZE=> $size)); |
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.
Please explain why the buffer sizes are different for table 1 and table 2
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.
the data retrieval is different for varchar(max) and varchar(1000).
A slightly bigger buffer is needed for varchar(max) to work even if inserted data is the same.
fetchData($conn, $dbName.".[dbo].[php_test_table_2]", $size); // this should return 0 rows. | ||
// set client buffer size to 2KB | ||
$size = 2; | ||
fetchData($conn, $dbName.".[dbo].[php_test_table_1]", $size); // this should return 1 row. |
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.
Is the client buffer size requirement 2KB due to UTF-8 char set? It's not clear in this test alone
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.
The total column length is > 1024 since it's varchar(1036).
Please merge this code into 'merged-codebase' branch |
In sqlsrv check that ClientBufferMaxKBSize is a positive integer.
Add new tests for sqlsrv and pdo.