Skip to content
Snippets Groups Projects
Commit 2df445f9 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

fixes #2645 by returning an empty vector in the case where a query results in no rows.

parent 67073c73
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@
(into [sql] params)
sql)]
(let [[columns & rows] (jdbc/query t-conn statement, :identifiers identity, :as-arrays? true)]
{:rows rows
{:rows (or rows [])
:columns columns}))))
(catch java.sql.SQLException e
(let [^String message (or (->> (.getMessage e) ; error message comes back like 'Column "ZID" not found; SQL statement: ... [error-code]' sometimes
......
......@@ -328,7 +328,7 @@
(into [sql] params)
sql)]
(let [[columns & rows] (jdbc/query t-conn statement, :identifiers identity, :as-arrays? true)]
{:rows rows
{:rows (or rows [])
:columns columns}))
;; Rollback any changes made during this transaction just to be extra-double-sure JDBC doesn't try to commit them automatically for us
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment