This test changes SAVEPOINT names from relying on the memory address of the callback (which can cause unexpected issues with partial rollbacks), to using a random integer.
The integer is generated using maphash.Hash, which is used as that internally relies on runtime.fastrand, which is the most performant way to get a random integer.
I've ensured the test fails without my code changes, and passes with them applied.
What did this pull request do?
This test changes
SAVEPOINT
names from relying on the memory address of the callback (which can cause unexpected issues with partial rollbacks), to using a random integer.The integer is generated using
maphash.Hash
, which is used as that internally relies onruntime.fastrand
, which is the most performant way to get a random integer.I've ensured the test fails without my code changes, and passes with them applied.
Use Case Description
Covered in https://github.com/go-gorm/gorm/issues/7173