List:Commits« Previous MessageNext Message »
From:ahristov Date:July 5 2007 3:40pm
Subject:PHP mysqlnd svn commit: r652 - in trunk/php6/ext: mysql mysqli
View as plain text  
Author: ahristov
Date: 2007-07-05 17:40:14 +0200 (Thu, 05 Jul 2007)
New Revision: 652

Modified:
   trunk/php6/ext/mysql/php_mysql.c
   trunk/php6/ext/mysqli/mysqli.c
Log:
One more bites the dust. If data is binary, return
binary


Modified: trunk/php6/ext/mysql/php_mysql.c
===================================================================
--- trunk/php6/ext/mysql/php_mysql.c	2007-07-05 15:28:19 UTC (rev 651)
+++ trunk/php6/ext/mysql/php_mysql.c	2007-07-05 15:40:14 UTC (rev 652)
@@ -1902,9 +1902,9 @@
 #define MYSQL_BINARY_CHARSET_NR 63
 
 #define IS_BINARY_DATA(f) (((f)->type == MYSQL_TYPE_TINY_BLOB || (f)->type ==
MYSQL_TYPE_BLOB || \
-				(f)->type == MYSQL_TYPE_MEDIUM_BLOB || (f)->type == MYSQL_TYPE_LONG_BLOB || \
-				(f)->type == MYSQL_TYPE_BIT || (f)->type == MYSQL_TYPE_VAR_STRING || \
-				(f)->type == MYSQL_TYPE_VARCHAR) && (f)->charsetnr ==
MYSQL_BINARY_CHARSET_NR)
+	(f)->type == MYSQL_TYPE_MEDIUM_BLOB || (f)->type == MYSQL_TYPE_LONG_BLOB || \
+	(f)->type == MYSQL_TYPE_BIT || (f)->type == MYSQL_TYPE_VAR_STRING || \
+	(f)->type == MYSQL_TYPE_VARCHAR || (f)->type == MYSQL_TYPE_STRING)&&
(f)->charsetnr == MYSQL_BINARY_CHARSET_NR)
 
 /* {{{ php_mysql_fetch_hash
  */

Modified: trunk/php6/ext/mysqli/mysqli.c
===================================================================
--- trunk/php6/ext/mysqli/mysqli.c	2007-07-05 15:28:19 UTC (rev 651)
+++ trunk/php6/ext/mysqli/mysqli.c	2007-07-05 15:40:14 UTC (rev 652)
@@ -965,6 +965,14 @@
 }
 /* }}} */
 
+#define MYSQL_BINARY_CHARSET_NR 63
+
+#define IS_BINARY_DATA(f) (((f).type == MYSQL_TYPE_TINY_BLOB || (f).type ==
MYSQL_TYPE_BLOB || \
+	(f).type == MYSQL_TYPE_MEDIUM_BLOB || (f).type == MYSQL_TYPE_LONG_BLOB || \
+	(f).type == MYSQL_TYPE_BIT || (f).type == MYSQL_TYPE_VAR_STRING || (f).type ==
MYSQL_TYPE_VARCHAR ||\
+	(f).type == MYSQL_TYPE_STRING) && (f).charsetnr == MYSQL_BINARY_CHARSET_NR)
+
+
 /* {{{ php_mysqli_fetch_into_hash
  */
 void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags, int
into_object)
@@ -1025,9 +1033,7 @@
 		RETURN_NULL();
 	}
 
-	if (fetchtype & MYSQLI_ASSOC) {
-		fields = mysql_fetch_fields(result);
-	}
+	fields = mysql_fetch_fields(result);
 
 	array_init(return_value);
 	field_len = mysql_fetch_lengths(result);
@@ -1038,7 +1044,7 @@
 
 			MAKE_STD_ZVAL(res);
 
-			if (UG(unicode)) {
+			if (UG(unicode) && !IS_BINARY_DATA(fields[i])) {
 				UChar *ustr;
 				int ulen;
 

Thread
PHP mysqlnd svn commit: r652 - in trunk/php6/ext: mysql mysqliahristov5 Jul