mirror of
https://github.com/dimitri/pgloader.git
synced 2026-01-23 08:01:04 +01:00
Fix double transformation call in CSV projections.
In advanced projections it could be that we call the transformation function for some input fields twice. This is a bug that manifest in particular when the output of the transformation can't be used/parsed again by the same function as shown in the bug reported. Fix #523.
This commit is contained in:
parent
3fac222432
commit
ab7e77c2d0
@ -107,8 +107,7 @@
|
||||
;; we expect the name of a COLUMN to be the same
|
||||
;; as the name of its derived FIELD when we
|
||||
;; don't have any transformation function
|
||||
(or fn `(funcall ,(process-field name)
|
||||
,(field-name-as-symbol name))))))
|
||||
(or fn (field-name-as-symbol name)))))
|
||||
`(lambda (row)
|
||||
(declare (optimize speed) (type list row))
|
||||
(destructuring-bind (&optional ,@args &rest extra) row
|
||||
|
||||
@ -2,7 +2,7 @@ LOAD CSV
|
||||
FROM inline
|
||||
(
|
||||
"row num",
|
||||
ts [date format 'YYYY-MM-DD HH24-MI-SS.US'],
|
||||
ts [date format 'MM-DD-YYYY HH24-MI-SS.US'],
|
||||
hr [date format 'HH24:MI.SS']
|
||||
)
|
||||
INTO postgresql:///pgloader?dateformat ("row num", ts, hr)
|
||||
@ -25,6 +25,6 @@ LOAD CSV
|
||||
);
|
||||
$$;
|
||||
|
||||
1,1999-10-02 00-33-12.123456,"00:05.02"
|
||||
2,2014-10-02 00-33-13.123,"18:25.52"
|
||||
3,2014-10-02 00-33-14.1234,13:14.15
|
||||
1,10-02-1999 00-33-12.123456,"00:05.02"
|
||||
2,10-02-2014 00-33-13.123,"18:25.52"
|
||||
3,10-02-2014 00-33-14.1234,13:14.15
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user