Merge pull request #759 from yitam/vso2829
Remove the limitation of getting binary as strings as INOUT param
This commit is contained in:
commit
440636aff8
|
@ -1180,9 +1180,10 @@ int pdo_sqlsrv_stmt_param_hook( _Inout_ pdo_stmt_t *stmt,
|
||||||
}
|
}
|
||||||
// if the parameter is output or input/output, translate the type between the PDO::PARAM_* constant
|
// if the parameter is output or input/output, translate the type between the PDO::PARAM_* constant
|
||||||
// and the SQLSRV_PHPTYPE_* constant
|
// and the SQLSRV_PHPTYPE_* constant
|
||||||
int pdo_type = param->param_type;
|
// vso 2829: derive the pdo_type for input/output parameter as well
|
||||||
|
int pdo_type = (direction == SQL_PARAM_OUTPUT) ? param->param_type : param->param_type & ~PDO_PARAM_INPUT_OUTPUT;
|
||||||
SQLSRV_PHPTYPE php_out_type = SQLSRV_PHPTYPE_INVALID;
|
SQLSRV_PHPTYPE php_out_type = SQLSRV_PHPTYPE_INVALID;
|
||||||
switch( pdo_type & ~PDO_PARAM_INPUT_OUTPUT ) {
|
switch (pdo_type) {
|
||||||
case PDO_PARAM_BOOL:
|
case PDO_PARAM_BOOL:
|
||||||
case PDO_PARAM_INT:
|
case PDO_PARAM_INT:
|
||||||
php_out_type = SQLSRV_PHPTYPE_INT;
|
php_out_type = SQLSRV_PHPTYPE_INT;
|
||||||
|
|
|
@ -88,12 +88,6 @@ function testOutputBinary($inout)
|
||||||
$stmt = $conn->prepare($outSql);
|
$stmt = $conn->prepare($outSql);
|
||||||
trace("\nParam $pdoParamType with INOUT = $inout\n");
|
trace("\nParam $pdoParamType with INOUT = $inout\n");
|
||||||
|
|
||||||
if ($inout && $pdoParamType == PDO::PARAM_STR) {
|
|
||||||
// Currently do not support getting binary as strings + INOUT param
|
|
||||||
// See VSO 2829 for details
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isAEConnected() && $pdoParamType == PDO::PARAM_INT) {
|
if (!isAEConnected() && $pdoParamType == PDO::PARAM_INT) {
|
||||||
// Without AE, there is no possible way to specify
|
// Without AE, there is no possible way to specify
|
||||||
// binary encoding for this output param type,
|
// binary encoding for this output param type,
|
||||||
|
|
Loading…
Reference in a new issue