Commit: 4d2d8e871771be0342869e6710ef4e74346db1e7 Author: andrey <and...@php.net> Wed, 16 May 2012 15:59:39 +0200 Parents: 1abcd81872978026d269532c2f5f1e0f35dcb729 d4afbd487abbe9e5f3e4fc6c44974639e123406a Branches: PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4d2d8e871771be0342869e6710ef4e74346db1e7 Log: Merge branch 'PHP-5.3' into PHP-5.4 Conflicts: ext/mysqlnd/mysqlnd_ps.c merge fix for bug#62046 Bugs: https://bugs.php.net/62046 Changed paths: MM ext/mysqlnd/mysqlnd_ps.c Diff: diff --cc ext/mysqlnd/mysqlnd_ps.c index 90e6856,d762689..1b48ba1 --- 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); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php