Skip to content

Commit

Permalink
Report len as -1 instead of INT_MAX
Browse files Browse the repository at this point in the history
Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.
  • Loading branch information
nikic committed Jun 3, 2020
1 parent 2a7d628 commit 3911158
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/pdo_sqlite/sqlite_statement.c
Expand Up @@ -286,7 +286,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 = 0xffffffff;
stmt->columns[colno].maxlen = SIZE_MAX;
stmt->columns[colno].precision = 0;

switch (sqlite3_column_type(S->stmt, colno)) {
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_sqlite/tests/bug79664.phpt
Expand Up @@ -24,7 +24,7 @@ array(6) {
["name"]=>
string(1) "1"
["len"]=>
int(4294967295)
int(-1)
["precision"]=>
int(0)
["pdo_type"]=>
Expand Down

0 comments on commit 3911158

Please sign in to comment.