Skip to content

Commit 5ed83f7

Browse files
committed
Apply fix for #69356 to "Sent SQL"
1 parent 3ac20e0 commit 5ed83f7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,9 +2111,10 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
21112111
/* show parsed SQL if emulated prepares enabled */
21122112
/* pointers will be equal if PDO::query() was invoked */
21132113
if (stmt->active_query_string != NULL && stmt->active_query_string != stmt->query_string) {
2114-
php_stream_printf(out, "Sent SQL: [%zd] %.*s\n",
2115-
stmt->active_query_stringlen,
2116-
(int) stmt->active_query_stringlen, stmt->active_query_string);
2114+
/* break into multiple operations so query string won't be truncated at FORMAT_CONV_MAX_PRECISION */
2115+
php_stream_printf(out, "Sent SQL: [%zd] ", stmt->active_query_stringlen);
2116+
php_stream_write(out, stmt->active_query_string, stmt->active_query_stringlen);
2117+
php_stream_write(out, "\n", 1);
21172118
}
21182119

21192120
php_stream_printf(out, "Params: %d\n",

0 commit comments

Comments
 (0)