From 42c9ccfbb39f696117bbbd6c477733bd476b4ae9 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 25 Feb 2018 23:39:52 +0100 Subject: [PATCH] DB3: pick user's choice of schema name when given. We would hard-code the schema name into the table's name in the DB3 case on the grounds that a db3/dbf file doesn't have a notion of a schema. But when the user wants to add data into an existing target table, then we merge the catalogs and must keep the given target schema and table name. Fix #701. --- src/sources/db3/db3.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sources/db3/db3.lisp b/src/sources/db3/db3.lisp index 03eb244..8b8d0ef 100644 --- a/src/sources/db3/db3.lisp +++ b/src/sources/db3/db3.lisp @@ -51,7 +51,10 @@ (declare (ignore materialize-views only-tables create-indexes foreign-keys including excluding)) (let* ((table (or (target db3) (source db3))) - (schema (add-schema catalog (table-name table)))) + (schema (or (when (table-schema (target db3)) + (push-to-end (table-schema (target db3)) + (catalog-schema-list catalog))) + (add-schema catalog (table-name table))))) (push-to-end table (schema-table-list schema)) (with-connection (conn (source-db db3))