From: Adam Baratz Date: Thu, 29 Jun 2017 09:45:41 +0000 (+0200) Subject: Apply fix for #69356 to "Sent SQL" X-Git-Tag: php-7.2.0alpha3~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ed83f7e846a9b6bd844df8818180a890c1904cb;p=php Apply fix for #69356 to "Sent SQL" --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index efdcc87eb8..caf3ff1ef4 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2111,9 +2111,10 @@ static PHP_METHOD(PDOStatement, debugDumpParams) /* show parsed SQL if emulated prepares enabled */ /* pointers will be equal if PDO::query() was invoked */ if (stmt->active_query_string != NULL && stmt->active_query_string != stmt->query_string) { - php_stream_printf(out, "Sent SQL: [%zd] %.*s\n", - stmt->active_query_stringlen, - (int) stmt->active_query_stringlen, stmt->active_query_string); + /* break into multiple operations so query string won't be truncated at FORMAT_CONV_MAX_PRECISION */ + php_stream_printf(out, "Sent SQL: [%zd] ", stmt->active_query_stringlen); + php_stream_write(out, stmt->active_query_string, stmt->active_query_stringlen); + php_stream_write(out, "\n", 1); } php_stream_printf(out, "Params: %d\n",