summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_result.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2008-02-06 14:11:32 +0000
committerAndrey Hristov <andrey@php.net>2008-02-06 14:11:32 +0000
commit0c65a68fc9c545a62ae7b0d2fc61b19441284379 (patch)
tree83bacc229c3ca51b08c721c630a28306b2341589 /ext/mysqlnd/mysqlnd_result.c
parentbb4051d4806557c287c870539bd77bdc82d0adae (diff)
downloadphp-git-0c65a68fc9c545a62ae7b0d2fc61b19441284379.tar.gz
Fix a bug and a test
Diffstat (limited to 'ext/mysqlnd/mysqlnd_result.c')
-rw-r--r--ext/mysqlnd/mysqlnd_result.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index 46d47893e5..0d4804f50a 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -372,7 +372,6 @@ static
void mysqlnd_internal_free_result(MYSQLND_RES *result TSRMLS_DC)
{
DBG_ENTER("mysqlnd_internal_free_result");
-
result->m.free_result_contents(result TSRMLS_CC);
if (result->conn) {
@@ -439,6 +438,7 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT *stmt TSRMLS_DC
ret = FAIL;
PACKET_INIT_ALLOCA(rset_header, PROT_RSET_HEADER_PACKET);
do {
+ SET_ERROR_AFF_ROWS(conn);
if (FAIL == (ret = PACKET_READ_ALLOCA(rset_header, conn))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading result set's header");
break;
@@ -455,7 +455,6 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT *stmt TSRMLS_DC
safe to unconditionally turn off the flag here.
*/
conn->upsert_status.server_status &= ~SERVER_MORE_RESULTS_EXISTS;
- conn->upsert_status.affected_rows = -1;
/*
This will copy the error code and the messages, as they
are buffers in the struct
@@ -507,6 +506,9 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT *stmt TSRMLS_DC
MYSQLND_INC_CONN_STATISTIC(&conn->stats, STAT_RSET_QUERY);
memset(&conn->upsert_status, 0, sizeof(conn->upsert_status));
+ /* restore after zeroing */
+ SET_ERROR_AFF_ROWS(conn);
+
conn->last_query_type = QUERY_SELECT;
CONN_SET_STATE(conn, CONN_FETCHING_DATA);
/* PS has already allocated it */