mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Fix custom CAST rules with expressions, fix #322.
In a previous commit the typemod matching code had been broken, and we failed to notice that until now. Thanks to bug report #322 we just got the memo... Add a test case in the local-only MySQL database. The regression testing facilities should be improved to be able to test a full database, and then to dynamically create said database from code or something to ease test coverage of those cases.
This commit is contained in:
parent
2c200f5747
commit
44a2bd14d4
@ -27,7 +27,7 @@
|
||||
(mapcar #'parse-integer
|
||||
(sq:split-sequence #\, column-type
|
||||
:start (+ 1 start-1) :end end))
|
||||
(cons a b))))))
|
||||
(list a b))))))
|
||||
|
||||
(defun typemod-expr-matches-p (rule-typemod-expr typemod)
|
||||
"Check if an expression such as (< 10) matches given typemod."
|
||||
@ -98,7 +98,7 @@
|
||||
(t type)))
|
||||
(pg-typemod
|
||||
(when source-typemod
|
||||
(destructuring-bind (a . b) source-typemod
|
||||
(destructuring-bind (a &optional b) source-typemod
|
||||
(format nil "(~a~:[~*~;,~a~])" a b b)))))
|
||||
(make-column :name (apply-identifier-case source-column-name)
|
||||
:type-name type-name
|
||||
|
||||
@ -26,8 +26,9 @@ LOAD DATABASE
|
||||
column ascii.s using byte-vector-to-bytea,
|
||||
column enumerate.foo using empty-string-to-null,
|
||||
|
||||
column ip.ip_address to inet keep not null drop typemod
|
||||
column ip.ip_address to inet keep not null drop typemod,
|
||||
|
||||
type decimal when (= precision 1) to boolean drop typemod
|
||||
|
||||
MATERIALIZE VIEWS nonexisting,
|
||||
d as $$
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user