summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2004-12-07 19:12:29 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2004-12-07 19:12:29 +0200
commit5c7949af6b3e927854b14889940483b827553197 (patch)
treed3cca00e8433c3fd7930e0b647643f5218e0ef3f /libmysql/libmysql.c
parentf8cdf570979c550ef04c53f691118ed2b1296a7c (diff)
downloadmariadb-git-5c7949af6b3e927854b14889940483b827553197.tar.gz
Fix for a bug #6996
BitKeeper/etc/ignore: Added analyse.test client/mysqladmin.c to the ignore list libmysql/libmysql.c: Fix for a bug #6996 This fix enables that after all rows are read from a buffered result, mysql_stmt_data_seek(stmt,0) can rewind a counter to the beginning, so that rows can be re-fetched. tests/client_test.c: Addition of a test for fix of the bug #6996 in client_test.c
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index cb20c5181a8..99fa0299de9 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -4413,6 +4413,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
for (; tmp && row; --row, tmp= tmp->next)
;
stmt->data_cursor= tmp;
+ if (!row && tmp)
+ {
+ /* Rewind the counter */
+ stmt->read_row_func= stmt_read_row_buffered;
+ stmt->state= MYSQL_STMT_EXECUTE_DONE;
+ }
DBUG_VOID_RETURN;
}