-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathvector_agg_text_overflow.out
More file actions
60 lines (55 loc) · 2.08 KB
/
Copy pathvector_agg_text_overflow.out
File metadata and controls
60 lines (55 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.
-- Tests for body buffer overflow in columnar_result_set_row with
-- DT_ArrowText type. When vectorized text functions produce large
-- results, the body buffer growth computation could overflow int32,
-- and the total buffer size can exceed MaxAllocSize.
set max_parallel_workers_per_gather to 0;
create table t_textoverflow (time timestamptz, a text);
select table_name from create_hypertable('t_textoverflow', 'time',
chunk_time_interval => interval '1 year');
table_name
----------------
t_textoverflow
insert into t_textoverflow
select '2020-01-01'::timestamptz + i * interval '1 hour',
repeat('x', 100000)
from generate_series(1, 10) i;
alter table t_textoverflow set (
timescaledb.compress,
timescaledb.compress_orderby = 'time'
);
select count(compress_chunk(c)) from show_chunks('t_textoverflow') c;
count
-------
1
set timescaledb.debug_require_vector_agg to 'require';
select sum(length(a || a)) from t_textoverflow;
sum
---------
2000000
reset timescaledb.debug_require_vector_agg;
drop table t_textoverflow cascade;
-- When the actual data doesn't fit into MaxAllocSize, produce an error message
-- instead of erroring out in palloc.
create table t_text_overflow (time timestamptz not null, text_col text not null);
select table_name from create_hypertable('t_text_overflow', 'time',
chunk_time_interval => interval '1 year');
table_name
-----------------
t_text_overflow
insert into t_text_overflow
select '2020-01-01'::timestamptz + i * interval '1 hour', 'a'
from generate_series(1, 1000) i;
alter table t_text_overflow set (
timescaledb.compress,
timescaledb.compress_orderby = 'time'
);
select count(compress_chunk(c)) from show_chunks('t_text_overflow') c;
count
-------
1
set timescaledb.debug_require_vector_agg to 'require';
select count(text_col || repeat('x', 2000000)) from t_text_overflow;
ERROR: vectorized text result exceeds 1073741823 bytes