Skip to content

Commit df964b4

Browse files
committed
Fix tests for Windows and make it platform agnostic
1 parent 4fbdfca commit df964b4

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

oci_driver.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "php_pdo_oci_int.h"
2828
#include "Zend/zend_exceptions.h"
2929

30-
static inline ub4 pdo_oci_sanitize_prefetch(long prefetch);
30+
static inline ub4 pdo_oci_sanitize_prefetch(zend_long prefetch);
3131

3232
static void pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
3333
{
@@ -879,13 +879,14 @@ const pdo_driver_t pdo_oci_driver = {
879879
pdo_oci_handle_factory
880880
};
881881

882-
static inline ub4 pdo_oci_sanitize_prefetch(long prefetch) /* {{{ */
882+
static inline ub4 pdo_oci_sanitize_prefetch(zend_long prefetch) /* {{{ */
883883
{
884884
if (prefetch < 0) {
885-
prefetch = 0;
886-
} else if (prefetch > UB4MAXVAL / PDO_OCI_PREFETCH_ROWSIZE) {
887-
prefetch = PDO_OCI_PREFETCH_DEFAULT;
885+
return 0;
888886
}
889-
return ((ub4)prefetch);
887+
if (prefetch > (zend_long)(UB4MAXVAL / PDO_OCI_PREFETCH_ROWSIZE)) {
888+
return PDO_OCI_PREFETCH_DEFAULT;
889+
}
890+
return (ub4)prefetch;
890891
}
891892
/* }}} */

tests/pdo_oci_debugdumpparams.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $stmt = $db->query("
2626
var_dump($stmt->debugDumpParams());
2727
?>
2828
--EXPECTF--
29-
SQL: [844]%s
29+
SQL: [%d]%s
3030
SELECT '
3131
Dumps the information contained by a prepared statement directly on the output. It will provide the SQL query in use, the number of parameters used (Params), the list of parameters, with their name, type (paramtype) as an integer, their key name or position, and the position in the query (if this is supported by the PDO driver, otherwise, it will be -1).
3232
This is a debug function, which dump directly the data on the normal output.
@@ -37,4 +37,3 @@ SQL: [844]%s
3737

3838
Params: 0
3939
NULL
40-

0 commit comments

Comments
 (0)