summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2015-11-11 16:09:18 +0000
committerDominik Picheta <dominikpicheta@googlemail.com>2015-11-11 16:09:18 +0000
commit29fd3edb9cf15146dae18bcdc74ae08bb0b1d86e (patch)
treebee6893caf533750b25c588c154ccdd9d8aa2100 /lib
parentf9ad735e55d45d6a3ed7e9e7da7abd31065f99ac (diff)
parentc0179043639ceab4f146fda2eec906fc30740b4b (diff)
downloadNim-29fd3edb9cf15146dae18bcdc74ae08bb0b1d86e.tar.gz
Merge pull request #3514 from vegansk/3513_pgsql_prepstat
Fixed issue 3513: wrong setupQuery realization
Diffstat (limited to 'lib')
-rw-r--r--lib/impure/db_postgres.nim8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim
index 7e6219465..5603d9686 100644
--- a/lib/impure/db_postgres.nim
+++ b/lib/impure/db_postgres.nim
@@ -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.
\ No newline at end of file
+# Tests are in ../../tests/untestable/tpostgres.