From: Russ Tyndall Date: Tue, 24 Mar 2015 13:20:57 +0000 (-0400) Subject: Changelog and minor cleanup of yesterdays patch X-Git-Tag: v6.7.0~10 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=31ca29efddf77e342aa180dfd2d2e292f6055530 Changelog and minor cleanup of yesterdays patch --- diff --git a/ChangeLog b/ChangeLog index e7c5d9b..45fa7d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,19 +1,26 @@ -2014-03-18 Russ Tyndall +2015-03-24 Russ Tyndall + * sql/oodml.lisp: fixed call-next-method in the base of + read-sql-value and replaced with a continuable + sql-value-conversion-error + * default read-sql-value for list + * tests for sql-value-conversion-errors and list + +2015-03-18 Russ Tyndall * {uffi,db-mysql}/Makefile: remove -pie build hardening for which caused load issues for Linux Mint -2014-02-26 Kevin Rosenberg +2015-02-26 Kevin Rosenberg * Version 6.6.0 release * {uffi,db-mysql}/Makefile: Add build hardening for Debian -2014-02-24 Russ Tyndall +2015-02-24 Russ Tyndall * mysql-sql.lisp an error in type declarations generating a compilation warning was being treated as an error in recent SBCLs, fixed the type warning by correcting the type (still a ton of compliation notes) -2014-02-23 Russ Tyndall +2015-02-23 Russ Tyndall * sql/metaclasses.lisp made reinitialize-instance return the instance passed to it as SBCL now expected (mentioned on the SBCL-devel mailing list by diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 5a966e7..0e4810b 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -600,29 +600,36 @@ (declare (ignore db-type)) (cond ;; null value or type - ((or (equalp "nil" val) (eql 'null val)) nil) - + ((or (null val) + (equalp "nil" val) + (eql 'null val) + (eql 'null type)) + nil) + ;; no specified type or already the right type ((or (null type) (ignore-errors (typep val type))) val) ;; actually convert - (t + (t (let ((res (handler-bind ;; all errors should be converted to sql-value-conversion-error ((error (lambda (c) - (when *debugger-hook* - (invoke-debugger c)) (unless (typep c 'sql-value-conversion-error) + ;; this was blowing up the tests till I + ;; unbound *debugger-hook* not sure the answer, + ;; as this is also imensely useful in actually + ;; finding bugs below this point + (when *debugger-hook* (invoke-debugger c)) (error-converting-value val type database))))) (call-next-method)))) ;; if we didnt get the right type after converting, we should probably ;; error right away - (maybe-error-converting-value - res val type database))))) + (maybe-error-converting-value res val type database))))) (defmethod read-sql-value (val type database db-type) + "read a sql value, from :around read-eval is disabled read numbers in base 10" ;; errors, nulls and preconverted types are already handled in around (typecase type (symbol @@ -644,7 +651,7 @@ (double-float 'double-float)))) (read-from-string val))) ;; maybe wrong type of float - (float val)) + (float val)) (if (eql type 'double-float) 1.0d0 1.0s0))) (number (read-from-string val)) ((boolean generalized-boolean) @@ -657,13 +664,10 @@ (number (not (zerop val)))))) ((wall-time duration) (parse-timestring val)) (date (parse-datestring val)) - (list (let ((*read-eval* nil)) - (read-from-string val))) + (list (read-from-string val)) (t (error-converting-value val type database)))) (t (typecase val - (string - (let ((*read-eval* nil)) - (read-from-string val))) + (string (read-from-string val)) (t (error-converting-value val type database)))))) ;; ------------------------------------------------------------