From 39111585a2f8e40e72bdc662eb8b2e3c19e93615 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 3 Jun 2020 10:15:54 +0200 Subject: [PATCH] Report len as -1 instead of INT_MAX Per docs it should be -1. And would be on 32-bit systems, but not on 64-bit systems. --- ext/pdo_sqlite/sqlite_statement.c | 2 +- ext/pdo_sqlite/tests/bug79664.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index 63f2d5d80c..a8723da640 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -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)) { diff --git a/ext/pdo_sqlite/tests/bug79664.phpt b/ext/pdo_sqlite/tests/bug79664.phpt index 072d107ba6..fae39aea3e 100644 --- a/ext/pdo_sqlite/tests/bug79664.phpt +++ b/ext/pdo_sqlite/tests/bug79664.phpt @@ -24,7 +24,7 @@ array(6) { ["name"]=> string(1) "1" ["len"]=> - int(4294967295) + int(-1) ["precision"]=> int(0) ["pdo_type"]=> -- 2.40.0