-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1503 from microsoft/dev
Merge to master for 5.12.0 release
- Loading branch information
Showing
5 changed files
with
87 additions
and
40 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
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
48 changes: 48 additions & 0 deletions
48
test/functional/sqlsrv/Invalid_Precision_Reusing_Prepared_Statement.phpt
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,48 @@ | ||
--TEST-- | ||
HY104 Invalid precision value when reusing prepared statement | ||
--SKIPIF-- | ||
<?php require('skipif_versions_old.inc'); ?> | ||
--FILE-- | ||
<?php | ||
set_time_limit(0); | ||
sqlsrv_configure('WarningsReturnAsErrors', 0); | ||
sqlsrv_configure('LogSeverity', SQLSRV_LOG_SEVERITY_ALL); | ||
|
||
require_once('MsCommon.inc'); | ||
|
||
$conn = connect(array('CharacterSet'=>'UTF-8')); | ||
if (!$conn) { | ||
fatalError("Failed to connect"); | ||
} | ||
|
||
$tableName = 'php_test_table'; | ||
$column = array(new AE\ColumnMeta("VARCHAR(8000)", "TestColumn", "NULL")); | ||
|
||
$stmt = AE\createTable($conn, $tableName, $column); | ||
if (!$stmt) { | ||
fatalError("Failed to create table $tableName\n"); | ||
} | ||
|
||
$query = "INSERT INTO $tableName (TestColumn) VALUES (?)"; | ||
$parameterValue = "Test value."; | ||
$parameterReference[0] = [ & $parameterValue, SQLSRV_PARAM_IN, null, SQLSRV_SQLTYPE_VARCHAR('8000') ]; | ||
$queryHandle = sqlsrv_prepare($conn, $query, $parameterReference); | ||
|
||
$r1 = sqlsrv_execute($queryHandle); | ||
if ($r1 === false) { | ||
print_r(sqlsrv_errors(SQLSRV_ERR_ALL)); | ||
} | ||
|
||
$r2 = sqlsrv_execute($queryHandle); | ||
if ($r2 === false) { | ||
print_r(sqlsrv_errors(SQLSRV_ERR_ALL)); | ||
} | ||
|
||
dropTable($conn, $tableName); | ||
sqlsrv_close($conn); | ||
|
||
echo "Done\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
Done |
This file was deleted.
Oops, something went wrong.