From b1d4e94f2a5530299f3e79a9e1724c2cd38372fa Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 27 Mar 2016 20:42:20 +0200 Subject: [PATCH] Fix integer parsing support for SQLite. The function needs to return a string to be added to the COPY stream, we still need to make sure whatever given here looks like an integer. Given the very dynamic nature of data types in SQLite, the integer-to-string function was already a default now, but failed to be published before in its fixed version, somehow. --- src/utils/transforms.lisp | 17 +++++++++-------- test/sqlite.load | 3 ++- test/sqlite/sqlite.db | Bin 94208 -> 98304 bytes 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/utils/transforms.lisp b/src/utils/transforms.lisp index f3ed6f3..dde2489 100644 --- a/src/utils/transforms.lisp +++ b/src/utils/transforms.lisp @@ -193,14 +193,15 @@ values." (declare (type (or null string fixnum) integer-string)) (when integer-string - (typecase integer-string - (integer (princ-to-string integer-string)) - (string (handler-case - (parse-integer integer-string :start 0) - (condition (c) - (declare (ignore c)) - (parse-integer integer-string :start 1 - :end (- (length integer-string) 1)))))))) + (princ-to-string + (typecase integer-string + (integer integer-string) + (string (handler-case + (parse-integer integer-string :start 0) + (condition (c) + (declare (ignore c)) + (parse-integer integer-string :start 1 + :end (- (length integer-string) 1))))))))) (defun float-to-string (float) "Transform a Common Lisp float value into its string representation as diff --git a/test/sqlite.load b/test/sqlite.load index c884c9e..38c7e15 100644 --- a/test/sqlite.load +++ b/test/sqlite.load @@ -11,6 +11,7 @@ load database $$ create schema if not exists sqlite; $$ cast column character.f1 to text drop typemod, - column appointments.time to timestamptz drop default + column appointments.time to timestamptz drop default, + type intege to integer set work_mem to '16MB', maintenance_work_mem to '512 MB', search_path to 'sqlite'; \ No newline at end of file diff --git a/test/sqlite/sqlite.db b/test/sqlite/sqlite.db index 6874be9ae5cb272e30bf4a00ed0c9c6357dae7b7..f6433610772e49e4a9715900fa6c0dfdcd5de7d7 100644 GIT binary patch delta 175 zcmZp8z}nEjHbGiYhk=1X0*GNie4>sqj}C+GGcI24e+&X#A``RanYctYPVC@xbrxU~ zmy~2oE=f$vNzKeFNlk~663#)cjv=lJA&yQyt_lztjm#7%OCcpSEwMDGM8PlA$49d{ zl52Y;7vu8ONefuGnE78Y@c-fe!vA8k;DTHH5?sto><$_;L0}de6O(93en~zPBNHb8 DRdq2a delta 59 zcmZo@U~725Izd`coq>Tt9Ef2+WTK8Sk2-_yGcI24e+>LwkrT7!Hwy}!=WLGT+8)Wp HxI7gARyGY5