Commit 1b4780d 1 parent babcc8e commit 1b4780d Copy full SHA for 1b4780d
File tree 3 files changed +54
-1
lines changed
3 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ cursor_fetcher_rewind(DataFetcher *df)
421
421
{
422
422
char sql [64 ];
423
423
424
- Assert (cursor -> state .data_req != NULL );
424
+ Assert (cursor -> state .eof || cursor -> state . data_req != NULL );
425
425
426
426
if (!cursor -> state .eof )
427
427
async_request_discard_response (cursor -> state .data_req );
Original file line number Diff line number Diff line change @@ -91,3 +91,31 @@ limit 1;
91
91
(1 row)
92
92
93
93
reset timescaledb.remote_data_fetcher;
94
+ -- #3786 test for assertion failure in cursor_fetcher_rewind
95
+ SET jit TO off;
96
+ SELECT *
97
+ FROM devices AS d
98
+ WHERE
99
+ EXISTS(
100
+ SELECT 1
101
+ FROM metrics_dist AS m,
102
+ LATERAL(
103
+ SELECT 1
104
+ FROM insert_test it
105
+ WHERE
106
+ EXISTS(
107
+ SELECT 1
108
+ FROM dist_chunk_copy AS ref_2
109
+ WHERE
110
+ it.id IS NOT NULL AND
111
+ EXISTS(SELECT d.name AS c0 FROM metrics_int WHERE NULL::TIMESTAMP <= m.time)
112
+ )
113
+ ) AS l
114
+ WHERE d.name ~~ d.name
115
+ )
116
+ ORDER BY 1,2;
117
+ device_id | name
118
+ -----------+------
119
+ (0 rows)
120
+
121
+ RESET jit;
Original file line number Diff line number Diff line change @@ -37,3 +37,28 @@ where t1.id = t2.id + 1
37
37
limit 1 ;
38
38
39
39
reset timescaledb .remote_data_fetcher ;
40
+
41
+ -- #3786 test for assertion failure in cursor_fetcher_rewind
42
+ SET jit TO off;
43
+ SELECT *
44
+ FROM devices AS d
45
+ WHERE
46
+ EXISTS(
47
+ SELECT 1
48
+ FROM metrics_dist AS m,
49
+ LATERAL(
50
+ SELECT 1
51
+ FROM insert_test it
52
+ WHERE
53
+ EXISTS(
54
+ SELECT 1
55
+ FROM dist_chunk_copy AS ref_2
56
+ WHERE
57
+ it .id IS NOT NULL AND
58
+ EXISTS(SELECT d .name AS c0 FROM metrics_int WHERE NULL ::TIMESTAMP <= m .time )
59
+ )
60
+ ) AS l
61
+ WHERE d .name ~~ d .name
62
+ )
63
+ ORDER BY 1 ,2 ;
64
+ RESET jit;
You can’t perform that action at this time.
0 commit comments