Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80770 invoked from network); 24 Apr 2012 11:35:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2012 11:35:56 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:46748] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/18-34190-B10969F4 for ; Tue, 24 Apr 2012 07:35:55 -0400 Received: by eaao10 with SMTP id o10so124744eaa.29 for ; Tue, 24 Apr 2012 04:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=pGuP98/DTQwOnLeA76wwNPsXSLcLW/baOhjIbPbUMog=; b=Pg9G0VdxacxWzDL/6YLbSOMHcvKwLxj0WWTm6pc7APj4kweLa/Kp++vZ+w2mXJbYN1 FRuACGcBUWCzGcPEBcUYUeFPvQAJDTLWNkuDCS5ppkCudCIWEMfVCd7Stw8rKcTtXBW2 /Bdwsr7Hl2A68dg6YovdclDOdPdmIv8mB0BIwHpszQvxwesQsBn3/aRErSFzTA8toKJu K3a+9M5Ht30+EL973squms4jg5kyCLV1DFC/mnxLS/Ntfx7EKgcO1UZVIhhbicTSX+jl 8KLBS8EQZ1M6RMbBlrLBQwbuxpTPlFly/r0RsrNO8NfydIw4TzjhwWPtsRZGpJcGPLOF 2A7g== Received: by 10.213.19.193 with SMTP id c1mr235920ebb.295.1335267352589; Tue, 24 Apr 2012 04:35:52 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.213.29.83 with HTTP; Tue, 24 Apr 2012 04:35:12 -0700 (PDT) Date: Tue, 24 Apr 2012 13:35:12 +0200 X-Google-Sender-Auth: EVsM3XI_RBFvL7aXV46L0gB-spM Message-ID: To: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Expose mysqlnd API through all MySQL extensions From: jpauli@php.net (jpauli) Hi all, I'm actually putting my head into ext/mysqlnd and I noticed weird things about its API. As you should know, ext/mysqlnd is a replacement for libmysql, that is, all our 3 MySQL-related extensions may use it, and it is done by default for 5.4 branch. However, I've been surprised that ext/mysqlnd expose its API through ext/mysqli only... - mysqli_get_client_stats() - mysqli_get_connection_stats() - mysqli_get_cache_stats() 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. 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_****(). 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 ? I then suggest to expose ext/mysqlnd API through itself (http://lxr.php.net/xref/PHP_5_3/ext/mysqlnd/php_mysqlnd.c#33) in php_mysqlnd.c or create a new php_mysqlnd_fe.c For the actual functions, please refer to http://lxr.php.net/xref/PHP_5_3/ext/mysqli/mysqli_nonapi.c#392 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. Any ideas, comments ? Cheers, Julien