Skip to content

Commit 7825f6c

Browse files
committed
Untested PARAM_BINARY support for PDO SQLite
1 parent 258cd35 commit 7825f6c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ext/pdo_sqlite/sqlite_statement.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
129129
return 0;
130130

131131
case PDO_PARAM_LOB:
132+
// For SQLite BLOB columns, these are identical
133+
case PDO_PARAM_BINARY:
132134
if (Z_ISREF(param->parameter)) {
133135
parameter = Z_REFVAL(param->parameter);
134136
} else {
@@ -329,9 +331,11 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
329331
break;
330332

331333
case SQLITE_BLOB:
332-
add_next_index_string(&flags, "blob");
333-
/* TODO Check this is correct */
334-
ZEND_FALLTHROUGH;
334+
// add_next_index_string(&flags, "blob");
335+
add_assoc_str(return_value, "native_type", ZSTR_KNOWN(ZEND_STR_STRING));
336+
add_assoc_long(return_value, "pdo_type", PDO_PARAM_BINARY);
337+
break;
338+
335339
case SQLITE_TEXT:
336340
add_assoc_str(return_value, "native_type", ZSTR_KNOWN(ZEND_STR_STRING));
337341
add_assoc_long(return_value, "pdo_type", PDO_PARAM_STR);

0 commit comments

Comments
 (0)