From: andrey Date: Wed, 16 May 2012 13:59:39 +0000 (+0200) Subject: Merge branch 'PHP-5.3' into PHP-5.4 X-Git-Tag: php-5.4.4RC2~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d2d8e871771be0342869e6710ef4e74346db1e7;p=php Merge branch 'PHP-5.3' into PHP-5.4 Conflicts: ext/mysqlnd/mysqlnd_ps.c merge fix for bug#62046 --- 4d2d8e871771be0342869e6710ef4e74346db1e7 diff --cc ext/mysqlnd/mysqlnd_ps.c index 90e685654b,d762689a92..1b48ba1d7b --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@@ -636,9 -657,9 +636,11 @@@ MYSQLND_METHOD(mysqlnd_stmt, execute)(M have it again. */ stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC); ++ ++ stmt->state = MYSQLND_STMT_PREPARED; } else if (stmt->state < MYSQLND_STMT_PREPARED) { /* Only initted - error */ - SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, + SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); SET_STMT_ERROR(stmt, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); DBG_INF("FAIL"); @@@ -1205,45 -1233,6 +1207,43 @@@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYS } } + s->m->flush(s TSRMLS_CC); + + /* + Don't free now, let the result be usable. When the stmt will again be + executed then the result set will be cleaned, the bound variables will + be separated before that. + */ + + int4store(cmd_buf, stmt->stmt_id); + if (CONN_GET_STATE(conn) == CONN_READY && + FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf, + sizeof(cmd_buf), PROT_OK_PACKET, + FALSE, TRUE TSRMLS_CC))) { + COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); + } + *stmt->upsert_status = *conn->upsert_status; - - stmt->state = MYSQLND_STMT_PREPARED; + } + DBG_INF(ret == PASS? "PASS":"FAIL"); + DBG_RETURN(ret); +} +/* }}} */ + + +/* {{{ mysqlnd_stmt::flush */ +static enum_func_status +MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC) +{ + MYSQLND_STMT_DATA * stmt = s? s->data:NULL; + enum_func_status ret = PASS; + + DBG_ENTER("mysqlnd_stmt::flush"); + if (!stmt || !stmt->conn) { + DBG_RETURN(FAIL); + } + DBG_INF_FMT("stmt=%lu", stmt->stmt_id); + + if (stmt->stmt_id) { /* If the user decided to close the statement right after execute() We have to call the appropriate use_result() or store_result() and @@@ -1261,8 -1250,21 +1261,6 @@@ stmt->result->m.skip_result(stmt->result TSRMLS_CC); } } while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS); -- - stmt->state = MYSQLND_STMT_PREPARED; - /* - Don't free now, let the result be usable. When the stmt will again be - executed then the result set will be cleaned, the bound variables will - be separated before that. - */ - - int4store(cmd_buf, stmt->stmt_id); - if (CONN_GET_STATE(conn) == CONN_READY && - FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, (char *)cmd_buf, - sizeof(cmd_buf), PROT_OK_PACKET, - FALSE, TRUE TSRMLS_CC))) { - stmt->error_info = conn->error_info; - } - stmt->upsert_status = conn->upsert_status; } DBG_INF(ret == PASS? "PASS":"FAIL"); DBG_RETURN(ret);