diff options
author | Christopher Jones <christopher.jones@oracle.com> | 2016-04-14 13:50:01 +1000 |
---|---|---|
committer | Christopher Jones <christopher.jones@oracle.com> | 2016-04-14 13:50:01 +1000 |
commit | 8f2e6da8066d4f0b4c3846aeba14f894ef8b02ed (patch) | |
tree | a82a544d68edf488825b1f0da4c8ab7ccc2c7d28 | |
parent | c1f597d9a13a6a4df80d9969fe7845b45bddf402 (diff) | |
download | php-git-8f2e6da8066d4f0b4c3846aeba14f894ef8b02ed.tar.gz |
Fixed bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column)
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/oci8/oci8_statement.c | 4 | ||||
-rw-r--r-- | ext/oci8/package.xml | 26 | ||||
-rw-r--r-- | ext/oci8/php_oci8.h | 2 | ||||
-rw-r--r-- | ext/oci8/tests/bug71422.phpt | 65 |
5 files changed, 94 insertions, 7 deletions
@@ -15,6 +15,10 @@ PHP NEWS . Fixed bug #71889 (DateInterval::format Segmentation fault). (Thomas Punt) +- OCI8: + . Fixed bug #71422 (Fix ORA-01438: value larger than specified precision + allowed for this column) + - ODBC: . Fixed bug #63171 (Script hangs after max_execution_time). (Remi) diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index a0cd56e580..3bc17fda1c 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -1145,7 +1145,9 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, return 1; } convert_to_long(var); -#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION > 10 + +#if defined(OCI_MAJOR_VERSION) && (OCI_MAJOR_VERSION > 10) && \ +(defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)) bind_data = (ub8 *)&Z_LVAL_P(var); value_sz = sizeof(ub8); #else diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 56872f4fb2..2f93fc4830 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -9,7 +9,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> <description> Use the OCI8 extension to access Oracle Database. PHP OCI8 2.1 builds -with PHP 7. Use 'pecl install oci8-2.0.10' to install OCI8 for PHP +with PHP 7. Use 'pecl install oci8-2.0.11' to install OCI8 for PHP 5.2 - PHP 5.6. Use 'pecl install oci8-1.4.10' to install PHP OCI8 1.4 for PHP 4.3.9 - PHP 5.1. The OCI8 extension can be linked with Oracle client libraries from Oracle Database 12.1, 11, or 10.2. These @@ -46,12 +46,12 @@ Interoperability Support" (ID 207303.1) for details. <active>no</active> </lead> - <date>2015-12-12</date> + <date>2016-04-15</date> <time>12:00:00</time> <version> - <release>2.0.10</release> - <api>2.0.10</api> + <release>2.0.11</release> + <api>2.0.11</api> </version> <stability> <release>stable</release> @@ -59,7 +59,7 @@ Interoperability Support" (ID 207303.1) for details. </stability> <license uri="http://www.php.net/license">PHP</license> <notes> -Fixed bug #68298 (OCI int overflow) +Fixed bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column) </notes> <contents> <dir name="/"> @@ -159,6 +159,7 @@ Fixed bug #68298 (OCI int overflow) <file name="bug51291_1.phpt" role="test" /> <file name="bug51291_2.phpt" role="test" /> <file name="bug68298.phpt" role="test" /> + <file name="bug71422.phpt" role="test" /> <file name="clientversion.phpt" role="test" /> <file name="close.phpt" role="test" /> <file name="coll_001.phpt" role="test" /> @@ -466,6 +467,21 @@ Fixed bug #68298 (OCI int overflow) <release> <version> + <release>2.0.10</release> + <api>2.0.10</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.php.net/license">PHP</license> + <notes> +Fixed bug #68298 (OCI int overflow) + </notes> +</release> + +<release> + <version> <release>2.0.9</release> <api>2.0.9</api> </version> diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 74dfd01fb6..ae28aec6c4 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -45,7 +45,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.0.10" +#define PHP_OCI8_VERSION "2.0.11" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/tests/bug71422.phpt b/ext/oci8/tests/bug71422.phpt new file mode 100644 index 0000000000..5978e04ece --- /dev/null +++ b/ext/oci8/tests/bug71422.phpt @@ -0,0 +1,65 @@ +--TEST-- +Bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column) +--SKIPIF-- +<?php +if (!extension_loaded('oci8')) die ("skip no oci8 extension"); +?> +--FILE-- +<?php + +require(dirname(__FILE__).'/connect.inc'); + +$stmtarray = array( + "DROP TABLE BUG71422_TEST", + "CREATE TABLE BUG71422_TEST (TEST_ID NUMBER(*,0) NOT NULL, LABEL VARCHAR2(50 CHAR), CONSTRAINT BUG71422_TEST_PK PRIMARY KEY (TEST_ID))", + "INSERT INTO BUG71422_TEST (TEST_ID, LABEL) VALUES (1, 'Foo')" +); + +oci8_test_sql_execute($c, $stmtarray); + +$stmt = oci_parse($c, 'SELECT LABEL AS RAW_QUERY FROM BUG71422_TEST WHERE TEST_ID=1'); +oci_execute($stmt); +while ($row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS)) { + var_dump($row); +} + +$stmt = oci_parse($c, 'SELECT LABEL AS NUMERIC_BIND_PARAMETER FROM BUG71422_TEST WHERE TEST_ID=:test_id'); +$value = 1; +oci_bind_by_name($stmt, ':test_id', $value, -1, SQLT_INT); +oci_execute($stmt); +while ($row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS)) { + var_dump($row); +} + +$stmt = oci_parse($c, 'SELECT LABEL AS STRING_BIND_PARAMETER FROM BUG71422_TEST WHERE TEST_ID=:test_id'); +$value = 1; +oci_bind_by_name($stmt, ':test_id', $value, -1, SQLT_CHR); +oci_execute($stmt); +while ($row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS)) { + var_dump($row); +} + +// Cleanup + +$stmtarray = array( + "DROP TABLE BUG71422_TEST" +); +oci8_test_sql_execute($c, $stmtarray); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +array(1) { + ["RAW_QUERY"]=> + string(3) "Foo" +} +array(1) { + ["NUMERIC_BIND_PARAMETER"]=> + string(3) "Foo" +} +array(1) { + ["STRING_BIND_PARAMETER"]=> + string(3) "Foo" +} +===DONE=== |