Skip to content

Commit

Permalink
Fix early abort in compression-ddl test (#7194)
Browse files Browse the repository at this point in the history
Disable-check: force-changelog-file
  • Loading branch information
kpan2034 authored Aug 13, 2024
1 parent e9e19ca commit a60d305
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tsl/test/expected/compression_ddl.out
Original file line number Diff line number Diff line change
Expand Up @@ -2497,5 +2497,17 @@ select decompress_chunk(show_chunks('hyper_unique_deferred'));
_timescaledb_internal._hyper_40_146_chunk
(1 row)

\set ON_ERROR_STOP 0
begin; insert INTO hyper_unique_deferred values (1257987700000000000, 'dev1', 1); abort;
ERROR: new row for relation "_hyper_40_146_chunk" violates check constraint "hyper_unique_deferred_sensor_1_check"
\set ON_ERROR_STOP 1
select compress_chunk(show_chunks('hyper_unique_deferred'));
compress_chunk
-------------------------------------------
_timescaledb_internal._hyper_40_146_chunk
(1 row)

\set ON_ERROR_STOP 0
begin; insert INTO hyper_unique_deferred values (1257987700000000000, 'dev1', 1); abort;
ERROR: duplicate key value violates unique constraint "146_2_hyper_unique_deferred_time_key"
\set ON_ERROR_STOP 1
4 changes: 4 additions & 0 deletions tsl/test/sql/compression_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,10 @@ INSERT INTO hyper_unique_deferred(time, device_id,sensor_1) VALUES (125798770000
alter table hyper_unique_deferred set (timescaledb.compress);
select compress_chunk(show_chunks('hyper_unique_deferred')); -- also worked fine before 2.11.0
select decompress_chunk(show_chunks('hyper_unique_deferred'));
\set ON_ERROR_STOP 0
begin; insert INTO hyper_unique_deferred values (1257987700000000000, 'dev1', 1); abort;
\set ON_ERROR_STOP 1
select compress_chunk(show_chunks('hyper_unique_deferred'));
\set ON_ERROR_STOP 0
begin; insert INTO hyper_unique_deferred values (1257987700000000000, 'dev1', 1); abort;
\set ON_ERROR_STOP 1

0 comments on commit a60d305

Please sign in to comment.