fixes #3220 lib/impure/db_mysql.nim getValue()

mysql connector command out of sync error due to
breaking the fastRows iterator loop
This commit is contained in:
JamesP 2015-08-28 22:51:35 +10:00
commit 1b47941b01

View file

@ -206,10 +206,7 @@ proc getValue*(db: DbConn, query: SqlQuery,
## executes the query and returns the first column of the first row of the ## 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 ## result dataset. Returns "" if the dataset contains no rows or the database
## value is NULL. ## value is NULL.
result = "" result = getRow(db, query, args)[0]
for row in fastRows(db, query, args):
result = row[0]
break
proc tryInsertId*(db: DbConn, query: SqlQuery, proc tryInsertId*(db: DbConn, query: SqlQuery,
args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} = args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} =