From: Andrey Hristov Date: Thu, 16 Dec 2010 12:56:19 +0000 (+0000) Subject: fix a small bug about affected_rows in the text protocol X-Git-Tag: php-5.3.6RC1~213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17b833604706cd187e4f3b4aeffa003adbeaf1dc;p=php fix a small bug about affected_rows in the text protocol --- diff --git a/NEWS b/NEWS index 4c67881f45..62f758123d 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,9 @@ query). (Kalle) . Fixed bug #53425 (mysqli_real_connect() ignores client flags when built to call libmysql). (Kalle, tre-php-net at crushedhat dot com) + . Fixed buggy counting of affected rows when using the text protocol. The + collected statistics were wrong when multi_query was used with mysqlnd. + (Andrey) - OpenSSL extension: . Implemented FR #53447 (Cannot disable SessionTicket extension for servers diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index d4ccd00346..1d9ad8ddf8 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -1812,6 +1812,9 @@ MYSQLND_METHOD(mysqlnd_conn, next_result)(MYSQLND * const conn TSRMLS_DC) DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info.error_no, conn->error_info.error); } } + if (ret == PASS && conn->last_query_type == QUERY_UPSERT && conn->upsert_status.affected_rows) { + MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status.affected_rows); + } DBG_RETURN(ret); }