Skip to content

Commit 1433a38

Browse files
committed
repro: materialized_views_ignore_errors metes errors from source table
1 parent ad21a93 commit 1433a38

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- { echoOn }
2+
3+
insert into testX select number from numbers(20)
4+
settings materialized_views_ignore_errors = 0; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }
5+
select count() from testX;
6+
0
7+
select count() from testXA;
8+
0
9+
insert into testX select number from numbers(20)
10+
settings materialized_views_ignore_errors = 1;
11+
select count() from testX;
12+
0
13+
select count() from testXA;
14+
0
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- more blocks to process
2+
set max_block_size = 10;
3+
set min_insert_block_size_rows = 10;
4+
5+
drop table if exists testX;
6+
drop table if exists testXA;
7+
8+
create table testX (A Int64) engine=MergeTree partition by (intDiv(A, 10), throwIf(A=2)) order by tuple();
9+
create materialized view testXA engine=MergeTree order by tuple() as select sleep(0.1) from testX;
10+
11+
-- { echoOn }
12+
13+
insert into testX select number from numbers(20)
14+
settings materialized_views_ignore_errors = 0; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }
15+
16+
select count() from testX;
17+
select count() from testXA;
18+
19+
insert into testX select number from numbers(20)
20+
settings materialized_views_ignore_errors = 1;
21+
22+
select count() from testX;
23+
select count() from testXA;
24+
25+
-- { echoOff }
26+
27+
drop table testX;
28+
drop view testXA;

0 commit comments

Comments
 (0)