Also check for temporary view

This is another case for #9319 

cc @RaymondLim @JeffryBooher