diff options
author | Tianfang Yang <tianfyan@php.net> | 2017-08-14 00:23:41 -0400 |
---|---|---|
committer | Tianfang Yang <tianfyan@php.net> | 2017-08-14 00:23:41 -0400 |
commit | 4d936c1254cdb8db9a6203cec301839fc335d324 (patch) | |
tree | 841fbd77af3a662027593d26e7b67591dff8f522 | |
parent | 3069ad8dd1400f19a28230d3028048a27d07ce8d (diff) | |
parent | f5552247432bd71b68fc22260dd4ef109074b717 (diff) | |
download | php-git-4d936c1254cdb8db9a6203cec301839fc335d324.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
-rw-r--r-- | ext/oci8/oci8_collection.c | 2 | ||||
-rw-r--r-- | ext/oci8/oci8_interface.c | 12 | ||||
-rw-r--r-- | ext/oci8/oci8_lob.c | 2 | ||||
-rw-r--r-- | ext/oci8/oci8_statement.c | 2 | ||||
-rw-r--r-- | ext/oci8/php_oci8.h | 2 | ||||
-rw-r--r-- | ext/oci8/php_oci8_int.h | 2 | ||||
-rw-r--r-- | ext/oci8/tests/bug72524.phpt | 192 | ||||
-rw-r--r-- | ext/oci8/tests/coll_019.phpt | 2 | ||||
-rw-r--r-- | ext/oci8/tests/lob_040.phpt | 4 | ||||
-rw-r--r-- | ext/oci8/tests/xmltype_02.phpt | 4 |
10 files changed, 116 insertions, 108 deletions
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index a7055e4d65..9e0ea69120 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@php.net> | + | Authors: Stig Sæther Bakken <ssb@php.net> | | Thies C. Arntzen <thies@thieso.net> | | | | Collection support by Andy Sautins <asautins@veripost.net> | diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index b0a8104827..5da3084520 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@php.net> | + | Authors: Stig Sæther Bakken <ssb@php.net> | | Thies C. Arntzen <thies@thieso.net> | | | | Collection support by Andy Sautins <asautins@veripost.net> | @@ -56,13 +56,21 @@ PHP_FUNCTION(oci_register_taf_callback) } if (callback) { +#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2) + if (!zend_is_callable(callback, 0, 0)) { + callback_name = zend_get_callable_name(callback); + php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); + zend_string_release(callback_name); + RETURN_FALSE; + } +#else if (!zend_is_callable(callback, 0, &callback_name)) { php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name)); zend_string_release(callback_name); RETURN_FALSE; } - zend_string_release(callback_name); +#endif } PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index d8755d1cfa..5e3107edfc 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@php.net> | + | Authors: Stig Sæther Bakken <ssb@php.net> | | Thies C. Arntzen <thies@thieso.net> | | | | Collection support by Andy Sautins <asautins@veripost.net> | diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 470d8d0d94..7639340c12 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@php.net> | + | Authors: Stig Sæther Bakken <ssb@php.net> | | Thies C. Arntzen <thies@thieso.net> | | | | Collection support by Andy Sautins <asautins@veripost.net> | diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index c236f6c19f..e70e2fe09c 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@php.net> | + | Authors: Stig Sæther Bakken <ssb@php.net> | | Thies C. Arntzen <thies@thieso.net> | | | | Collection support by Andy Sautins <asautins@veripost.net> | diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 5e74bb0096..97ccbd5776 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Stig Sæther Bakken <ssb@php.net> | + | Authors: Stig Sæther Bakken <ssb@php.net> | | Thies C. Arntzen <thies@thieso.net> | | | | Collection support by Andy Sautins <asautins@veripost.net> | diff --git a/ext/oci8/tests/bug72524.phpt b/ext/oci8/tests/bug72524.phpt index dde99b000c..45ce8c7d5b 100644 --- a/ext/oci8/tests/bug72524.phpt +++ b/ext/oci8/tests/bug72524.phpt @@ -1,96 +1,96 @@ ---TEST--
-Bug #72524 (Binding null values triggers ORA-24816 error)
---SKIPIF--
-<?php
-$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
-require(dirname(__FILE__).'/skipif.inc');
-?>
---FILE--
-
-<?php
-
-require(dirname(__FILE__).'/connect.inc');
-
-// Initialize
-
-$stmtarray = array(
- "CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)"
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-// Run test
-
-$sql = "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)";
-
-echo "Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default\n";
-$stmt = oci_parse($c, $sql);
-
-$clob = NULL;
-$varchar2 = NULL;
-oci_bind_by_name($stmt, ':clob_col', $clob);
-oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
-
-var_dump(oci_execute($stmt));
-
-echo "Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default\n";
-
-$clob = '';
-$varchar2 = '';
-oci_bind_by_name($stmt, ':clob_col', $clob);
-oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
-
-var_dump(oci_execute($stmt));
-
-echo "Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default\n";
-$clob = 'abc';
-$varchar2 = 'abc';
-oci_bind_by_name($stmt, ':clob_col', $clob, 0);
-oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0);
-
-var_dump(oci_execute($stmt));
-
-echo "Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default\n";
-$clob = NULL;
-$varchar2 = NULL;
-oci_bind_by_name($stmt, ':clob_col', $clob, -1, SQLT_LNG);
-oci_bind_by_name($stmt, ':varchar2_col', $varchar2, -1, SQLT_LNG);
-
-var_dump(oci_execute($stmt));
-
-echo "Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default\n";
-$clob = NULL;
-$varchar2 = NULL;
-oci_bind_by_name($stmt, ':clob_col', $clob, 0, SQLT_LNG);
-oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0, SQLT_LNG);
-
-
-var_dump(oci_execute($stmt));
-
-// Cleanup
-
-$stmtarray = array(
- "DROP TABLE mytable"
-);
-
-oci8_test_sql_execute($c, $stmtarray);
-
-?>
-===DONE===
-<?php exit(0); ?>
---EXPECTF--
-Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default
-bool(true)
-Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default
-bool(true)
-Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default
-bool(true)
-Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default
-
-Warning: oci_execute(): ORA-24816: %s in %s on line %d
-bool(false)
-Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default
-
-Warning: oci_execute(): ORA-24816: %s in %s on line %d
-bool(false)
-===DONE===
+--TEST-- +Bug #72524 (Binding null values triggers ORA-24816 error) +--SKIPIF-- +<?php +$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs +require(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- + +<?php + +require(dirname(__FILE__).'/connect.inc'); + +// Initialize + +$stmtarray = array( + "CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)" +); + +oci8_test_sql_execute($c, $stmtarray); + +// Run test + +$sql = "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)"; + +echo "Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default\n"; +$stmt = oci_parse($c, $sql); + +$clob = NULL; +$varchar2 = NULL; +oci_bind_by_name($stmt, ':clob_col', $clob); +oci_bind_by_name($stmt, ':varchar2_col', $varchar2); + +var_dump(oci_execute($stmt)); + +echo "Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default\n"; + +$clob = ''; +$varchar2 = ''; +oci_bind_by_name($stmt, ':clob_col', $clob); +oci_bind_by_name($stmt, ':varchar2_col', $varchar2); + +var_dump(oci_execute($stmt)); + +echo "Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default\n"; +$clob = 'abc'; +$varchar2 = 'abc'; +oci_bind_by_name($stmt, ':clob_col', $clob, 0); +oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0); + +var_dump(oci_execute($stmt)); + +echo "Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default\n"; +$clob = NULL; +$varchar2 = NULL; +oci_bind_by_name($stmt, ':clob_col', $clob, -1, SQLT_LNG); +oci_bind_by_name($stmt, ':varchar2_col', $varchar2, -1, SQLT_LNG); + +var_dump(oci_execute($stmt)); + +echo "Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default\n"; +$clob = NULL; +$varchar2 = NULL; +oci_bind_by_name($stmt, ':clob_col', $clob, 0, SQLT_LNG); +oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0, SQLT_LNG); + + +var_dump(oci_execute($stmt)); + +// Cleanup + +$stmtarray = array( + "DROP TABLE mytable" +); + +oci8_test_sql_execute($c, $stmtarray); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default +bool(true) +Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default +bool(true) +Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default +bool(true) +Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default + +Warning: oci_execute(): ORA-24816: %s in %s on line %d +bool(false) +Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default + +Warning: oci_execute(): ORA-24816: %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/oci8/tests/coll_019.phpt b/ext/oci8/tests/coll_019.phpt index 371c802ede..e0c896dce1 100644 --- a/ext/oci8/tests/coll_019.phpt +++ b/ext/oci8/tests/coll_019.phpt @@ -13,7 +13,7 @@ require(dirname(__FILE__).'/skipif.inc'); require dirname(__FILE__)."/connect.inc"; -$ora_sql = "DROP TYPE ".$type_name;; +$ora_sql = "DROP TYPE ".$type_name; $statement = oci_parse($c,$ora_sql); @oci_execute($statement); diff --git a/ext/oci8/tests/lob_040.phpt b/ext/oci8/tests/lob_040.phpt index 0a29dc1b9e..0d60054b22 100644 --- a/ext/oci8/tests/lob_040.phpt +++ b/ext/oci8/tests/lob_040.phpt @@ -29,9 +29,9 @@ for ($i = 0; $i < NUMLOBS; $i++) { } for ($i = 0; $i < NUMLOBS; $i++) { - echo "Row $i Size: " . $row[$i][0]->size() . "\n";; + echo "Row $i Size: " . $row[$i][0]->size() . "\n"; echo "Pos 1: " . $row[$i][0]->tell() . "\n"; - echo "Data: " . $row[$i][0]->read(5) . "\n";; + echo "Data: " . $row[$i][0]->read(5) . "\n"; echo "Pos 2: " . $row[$i][0]->tell() . "\n"; echo "Data: " . $row[$i][0]->read(12) . "\n"; } diff --git a/ext/oci8/tests/xmltype_02.phpt b/ext/oci8/tests/xmltype_02.phpt index 28e9401baf..9a17f5db18 100644 --- a/ext/oci8/tests/xmltype_02.phpt +++ b/ext/oci8/tests/xmltype_02.phpt @@ -69,7 +69,7 @@ var_dump($row); echo "Test 2 Manipulate the data using SimpleXML\n"; -$sx = simplexml_load_string((binary)$row[0]->load()); +$sx = simplexml_load_string($row[0]->load()); $row[0]->free(); var_dump($sx); @@ -178,4 +178,4 @@ string(%d) "<?xml version="1.0"?> %sVClearance>10</VClearance> </Warehouse> " -===DONE===
\ No newline at end of file +===DONE=== |