-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-911181: Add parameter to disable query context cache
- Loading branch information
1 parent
ede1d51
commit d29124f
Showing
7 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -593,6 +593,20 @@ func TestParseDSN(t *testing.T) { | |
ocspMode: ocspModeFailOpen, | ||
err: nil, | ||
}, | ||
{ | ||
dsn: "u:[email protected]/db/s?account=a.r.c&disableQueryContextCache=true", | ||
config: &Config{ | ||
Account: "a", User: "u", Password: "p", | ||
Protocol: "https", Host: "a.r.c.snowflakecomputing.com", Port: 443, | ||
Database: "db", Schema: "s", ValidateDefaultParameters: ConfigBoolTrue, OCSPFailOpen: OCSPFailOpenTrue, | ||
ClientTimeout: defaultClientTimeout, | ||
JWTClientTimeout: defaultJWTClientTimeout, | ||
ExternalBrowserTimeout: defaultExternalBrowserTimeout, | ||
DisableQueryContextCache: true, | ||
}, | ||
ocspMode: ocspModeFailOpen, | ||
err: nil, | ||
}, | ||
} | ||
|
||
for _, at := range []AuthType{AuthTypeExternalBrowser, AuthTypeOAuth} { | ||
|
@@ -743,6 +757,9 @@ func TestParseDSN(t *testing.T) { | |
if test.config.TmpDirPath != cfg.TmpDirPath { | ||
t.Fatalf("%v: Failed to match TmpDirPatch. expected: %v, got: %v", i, test.config.TmpDirPath, cfg.TmpDirPath) | ||
} | ||
if test.config.DisableQueryContextCache != cfg.DisableQueryContextCache { | ||
t.Fatalf("%v: Failed to match DisableQueryContextCache. expected: %v, got: %v", i, test.config.DisableQueryContextCache, cfg.DisableQueryContextCache) | ||
} | ||
case test.err != nil: | ||
driverErrE, okE := test.err.(*SnowflakeError) | ||
driverErrG, okG := err.(*SnowflakeError) | ||
|
@@ -1133,6 +1150,15 @@ func TestDSN(t *testing.T) { | |
}, | ||
dsn: "u:[email protected]:443?ocspFailOpen=true®ion=b.c&tmpDirPath=%2Ftmp&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
Password: "p", | ||
Account: "a.b.c", | ||
DisableQueryContextCache: true, | ||
}, | ||
dsn: "u:[email protected]:443?disableQueryContextCache=true&ocspFailOpen=true®ion=b.c&validateDefaultParameters=true", | ||
}, | ||
} | ||
for _, test := range testcases { | ||
t.Run(test.dsn, func(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters