github-2906.slt 953 B

123456789101112131415161718192021222324252627
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # Regression test for https://github.com/MaterializeInc/database-issues/issues/2906
  10. statement ok
  11. CREATE TABLE tableA(happened_at TIMESTAMP, json_col JSON, offs NUMERIC, id INTEGER);
  12. statement ok
  13. CREATE INDEX a ON tablea(id);
  14. statement ok
  15. CREATE MATERIALIZED VIEW foobar26 AS
  16. SELECT tableA.id
  17. FROM tableA
  18. WHERE ((1000 * cast(extract(epoch FROM tableA.happened_at) AS numeric)) <= mz_now()
  19. AND mz_now() <= (1000 * cast(extract(epoch FROM tableA.happened_at) AS numeric) + offs ))
  20. AND id = 10;
  21. statement ok
  22. INSERT INTO tableA VALUES (now(), null, 10, 10);