From 020cd7d3edb510a3bd60bca685cc3bee1f48aa98 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 20 Sep 2013 22:51:44 +0200 Subject: [PATCH] Fix the code to handle lack of target type in MySQL cast rules parsing. --- parser.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parser.lisp b/parser.lisp index f3954c8..b4ee4b1 100644 --- a/parser.lisp +++ b/parser.lisp @@ -491,9 +491,11 @@ Here's a quick description of the format we're parsing here: (defun fix-target-type (source target) "When target has :type nil, steal the source :type definition." - (unless (getf target :type) - (setf (getf target :type) (getf source :type)) - target)) + (if (getf target :type) + 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)) (:lambda (cast)