X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Foodml.lisp;h=5cf86230dfdab18cc4018ee9793ea4007bc6e7be;hb=bdad8b00f0a2359c7990cf994842b809597552ed;hp=9dc7b0fd0c92bbe2391619e01608ff741f56cd08;hpb=ce5b60109610a07d48868a3f758fb8c7d362906d;p=clsql.git diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 9dc7b0f..5cf8623 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -639,10 +639,19 @@ (declare (ignore database db-type)) ;; writing 1.0 writes 1, so we we *really* want a float, must do (float ...) (etypecase val - (string - (float (read-from-string val))) - (float - val))) + (string (float (read-from-string val))) + (float val))) + +(defmethod read-sql-value (val (type (eql 'double-float)) database db-type) + (declare (ignore database db-type)) + ;; writing 1.0 writes 1, so if we *really* want a float, must do (float ...) + (etypecase val + (string (float + (let ((*read-default-float-format* 'double-float)) + (read-from-string val)) + 1.0d0)) + (double-float val) + (float (coerce val 'double-float)))) (defmethod read-sql-value (val (type (eql 'boolean)) database db-type) (declare (ignore database db-type))