Skip to content

Commit f85ae48

Browse files
committed
Fixed ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
There is a constant now which only is there when mysqli with mysqlnd and pdo_mysql was compiled at the same time, or when libmysql version > 50605. So checking for that dynamically, will fail only if there is no mysqli and no connection.
1 parent 01f1894 commit f85ae48

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
2929
$expected['MYSQL_ATTR_READ_DEFAULT_GROUP'] = true;
3030
}
3131

32+
if (extension_loaded('mysqli') && stristr(mysqli_get_client_info(), "mysqlnd")
33+
|| MySQLPDOTest::getClientVersion(MySQLPDOTest::factory()) > 50605) {
34+
/* XXX the MySQL client library version isn't exposed with any
35+
constants, the single possibility is to use the PDO::getAttribute().
36+
This however will fail with no connection. */
37+
$expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
38+
}
39+
3240
/*
3341
TODO
3442

0 commit comments

Comments
 (0)