Skip to content

Commit 5a096ae

Browse files
committed
PDO: Migrate maxlen of pdo_column_data from size_t to zend_long
1 parent 964a404 commit 5a096ae

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ PHP_METHOD(PDOStatement, getColumnMeta)
15901590
/* add stock items */
15911591
col = &stmt->columns[colno];
15921592
add_assoc_str(return_value, "name", zend_string_copy(col->name));
1593-
add_assoc_long(return_value, "len", col->maxlen); /* FIXME: unsigned ? */
1593+
add_assoc_long(return_value, "len", col->maxlen);
15941594
add_assoc_long(return_value, "precision", col->precision);
15951595
}
15961596
/* }}} */

ext/pdo/php_pdo_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static inline pdo_dbh_object_t *php_pdo_dbh_fetch_object(zend_object *obj) {
533533
/* describes a column */
534534
struct pdo_column_data {
535535
zend_string *name;
536-
size_t maxlen;
536+
zend_long maxlen;
537537
zend_ulong precision;
538538
};
539539

ext/pdo_sqlite/sqlite_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno)
251251

252252
str = sqlite3_column_name(S->stmt, colno);
253253
stmt->columns[colno].name = zend_string_init(str, strlen(str), 0);
254-
stmt->columns[colno].maxlen = SIZE_MAX;
254+
stmt->columns[colno].maxlen = -1;
255255
stmt->columns[colno].precision = 0;
256256

257257
return 1;

0 commit comments

Comments
 (0)