-
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
Reverted change handling bigint output parameters #744
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ insertRow($conn, $tbname, array("c1_bigint" => 922337203685479936)); | |
$outSql = "{CALL $spname (?)}"; | ||
$bigintOut = 0; | ||
$stmt = $conn->prepare($outSql); | ||
$stmt->bindParam(1, $bigintOut, PDO::PARAM_INT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE); | ||
// $stmt->bindParam(1, $bigintOut, PDO::PARAM_INT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE); | ||
$stmt->bindParam(1, $bigintOut, PDO::PARAM_STR, 2048); | ||
$stmt->execute(); | ||
printf("Large bigint output:\n" ); | ||
var_dump($bigintOut); | ||
|
@@ -35,7 +36,8 @@ printf("\n"); | |
// Call stored procedure with inout | ||
$bigintOut = 0; | ||
$stmt = $conn->prepare($outSql); | ||
$stmt->bindParam(1, $bigintOut, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE); | ||
// $stmt->bindParam(1, $bigintOut, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, PDO::SQLSRV_PARAM_OUT_DEFAULT_SIZE); | ||
$stmt->bindParam(1, $bigintOut, PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT, 2048); | ||
$stmt->execute(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps not 2048 but a size that's a bit larger than 20? |
||
printf("Large bigint inout:\n" ); | ||
var_dump($bigintOut); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,19 @@ AE\insertRow($conn, $tbname, array("c1_bigint" => 922337203685479936)); | |
// Call stored procedure with SQLSRV_PARAM_OUT | ||
$outSql = "{CALL $spname (?)}"; | ||
$bigintOut = 0; | ||
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_OUT))); | ||
// $stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_OUT))); | ||
// $stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_OUT, null, SQLSRV_SQLTYPE_BIGINT))); <-- this works | ||
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_OUT, null, SQLSRV_SQLTYPE_VARCHAR(256)))); //<-- this also works | ||
sqlsrv_execute($stmt); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same for this one: remove the commented lines and unnecessary comments |
||
printf("Large bigint output:\n"); | ||
var_dump($bigintOut); | ||
printf("\n"); | ||
|
||
// Call stored procedure with SQLSRV_PARAM_INOUT | ||
$bigintOut = 0; | ||
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_INOUT))); | ||
// $stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_INOUT))); | ||
// $stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_INOUT, null, SQLSRV_SQLTYPE_BIGINT))); <-- this works | ||
$stmt = sqlsrv_prepare($conn, $outSql, array(array(&$bigintOut, SQLSRV_PARAM_INOUT, null, SQLSRV_SQLTYPE_VARCHAR(256)))); //<-- this also works | ||
sqlsrv_execute($stmt); | ||
printf("Large bigint inout:\n"); | ||
var_dump($bigintOut); | ||
|
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 remove the commented lines in the test