List:Commits« Previous MessageNext Message »
From:jschlueter Date:March 11 2008 1:58pm
Subject:PHP mysqlnd svn commit: r1346 - trunk/php5/ext/pdo_mysqlnd
View as plain text  
Author: jschlueter
Date: 2008-03-11 14:58:40 +0100 (Tue, 11 Mar 2008)
New Revision: 1346

Modified:
   trunk/php5/ext/pdo_mysqlnd/config.m4
   trunk/php5/ext/pdo_mysqlnd/mysql_driver.c
   trunk/php5/ext/pdo_mysqlnd/mysql_statement.c
   trunk/php5/ext/pdo_mysqlnd/php_pdo_mysql_int.h
Log:
HAVE_MYSQLND is not defined anymore by mysqlnd use
PDO_USE_MYSQLND instead



Modified: trunk/php5/ext/pdo_mysqlnd/config.m4
===================================================================
--- trunk/php5/ext/pdo_mysqlnd/config.m4	2008-03-11 12:44:06 UTC (rev 1345)
+++ trunk/php5/ext/pdo_mysqlnd/config.m4	2008-03-11 13:58:40 UTC (rev 1346)
@@ -25,6 +25,7 @@
     AC_MSG_RESULT($pdo_inc_path)
   ])
 
+  AC_DEFINE([PDO_USE_MYSQLND], 1, [Whether pdo_mysql uses mysqlnd])
 
   PHP_NEW_EXTENSION(pdo_mysqlnd, pdo_mysql.c mysql_driver.c mysql_statement.c,
$ext_shared,,-I$pdo_inc_path -I)
   ifdef([PHP_ADD_EXTENSION_DEP],

Modified: trunk/php5/ext/pdo_mysqlnd/mysql_driver.c
===================================================================
--- trunk/php5/ext/pdo_mysqlnd/mysql_driver.c	2008-03-11 12:44:06 UTC (rev 1345)
+++ trunk/php5/ext/pdo_mysqlnd/mysql_driver.c	2008-03-11 13:58:40 UTC (rev 1346)
@@ -30,12 +30,12 @@
 #include "pdo/php_pdo_driver.h"
 #include "php_pdo_mysqlnd.h"
 #include "php_pdo_mysql_int.h"
-#ifndef HAVE_MYSQLND
+#ifndef PDO_USE_MYSQLND
 #include <mysqld_error.h>
 #endif
 #include "zend_exceptions.h"
 
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 #	define pdo_mysql_init(persistent) mysqlnd_init(persistent)
 #else
 #	define pdo_mysql_init(persistent) mysql_init(NULL)
@@ -167,7 +167,7 @@
 {
 	pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
 	pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	char *nsql = NULL;
 	int nsql_len = 0;
 	int ret;
@@ -182,7 +182,7 @@
 		goto end;
 	}
 
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	server_version = mysql_get_server_version(H->server);
 	if (server_version < 40100) {
 		goto fallback;
@@ -230,7 +230,7 @@
 	S->num_params = mysql_stmt_param_count(S->stmt);
 
 	if (S->num_params) {
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 		S->params = NULL;
 #else
 		S->params = ecalloc(S->num_params, sizeof(MYSQL_PARAM_BIND));
@@ -467,7 +467,7 @@
 #endif
 		;
 
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 	int dbname_len = 0;
 	int password_len = 0;
 #endif
@@ -573,7 +573,7 @@
 
 	/* TODO: - Use a zval cahce instead of NULL as last parameter */
 	/*       - Cehck whether PDO offers the strlens */
-#ifdef HAVE_MYSQLND
+#ifdef PDO_USE_MYSQLND
 	if (dbname) {
 		dbname_len = strlen(dbname);
 	}

Modified: trunk/php5/ext/pdo_mysqlnd/mysql_statement.c
===================================================================
--- trunk/php5/ext/pdo_mysqlnd/mysql_statement.c	2008-03-11 12:44:06 UTC (rev 1345)
+++ trunk/php5/ext/pdo_mysqlnd/mysql_statement.c	2008-03-11 13:58:40 UTC (rev 1346)
@@ -31,7 +31,7 @@
 #include "php_pdo_mysqlnd.h"
 #include "php_pdo_mysql_int.h"
 
-#ifdef HAVE_MYSQLND
+#ifdef PDO_USE_MYSQLND
 #	define pdo_free_bound_result(res) zval_dtor(res.zv);
 #	define pdo_mysql_stmt_close(stmt) mysqlnd_stmt_close(stmt, 0)
 #else
@@ -52,7 +52,7 @@
 		pefree(S->einfo.errmsg, stmt->dbh->is_persistent);
 		S->einfo.errmsg = NULL;
 	}
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (S->stmt) {
 		pdo_mysql_stmt_close(S->stmt);
 		S->stmt = NULL;
@@ -102,7 +102,7 @@
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
 	pdo_mysql_db_handle *H = S->H;
 	my_ulonglong row_count;
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (S->stmt) {
 		/* (re)bind the parameters */
 		if (mysqlnd_stmt_bind_param(S->stmt, S->params)) {
@@ -110,7 +110,7 @@
 			return 0;
 		}
 
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 		{
 			unsigned int i;
 			stmt->column_count = S->stmt->field_count;
@@ -127,7 +127,7 @@
 			return 0;
 		}
 
-#	if HAVE_MYSQLND
+#	if PDO_USE_MYSQLND
 		S->result = mysqlnd_stmt_result_metadata(S->stmt);
 		if (S->result) {
 			/* TODO: implement mysql_fetch_fields in mysqlnd instead of directly accesing it's
data structures */
@@ -265,7 +265,7 @@
 
 		if (!stmt->executed) {
 			stmt->column_count = (int) mysql_num_fields(S->result);
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 			/* TODO: implement mysql_fetch_fields in mysqlnd instead of directly accesing it's
data structures */
 			S->fields =  S->result->meta->fields;
 #else
@@ -341,7 +341,7 @@
 {
 	/* TODO: MAke sure the param is really free'D there seem to be leaks from 
  	* time to time from the parameter stack building */
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
 	PDO_MYSQL_PARAM_BIND *b;
 
@@ -353,14 +353,14 @@
 					strcpy(stmt->error_code, "HY093");
 					return 0;
 				}
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 				if (param->paramno == 0) {
 					S->params = ecalloc(S->num_params, sizeof(MYSQLND_PARAM_BIND));
 				}
 #endif
 				b = &S->params[param->paramno];
 				param->driver_data = b;
-#ifndef HAVE_MYSQLND
+#ifndef PDO_USE_MYSQLND
 				/* TODO: See also allocation of these in mysql_dricer.c */
 				b->is_null = &S->in_null[param->paramno];
 				b->length = &S->in_length[param->paramno];
@@ -370,7 +370,7 @@
 			case PDO_PARAM_EVT_EXEC_PRE:
 				b = (PDO_MYSQL_PARAM_BIND*)param->driver_data;
 
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 				if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL ||
 						Z_TYPE_P(param->parameter) == IS_NULL) {
 					b->type = MYSQL_TYPE_NULL;
@@ -415,7 +415,7 @@
 						;
 				}
 		
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 				/* Is it really correct to check the zval's type? - But well, that's what the old
code below does, too */
 				switch (Z_TYPE_P(param->parameter)) {
 					case IS_STRING:
@@ -461,7 +461,7 @@
 				}
 #endif
 		case PDO_PARAM_EVT_FREE:
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 			if (S->params) {
 /* TODO:				efree(S->params);*/
 			}
@@ -485,7 +485,7 @@
 	enum pdo_fetch_orientation ori, long offset TSRMLS_DC) /* {{{ */
 {
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 	zend_bool fetched_anything;
 
 	if (S->stmt) {
@@ -548,7 +548,7 @@
 	struct pdo_column_data *cols = stmt->columns;
 	unsigned int i;
 
-#if HAVE_MYSQLND_foobar
+#if PDO_USE_MYSQLND_foobar
         /* TODO ... I guess the right place would be the execute function to init some
stuff */
 	return 1;
 #endif
@@ -590,20 +590,20 @@
 	}
 
 	/* With mysqlnd data is stored inside mysqlnd, not S->current_data */
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (!S->stmt) {
 #endif
 		if (S->current_data == NULL || !S->result) {
 			return 0;
 		}
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	}
 #endif
 	if (colno >= stmt->column_count) {
 		/* error invalid column */
 		return 0;
 	}
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 	if (S->stmt) {
 		/*
  		TODO: PDO's fetch expects to get a string, so we cast to
@@ -754,7 +754,7 @@
 		mysql_free_result(S->result);
 		S->result = NULL;
 	}
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (S->stmt) {
 		int retval;
 		if (!S->H->buffered) {

Modified: trunk/php5/ext/pdo_mysqlnd/php_pdo_mysql_int.h
===================================================================
--- trunk/php5/ext/pdo_mysqlnd/php_pdo_mysql_int.h	2008-03-11 12:44:06 UTC (rev 1345)
+++ trunk/php5/ext/pdo_mysqlnd/php_pdo_mysql_int.h	2008-03-11 13:58:40 UTC (rev 1346)
@@ -22,7 +22,7 @@
 #ifndef PHP_PDO_MYSQL_INT_H
 #define PHP_PDO_MYSQL_INT_H
 
-#if defined(HAVE_MYSQLND)
+#if defined(PDO_USE_MYSQLND)
 #	include "ext/mysqlnd/mysqlnd.h"
 #	include "ext/mysql/mysql_mysqlnd.h"
 #	include "ext/mysqlnd/mysqlnd_libmysql_compat.h"
@@ -62,13 +62,13 @@
 	MYSQL_RES		*result;
 	MYSQL_FIELD		*fields;
 	MYSQL_ROW		current_data;
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 	unsigned long		*current_lengths;
 #else
 	long			*current_lengths;
 #endif
 	pdo_mysql_error_info einfo;
-#if HAVE_MYSQL_STMT_PREPARE || HAVE_MYSQLND
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	MYSQLND_STMT 		*stmt;
 	
 	int num_params;
@@ -78,7 +78,7 @@
 	PDO_MYSQL_PARAM_BIND	*bound_result;
 	my_bool			*out_null;
 	unsigned long		*out_length;
-#if HAVE_MYSQLND
+#if PDO_USE_MYSQLND
 	 MYSQLND_RESULT_BIND 	*result_bind;
 #endif
 	unsigned		max_length:1;

Thread
PHP mysqlnd svn commit: r1346 - trunk/php5/ext/pdo_mysqlndjschlueter12 Mar