From 3f61c66a79446a1487c31d75ee908de679a7d989 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 23 Jan 2014 15:15:42 +0100 Subject: [PATCH] Also handle extra columns in CSV parsing. --- src/sources/sources.lisp | 4 ++-- test/errors.load | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sources/sources.lisp b/src/sources/sources.lisp index b923aff..ee6f73c 100644 --- a/src/sources/sources.lisp +++ b/src/sources/sources.lisp @@ -263,8 +263,8 @@ ,(field-name-as-symbol name)))))) `(lambda (row) (declare (optimize speed) (type list row)) - (destructuring-bind (&optional ,@args) row - (declare (ignorable ,@args)) + (destructuring-bind (&optional ,@args &rest extra) row + (declare (ignorable ,@args) (ignore extra)) (vector ,@newrow)))))))) ;; allow for some debugging (if compile (compile nil projection) projection)))) diff --git a/test/errors.load b/test/errors.load index 3fb487b..572c5bf 100644 --- a/test/errors.load +++ b/test/errors.load @@ -45,5 +45,6 @@ LOAD CSV 5|another month 13, stress retry path|2006-13-10| 6|some null date to play with|| 7|and a ragged line| -8|and another line|2014-01-22| +8|and a line with extra columns|2014-01-23|hello|there| +9|and another line|2014-01-22|