Hopefully fix test failures by properly using $1 rather than recording_id in SQL function definitions