Closed yugo-n closed 2 years ago
I added tests.
Also, I fixed the behavior when the view has aggregates without GROUP clause.
Aggregate views without a GROUP clause always have one row. Therefore, if a base table is truncated, the view will not be empty and will contain a row with NULL value (or 0 for count()). So, in this case, we refresh the view instead of truncating it.
If we don't have any outer-joins, the view can be truncated when a base table is truncated. Otherwise, if we have any outer-joins, a simple refresh is performed.