r/SQL • • 13h ago

Snowflake Looking for Snowflake users to help build and test a safe-repair flow in an open-source data tool

/r/snowflake/comments/1ydrzx1/looking_for_snowflake_users_to_help_build_and/
1 Upvotes

2 comments sorted by

1

u/Discordbothost 10h ago

Add a failure test for #99: let one UPDATE succeed, make the next fail, then check that both are rolled back. Snowflake can leave a transaction active after a statement error. If your handler catches it and reaches COMMIT, the first change could survive.

1

u/GuidanceBrief612 8h ago

Thanks, good catch. The clone step already rolls back on any error before it can reach COMMIT, but my failure test only covers the first statement failing. I'll add the case you describe (first UPDATE succeeds, the next one fails, check both are rolled back) and make it a requirement for #99, along with keeping only DML inside the transaction. Tracking it here: https://github.com/akshaysharma1088/dataranger/issues/99