fetch-tail-timestamp-zero.td 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #
  10. # Make sure that sources for which the timestamp field is zero can be SUBSCRIBE-ed
  11. #
  12. > CREATE VIEW v1 AS SELECT 123;
  13. > CREATE VIEW v2 AS VALUES (123);
  14. > SELECT * FROM v1;
  15. 123
  16. > SELECT * FROM v2;
  17. 123
  18. > BEGIN
  19. > DECLARE c1 CURSOR FOR SUBSCRIBE v1 WITH (PROGRESS = TRUE);
  20. > FETCH 1 FROM c1 WITH (timeout = '60s')
  21. 18446744073709551615 true <null> <null>
  22. > FETCH 1 FROM c1 WITH (timeout = '60s')
  23. 18446744073709551615 false 1 123
  24. > COMMIT;
  25. > BEGIN;
  26. > DECLARE c2 CURSOR FOR SUBSCRIBE v2 WITH (PROGRESS = TRUE);
  27. > FETCH 1 FROM c2 WITH (timeout = '60s')
  28. 18446744073709551615 true <null> <null>
  29. > FETCH 1 FROM c2 WITH (timeout = '60s')
  30. 18446744073709551615 false 1 123
  31. > COMMIT;
  32. > BEGIN;
  33. > DECLARE c1 CURSOR FOR SUBSCRIBE v1 WITH (SNAPSHOT = FALSE);
  34. > FETCH ALL FROM c1 WITH (timeout = '3s')