fetch-tail-limit-timeout.td 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. # Test that specifying a limit for FETCH works with timeout
  11. #
  12. $ set-regex match=\d{13} replacement=<TIMESTAMP>
  13. > CREATE TABLE v1 (f1 INTEGER);
  14. > INSERT INTO v1 VALUES (123);
  15. > SELECT * FROM v1;
  16. 123
  17. > BEGIN
  18. > DECLARE c CURSOR FOR SELECT * FROM v1;
  19. > FETCH 1 c WITH (timeout = '1d');
  20. 123
  21. > COMMIT
  22. > BEGIN
  23. > DECLARE c CURSOR FOR SUBSCRIBE v1;
  24. > FETCH 1 c WITH (timeout = '1d');
  25. <TIMESTAMP> 1 123
  26. > COMMIT
  27. > INSERT INTO v1 VALUES (234);
  28. > INSERT INTO v1 VALUES (345);
  29. > BEGIN
  30. > DECLARE c CURSOR FOR SUBSCRIBE v1;
  31. > FETCH 3 c WITH (timeout = '1d');
  32. <TIMESTAMP> 1 123
  33. <TIMESTAMP> 1 234
  34. <TIMESTAMP> 1 345
  35. > COMMIT
  36. > BEGIN
  37. > DECLARE c CURSOR FOR SELECT * FROM v1;
  38. > FETCH 3 c WITH (timeout = '1d');
  39. 123
  40. 234
  41. 345