#endif
#include "zend_exceptions.h"
-#if PDO_USE_MYSQLND
+#if defined(PDO_USE_MYSQLND)
# define pdo_mysql_init(persistent) mysqlnd_init(persistent)
#else
# define pdo_mysql_init(persistent) mysql_init(NULL)
if (S->num_params) {
S->params_given = 0;
-#if PDO_USE_MYSQLND
+#if defined(PDO_USE_MYSQLND)
S->params = NULL;
#else
S->params = ecalloc(S->num_params, sizeof(MYSQL_BIND));
break;
case PDO_ATTR_SERVER_INFO: {
char *tmp;
-#if PDO_USE_MYSQLND
+#if defined(PDO_USE_MYSQLND)
unsigned int tmp_len;
if (mysqlnd_stat(H->server, &tmp, &tmp_len) == PASS) {
#endif
;
-#if PDO_USE_MYSQLND
+#if defined(PDO_USE_MYSQLND)
int dbname_len = 0;
int password_len = 0;
#endif
{
local_infile = 0;
}
-#ifdef MYSQL_OPT_LOCAL_INFILE
+#if defined(MYSQL_OPT_LOCAL_INFILE) || defined(PDO_USE_MYSQLND)
if (mysql_options(H->server, MYSQL_OPT_LOCAL_INFILE, (const char *)&local_infile)) {
pdo_mysql_error(dbh);
goto cleanup;
#endif
#ifdef MYSQL_OPT_RECONNECT
/* since 5.0.3, the default for this option is 0 if not specified.
- * we want the old behaviour */
+ * we want the old behaviour
+ * mysqlnd doesn't support reconnect, thus we don't have "|| defined(PDO_USE_MYSQLND)"
+ */
{
long reconnect = 1;
mysql_options(H->server, MYSQL_OPT_RECONNECT, (const char*)&reconnect);