File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,21 @@ type connector struct {
1919}
2020
2121func (c * connector ) Connect (ctx context.Context ) (driver.Conn , error ) {
22+ var catalogName * cli_service.TIdentifier
23+ var schemaName * cli_service.TIdentifier
2224 var initialNamespace * cli_service.TNamespace
2325
2426 if c .cfg .Catalog != "" {
25- initialNamespace = & cli_service.TNamespace {}
26- initialNamespace .CatalogName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Catalog ))
27+ catalogName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Catalog ))
2728 }
2829 if c .cfg .Schema != "" {
29- if initialNamespace == nil {
30- initialNamespace = & cli_service.TNamespace {}
30+ schemaName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Schema ))
31+ }
32+ if catalogName != nil || schemaName != nil {
33+ initialNamespace = & cli_service.TNamespace {
34+ CatalogName : catalogName ,
35+ SchemaName : schemaName ,
3136 }
32- initialNamespace .SchemaName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Schema ))
3337 }
3438
3539 tclient , err := client .InitThriftClient (c .cfg )
You can’t perform that action at this time.
0 commit comments