wez Fri Jul 8 23:54:13 2005 EDT Modified files: /php-src/ext/pdo_mysql mysql_statement.c Log: Fix two bugs: - execute() would not re-fetch meta data after nextRowset() had been called. - buffered mode would only be enabled on the first execute on a statement handle. http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.30&r2=1.31&ty=u Index: php-src/ext/pdo_mysql/mysql_statement.c diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.30 php-src/ext/pdo_mysql/mysql_statement.c:1.31 --- php-src/ext/pdo_mysql/mysql_statement.c:1.30 Thu Jul 7 13:53:34 2005 +++ php-src/ext/pdo_mysql/mysql_statement.c Fri Jul 8 23:54:13 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mysql_statement.c,v 1.30 2005/07/07 17:53:34 iliaa Exp $ */ +/* $Id: mysql_statement.c,v 1.31 2005/07/09 03:54:13 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -91,17 +91,13 @@ return 0; } - if (!stmt->executed) { + if (!S->result) { /* figure out the result set format, if any */ S->result = mysql_stmt_result_metadata(S->stmt); if (S->result) { S->fields = mysql_fetch_fields(S->result); stmt->column_count = (int)mysql_num_fields(S->result); - if (H->buffered) { - mysql_stmt_store_result(S->stmt); - } - S->bound_result = ecalloc(stmt->column_count, sizeof(MYSQL_BIND)); S->out_null = ecalloc(stmt->column_count, sizeof(my_bool)); S->out_length = ecalloc(stmt->column_count, sizeof(unsigned long)); @@ -121,6 +117,11 @@ } } } + + /* if buffered, pre-fetch all the data */ + if (H->buffered) { + mysql_stmt_store_result(S->stmt); + } stmt->row_count = mysql_stmt_affected_rows(S->stmt); return 1;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php