Author: ahristov
Date: 2007-07-19 14:58:12 +0200 (Thu, 19 Jul 2007)
New Revision: 798
Modified:
trunk/mysqlnd/mysqlnd_priv.h
trunk/mysqlnd/mysqlnd_result.c
trunk/tests/ext/mysqli/mysqli_info.phpt
Log:
get mysqli_info test fixed and also reset last_message
if the command is SELECT
Modified: trunk/mysqlnd/mysqlnd_priv.h
===================================================================
--- trunk/mysqlnd/mysqlnd_priv.h 2007-07-19 12:08:39 UTC (rev 797)
+++ trunk/mysqlnd/mysqlnd_priv.h 2007-07-19 12:58:12 UTC (rev 798)
@@ -112,7 +112,7 @@
#define SET_NEW_MESSAGE(buf, buf_len, message, len) \
{\
if ((buf)) { \
- efree(buf); \
+ efree((buf)); \
} \
(buf) = (message); \
(buf_len) = (len); \
@@ -120,6 +120,16 @@
(message) = NULL; \
}
+#define SET_EMPTY_MESSAGE(buf, buf_len) \
+ {\
+ if ((buf)) { \
+ efree((buf)); \
+ (buf) = NULL; \
+ } \
+ (buf_len) = 0; \
+ }
+
+
#define SET_EMPTY_ERROR(error_info) \
{ \
error_info.error_no = 0; \
Modified: trunk/mysqlnd/mysqlnd_result.c
===================================================================
--- trunk/mysqlnd/mysqlnd_result.c 2007-07-19 12:08:39 UTC (rev 797)
+++ trunk/mysqlnd/mysqlnd_result.c 2007-07-19 12:58:12 UTC (rev 798)
@@ -284,6 +284,8 @@
MYSQLND_RES *result;
uint stat = -1;
+ SET_EMPTY_MESSAGE(conn->last_message, conn->last_message_len);
+
MYSQLND_INC_CONN_STATISTIC(&conn->stats, STAT_RSET_QUERY);
memset(&conn->upsert_status, 0, sizeof(conn->upsert_status));
conn->last_query_type = QUERY_SELECT;
Modified: trunk/tests/ext/mysqli/mysqli_info.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_info.phpt 2007-07-19 12:08:39 UTC (rev 797)
+++ trunk/tests/ext/mysqli/mysqli_info.phpt 2007-07-19 12:58:12 UTC (rev 798)
@@ -63,9 +63,9 @@
/* ignore this error */
break;
- if (!fwrite($fp, "100;'a';\n") ||
- !fwrite($fp, "101;'b';\n") ||
- !fwrite($fp, "102;'c';\n")) {
+ if (!fwrite($fp, b"100;'a';\n") ||
+ !fwrite($fp, b"101;'b';\n") ||
+ !fwrite($fp, b"102;'c';\n")) {
@unlink($file);
break;
}
@@ -91,4 +91,4 @@
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
| Thread |
|---|
| • PHP mysqlnd svn commit: r798 - in trunk: mysqlnd tests/ext/mysqli | ahristov | 19 Jul |