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 @@ -20,17 +20,21 @@ type connector struct {
20
20
}
21
21
22
22
func (c * connector ) Connect (ctx context.Context ) (driver.Conn , error ) {
23
+ var catalogName * cli_service.TIdentifier
24
+ var schemaName * cli_service.TIdentifier
23
25
var initialNamespace * cli_service.TNamespace
24
26
25
27
if c .cfg .Catalog != "" {
26
- initialNamespace = & cli_service.TNamespace {}
27
- initialNamespace .CatalogName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Catalog ))
28
+ catalogName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Catalog ))
28
29
}
29
30
if c .cfg .Schema != "" {
30
- if initialNamespace == nil {
31
- initialNamespace = & cli_service.TNamespace {}
31
+ schemaName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Schema ))
32
+ }
33
+ if catalogName != nil || schemaName != nil {
34
+ initialNamespace = & cli_service.TNamespace {
35
+ CatalogName : catalogName ,
36
+ SchemaName : schemaName ,
32
37
}
33
- initialNamespace .SchemaName = cli_service .TIdentifierPtr (cli_service .TIdentifier (c .cfg .Schema ))
34
38
}
35
39
36
40
// we need to ensure that open session will eventually end
You can’t perform that action at this time.
0 commit comments