File tree 2 files changed +13
-0
lines changed
e2e_test/sink/sink_into_table
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
# cycle check
2
+ statement ok
3
+ create table t_t(v int primary key);
4
+
5
+ statement error Creating such a sink will result in circular dependency
6
+ create sink t_s into t_t from t_t;
2
7
3
8
statement ok
4
9
create table t_a(v int primary key);
@@ -33,6 +38,9 @@ drop table t_b;
33
38
statement ok
34
39
drop table t_c;
35
40
41
+ statement ok
42
+ drop table t_t;
43
+
36
44
# cycle check (with materialize view)
37
45
38
46
statement ok
Original file line number Diff line number Diff line change @@ -328,6 +328,11 @@ where
328
328
return Ok ( false ) ;
329
329
}
330
330
331
+ // special check for self referencing
332
+ if dependent_objs. contains ( & target_table) {
333
+ return Ok ( true ) ;
334
+ }
335
+
331
336
let query = construct_sink_cycle_check_query ( target_table, dependent_objs) ;
332
337
let ( sql, values) = query. build_any ( & * db. get_database_backend ( ) . get_query_builder ( ) ) ;
333
338
You can’t perform that action at this time.
0 commit comments