Skip to content

Commit b0ac91c

Browse files
committed
Add untested, unexposed PARAM_BINARY
1 parent efcd720 commit b0ac91c

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

ext/pdo/pdo_dbh.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class PDO
1717
public const int PARAM_LOB = 3;
1818
/** @cvalue LONG_CONST(PDO_PARAM_STMT) */
1919
public const int PARAM_STMT = 4;
20+
/** @cvalue LONG_CONST(PDO_PARAM_BINARY) */
21+
public const int PARAM_BINARY = 4;
2022
/** @cvalue LONG_CONST(PDO_PARAM_INPUT_OUTPUT) */
2123
public const int PARAM_INPUT_OUTPUT = UNKNOWN;
2224
/** @cvalue LONG_CONST(PDO_PARAM_STR_NATL) */

ext/pdo/pdo_dbh_arginfo.h

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo/pdo_stmt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_
269269
parameter = Z_REFVAL(param->parameter);
270270
}
271271

272-
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P(parameter)) {
272+
if ((PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR || PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BINARY) && param->max_value_len <= 0 && !Z_ISNULL_P(parameter)) {
273273
if (!try_convert_to_string(parameter)) {
274274
return 0;
275275
}
@@ -517,6 +517,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, enum pdo
517517
convert_to_boolean(dest);
518518
break;
519519
case PDO_PARAM_STR:
520+
case PDO_PARAM_BINARY:
520521
if (Z_TYPE_P(dest) == IS_FALSE) {
521522
/* Return "0" rather than "", because this is what database drivers that
522523
* don't have a dedicated boolean type would return. */

ext/pdo/php_pdo_driver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ enum pdo_param_type {
4747
/* get_col: Not supported (yet?) */
4848
PDO_PARAM_STMT = 4, /* hierarchical result set */
4949

50+
PDO_PARAM_BINARY = 6,
51+
5052
/* magic flag to denote a parameter as being input/output */
5153
PDO_PARAM_INPUT_OUTPUT = 0x80000000,
5254

0 commit comments

Comments
 (0)