Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 79454c6

Browse files
committed
Tighten the per-operator testing done in brin regression test.
Verify that the number of matches is exactly what it should be, not just that it not be zero. This should help us detect any environment-dependent issues. Also, verify that we're getting the expected type of scan plan (either bitmap or seqscan as appropriate). Right now, this is failing on the cidrcol test cases, as shown in the output file. I'll look into that in a bit, but it seems good to commit this as-is temporarily to verify that it behaves as expected on the buildfarm.
1 parent 78e7279 commit 79454c6

File tree

2 files changed

+458
-104
lines changed

2 files changed

+458
-104
lines changed

src/test/regress/expected/brin.out

Lines changed: 243 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -92,65 +92,206 @@ CREATE INDEX brinidx ON brintest USING brin (
9292
lsncol,
9393
boxcol
9494
) with (pages_per_range = 1);
95-
CREATE TABLE brinopers (colname name, typ text, op text[], value text[],
96-
check (cardinality(op) = cardinality(value)));
95+
CREATE TABLE brinopers (colname name, typ text,
96+
op text[], value text[], matches int[],
97+
check (cardinality(op) = cardinality(value)),
98+
check (cardinality(op) = cardinality(matches)));
9799
INSERT INTO brinopers VALUES
98-
('byteacol', 'bytea', '{>, >=, =, <=, <}', '{AAAAAA, AAAAAA, BNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAA, ZZZZZZ, ZZZZZZ}'),
99-
('charcol', '"char"', '{>, >=, =, <=, <}', '{A, A, M, Z, Z}'),
100-
('namecol', 'name', '{>, >=, =, <=, <}', '{AAAAAA, AAAAAA, MAAAAA, ZZAAAA, ZZAAAA}'),
101-
('int2col', 'int2', '{>, >=, =, <=, <}', '{0, 0, 800, 999, 999}'),
102-
('int2col', 'int4', '{>, >=, =, <=, <}', '{0, 0, 800, 999, 1999}'),
103-
('int2col', 'int8', '{>, >=, =, <=, <}', '{0, 0, 800, 999, 1428427143}'),
104-
('int4col', 'int2', '{>, >=, =, <=, <}', '{0, 0, 800, 1999, 1999}'),
105-
('int4col', 'int4', '{>, >=, =, <=, <}', '{0, 0, 800, 1999, 1999}'),
106-
('int4col', 'int8', '{>, >=, =, <=, <}', '{0, 0, 800, 1999, 1428427143}'),
107-
('int8col', 'int2', '{>, >=}', '{0, 0}'),
108-
('int8col', 'int4', '{>, >=}', '{0, 0}'),
109-
('int8col', 'int8', '{>, >=, =, <=, <}', '{0, 0, 1257141600, 1428427143, 1428427143}'),
110-
('textcol', 'text', '{>, >=, =, <=, <}', '{AAAAAA, AAAAAA, BNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAA, ZZAAAA, ZZAAAA}'),
111-
('oidcol', 'oid', '{>, >=, =, <=, <}', '{0, 0, 8800, 9999, 9999}'),
112-
('tidcol', 'tid', '{>, >=, =, <=, <}', '{"(0,0)", "(0,0)", "(8800,0)", "(9999,19)", "(9999,19)"}'),
113-
('float4col', 'float4', '{>, >=, =, <=, <}', '{0.0103093, 0.0103093, 1, 1, 1}'),
114-
('float4col', 'float8', '{>, >=, =, <=, <}', '{0.0103093, 0.0103093, 1, 1, 1}'),
115-
('float8col', 'float4', '{>, >=, =, <=, <}', '{0, 0, 0, 1.98, 1.98}'),
116-
('float8col', 'float8', '{>, >=, =, <=, <}', '{0, 0, 0, 1.98, 1.98}'),
117-
('macaddrcol', 'macaddr', '{>, >=, =, <=, <}', '{00:00:01:00:00:00, 00:00:01:00:00:00, 2c:00:2d:00:16:00, ff:fe:00:00:00:00, ff:fe:00:00:00:00}'),
118-
('inetcol', 'inet', '{&&, =, <, <=, >, >=, >>=, >>, <<=, <<}', '{10/8, 10.2.14.231/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14.231/24, 10.2.14.231/25, 10.2.14.231/8, 0/0}'),
119-
('inetcol', 'inet', '{&&, >>=, <<=, =}', '{fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46, fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46}'),
120-
('inetcol', 'cidr', '{&&, <, <=, >, >=, >>=, >>, <<=, <<}', '{10/8, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14/24, 10.2.14/25, 10/8, 0/0}'),
121-
('inetcol', 'cidr', '{&&, >>=, <<=, =}', '{fe80::/32, fe80::6e40:8ff:fea9:8c46, fe80::/32, fe80::6e40:8ff:fea9:8c46}'),
122-
('cidrcol', 'inet', '{&&, =, <, <=, >, >=, >>=, >>, <<=, <<}', '{10/8, 10.2.14/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14.231/24, 10.2.14.231/25, 10.2.14.231/8, 0/0}'),
123-
('cidrcol', 'inet', '{&&, >>=, <<=, =}', '{fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46, fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46}'),
124-
('cidrcol', 'cidr', '{&&, =, <, <=, >, >=, >>=, >>, <<=, <<}', '{10/8, 10.2.14/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14/24, 10.2.14/25, 10/8, 0/0}'),
125-
('cidrcol', 'cidr', '{&&, >>=, <<=, =}', '{fe80::/32, fe80::6e40:8ff:fea9:8c46, fe80::/32, fe80::6e40:8ff:fea9:8c46}'),
126-
('bpcharcol', 'bpchar', '{>, >=, =, <=, <}', '{A, A, W, Z, Z}'),
127-
('datecol', 'date', '{>, >=, =, <=, <}', '{1995-08-15, 1995-08-15, 2009-12-01, 2022-12-30, 2022-12-30}'),
128-
('timecol', 'time', '{>, >=, =, <=, <}', '{01:20:30, 01:20:30, 02:28:57, 06:28:31.5, 06:28:31.5}'),
129-
('timestampcol', 'timestamp', '{>, >=, =, <=, <}', '{1942-07-23 03:05:09, 1942-07-23 03:05:09, 1964-03-24 19:26:45, 1984-01-20 22:42:21, 1984-01-20 22:42:21}'),
130-
('timestampcol', 'timestamptz', '{>, >=, =, <=, <}', '{1942-07-23 03:05:09, 1942-07-23 03:05:09, 1964-03-24 19:26:45, 1984-01-20 22:42:21, 1984-01-20 22:42:21}'),
131-
('timestampcol', 'timestamptz', '{>, >=, =, <=, <}', '{1942-07-23 03:05:09, 1942-07-23 03:05:09, 1964-03-24 19:26:45, 1984-01-20 22:42:21, 1984-01-20 22:42:21}'),
132-
('timestamptzcol', 'timestamptz', '{>, >=, =, <=, <}', '{1972-10-10 03:00:00-04, 1972-10-10 03:00:00-04, 1972-10-19 09:00:00-07, 1972-11-20 19:00:00-03, 1972-11-20 19:00:00-03}'),
133-
('intervalcol', 'interval', '{>, >=, =, <=, <}', '{00:00:00, 00:00:00, 1 mons 13 days 12:24, 2 mons 23 days 07:48:00, 1 year}'),
134-
('timetzcol', 'timetz', '{>, >=, =, <=, <}', '{01:30:20+02, 01:30:20+02, 01:35:50+02, 23:55:05+02, 23:55:05+02}'),
135-
('bitcol', 'bit(10)', '{>, >=, =, <=, <}', '{0000000010, 0000000010, 0011011110, 1111111000, 1111111000}'),
136-
('varbitcol', 'varbit(16)', '{>, >=, =, <=, <}', '{0000000000000100, 0000000000000100, 0001010001100110, 1111111111111000, 1111111111111000}'),
137-
('numericcol', 'numeric', '{>, >=, =, <=, <}', '{0.00, 0.01, 2268164.347826086956521739130434782609, 99470151.9, 99470151.9}'),
138-
('uuidcol', 'uuid', '{>, >=, =, <=, <}', '{00040004-0004-0004-0004-000400040004, 00040004-0004-0004-0004-000400040004, 52225222-5222-5222-5222-522252225222, 99989998-9998-9998-9998-999899989998, 99989998-9998-9998-9998-999899989998}'),
139-
('int4rangecol', 'int4range', '{<<, &<, &&, &>, >>, @>, <@, =, <, <=, >, >=}', '{"[10000,)","[10000,)","(,]","[3,4)","[36,44)","(1500,1501]","[3,4)","[222,1222)","[36,44)","[43,1043)","[367,4466)","[519,)"}'),
140-
('int4rangecol', 'int4range', '{@>, <@, =, <=, >, >=}', '{empty, empty, empty, empty, empty, empty}'),
141-
('int4rangecol', 'int4', '{@>}', '{1500}'),
142-
('lsncol', 'pg_lsn', '{>, >=, =, <=, <, IS, IS NOT}', '{0/1200, 0/1200, 44/455222, 198/1999799, 198/1999799, NULL, NULL}'),
143-
('boxcol', 'point', '{@>}', '{"(500,43)"}'),
144-
('boxcol', 'box', '{<<, &<, &&, &>, >>, <<|, &<|, |&>, |>>, @>, <@, ~=}', '{"((1000,2000),(3000,4000))","((1,2),(3000,4000))","((1,2),(3000,4000))","((1,2),(3000,4000))","((1,2),(3,4))","((1000,2000),(3000,4000))","((1,2000),(3,4000))","((1000,2),(3000,4))","((1,2),(3,4))","((1,2),(300,400))","((1,2),(3000,4000))","((222,1222),(44,45))"}');
100+
('byteacol', 'bytea',
101+
'{>, >=, =, <=, <}',
102+
'{AAAAAA, AAAAAA, BNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAA, ZZZZZZ, ZZZZZZ}',
103+
'{100, 100, 1, 100, 100}'),
104+
('charcol', '"char"',
105+
'{>, >=, =, <=, <}',
106+
'{A, A, M, Z, Z}',
107+
'{97, 100, 6, 100, 98}'),
108+
('namecol', 'name',
109+
'{>, >=, =, <=, <}',
110+
'{AAAAAA, AAAAAA, MAAAAA, ZZAAAA, ZZAAAA}',
111+
'{100, 100, 2, 100, 100}'),
112+
('int2col', 'int2',
113+
'{>, >=, =, <=, <}',
114+
'{0, 0, 800, 999, 999}',
115+
'{100, 100, 1, 100, 100}'),
116+
('int2col', 'int4',
117+
'{>, >=, =, <=, <}',
118+
'{0, 0, 800, 999, 1999}',
119+
'{100, 100, 1, 100, 100}'),
120+
('int2col', 'int8',
121+
'{>, >=, =, <=, <}',
122+
'{0, 0, 800, 999, 1428427143}',
123+
'{100, 100, 1, 100, 100}'),
124+
('int4col', 'int2',
125+
'{>, >=, =, <=, <}',
126+
'{0, 0, 800, 1999, 1999}',
127+
'{100, 100, 1, 100, 100}'),
128+
('int4col', 'int4',
129+
'{>, >=, =, <=, <}',
130+
'{0, 0, 800, 1999, 1999}',
131+
'{100, 100, 1, 100, 100}'),
132+
('int4col', 'int8',
133+
'{>, >=, =, <=, <}',
134+
'{0, 0, 800, 1999, 1428427143}',
135+
'{100, 100, 1, 100, 100}'),
136+
('int8col', 'int2',
137+
'{>, >=}',
138+
'{0, 0}',
139+
'{100, 100}'),
140+
('int8col', 'int4',
141+
'{>, >=}',
142+
'{0, 0}',
143+
'{100, 100}'),
144+
('int8col', 'int8',
145+
'{>, >=, =, <=, <}',
146+
'{0, 0, 1257141600, 1428427143, 1428427143}',
147+
'{100, 100, 1, 100, 100}'),
148+
('textcol', 'text',
149+
'{>, >=, =, <=, <}',
150+
'{AAAAAA, AAAAAA, BNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAABNAAAA, ZZAAAA, ZZAAAA}',
151+
'{100, 100, 1, 100, 100}'),
152+
('oidcol', 'oid',
153+
'{>, >=, =, <=, <}',
154+
'{0, 0, 8800, 9999, 9999}',
155+
'{100, 100, 1, 100, 100}'),
156+
('tidcol', 'tid',
157+
'{>, >=, =, <=, <}',
158+
'{"(0,0)", "(0,0)", "(8800,0)", "(9999,19)", "(9999,19)"}',
159+
'{100, 100, 1, 100, 100}'),
160+
('float4col', 'float4',
161+
'{>, >=, =, <=, <}',
162+
'{0.0103093, 0.0103093, 1, 1, 1}',
163+
'{100, 100, 4, 100, 96}'),
164+
('float4col', 'float8',
165+
'{>, >=, =, <=, <}',
166+
'{0.0103093, 0.0103093, 1, 1, 1}',
167+
'{100, 100, 4, 100, 96}'),
168+
('float8col', 'float4',
169+
'{>, >=, =, <=, <}',
170+
'{0, 0, 0, 1.98, 1.98}',
171+
'{99, 100, 1, 100, 100}'),
172+
('float8col', 'float8',
173+
'{>, >=, =, <=, <}',
174+
'{0, 0, 0, 1.98, 1.98}',
175+
'{99, 100, 1, 100, 100}'),
176+
('macaddrcol', 'macaddr',
177+
'{>, >=, =, <=, <}',
178+
'{00:00:01:00:00:00, 00:00:01:00:00:00, 2c:00:2d:00:16:00, ff:fe:00:00:00:00, ff:fe:00:00:00:00}',
179+
'{99, 100, 2, 100, 100}'),
180+
('inetcol', 'inet',
181+
'{&&, =, <, <=, >, >=, >>=, >>, <<=, <<}',
182+
'{10/8, 10.2.14.231/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14.231/24, 10.2.14.231/25, 10.2.14.231/8, 0/0}',
183+
'{100, 1, 100, 100, 125, 125, 2, 2, 100, 100}'),
184+
('inetcol', 'inet',
185+
'{&&, >>=, <<=, =}',
186+
'{fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46, fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46}',
187+
'{25, 1, 25, 1}'),
188+
('inetcol', 'cidr',
189+
'{&&, <, <=, >, >=, >>=, >>, <<=, <<}',
190+
'{10/8, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14/24, 10.2.14/25, 10/8, 0/0}',
191+
'{100, 100, 100, 125, 125, 2, 2, 100, 100}'),
192+
('inetcol', 'cidr',
193+
'{&&, >>=, <<=, =}',
194+
'{fe80::/32, fe80::6e40:8ff:fea9:8c46, fe80::/32, fe80::6e40:8ff:fea9:8c46}',
195+
'{25, 1, 25, 1}'),
196+
('cidrcol', 'inet',
197+
'{&&, =, <, <=, >, >=, >>=, >>, <<=, <<}',
198+
'{10/8, 10.2.14/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14.231/24, 10.2.14.231/25, 10.2.14.231/8, 0/0}',
199+
'{100, 2, 100, 100, 125, 125, 2, 2, 100, 100}'),
200+
('cidrcol', 'inet',
201+
'{&&, >>=, <<=, =}',
202+
'{fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46, fe80::6e40:8ff:fea9:a673/32, fe80::6e40:8ff:fea9:8c46}',
203+
'{25, 1, 25, 1}'),
204+
('cidrcol', 'cidr',
205+
'{&&, =, <, <=, >, >=, >>=, >>, <<=, <<}',
206+
'{10/8, 10.2.14/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0, 10.2.14/24, 10.2.14/25, 10/8, 0/0}',
207+
'{100, 2, 100, 100, 125, 125, 2, 2, 100, 100}'),
208+
('cidrcol', 'cidr',
209+
'{&&, >>=, <<=, =}',
210+
'{fe80::/32, fe80::6e40:8ff:fea9:8c46, fe80::/32, fe80::6e40:8ff:fea9:8c46}',
211+
'{25, 1, 25, 1}'),
212+
('bpcharcol', 'bpchar',
213+
'{>, >=, =, <=, <}',
214+
'{A, A, W, Z, Z}',
215+
'{97, 100, 6, 100, 98}'),
216+
('datecol', 'date',
217+
'{>, >=, =, <=, <}',
218+
'{1995-08-15, 1995-08-15, 2009-12-01, 2022-12-30, 2022-12-30}',
219+
'{100, 100, 1, 100, 100}'),
220+
('timecol', 'time',
221+
'{>, >=, =, <=, <}',
222+
'{01:20:30, 01:20:30, 02:28:57, 06:28:31.5, 06:28:31.5}',
223+
'{100, 100, 1, 100, 100}'),
224+
('timestampcol', 'timestamp',
225+
'{>, >=, =, <=, <}',
226+
'{1942-07-23 03:05:09, 1942-07-23 03:05:09, 1964-03-24 19:26:45, 1984-01-20 22:42:21, 1984-01-20 22:42:21}',
227+
'{100, 100, 1, 100, 100}'),
228+
('timestampcol', 'timestamptz',
229+
'{>, >=, =, <=, <}',
230+
'{1942-07-23 03:05:09, 1942-07-23 03:05:09, 1964-03-24 19:26:45, 1984-01-20 22:42:21, 1984-01-20 22:42:21}',
231+
'{100, 100, 1, 100, 100}'),
232+
('timestamptzcol', 'timestamptz',
233+
'{>, >=, =, <=, <}',
234+
'{1972-10-10 03:00:00-04, 1972-10-10 03:00:00-04, 1972-10-19 09:00:00-07, 1972-11-20 19:00:00-03, 1972-11-20 19:00:00-03}',
235+
'{100, 100, 1, 100, 100}'),
236+
('intervalcol', 'interval',
237+
'{>, >=, =, <=, <}',
238+
'{00:00:00, 00:00:00, 1 mons 13 days 12:24, 2 mons 23 days 07:48:00, 1 year}',
239+
'{100, 100, 1, 100, 100}'),
240+
('timetzcol', 'timetz',
241+
'{>, >=, =, <=, <}',
242+
'{01:30:20+02, 01:30:20+02, 01:35:50+02, 23:55:05+02, 23:55:05+02}',
243+
'{99, 100, 2, 100, 100}'),
244+
('bitcol', 'bit(10)',
245+
'{>, >=, =, <=, <}',
246+
'{0000000010, 0000000010, 0011011110, 1111111000, 1111111000}',
247+
'{100, 100, 1, 100, 100}'),
248+
('varbitcol', 'varbit(16)',
249+
'{>, >=, =, <=, <}',
250+
'{0000000000000100, 0000000000000100, 0001010001100110, 1111111111111000, 1111111111111000}',
251+
'{100, 100, 1, 100, 100}'),
252+
('numericcol', 'numeric',
253+
'{>, >=, =, <=, <}',
254+
'{0.00, 0.01, 2268164.347826086956521739130434782609, 99470151.9, 99470151.9}',
255+
'{100, 100, 1, 100, 100}'),
256+
('uuidcol', 'uuid',
257+
'{>, >=, =, <=, <}',
258+
'{00040004-0004-0004-0004-000400040004, 00040004-0004-0004-0004-000400040004, 52225222-5222-5222-5222-522252225222, 99989998-9998-9998-9998-999899989998, 99989998-9998-9998-9998-999899989998}',
259+
'{100, 100, 1, 100, 100}'),
260+
('int4rangecol', 'int4range',
261+
'{<<, &<, &&, &>, >>, @>, <@, =, <, <=, >, >=}',
262+
'{"[10000,)","[10000,)","(,]","[3,4)","[36,44)","(1500,1501]","[3,4)","[222,1222)","[36,44)","[43,1043)","[367,4466)","[519,)"}',
263+
'{53, 53, 53, 53, 50, 22, 72, 1, 74, 75, 34, 21}'),
264+
('int4rangecol', 'int4range',
265+
'{@>, <@, =, <=, >, >=}',
266+
'{empty, empty, empty, empty, empty, empty}',
267+
'{125, 72, 72, 72, 53, 125}'),
268+
('int4rangecol', 'int4',
269+
'{@>}',
270+
'{1500}',
271+
'{22}'),
272+
('lsncol', 'pg_lsn',
273+
'{>, >=, =, <=, <, IS, IS NOT}',
274+
'{0/1200, 0/1200, 44/455222, 198/1999799, 198/1999799, NULL, NULL}',
275+
'{100, 100, 1, 100, 100, 25, 100}'),
276+
('boxcol', 'point',
277+
'{@>}',
278+
'{"(500,43)"}',
279+
'{11}'),
280+
('boxcol', 'box',
281+
'{<<, &<, &&, &>, >>, <<|, &<|, |&>, |>>, @>, <@, ~=}',
282+
'{"((1000,2000),(3000,4000))","((1,2),(3000,4000))","((1,2),(3000,4000))","((1,2),(3000,4000))","((1,2),(3,4))","((1000,2000),(3000,4000))","((1,2000),(3,4000))","((1000,2),(3000,4))","((1,2),(3,4))","((1,2),(300,400))","((1,2),(3000,4000))","((222,1222),(44,45))"}',
283+
'{100, 100, 100, 99, 96, 100, 100, 99, 96, 1, 99, 1}');
145284
DO $x$
146285
DECLARE
147286
r record;
148287
r2 record;
149288
cond text;
150289
count int;
151290
mismatch bool;
291+
plan_ok bool;
292+
plan_line text;
152293
BEGIN
153-
FOR r IN SELECT colname, oper, typ, value[ordinality] FROM brinopers, unnest(op) WITH ORDINALITY AS oper LOOP
294+
FOR r IN SELECT colname, oper, typ, value[ordinality], matches[ordinality] FROM brinopers, unnest(op) WITH ORDINALITY AS oper LOOP
154295
mismatch := false;
155296

156297
-- prepare the condition
@@ -164,12 +305,34 @@ BEGIN
164305
CREATE TEMP TABLE brin_result (cid tid);
165306
SET enable_seqscan = 0;
166307
SET enable_bitmapscan = 1;
308+
309+
plan_ok := false;
310+
FOR plan_line IN EXECUTE format($y$EXPLAIN SELECT ctid FROM brintest WHERE %s $y$, cond) LOOP
311+
IF plan_line LIKE 'Bitmap Heap Scan on brintest%' THEN
312+
plan_ok := true;
313+
END IF;
314+
END LOOP;
315+
IF NOT plan_ok THEN
316+
RAISE WARNING 'did not get bitmap indexscan plan for %', r;
317+
END IF;
318+
167319
EXECUTE format($y$INSERT INTO brin_result SELECT ctid FROM brintest WHERE %s $y$, cond);
168320

169321
-- run the query using a seqscan
170322
CREATE TEMP TABLE brin_result_ss (cid tid);
171323
SET enable_seqscan = 1;
172324
SET enable_bitmapscan = 0;
325+
326+
plan_ok := false;
327+
FOR plan_line IN EXECUTE format($y$EXPLAIN SELECT ctid FROM brintest WHERE %s $y$, cond) LOOP
328+
IF plan_line LIKE 'Seq Scan on brintest%' THEN
329+
plan_ok := true;
330+
END IF;
331+
END LOOP;
332+
IF NOT plan_ok THEN
333+
RAISE WARNING 'did not get seqscan plan for %', r;
334+
END IF;
335+
173336
EXECUTE format($y$INSERT INTO brin_result_ss SELECT ctid FROM brintest WHERE %s $y$, cond);
174337

175338
-- make sure both return the same results
@@ -200,16 +363,44 @@ BEGIN
200363
END LOOP;
201364
END IF;
202365

203-
-- make sure it was a sensible test case
366+
-- make sure we found expected number of matches
204367
SELECT count(*) INTO count FROM brin_result;
205-
IF count = 0 THEN RAISE WARNING 'no results for %', r; END IF;
368+
IF count != r.matches THEN RAISE WARNING 'unexpected number of results % for %', count, r; END IF;
206369

207370
-- drop the temporary tables
208371
DROP TABLE brin_result;
209372
DROP TABLE brin_result_ss;
210373
END LOOP;
211374
END;
212375
$x$;
376+
WARNING: did not get bitmap indexscan plan for (cidrcol,&&,inet,10/8,100)
377+
WARNING: did not get bitmap indexscan plan for (cidrcol,=,inet,10.2.14/24,2)
378+
WARNING: did not get bitmap indexscan plan for (cidrcol,<,inet,255.255.255.255,100)
379+
WARNING: did not get bitmap indexscan plan for (cidrcol,<=,inet,255.255.255.255,100)
380+
WARNING: did not get bitmap indexscan plan for (cidrcol,>,inet,0.0.0.0,125)
381+
WARNING: did not get bitmap indexscan plan for (cidrcol,>=,inet,0.0.0.0,125)
382+
WARNING: did not get bitmap indexscan plan for (cidrcol,>>=,inet,10.2.14.231/24,2)
383+
WARNING: did not get bitmap indexscan plan for (cidrcol,>>,inet,10.2.14.231/25,2)
384+
WARNING: did not get bitmap indexscan plan for (cidrcol,<<=,inet,10.2.14.231/8,100)
385+
WARNING: did not get bitmap indexscan plan for (cidrcol,<<,inet,0/0,100)
386+
WARNING: did not get bitmap indexscan plan for (cidrcol,&&,inet,fe80::6e40:8ff:fea9:a673/32,25)
387+
WARNING: did not get bitmap indexscan plan for (cidrcol,>>=,inet,fe80::6e40:8ff:fea9:8c46,1)
388+
WARNING: did not get bitmap indexscan plan for (cidrcol,<<=,inet,fe80::6e40:8ff:fea9:a673/32,25)
389+
WARNING: did not get bitmap indexscan plan for (cidrcol,=,inet,fe80::6e40:8ff:fea9:8c46,1)
390+
WARNING: did not get bitmap indexscan plan for (cidrcol,&&,cidr,10/8,100)
391+
WARNING: did not get bitmap indexscan plan for (cidrcol,=,cidr,10.2.14/24,2)
392+
WARNING: did not get bitmap indexscan plan for (cidrcol,<,cidr,255.255.255.255,100)
393+
WARNING: did not get bitmap indexscan plan for (cidrcol,<=,cidr,255.255.255.255,100)
394+
WARNING: did not get bitmap indexscan plan for (cidrcol,>,cidr,0.0.0.0,125)
395+
WARNING: did not get bitmap indexscan plan for (cidrcol,>=,cidr,0.0.0.0,125)
396+
WARNING: did not get bitmap indexscan plan for (cidrcol,>>=,cidr,10.2.14/24,2)
397+
WARNING: did not get bitmap indexscan plan for (cidrcol,>>,cidr,10.2.14/25,2)
398+
WARNING: did not get bitmap indexscan plan for (cidrcol,<<=,cidr,10/8,100)
399+
WARNING: did not get bitmap indexscan plan for (cidrcol,<<,cidr,0/0,100)
400+
WARNING: did not get bitmap indexscan plan for (cidrcol,&&,cidr,fe80::/32,25)
401+
WARNING: did not get bitmap indexscan plan for (cidrcol,>>=,cidr,fe80::6e40:8ff:fea9:8c46,1)
402+
WARNING: did not get bitmap indexscan plan for (cidrcol,<<=,cidr,fe80::/32,25)
403+
WARNING: did not get bitmap indexscan plan for (cidrcol,=,cidr,fe80::6e40:8ff:fea9:8c46,1)
213404
INSERT INTO brintest SELECT
214405
repeat(stringu1, 42)::bytea,
215406
substr(stringu1, 1, 1)::"char",

0 commit comments

Comments
 (0)