-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reset type after bind param Keep the same behavior as 5.9 Issue #1448 * Add unit test, skip for decimal format * Add unit test, skip for decimal format * Update unit test
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
Test for Github Issue 1448 | ||
--DESCRIPTION-- | ||
Prepare and execute with int, then execute with string caused "Invalid character value for cast specification" error. | ||
Repro script provided by thsmrtone1 | ||
--FILE-- | ||
<?php | ||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); | ||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); | ||
|
||
require_once( 'MsCommon.inc' ); | ||
$conn = Connect(); | ||
if( !$conn ) { | ||
var_dump( sqlsrv_errors() ); | ||
die( "sqlsrv_connect failed." ); | ||
} | ||
|
||
sqlsrv_query($conn, "CREATE TABLE test1448 (testCol nvarchar(50) NULL)"); | ||
|
||
$v0 = 1000; | ||
$stmt = sqlsrv_prepare($conn, 'INSERT INTO [test1448] (testCol) VALUES (?);', [&$v0]); | ||
sqlsrv_execute($stmt); | ||
|
||
$v0 = 'abcd'; | ||
sqlsrv_execute($stmt); | ||
|
||
$error = sqlsrv_errors(SQLSRV_ERR_ERRORS); | ||
var_dump($error); | ||
|
||
dropTable($conn, "test1448"); | ||
sqlsrv_close($conn); | ||
?> | ||
--EXPECT-- | ||
NULL |