sql statement fails when switching fork and same trx was present in both forks
This scenario is specific to transactions with multiple signatures. At first we make fork. Its is possible that the same transaction (exactly the same, with the same hash and reference block number) would be applied in both forks. After switching back from fork, both transactions (with exactly the same hash and signature) will end up in tables transactions_reversible and transactions_multisig_reversible.
It looks like there is problem of primary key of table transactions_multisig_reversible, currently there is trx_hash and signature, maybe adding also fork_id to primary key would solve problem.