From 00e493d0ed990abeece6ae5dc06cb3d634b65bfe Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 7 Feb 2012 17:07:45 -0500 Subject: Fix off-by-one when selecting previous rows in port driver. --- src/mysqlerl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mysqlerl.c b/src/mysqlerl.c index 431b8cd..0ee04ed 100644 --- a/src/mysqlerl.c +++ b/src/mysqlerl.c @@ -666,7 +666,7 @@ handle_prev(ETERM *msg) ecols = make_cols(fields, num_fields); logmsg("resultoffset: %d, num_rows: %d", resultoffset, numrows); - if (resultoffset == 1) { + if (resultoffset <= 1) { resp = erl_format("{selected, ~w, []}", ecols); } else { resultoffset = resultoffset - 1; -- cgit v1.2.3