pg_auto_failover
pg_auto_failover copied to clipboard
Don't reference temporaries when using intToString
The following code that we use a lot is undefined behavior:
paramValues[1] = intToString(index).strValue;
Instead it should be:
IntString indexStr = intToString(index);
paramValues[1] = indexStr.strValue;
With the current code we're referencing temporaries, which can lead to all kinds of weird bugs.
Useful source: https://stackoverflow.com/a/17903361/2570866