mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
Merge pull request #3514 from vegansk/3513_pgsql_prepstat
Fixed issue 3513: wrong setupQuery realization
This commit is contained in:
@@ -167,11 +167,7 @@ proc newRow(L: int): Row =
|
||||
|
||||
proc setupQuery(db: DbConn, query: SqlQuery,
|
||||
args: varargs[string]): PPGresult =
|
||||
# s is a dummy unique id str for each setupQuery query
|
||||
let s = "setupQuery_Query_" & string(query)
|
||||
var res = pqprepare(db, s, dbFormat(query, args), 0, nil)
|
||||
result = pqexecPrepared(db, s, 0, nil,
|
||||
nil, nil, 0)
|
||||
result = pqexec(db, dbFormat(query, args))
|
||||
if pqResultStatus(result) != PGRES_TUPLES_OK: dbError(db)
|
||||
|
||||
proc setupQuery(db: DbConn, stmtName: SqlPrepared,
|
||||
@@ -380,4 +376,4 @@ proc setEncoding*(connection: DbConn, encoding: string): bool {.
|
||||
return pqsetClientEncoding(connection, encoding) == 0
|
||||
|
||||
|
||||
# Tests are in ../../tests/untestable/tpostgres.
|
||||
# Tests are in ../../tests/untestable/tpostgres.
|
||||
|
||||
Reference in New Issue
Block a user