mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-12 17:26:58 +02:00
Filter out incomplete foreign key definitions.
It's possible that in MySQL a foreign key constraint definition is pointing to a non-existing table. In such a case, issue an error message and refrain from trying to then reinstall the faulty foreign key definition. The lack of error handling at this point led to a frozen instance of pgloader apparently, I think because it could not display the interactive debugger at the point where the error occurs. See #328, also #337 that might be fixed here.
This commit is contained in:
parent
42e9e521e0
commit
7af6c7ac41
@ -306,7 +306,13 @@ FROM
|
|||||||
(sq:split-sequence #\, fcols))
|
(sq:split-sequence #\, fcols))
|
||||||
:update-rule update-rule
|
:update-rule update-rule
|
||||||
:delete-rule delete-rule)))
|
:delete-rule delete-rule)))
|
||||||
(add-fkey table fk))
|
(if (and name table ftable)
|
||||||
|
(add-fkey table fk)
|
||||||
|
(log-message :error
|
||||||
|
"Incomplete Foreign Key definition: constraint ~s on table ~s referencing table ~s"
|
||||||
|
name
|
||||||
|
(when table (format-table-name table))
|
||||||
|
(when ftable (format-table-name ftable)))))
|
||||||
:finally
|
:finally
|
||||||
(return schema)))
|
(return schema)))
|
||||||
|
|
||||||
|
@ -198,7 +198,8 @@
|
|||||||
(format nil "~{~}"
|
(format nil "~{~}"
|
||||||
(log-message-description event)
|
(log-message-description event)
|
||||||
(log-message-arguments event))
|
(log-message-arguments event))
|
||||||
(log-message-description event))))
|
(log-message-description event)))
|
||||||
|
(*print-circle* t))
|
||||||
(cl-log:log-message (log-message-category event) "~a" mesg)))
|
(cl-log:log-message (log-message-category event) "~a" mesg)))
|
||||||
|
|
||||||
(new-label
|
(new-label
|
||||||
|
Loading…
Reference in New Issue
Block a user