subscribe_error.slt 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. # Test that subscribes propagate query errors.
  10. mode cockroach
  11. statement ok
  12. CREATE TABLE t (a int)
  13. statement ok
  14. INSERT INTO t VALUES (1), (2), (0)
  15. statement ok
  16. CREATE VIEW v AS SELECT 1/a FROM t
  17. statement ok
  18. CREATE DEFAULT INDEX ON v
  19. statement ok
  20. CREATE MATERIALIZED VIEW mv AS SELECT 1/a FROM t
  21. statement ok
  22. BEGIN
  23. statement ok
  24. DECLARE c CURSOR FOR SUBSCRIBE (SELECT 1/a FROM t)
  25. statement error Evaluation error: division by zero
  26. FETCH 1 c
  27. statement ok
  28. ROLLBACK
  29. statement ok
  30. BEGIN
  31. statement ok
  32. DECLARE c CURSOR FOR SUBSCRIBE v
  33. statement error Evaluation error: division by zero
  34. FETCH 1 c
  35. statement ok
  36. ROLLBACK
  37. statement ok
  38. BEGIN
  39. statement ok
  40. DECLARE c CURSOR FOR SUBSCRIBE mv
  41. statement error Evaluation error: division by zero
  42. FETCH 1 c
  43. statement ok
  44. ROLLBACK