Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60271 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84147 invoked from network); 24 Apr 2012 12:06:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2012 12:06:53 -0000 Authentication-Results: pb1.pair.com header.from=johannes.schlueter@oracle.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=johannes.schlueter@oracle.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracle.com designates 141.146.126.227 as permitted sender) X-PHP-List-Original-Sender: johannes.schlueter@oracle.com X-Host-Fingerprint: 141.146.126.227 acsinet15.oracle.com Received: from [141.146.126.227] ([141.146.126.227:36633] helo=acsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/A8-34190-B57969F4 for ; Tue, 24 Apr 2012 08:06:52 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q3OC6kPp004788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 24 Apr 2012 12:06:49 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q3OC6k8e010414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Apr 2012 12:06:46 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q3OC6jE3028288; Tue, 24 Apr 2012 07:06:45 -0500 Received: from [192.168.2.230] (/88.217.90.125) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 24 Apr 2012 05:06:45 -0700 To: jpauli Cc: PHP Internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Organization: Oracle Corporation Date: Tue, 24 Apr 2012 14:06:42 +0200 Message-ID: <1335269202.13732.34.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] Subject: Re: [PHP-DEV] Expose mysqlnd API through all MySQL extensions From: johannes.schlueter@oracle.com (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Tue, 2012-04-24 at 13:35 +0200, jpauli wrote: > - mysqli_get_client_stats() > - mysqli_get_connection_stats() > - mysqli_get_cache_stats() >=20 > Those three functions are ext/mysqlnd related, they are #ifdef 'ed in > the source code of ext/mysqli and not defined if ext/mysqli has been > compiled against libmysql. With libmysql we don't have the statistics, therefore they are useless. > There is a mismatch in the naming and the place here, those 3 > functions should be part of ext/mysqlnd API, and be named > mysqlnd_****(). Until 5.4 we couldn't do "mysqlnd_get_connection_stats" as there was no way to get from an arbitrary zval (PDO or mysqli object, mysql resource) to the corresponding MYSQLND*. The other reason is that one idea for mysqlnd was that it doesn't expose anything to the userland while ext/mysql is legacy and get's no additions and PDO would allow user-defined functions,while that's not really nice. > What if I choose to only compile pdo_mysql (against mysqlnd) and not > mysqli ?? I then would be able to use mysqlnd, but I would have access > to its statistics, as its functions are part of ext/mysqli... Strange > as well as embarrassing isn't it ? You simply shouldn't do that ;-) > Second, I would suggest to add a function that would reset the global > stat counter. The only way to do it actually is by passing in MINIT(), > so by restarting PHP ; it may be useful, and not very hard to develop, > to create a mysqlnd_stats_reset($someOptionsIfNeeded) function. >=20 > Any ideas, comments ? Feel free to open a ticket in the bug tracker and assign it to us (mysql user). johannes --=20 Johannes Schl=C3=BCter, MySQL Engineering Connectors and Client Connectivit= y ORACLE Deutschland B.V. & Co. KG, Riesstr. 25, D-80992 M=C3=BCnchen