com php-src: Merge branch 'PHP-7.1': ext/pdo/pdo_stmt.c

From: Date: Thu, 29 Jun 2017 09:44:02 +0000
Subject: com php-src: Merge branch 'PHP-7.1': ext/pdo/pdo_stmt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98250@lists.php.net to get a copy of this message
Commit: 3ac20e099511c0bcbcfc5755199fe704e3918993 Author: Adam Baratz <adambaratz@php.net> Thu, 29 Jun 2017 11:44:02 +0200 Parents: 10dc924999a473406591ebbbf1dad184aef163e4 c8bb64c406cc7a6fd56d7831aabac52f5402677e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3ac20e099511c0bcbcfc5755199fe704e3918993 Log: Merge branch 'PHP-7.1' * PHP-7.1: Fixed bug #69356 Fixed #69356: PDOStatement::debugDumpParams() truncates query Bugs: https://bugs.php.net/69356 Changed paths: MM ext/pdo/pdo_stmt.c Diff: diff --cc ext/pdo/pdo_stmt.c index a826240,b953739..efdcc87 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@@ -2103,18 -2104,11 +2103,19 @@@ static PHP_METHOD(PDOStatement, debugDu RETURN_FALSE; } - php_stream_printf(out, "SQL: [%zd] %.*s\n", - stmt->query_stringlen, - (int) stmt->query_stringlen, stmt->query_string); + /* break into multiple operations so query string won't be truncated at FORMAT_CONV_MAX_PRECISION */ + php_stream_printf(out, "SQL: [%zd] ", stmt->query_stringlen); + php_stream_write(out, stmt->query_string, stmt->query_stringlen); + php_stream_write(out, "\n", 1); + /* 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); + } + php_stream_printf(out, "Params: %d\n", stmt->bound_params ? zend_hash_num_elements(stmt->bound_params) : 0);

« previous php.cvs (#98250) next »