123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Use of this software is governed by the Business Source License
- # included in the LICENSE file at the root of this repository.
- #
- # As of the Change Date specified in that file, in accordance with
- # the Business Source License, use of this software will be governed
- # by the Apache License, Version 2.0.
- mode cockroach
- simple conn=mz_system,user=mz_system
- ALTER SYSTEM SET enable_envelope_debezium_in_subscribe = true
- ----
- COMPLETE 0
- simple conn=mz_system,user=mz_system
- ALTER SYSTEM SET enable_within_timestamp_order_by_in_subscribe = true
- ----
- COMPLETE 0
- statement ok
- CREATE TABLE t (a int, b int)
- statement ok
- CREATE TABLE t2 (a int, b int, c int)
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t
- query IIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_diff a b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t WITH (PROGRESS)
- query IIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_progressed mz_diff a b
- statement ok
- COMMIT
- # ENVELOPE UPSERT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t ENVELOPE UPSERT (KEY (a))
- query IIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_state a b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t WITH (PROGRESS) ENVELOPE UPSERT (KEY (a))
- query IIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_progressed mz_state a b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t ENVELOPE UPSERT (KEY (a)) WITH (PROGRESS)
- query IIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_progressed mz_state a b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t ENVELOPE UPSERT (KEY (b))
- query IIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_state b a
- statement ok
- COMMIT
- # ENVELOPE DEBEZIUM
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t ENVELOPE DEBEZIUM (KEY (a))
- query IIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_state a before_b after_b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t WITH (PROGRESS) ENVELOPE DEBEZIUM (KEY (a))
- query IIIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_progressed mz_state a before_b after_b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t ENVELOPE DEBEZIUM (KEY (b))
- query IIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_state b before_a after_a
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t2 ENVELOPE DEBEZIUM (KEY (b))
- query IIIIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_state b before_a before_c after_a after_c
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t2 ENVELOPE DEBEZIUM (KEY (c, b))
- query IIIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_state c b before_a after_a
- statement ok
- COMMIT
- # WITHIN TIMESTAMP ORDER BY
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t WITHIN TIMESTAMP ORDER BY a, mz_diff
- query IIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_diff a b
- statement ok
- COMMIT
- statement ok
- BEGIN
- statement ok
- DECLARE c CURSOR FOR SUBSCRIBE t WITH (PROGRESS) WITHIN TIMESTAMP ORDER BY a, mz_diff
- query IIIII colnames
- FETCH 0 c
- ----
- mz_timestamp mz_progressed mz_diff a b
- statement ok
- COMMIT
- # SHOW commands are not allowed in maintained (i.e., non-one-shot) dataflows, but SUBSCRIBE _does_ allow it, even though
- # it's a maintained dataflow.
- statement ok
- BEGIN
- statement ok
- DECLARE c2 CURSOR FOR SUBSCRIBE TO (SHOW CLUSTER REPLICAS);
- statement ok
- COMMIT
|