bug in corner case

"with x as (y) select * from x " was inlined
"with x as (y) select * from x" was not inlined