mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 07:16:58 +02:00
Fix the code to handle lack of target type in MySQL cast rules parsing.
This commit is contained in:
parent
dd38c9c154
commit
020cd7d3ed
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user