Fix missing *pg-dbname* in CSV processing, resulting in broken logging.

This commit is contained in:
Dimitri Fontaine 2013-12-25 16:50:14 +01:00
parent 7d94d4ff62
commit cd1d5ad597
2 changed files with 17 additions and 15 deletions

View File

@ -1567,6 +1567,7 @@ load database
(*pgconn-port* ,port)
(*pgconn-user* ,user)
(*pgconn-pass* ,password)
(*pg-dbname* ,dbname)
(*pg-settings* ',gucs))
(progn

View File

@ -215,21 +215,22 @@
given DBNAME and TABLE-NAME"
(let ((result (gensym "result"))
(secs (gensym "secs")))
`(prog2
(pgstate-add-table ,pgstate ,dbname ,table-name)
(multiple-value-bind (,result ,secs)
(timing ,@forms)
(cond ((and ,use-result-as-read ,use-result-as-rows)
(pgstate-incf ,pgstate ,table-name
:read ,result :rows ,result :secs ,secs))
(,use-result-as-read
(pgstate-incf ,pgstate ,table-name :read ,result :secs ,secs))
(,use-result-as-rows
(pgstate-incf ,pgstate ,table-name :rows ,result :secs ,secs))
(t
(pgstate-incf ,pgstate ,table-name :secs ,secs)))
,result)
(when ,summary (report-summary)))))
`(let ((*pg-dbname* (or ,dbname *pg-dbname*)))
(prog2
(pgstate-add-table ,pgstate *pg-dbname* ,table-name)
(multiple-value-bind (,result ,secs)
(timing ,@forms)
(cond ((and ,use-result-as-read ,use-result-as-rows)
(pgstate-incf ,pgstate ,table-name
:read ,result :rows ,result :secs ,secs))
(,use-result-as-read
(pgstate-incf ,pgstate ,table-name :read ,result :secs ,secs))
(,use-result-as-rows
(pgstate-incf ,pgstate ,table-name :rows ,result :secs ,secs))
(t
(pgstate-incf ,pgstate ,table-name :secs ,secs)))
,result)
(when ,summary (report-summary))))))
(defun report-full-summary (legend state
&key before finally parallel)