Ensures that compile() and execute() obey set_connection() calls. Ref #1760