shard_errors.slt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. # Disable persist inline writes so we get hollow parts with diffs_sum below
  10. simple conn=mz_system,user=mz_system
  11. ALTER SYSTEM SET persist_inline_writes_single_max_bytes = 0
  12. ----
  13. COMPLETE 0
  14. # Create a one batch shard with a `SourceData(Err(_))` in it and an empty upper.
  15. # This guarantees that the query timestamp of the select is within our one
  16. # batch.
  17. statement ok
  18. CREATE MATERIALIZED VIEW foo AS (VALUES (1/0));
  19. # Make sure we get the error even if we project away all columns.
  20. query error division by zero
  21. SELECT count(*) FROM foo;
  22. # Create another shard with an error in it, and then some batch with no error
  23. # past it. This means we should have a batch with an error that is entirely
  24. # before the query timestamp of the select below.
  25. statement ok
  26. CREATE TABLE bar (a INT);
  27. statement ok
  28. INSERT INTO bar VALUES (0);
  29. statement ok
  30. CREATE MATERIALIZED VIEW baz AS SELECT 1/a FROM bar;
  31. statement ok
  32. INSERT INTO bar VALUES (1);
  33. # Make sure we get the error even if we project away all columns.
  34. query error division by zero
  35. SELECT count(*) FROM baz;
  36. query error item doesn't exist
  37. INSPECT SHARD 'u666'