WITH query regression test