Fix the code to handle lack of target type in MySQL cast rules parsing.

This commit is contained in:
Dimitri Fontaine 2013-09-20 22:51:44 +02:00
parent dd38c9c154
commit 020cd7d3ed

View File

@ -491,9 +491,11 @@ Here's a quick description of the format we're parsing here:
(defun fix-target-type (source target) (defun fix-target-type (source target)
"When target has :type nil, steal the source :type definition." "When target has :type nil, steal the source :type definition."
(unless (getf target :type) (if (getf target :type)
(setf (getf target :type) (getf source :type)) target
target)) (loop
for (key value) on target by #'cddr
append (list key (if (eq :type key) (getf source :type) value)))))
(defrule cast-rule (and cast-source cast-def (? cast-function)) (defrule cast-rule (and cast-source cast-def (? cast-function))
(:lambda (cast) (:lambda (cast)