bug 1546 - replacing REPLACE statements