@@ -50,7 +50,7 @@ def test_simple_query(config):
5050 Buckets: \d+ Batches: \d+ Memory Usage: \d+kB
5151 -> Seq Scan on bar \(Current loop: actual rows=\d+, loop number=1\)"""
5252
53- qs , _ = common .query_state (config , acon , query )
53+ qs , _ = common .onetime_query_state (config , acon , query )
5454 assert qs [0 ][0 ] == acon .get_backend_pid () and qs [0 ][1 ] == 0 \
5555 and qs [0 ][2 ] == query and re .match (expected , qs [0 ][3 ]) and qs [0 ][4 ] == None
5656
@@ -111,7 +111,7 @@ def test_nested_call(config):
111111 util_curs .execute (create_function )
112112 util_conn .commit ()
113113
114- qs , notices = common .query_state (config , acon , call_function )
114+ qs , notices = common .onetime_query_state (config , acon , call_function )
115115 assert len (qs ) == 2 \
116116 and qs [0 ][0 ] == qs [1 ][0 ] == acon .get_backend_pid () \
117117 and qs [0 ][1 ] == 0 and qs [1 ][1 ] == 1 \
@@ -143,7 +143,7 @@ def test_insert_on_conflict(config):
143143 util_curs .execute (add_field_uniqueness )
144144 util_conn .commit ()
145145
146- qs , notices = common .query_state (config , acon , query )
146+ qs , notices = common .onetime_query_state (config , acon , query )
147147
148148 assert qs [0 ][0 ] == acon .get_backend_pid () and qs [0 ][1 ] == 0 \
149149 and qs [0 ][2 ] == query and re .match (expected , qs [0 ][3 ]) \
@@ -185,13 +185,13 @@ def test_trigger(config):
185185 util_curs .execute (create_trigger )
186186 util_conn .commit ()
187187
188- qs , notices = common .query_state (config , acon , query , {'triggers' : True })
188+ qs , notices = common .onetime_query_state (config , acon , query , {'triggers' : True })
189189 assert qs [0 ][0 ] == acon .get_backend_pid () and qs [0 ][1 ] == 0 \
190190 and qs [0 ][2 ] == query and re .match (expected_upper , qs [0 ][3 ]) \
191191 and qs [0 ][4 ] == None
192192 assert len (notices ) == 0
193193
194- qs , notices = common .query_state (config , acon , query , {'triggers' : False })
194+ qs , notices = common .onetime_query_state (config , acon , query , {'triggers' : False })
195195 assert qs [0 ][0 ] == acon .get_backend_pid () and qs [0 ][1 ] == 0 \
196196 and qs [0 ][2 ] == query and re .match (expected_upper , qs [0 ][3 ]) \
197197 and qs [0 ][4 ] == None
@@ -215,7 +215,7 @@ def test_costs(config):
215215 Buckets: \d+ Batches: \d+ Memory Usage: \d+kB
216216 -> Seq Scan on bar \(cost=0.00..\d+.\d+ rows=\d+ width=4\) \(Current loop: actual rows=\d+, loop number=1\)"""
217217
218- qs , notices = common .query_state (config , acon , query , {'costs' : True })
218+ qs , notices = common .onetime_query_state (config , acon , query , {'costs' : True })
219219 assert len (qs ) == 1 and re .match (expected , qs [0 ][3 ])
220220 assert len (notices ) == 0
221221
@@ -238,7 +238,7 @@ def test_buffers(config):
238238
239239 common .set_guc (acon , 'pg_query_state.enable_buffers' , 'on' )
240240
241- qs , notices = common .query_state (config , acon , query , {'buffers' : True })
241+ qs , notices = common .onetime_query_state (config , acon , query , {'buffers' : True })
242242 assert len (qs ) == 1 and re .match (expected , qs [0 ][3 ])
243243 assert len (notices ) == 0
244244
@@ -259,7 +259,7 @@ def test_timing(config):
259259
260260 common .set_guc (acon , 'pg_query_state.enable_timing' , 'on' )
261261
262- qs , notices = common .query_state (config , acon , query , {'timing' : True })
262+ qs , notices = common .onetime_query_state (config , acon , query , {'timing' : True })
263263 assert len (qs ) == 1 and re .match (expected , qs [0 ][3 ])
264264 assert len (notices ) == 0
265265
@@ -298,11 +298,11 @@ def test_formats(config):
298298 Buckets: \d+ Batches: \d+ Memory Usage: \d+kB
299299 -> Seq Scan on bar \(Current loop: actual rows=\d+, loop number=1\)"""
300300
301- qs , notices = common .query_state (config , acon , query , {'format' : 'text' })
301+ qs , notices = common .onetime_query_state (config , acon , query , {'format' : 'text' })
302302 assert len (qs ) == 1 and re .match (expected , qs [0 ][3 ])
303303 assert len (notices ) == 0
304304
305- qs , notices = common .query_state (config , acon , query , {'format' : 'json' })
305+ qs , notices = common .onetime_query_state (config , acon , query , {'format' : 'json' })
306306 try :
307307 js_obj = json .loads (qs [0 ][3 ])
308308 except ValueError :
@@ -311,7 +311,7 @@ def test_formats(config):
311311 assert len (notices ) == 0
312312 check_plan (js_obj ['Plan' ])
313313
314- qs , notices = common .query_state (config , acon , query , {'format' : 'xml' })
314+ qs , notices = common .onetime_query_state (config , acon , query , {'format' : 'xml' })
315315 assert len (qs ) == 1
316316 assert len (notices ) == 0
317317 try :
@@ -320,7 +320,7 @@ def test_formats(config):
320320 assert False , 'Invalid xml format'
321321 check_xml (xml_root )
322322
323- qs , _ = common .query_state (config , acon , query , {'format' : 'yaml' })
323+ qs , _ = common .onetime_query_state (config , acon , query , {'format' : 'yaml' })
324324 try :
325325 yaml_doc = yaml .load (qs [0 ][3 ], Loader = yaml .FullLoader )
326326 except :
@@ -339,15 +339,15 @@ def test_timing_buffers_conflicts(config):
339339 timing_pattern = '(?:running time=\d+.\d+)|(?:actual time=\d+.\d+..\d+.\d+)'
340340 buffers_pattern = 'Buffers:'
341341
342- qs , notices = common .query_state (config , acon , query , {'timing' : True , 'buffers' : False })
342+ qs , notices = common .onetime_query_state (config , acon , query , {'timing' : True , 'buffers' : False })
343343 assert len (qs ) == 1 and not re .search (timing_pattern , qs [0 ][3 ])
344344 assert notices == ['WARNING: timing statistics disabled\n ' ]
345345
346- qs , notices = common .query_state (config , acon , query , {'timing' : False , 'buffers' : True })
346+ qs , notices = common .onetime_query_state (config , acon , query , {'timing' : False , 'buffers' : True })
347347 assert len (qs ) == 1 and not re .search (buffers_pattern , qs [0 ][3 ])
348348 assert notices == ['WARNING: buffers statistics disabled\n ' ]
349349
350- qs , notices = common .query_state (config , acon , query , {'timing' : True , 'buffers' : True })
350+ qs , notices = common .onetime_query_state (config , acon , query , {'timing' : True , 'buffers' : True })
351351 assert len (qs ) == 1 and not re .search (timing_pattern , qs [0 ][3 ]) \
352352 and not re .search (buffers_pattern , qs [0 ][3 ])
353353 assert len (notices ) == 2 and 'WARNING: timing statistics disabled\n ' in notices \
0 commit comments