]> granicus.if.org Git - php/commitdiff
Apply fix for #69356 to "Sent SQL"
authorAdam Baratz <adambaratz@php.net>
Thu, 29 Jun 2017 09:45:41 +0000 (11:45 +0200)
committerAdam Baratz <adambaratz@php.net>
Thu, 29 Jun 2017 09:45:41 +0000 (11:45 +0200)
ext/pdo/pdo_stmt.c

index efdcc87eb8148bc62d2cd5d69186db80aad5b2ab..caf3ff1ef4de211dfaf16daee73269f63aa6ece7 100644 (file)
@@ -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",