mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-14 17:43:34 +08:00
Handle when FROM clause is missing in continuous aggregate definition
It now errors out for such a case. Fixes #5500
This commit is contained in:
parent
cb81c331ae
commit
ff5959f8f9
@ -28,6 +28,7 @@ accidentally triggering the load of a previous DB version.**
|
||||
* #5459 Fix issue creating dimensional constraints
|
||||
* #5499 Do not segfault on large histogram() parameters
|
||||
* #5497 Allow named time_bucket arguments in Cagg definition
|
||||
* #5500 Fix when no FROM clause in continuous aggregate definition
|
||||
|
||||
**Thanks**
|
||||
* @nikolaps for reporting an issue with the COPY fetcher
|
||||
|
@ -1050,7 +1050,11 @@ cagg_query_supported(const Query *query, StringInfo hint, StringInfo detail, con
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!query->jointree->fromlist)
|
||||
{
|
||||
appendStringInfoString(hint, "FROM clause missing in the query");
|
||||
return false;
|
||||
}
|
||||
if (query->commandType != CMD_SELECT)
|
||||
{
|
||||
appendStringInfoString(hint, "Use a SELECT query in the continuous aggregate view.");
|
||||
|
@ -631,3 +631,6 @@ ERROR: invalid continuous aggregate query
|
||||
CREATE MATERIALIZED VIEW matv1 AS SELECT now() AS time;
|
||||
CREATE MATERIALIZED VIEW cagg1 WITH (timescaledb.continuous) AS SELECT time_bucket('1h',time) FROM matv1 GROUP BY 1;
|
||||
ERROR: invalid continuous aggregate view
|
||||
-- No FROM clause in CAGG definition
|
||||
CREATE MATERIALIZED VIEW cagg1 with (timescaledb.continuous) AS SELECT 1 GROUP BY 1 WITH NO DATA;
|
||||
ERROR: invalid continuous aggregate query
|
||||
|
@ -523,3 +523,5 @@ CREATE MATERIALIZED VIEW cagg1 WITH (timescaledb.continuous) AS SELECT time_buck
|
||||
CREATE MATERIALIZED VIEW matv1 AS SELECT now() AS time;
|
||||
CREATE MATERIALIZED VIEW cagg1 WITH (timescaledb.continuous) AS SELECT time_bucket('1h',time) FROM matv1 GROUP BY 1;
|
||||
|
||||
-- No FROM clause in CAGG definition
|
||||
CREATE MATERIALIZED VIEW cagg1 with (timescaledb.continuous) AS SELECT 1 GROUP BY 1 WITH NO DATA;
|
||||
|
Loading…
x
Reference in New Issue
Block a user