Skip to content
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

Setting for ClientBufferMaxKBSize was non-int or non-positive. #792

Closed
Flawm opened this issue Jun 7, 2018 · 2 comments
Closed

Setting for ClientBufferMaxKBSize was non-int or non-positive. #792

Flawm opened this issue Jun 7, 2018 · 2 comments

Comments

@Flawm
Copy link

Flawm commented Jun 7, 2018

Description

We are running into a hiccup with ClientBufferMaxKBSize causing a total failure on every query when it's set to 0 in the php.ini.

Expected and actual behavior

As stated here, when it is 0 there is supposed to be no buffer limit, however when we configure it to 0 in the php.ini, no queries work at all, and we get this from sqlsrv_errors()

    [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -60 [code] => -60 [2] => Setting for ClientBufferMaxKBSize was non-int or non-positive. [message] => Setting for ClientBufferMaxKBSize was non-int or non-positive. ))

Steps to reproduce

Edit the php.ini to contain this

sqlsrv.ClientBufferMaxKBSize = 0

and try to do any query.

After a cursory glance I want to say this is being specifically thrown from L630 in source/sqlsrv/util.cpp but I really don't know what's going on here.


PHP version

php -v
PHP 7.2.5 (cli) (built: Apr 25 2018 02:19:27) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group

MSODBCSQL version

17.1.0.1

SQL Server version

MSSQL Server 2014
Microsoft SQL Server Management Studio 12.0.5207.0
Microsoft Analysis Services Client Tools 12.0.5207.0
Microsoft Data Access Components (MDAC) 6.3.9600.17415
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.9600.19003
Microsoft .NET Framework a 4.0.30319.42000
Operating System 6.3.9600

Client operating system

Windows Server 2012 R2 Standard

PHP SQLSRV extension version

ExtensionVer | 5.1.0-preview+10119
using (php_sqlsrv_72_nts_x64.dll)

@david-puglielli
Copy link
Contributor

@Flawm The drivers don't allow ClientBufferMaxKBSize to be zero because 1. It causes problems with varchar(max) fields (see #228 and the fix #254), and 2. Buffered queries work best for small and medium sized result sets. The documentation is in error, for which we apologise. We will fix it promptly.

@Flawm Flawm closed this as completed Jun 7, 2018
@Flawm
Copy link
Author

Flawm commented Jun 7, 2018

Ok. Anyways, as a work around we're going to set it to the same value as our php memory limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants