From df19651f424195db9678879ed5dcd2902c562467 Mon Sep 17 00:00:00 2001 From: Noy Date: Mon, 23 Dec 2024 18:05:00 +0800 Subject: [PATCH] fix: adapt to tests --- catalog/provider.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/catalog/provider.go b/catalog/provider.go index d6bfc98..45d1dc9 100644 --- a/catalog/provider.go +++ b/catalog/provider.go @@ -183,7 +183,10 @@ func (prov *DatabaseProvider) CreateCatalog(dbFile string) (bool, error) { } storage := stdsql.OpenDB(connector) - prov.initCatalog(connector, storage) + err = prov.initCatalog(connector, storage) + if err != nil { + return false, err + } storage.Close() connector.Close() return true, nil @@ -219,7 +222,10 @@ func (prov *DatabaseProvider) SwitchCatalog(dbFile string) error { // in memory database needs to be initialized every time if dsn == "" { - prov.initCatalog(connector, storage) + err = prov.initCatalog(connector, storage) + if err != nil { + return err + } } prov.mu.Lock()