Author: grichter
Date: 2007-03-22 08:13:25 +0100 (Thu, 22 Mar 2007)
New Revision: 247
Modified:
trunk/ext/mysqli/mysqli.c
trunk/ext/mysqli/mysqli_api.c
Log:
fixed leak for bind parameter
fixed null support for unicode
Modified: trunk/ext/mysqli/mysqli.c
===================================================================
--- trunk/ext/mysqli/mysqli.c 2007-03-22 06:17:33 UTC (rev 246)
+++ trunk/ext/mysqli/mysqli.c 2007-03-22 07:13:25 UTC (rev 247)
@@ -1041,7 +1041,16 @@
add_index_null(return_value, i);
}
if (fetchtype & MYSQLI_ASSOC) {
- add_assoc_null(return_value, fields[i].name);
+ if (UG(unicode)) {
+ UChar *ustr;
+ int ulen;
+
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, fields[i].name,
strlen(fields[i].name) TSRMLS_CC);
+ add_u_assoc_null(return_value, IS_UNICODE, ZSTR(ustr));
+ efree(ustr);
+ } else {
+ add_assoc_null(return_value, fields[i].name);
+ }
}
}
}
Modified: trunk/ext/mysqli/mysqli_api.c
===================================================================
--- trunk/ext/mysqli/mysqli_api.c 2007-03-22 06:17:33 UTC (rev 246)
+++ trunk/ext/mysqli/mysqli_api.c 2007-03-22 07:13:25 UTC (rev 247)
@@ -751,7 +751,7 @@
/* free converted utf8 strings */
if (UG(unicode)) {
for (i = 0; i < stmt->param.var_cnt; i++) {
- if (stmt->stmt->params[i].buffer_type == MYSQL_TYPE_VAR_STRING) {
+ if (stmt->stmt->params[i].buffer_type == MYSQL_TYPE_VAR_STRING &&
Z_TYPE_P(stmt->param.vars[i]) == IS_UNICODE) {
efree(stmt->stmt->params[i].buffer);
}
}
| Thread |
|---|
| • PHP mysqlnd svn commit: r247 - trunk/ext/mysqli | grichter | 22 Mar |