Adding support for cloning select queries