fetch-tail-large-diff.td 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 SUBSCRIBE/FETCH can handle a case where the diff column has a very large value
  11. #
  12. $ set-regex match=\d{13} replacement=<TIMESTAMP>
  13. > CREATE TABLE ten (f1 INTEGER);
  14. > INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
  15. > CREATE MATERIALIZED VIEW v1 AS SELECT NULL FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6, ten AS a7
  16. > SELECT COUNT(*) FROM v1;
  17. 10000000
  18. > CREATE MATERIALIZED VIEW v2 AS SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6, ten AS a7
  19. > SELECT COUNT(*) FROM v2;
  20. 10000000
  21. > BEGIN
  22. > DECLARE c CURSOR FOR SUBSCRIBE v1;
  23. > FETCH 1 c;
  24. <TIMESTAMP> 10000000 <null>
  25. > FETCH 1 c WITH (timeout = '1s');
  26. > COMMIT
  27. > BEGIN
  28. > DECLARE c CURSOR FOR SUBSCRIBE v2;
  29. > FETCH 10 c;
  30. <TIMESTAMP> 1000000 1
  31. <TIMESTAMP> 1000000 2
  32. <TIMESTAMP> 1000000 3
  33. <TIMESTAMP> 1000000 4
  34. <TIMESTAMP> 1000000 5
  35. <TIMESTAMP> 1000000 6
  36. <TIMESTAMP> 1000000 7
  37. <TIMESTAMP> 1000000 8
  38. <TIMESTAMP> 1000000 9
  39. <TIMESTAMP> 1000000 10