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.
This commit is contained in:
Dimitri Fontaine 2016-03-27 20:42:20 +02:00
parent fe3601b04c
commit b1d4e94f2a
3 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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';

Binary file not shown.