What happens if you replace SET STATEMENT ... SELECT with session SET ... ; SELECT ? If it crashes, does the upstream crash too then?
What happens if you replace SET STATEMENT ... SELECT with session SET ... ; SELECT ? If it crashes, does the upstream crash too then?