sql: allow to create view as <WITH> clause
Allow views to use CTEs, which can be in any (nested) select after <AS>. Before this patch, during view creation all referenced spaces were fetched by name from SELECT and their reference counters were incremented to avoid dangling references. It occurred in update_view_references(). Obviously, CTE tables weren't held in space cache, ergo error "space doesn’t exist" was raised. Add check if a space from FROM is CTE. If it is, don't increment its reference counter and don't raise the error. Closes #4149
Loading
Please register or sign in to comment