From 1b47941b01c69ef2accf11622887de3a27d26c1c Mon Sep 17 00:00:00 2001 From: JamesP Date: Fri, 28 Aug 2015 22:51:35 +1000 Subject: [PATCH] fixes #3220 lib/impure/db_mysql.nim getValue() mysql connector command out of sync error due to breaking the fastRows iterator loop --- lib/impure/db_mysql.nim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/impure/db_mysql.nim b/lib/impure/db_mysql.nim index 7c2901efd..197286f29 100644 --- a/lib/impure/db_mysql.nim +++ b/lib/impure/db_mysql.nim @@ -206,10 +206,7 @@ proc getValue*(db: DbConn, query: SqlQuery, ## executes the query and returns the first column of the first row of the ## result dataset. Returns "" if the dataset contains no rows or the database ## value is NULL. - result = "" - for row in fastRows(db, query, args): - result = row[0] - break + result = getRow(db, query, args)[0] proc tryInsertId*(db: DbConn, query: SqlQuery, args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} =