X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Foodml.lisp;h=710e5e8e090c45548e4a41d6948ccd35c7c7536c;hb=2847fad43e1aa15f934108ce8f5e8dbe1fb1962d;hp=9dc7b0fd0c92bbe2391619e01608ff741f56cd08;hpb=ce5b60109610a07d48868a3f758fb8c7d362906d;p=clsql.git diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 9dc7b0f..710e5e8 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -332,6 +332,7 @@ :result-types nil :database vd)))) (when res + (setf (slot-value instance 'view-database) vd) (get-slot-values-from-view instance (mapcar #'car sels) (car res)))) (pres) (t nil))))) @@ -358,6 +359,7 @@ (res (select att-ref :from view-table :where view-qual :result-types nil))) (when res + (setf (slot-value instance 'view-database) vd) (get-slot-values-from-view instance (list slot-def) (car res)))))) (defmethod update-slot-with-null ((object standard-db-object) @@ -639,10 +641,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))