snowflake-connector-net icon indicating copy to clipboard operation
snowflake-connector-net copied to clipboard

Unable to connect to snowflake if the password contains ('=' or ';'). It did not work by using escape sequences also

Open AnushaSrikanth95 opened this issue 2 years ago • 3 comments

Issue description

Unable to connect to snowflake if the password contains ('=' or ';'). It did not work even using escape sequences

Example code

Error log

Error: Connection string is invalid: Invalid key value pair PASSWORD="'********* SqlState:

Configuration

Driver version:

*Dotnet framework and version:*4.7.2

Server version:

Client OS: Windows 10

AnushaSrikanth95 avatar Sep 26 '22 07:09 AnushaSrikanth95

it works (should work) if you replace = with ==, but there's no solution for ; :(

virgilp avatar Sep 29 '22 16:09 virgilp

@sfc-gh-kterada @SimbaGithub it would be interesting to know how you plan to fix this (if you do). Interestingly enough the spec for the OleDb connectionstring is even included in the source code (https://docs.microsoft.com/en-us/dotnet/api/system.data.oledb.oledbconnection.connectionstring), but the implementation thoroughly ignores it. The problem that I see is that whatever you do now is breaking change. E.g. schema names must be quoted in the connection string - ;SCHEMA="Foo" currently will use the quoted schema name, i.e. "Foo"; if you reinterpret the connection string according to the spec, then the value passed will be Foo which is the same as FOO - i.e. a very different schema name. The correct way (according to spec) to write the connection string would be ;SCHEMA='"Foo"' but this doesn't currently work.

virgilp avatar Sep 30 '22 07:09 virgilp

i'm looking into this

SimbaGithub avatar Oct 05 '22 20:10 SimbaGithub

the fix on Oct 2022 release

sfc-gh-ext-simba-dl avatar Dec 13 '22 18:12 sfc-gh-ext-simba-dl