Add "undo" support for HAVING clause [applied]