Index: ext/pdo_mysql/mysql_driver.c
--- ext/pdo_mysql/mysql_driver.c.orig	2015-12-01 14:36:34.000000000 +0100
+++ ext/pdo_mysql/mysql_driver.c	2015-12-02 20:17:51.198927871 +0100
@@ -724,7 +724,7 @@
 			}
 		}
 
-#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND)
+#if MYSQL_VERSION_ID > 50605 && defined(PDO_USE_MYSQLND)
 		{
 			zend_string *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL);
 			if (public_key) {
Index: ext/pdo_mysql/pdo_mysql.c
--- ext/pdo_mysql/pdo_mysql.c.orig	2015-12-02 20:17:51.198927000 +0100
+++ ext/pdo_mysql/pdo_mysql.c	2015-12-02 20:24:30.589062022 +0100
@@ -126,7 +126,7 @@
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_CA", (zend_long)PDO_MYSQL_ATTR_SSL_CA);
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_CAPATH", (zend_long)PDO_MYSQL_ATTR_SSL_CAPATH);
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_CIPHER", (zend_long)PDO_MYSQL_ATTR_SSL_CIPHER);
-#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND)
+#if MYSQL_VERSION_ID > 50605 && defined(PDO_USE_MYSQLND)
 	 REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SERVER_PUBLIC_KEY", (zend_long)PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY);
 #endif
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MULTI_STATEMENTS", (zend_long)PDO_MYSQL_ATTR_MULTI_STATEMENTS);
Index: ext/pdo_mysql/php_pdo_mysql_int.h
--- ext/pdo_mysql/php_pdo_mysql_int.h.orig	2015-12-01 14:36:34.000000000 +0100
+++ ext/pdo_mysql/php_pdo_mysql_int.h	2015-12-02 20:17:51.208953657 +0100
@@ -175,7 +175,7 @@
 	PDO_MYSQL_ATTR_SSL_CA,
 	PDO_MYSQL_ATTR_SSL_CAPATH,
 	PDO_MYSQL_ATTR_SSL_CIPHER,
-#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND)
+#if MYSQL_VERSION_ID > 50605 && defined(PDO_USE_MYSQLND)
 	PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY,
 #endif
 	PDO_MYSQL_ATTR_MULTI_STATEMENTS,
