github-2514.slt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. # Regression test for https://github.com/MaterializeInc/database-issues/issues/2514
  10. # See https://github.com/MaterializeInc/database-issues/issues/2535
  11. # Verify that an index added after a transaction has started complains.
  12. statement ok
  13. CREATE TABLE t1 (f1 INTEGER, f2 INTEGER);
  14. statement ok
  15. CREATE INDEX i1 ON t1 (f2);
  16. statement ok
  17. CREATE VIEW v1 AS SELECT * FROM t1;
  18. simple conn=conn1
  19. BEGIN;
  20. SELECT * FROM v1;
  21. ----
  22. COMPLETE 0
  23. COMPLETE 0
  24. statement ok
  25. CREATE INDEX i2 ON t1 (f2);
  26. simple conn=conn1
  27. SELECT * FROM v1;
  28. ----
  29. db error: ERROR: Transactions can only reference objects in the same timedomain. See https://materialize.com/docs/sql/begin/#same-timedomain-error
  30. DETAIL: The following relations in the query are outside the transaction's time domain:
  31. "materialize.public.i2"
  32. Only the following relations are available:
  33. "materialize.public.i1"
  34. "mz_catalog.mz_array_types"
  35. "mz_catalog.mz_base_types"
  36. "mz_catalog.mz_columns"
  37. "mz_catalog.mz_connections"
  38. "mz_catalog.mz_databases"
  39. "mz_catalog.mz_functions"
  40. "mz_catalog.mz_index_columns"
  41. "mz_catalog.mz_indexes"
  42. "mz_catalog.mz_list_types"
  43. "mz_catalog.mz_map_types"
  44. "mz_catalog.mz_materialized_views"
  45. "mz_catalog.mz_operators"
  46. "mz_catalog.mz_pseudo_types"
  47. "mz_catalog.mz_role_members"
  48. "mz_catalog.mz_role_parameters"
  49. "mz_catalog.mz_roles"
  50. "mz_catalog.mz_schemas"
  51. "mz_catalog.mz_secrets"
  52. "mz_catalog.mz_sinks"
  53. "mz_catalog.mz_sources"
  54. "mz_catalog.mz_system_privileges"
  55. "mz_catalog.mz_tables"
  56. "mz_catalog.mz_types"
  57. "mz_catalog.mz_views"
  58. "mz_internal.mz_aggregates"
  59. "mz_internal.mz_comments"
  60. "mz_internal.mz_continual_tasks"
  61. "mz_internal.mz_object_dependencies"
  62. "mz_internal.mz_type_pg_metadata"