-
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.
* Set preview for beta release (#1430) * Fix invalid percision error * add a end of file for added test * fix the test case * remove sql type reset logic --------- Co-authored-by: Sicong <[email protected]>
- Loading branch information
1 parent
41ac126
commit 09c53ef
Showing
3 changed files
with
49 additions
and
37 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
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.