From dfedce2aba3694f8c1eab72439f28340aa933cf2 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 1 Jun 2018 11:20:45 -0400 Subject: [PATCH] Fix support for discovery of DBF target table name. When the LOAD command does not provide the name of the target table for a DBF source, we can get the name of the table from the DBF file itself. That feature got broken, here's a fix. Fix #805. --- src/parsers/command-dbf.lisp | 3 ++- src/sources/db3/db3.lisp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parsers/command-dbf.lisp b/src/parsers/command-dbf.lisp index 84cf6b3..89d4764 100644 --- a/src/parsers/command-dbf.lisp +++ b/src/parsers/command-dbf.lisp @@ -107,7 +107,8 @@ :target-db ,pg-db-conn :encoding ,encoding :source-db source-db - :target (create-table ',target-table-name)))) + :target ,(when target-table-name + (create-table target-table-name))))) ,(sql-code-block pg-db-conn :pre before "before load") diff --git a/src/sources/db3/db3.lisp b/src/sources/db3/db3.lisp index 8b8d0ef..b303931 100644 --- a/src/sources/db3/db3.lisp +++ b/src/sources/db3/db3.lisp @@ -51,8 +51,8 @@ (declare (ignore materialize-views only-tables create-indexes foreign-keys including excluding)) (let* ((table (or (target db3) (source db3))) - (schema (or (when (table-schema (target db3)) - (push-to-end (table-schema (target db3)) + (schema (or (when (table-schema table) + (push-to-end (table-schema table) (catalog-schema-list catalog))) (add-schema catalog (table-name table))))) (push-to-end table (schema-table-list schema))