BUG-7052: move copy operation to StatementContextBase