Fixes segfault in db_sqlite. Fixes problems with times.format.
This commit is contained in:
parent
5a83bd8812
commit
8f3dc6ebd3
2 changed files with 58 additions and 17 deletions
|
|
@ -128,8 +128,10 @@ proc GetValue*(db: TDbConn, query: TSqlQuery,
|
|||
## executes the query and returns the result dataset's the first column
|
||||
## of the first row. Returns "" if the dataset contains no rows.
|
||||
var stmt = setupQuery(db, query, args)
|
||||
if step(stmt) == SQLITE_ROW:
|
||||
result = newStringOfCap(column_bytes(stmt, 0))
|
||||
if step(stmt) == SQLITE_ROW:
|
||||
let cb = column_bytes(stmt, 0)
|
||||
if cb == 0: return ""
|
||||
result = newStringOfCap(cb)
|
||||
add(result, column_text(stmt, 0))
|
||||
if finalize(stmt) != SQLITE_OK: dbError(db)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue