Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/pdo/pdo_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ PHP_METHOD(PDOStatement, getColumnMeta)
/* add stock items */
col = &stmt->columns[colno];
add_assoc_str(return_value, "name", zend_string_copy(col->name));
add_assoc_long(return_value, "len", col->maxlen); /* FIXME: unsigned ? */
add_assoc_long(return_value, "len", col->maxlen);
add_assoc_long(return_value, "precision", col->precision);
}
/* }}} */
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/php_pdo_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ static inline pdo_dbh_object_t *php_pdo_dbh_fetch_object(zend_object *obj) {
/* describes a column */
struct pdo_column_data {
zend_string *name;
size_t maxlen;
zend_long maxlen;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be more accurate?

Suggested change
zend_long maxlen;
ssize_t maxlen;

zend_ulong precision;
};

Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_sqlite/sqlite_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno)

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

return 1;
Expand Down