com php-src: Add IN bind case to bug74625.phpt: ext/oci8/tests/bug74625.phpt

From: Date: Wed, 21 Jun 2017 05:47:32 +0000
Subject: com php-src: Add IN bind case to bug74625.phpt: ext/oci8/tests/bug74625.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98141@lists.php.net to get a copy of this message
Commit: b4c5f20c466967d9d1242425691c57569662960d Author: Christopher Jones <sixd@php.net> Wed, 21 Jun 2017 15:47:32 +1000 Parents: fa3615f14ee9c0be361d8c45251f9d30cfe49900 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b4c5f20c466967d9d1242425691c57569662960d Log: Add IN bind case to bug74625.phpt Bugs: https://bugs.php.net/74625 Changed paths: M ext/oci8/tests/bug74625.phpt Diff: diff --git a/ext/oci8/tests/bug74625.phpt b/ext/oci8/tests/bug74625.phpt index 7b6c316..df9440e 100644 --- a/ext/oci8/tests/bug74625.phpt +++ b/ext/oci8/tests/bug74625.phpt @@ -3,26 +3,63 @@ Bug #74625 (Integer overflow in oci_bind_array_by_name) --SKIPIF-- <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); -if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?> --FILE-- <?php - require(dirname(__FILE__).'/connect.inc'); -$s = oci_parse($c, "BEGIN - SELECT -1 BULK COLLECT INTO :a FROM DUAL; - END;"); -oci_bind_array_by_name($s, ':a', $a, 5000, 10, SQLT_INT); -oci_execute($s); +// 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); -var_dump($a); ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- -Array -( - [0] => -1 -) +array(5) { + [0]=> + int(-2) + [1]=> + int(-4) + [2]=> + int(-6) + [3]=> + int(-8) + [4]=> + int(-10) +} ===DONE===

« previous php.cvs (#98141) next »