forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-7.0: Add bug #74625 to package.xml Add IN bind case to bug74625.phpt Fixed bug #74625 (Integer overflow in oci_bind_array_by_name).
- Loading branch information
Showing
3 changed files
with
83 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--TEST-- | ||
Bug #74625 (Integer overflow in oci_bind_array_by_name) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('oci8')) die ("skip no oci8 extension"); | ||
?> | ||
--FILE-- | ||
<?php | ||
require(dirname(__FILE__).'/connect.inc'); | ||
|
||
// Initialization | ||
|
||
$stmtarray = array( | ||
"CREATE TABLE bug74625_tab (NAME NUMBER)", | ||
"CREATE OR REPLACE PACKAGE PKG74625 AS | ||
TYPE ARRTYPE IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; | ||
PROCEDURE iobind(c1 IN OUT ARRTYPE); | ||
END PKG74625;", | ||
"CREATE OR REPLACE PACKAGE BODY PKG74625 AS | ||
PROCEDURE iobind(c1 IN OUT ARRTYPE) IS | ||
BEGIN | ||
FOR i IN 1..5 LOOP | ||
c1(i) := c1(i) * 2; | ||
END LOOP; | ||
END iobind; | ||
END PKG74625;" | ||
); | ||
|
||
oci8_test_sql_execute($c, $stmtarray); | ||
|
||
$statement = oci_parse($c, "BEGIN pkg74625.iobind(:c1); END;"); | ||
|
||
$array = Array(-1,-2,-3,-4,-5); | ||
|
||
oci_bind_array_by_name($statement, ":c1", $array, 5, -1, SQLT_INT); | ||
|
||
oci_execute($statement); | ||
|
||
var_dump($array); | ||
|
||
// Cleanup | ||
$stmtarray = array( | ||
"DROP TABLE bug74625_tab", | ||
"DROP PACKAGE PKG74625" | ||
); | ||
|
||
oci8_test_sql_execute($c, $stmtarray); | ||
|
||
?> | ||
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECTF-- | ||
array(5) { | ||
[0]=> | ||
int(-2) | ||
[1]=> | ||
int(-4) | ||
[2]=> | ||
int(-6) | ||
[3]=> | ||
int(-8) | ||
[4]=> | ||
int(-10) | ||
} | ||
===DONE=== |