Skip to content

Commit 862fdbe

Browse files
committed
fix 02345_implicit_transaction
1 parent bcb1090 commit 862fdbe

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

tests/queries/0_stateless/02345_implicit_transaction.reference

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
no_transaction_landing 10000
2-
no_transaction_target 0
1+
no_transaction_landing 1
2+
no_transaction_target 1
33
after_transaction_landing 0
44
after_transaction_target 0
55
after_implicit_txn_in_query_settings_landing 0

tests/queries/0_stateless/02345_implicit_transaction.sql

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
-- Tags: no-ordinary-database, no-fasttest
2+
DROP TABLE IF EXISTS landing_to_target;
3+
DROP TABLE IF EXISTS target;
4+
DROP TABLE IF EXISTS landing;
25

36
CREATE TABLE landing (n Int64) engine=MergeTree order by n;
47
CREATE TABLE target (n Int64) engine=MergeTree order by n;
58
CREATE MATERIALIZED VIEW landing_to_target TO target AS
69
SELECT n + throwIf(n == 3333) AS n
710
FROM landing;
811

9-
INSERT INTO landing SELECT * FROM numbers(10000); -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }
10-
SELECT 'no_transaction_landing', count() FROM landing;
11-
SELECT 'no_transaction_target', count() FROM target;
12+
-- There is no gurantee what is inserted in case if exception
13+
-- That initial check is meaninglessness
14+
-- We only sure that if the internal mv's exception is ignored then all the data is inserted to the table landing
15+
INSERT INTO landing SELECT * FROM numbers(10000) SETTINGS materialized_views_ignore_errors=1;
16+
SELECT 'no_transaction_landing', count() = 10000 FROM landing;
17+
SELECT 'no_transaction_target', count() < 10000 FROM target;
1218

1319
TRUNCATE TABLE landing;
1420
TRUNCATE TABLE target;

0 commit comments

Comments
 (0)