]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.3' into PHP-5.4
authorandrey <andrey@php.net>
Wed, 16 May 2012 13:59:39 +0000 (15:59 +0200)
committerandrey <andrey@php.net>
Wed, 16 May 2012 13:59:39 +0000 (15:59 +0200)
Conflicts:
ext/mysqlnd/mysqlnd_ps.c

merge fix for bug#62046

1  2 
ext/mysqlnd/mysqlnd_ps.c

index 90e685654ba497fe3002160933e66fee931cfe8b,d762689a92f2087e215deb35cd63c7773f8bb182..1b48ba1d7b23c457f4eeedf1c33c5f3a614dd5b3
@@@ -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
                        }
                }
  
-               stmt->state = MYSQLND_STMT_PREPARED;
 +              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;
 +      }
 +      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
                                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);