Skip to content

Commit 9047b56

Browse files
committed
Resolve build warnings. Bump ver. Better range check. Fix diffs
1 parent 4df77a6 commit 9047b56

File tree

8 files changed

+33
-25
lines changed

8 files changed

+33
-25
lines changed

ext/oci8/oci8.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,8 +3121,8 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
31213121
ub4 statement_cache_size = 0;
31223122

31233123
if (OCI_G(statement_cache_size) > 0) {
3124-
if (OCI_G(statement_cache_size) > UB4MAXVAL-1)
3125-
statement_cache_size = (ub4) UB4MAXVAL-1;
3124+
if (OCI_G(statement_cache_size) > SB4MAXVAL)
3125+
statement_cache_size = (ub4) SB4MAXVAL;
31263126
else
31273127
statement_cache_size = (ub4) OCI_G(statement_cache_size);
31283128
}
@@ -3316,8 +3316,8 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
33163316
ub4 statement_cache_size = 0;
33173317

33183318
if (OCI_G(statement_cache_size) > 0) {
3319-
if (OCI_G(statement_cache_size) > UB4MAXVAL-1)
3320-
statement_cache_size = (ub4) UB4MAXVAL-1;
3319+
if (OCI_G(statement_cache_size) > SB4MAXVAL)
3320+
statement_cache_size = (ub4) SB4MAXVAL;
33213321
else
33223322
statement_cache_size = (ub4) OCI_G(statement_cache_size);
33233323
}

ext/oci8/oci8_interface.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ PHP_FUNCTION(oci_lob_eof)
385385

386386
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
387387

388-
if (!php_oci_lob_get_length(descriptor, &lob_length) && lob_length >= 0) {
388+
if (!php_oci_lob_get_length(descriptor, &lob_length)) {
389389
if (lob_length == descriptor->lob_current_position) {
390390
RETURN_TRUE;
391391
}
@@ -492,8 +492,7 @@ PHP_FUNCTION(oci_lob_seek)
492492
descriptor->lob_current_position = (offset > 0) ? (ub4) offset : 0;
493493
break;
494494
}
495-
if ((descriptor->lob_current_position < 0) ||
496-
(descriptor->lob_current_position > UB4MAXVAL-1)) {
495+
if (descriptor->lob_current_position > UB4MAXVAL) {
497496
php_error_docref(NULL, E_WARNING, "Invalid offset or LOB position");
498497
RETURN_FALSE;
499498
}

ext/oci8/oci8_lob.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,6 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
416416
return 0;
417417
}
418418

419-
if (offset < 0) {
420-
offset = 0;
421-
}
422-
423419
if (offset > descriptor->lob_current_position) {
424420
offset = descriptor->lob_current_position;
425421
}

ext/oci8/oci8_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
14811481
}
14821482

14831483
if (Z_TYPE_P(column_index) == IS_STRING) {
1484-
column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index));
1484+
column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), (int) Z_STRLEN_P(column_index));
14851485
if (!column) {
14861486
php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
14871487
return NULL;

ext/oci8/package.xml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ in the free Oracle Instant Client available from Oracle. Oracle's
1515
standard cross-version connectivity applies. For example, PHP OCI8
1616
linked with Instant Client 11.2 can connect to Oracle Database 9.2
1717
onward. See Oracle's note "Oracle Client / Server Interoperability
18-
Support" (ID 207303.1) for details. PHP OCI8 2.0 can be built with
19-
PHP 5.2 onward. Use the older PHP OCI8 1.4.10 when using PHP 4.3.9
20-
through to PHP 5.1.x, or when only Oracle Database 9.2 client
21-
libraries are available.
18+
Support" (ID 207303.1) for details. PHP OCI8 2.1.0 can be built with
19+
PHP 7. PHP OCI8 2.0.9 can be built with PHP 5.2 onward. Use the older
20+
PHP OCI8 1.4.10 when using PHP 4.3.9 through to PHP 5.1.x, or when
21+
only Oracle Database 9.2 client libraries are available.
2222
</description>
2323
<lead>
2424
<name>Christopher Jones</name>
@@ -45,20 +45,20 @@ libraries are available.
4545
<active>no</active>
4646
</lead>
4747

48-
<date>2014-03-19</date>
48+
<date>2015-01-01</date>
4949
<time>12:00:00</time>
5050

5151
<version>
52-
<release>2.0.9</release>
53-
<api>2.0.9</api>
52+
<release>2.1.0</release>
53+
<api>2.1.0</api>
5454
</version>
5555
<stability>
5656
<release>stable</release>
5757
<api>stable</api>
5858
</stability>
5959
<license uri="http://www.php.net/license">PHP</license>
6060
<notes>
61-
Fixed oci_field_* reflection: $field can be a column name or index
61+
PHP 7 Compatibility. This version is for PHP 7 only.
6262
</notes>
6363
<contents>
6464
<dir name="/">
@@ -460,6 +460,21 @@ Fixed oci_field_* reflection: $field can be a column name or index
460460
</extsrcrelease>
461461
<changelog>
462462

463+
<release>
464+
<version>
465+
<release>2.0.9</release>
466+
<api>2.0.9</api>
467+
</version>
468+
<stability>
469+
<release>stable</release>
470+
<api>stable</api>
471+
</stability>
472+
<license uri="http://www.php.net/license">PHP</license>
473+
<notes>
474+
Fixed oci_field_* reflection: $field can be a column name or index
475+
</notes>
476+
</release>
477+
463478
<release>
464479
<version>
465480
<release>2.0.8</release>

ext/oci8/php_oci8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
#undef PHP_OCI8_VERSION
4747
#endif
48-
#define PHP_OCI8_VERSION "2.0.9"
48+
#define PHP_OCI8_VERSION "2.1.0"
4949

5050
extern zend_module_entry oci8_module_entry;
5151
#define phpext_oci8_ptr &oci8_module_entry

ext/oci8/tests/imp_res_close.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ oci8_test_sql_execute($c, $stmtarray);
6363
--EXPECTF--
6464
Test 1
6565
1
66-
2
6766

68-
Warning: oci_fetch_array(): %d is not a valid oci8 statement resource in %simp_res_close.php on line %d
67+
Warning: oci_fetch_array(): supplied resource is not a valid oci8 statement resource in %simp_res_close.php on line %d
6968
===DONE===

ext/oci8/tests/imp_res_get_close_2.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ while (($s1 = oci_get_implicit_resultset($s))) {
5656
--EXPECTF--
5757
Test 1
5858
1
59-
2
6059

6160
Warning: oci_fetch_array(): OCI_INVALID_HANDLE in %s on line %d
6261

63-
Warning: oci_get_implicit_resultset(): %d is not a valid oci8 statement resource in %s on line %d
62+
Warning: oci_get_implicit_resultset(): supplied resource is not a valid oci8 statement resource in %s on line %d
6463
===DONE===

0 commit comments

Comments
 (0)