Ulf Wendel

PHP: Is mysqlnd stable?

Is mysqlnd stable, is mysqlnd ready for wider consumption? Judging from the latest set of tests: yes!

During the development of mysqlnd, the MySQL native driver for PHP – an alternative to libmysql, a good number of new tests have been written. Let’s see how ext/mysql and ext/mysqli perform when running the test suite. Please note that this is a snapshot and figures might be slightly different when you repeat the test runs: mysqlnd is under constant development and your setup is likely to differ from mine.

PHP 6 , MySQL 5.1.15-beta

  Number of Tests Warned Failed Passed Code Coverage
HEAD @ libmysql 102 (+4 skipped) 0 0.0% 16 15.7 % 86 84.3 % 83.5 %
SVN @ libmysql 102 (+4 skipped) 0 0.0% 1 1.0 % 101 99 % 87.8 %
SVN @ mysqlnd 102 (+4 skipped) 0 0.0% 1 1.0 % 101 99 % 88.0 %
  Number of Tests Warned Failed Passed Code Coverage
HEAD @ libmysql 520 (+46 skipped) 2 0.4% 127 24.4 % 391 75.2 % 91.9 %
SVN @ libmysql 475 (+91 skipped) 2 0.4% 26 5.5 % 447 94.1 % 88.9 %
SVN @ mysqlnd 502 (+64 skipped ) 2 0.4% 16 3.2 % 484 96.4 % 91.6 %

For the test, I have checked out the latest version of PHP 6 (HEAD) from php.net. To test mysqlnd, I have replaced the ext/mysql and ext/mysqli directories of the PHP 6 tree with the correspondending code from the mysqlnd SVN repository. PHP has been compiled with --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-debug --enable-gcov --enable-pcntl for the libmysql based binaries and --with-mysql=mysqlnd --with-mysqli=mysqlnd --enable-debug --enable-gcov --enable-pcntl for the mysqlnd based binaries. The binaries have been tested against the latest set of tests that can be found in the mysqlnd SVN repository. The PHP test script run-tests.php has been invoked as follows: sapi/cli/php run-tests.php -U ext/mysqli/tests to run the tests in unicode and non-unicode mode.

As you can see, the SVN development repository of mysqlnd fails on less tests than PHP HEAD does. Don’t be afraid of the relatively high number of tests failures of HEAD @ libmysql @ ext/mysqli. First, it is the -U switch which makes a single issue appear twice in the statistics (1x unicode, 1x non-unicode), second and foremost, see how SVN @ libmysql @ ext/mysqli has been stabilized.

It’s time to merge mysqlnd into HEAD. We have far less test failures with the code from the mysqlnd SVN repository than with HEAD. And we have less issues with mysqlnd than with libmysql. It’s time to ask you to test mysqlnd.

By the way, note the code coverage figures and compare them to the current figures. With the new tests the ext/mysql code coverage has been increased from about 28% to ~85%, and ext/mysqli code coverage has gone up from 62.0% to ~90%.

Comments are closed.