gosnowflake icon indicating copy to clipboard operation
gosnowflake copied to clipboard

SNOW-1669514: uuid.UUID Valuer Interface No Longer Honored

Open AdamDrewsTR opened this issue 5 months ago • 11 comments

Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!

  1. What version of GO driver are you using? 1.11.1

  2. What operating system and processor architecture are you using? Mac, Linux x64 amd and m1

  3. What version of GO are you using? 1.22.7

4.Server version:* E.g. 1.90.1 8.34.0

  1. What did you do? Updated from 10.1 to 11.1.

  2. What did you expect to see? Values updated when using an in clause containing a struct that IS a string. We also had to implement a custom serializer to convert UUIDs to strings prior to making their way to sql. It seems like String() isn't honored anymore on struct?

Binding array of structs in a query's IN clause should return results. It seems like something is getting double escaped somewhere. We are using google's UUIDs which would resolve as an driver.Value of array b/c it's driver value is a string. This results in it flowing throug converter.arrayToString: [SAM CLI:59345] time="2024-09-17T21:03:11Z" level=debug msg="TYPE: uuid.UUID, 51d3526b-bf57-46bb-8258-1344e6e8d910" func="gosnowflake.(*defaultLogger).Debugf" file="log.go:176"

When I run the UUID through arrayToString I get a bingingValue of json, and the value is a quoted string: {0x1400022b640 json } "49dbf3b3-7a72-42f2-9183-d6e24d00f292"

Is this then getting double escaped somewhere because it thinks the string is json?

What should have happened and what happened instead? Queries find the value by string.

  1. Can you set logging to DEBUG and collect the logs? [SAM CLI:59345] time="2024-09-17T21:03:11Z" level=info msg="Exec: "UPDATE \"some_table\" SET \"is_read\"=? WHERE \"id\" IN (?) AND \"some_table\".\"deleted_at\" IS NULL AND \"user_id\" = ?", [{ 1 true} { 2 51d3526b-bf57-46bb-8258-1344e6e8d910} { 3 _USERID}]" func="gosnowflake.(*snowflakeConn).ExecContext" file="connection.go:312"

  2. What is your Snowflake account identifier, if any? (Optional)

AdamDrewsTR avatar Sep 17 '24 21:09 AdamDrewsTR