@@ -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 )
5454assert qs [0 ][0 ]== acon .get_backend_pid ()and qs [0 ][1 ]== 0 \
5555and 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):
111111util_curs .execute (create_function )
112112util_conn .commit ()
113113
114- qs ,notices = common .query_state (config ,acon ,call_function )
114+ qs ,notices = common .onetime_query_state (config ,acon ,call_function )
115115assert len (qs )== 2 \
116116and qs [0 ][0 ]== qs [1 ][0 ]== acon .get_backend_pid () \
117117and qs [0 ][1 ]== 0 and qs [1 ][1 ]== 1 \
@@ -143,7 +143,7 @@ def test_insert_on_conflict(config):
143143util_curs .execute (add_field_uniqueness )
144144util_conn .commit ()
145145
146- qs ,notices = common .query_state (config ,acon ,query )
146+ qs ,notices = common .onetime_query_state (config ,acon ,query )
147147
148148assert qs [0 ][0 ]== acon .get_backend_pid ()and qs [0 ][1 ]== 0 \
149149and qs [0 ][2 ]== query and re .match (expected ,qs [0 ][3 ]) \
@@ -185,13 +185,13 @@ def test_trigger(config):
185185util_curs .execute (create_trigger )
186186util_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 })
189189assert qs [0 ][0 ]== acon .get_backend_pid ()and qs [0 ][1 ]== 0 \
190190and qs [0 ][2 ]== query and re .match (expected_upper ,qs [0 ][3 ]) \
191191and qs [0 ][4 ]== None
192192assert 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 })
195195assert qs [0 ][0 ]== acon .get_backend_pid ()and qs [0 ][1 ]== 0 \
196196and qs [0 ][2 ]== query and re .match (expected_upper ,qs [0 ][3 ]) \
197197and 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 })
219219assert len (qs )== 1 and re .match (expected ,qs [0 ][3 ])
220220assert len (notices )== 0
221221
@@ -238,7 +238,7 @@ def test_buffers(config):
238238
239239common .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 })
242242assert len (qs )== 1 and re .match (expected ,qs [0 ][3 ])
243243assert len (notices )== 0
244244
@@ -259,7 +259,7 @@ def test_timing(config):
259259
260260common .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 })
263263assert len (qs )== 1 and re .match (expected ,qs [0 ][3 ])
264264assert 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' })
302302assert len (qs )== 1 and re .match (expected ,qs [0 ][3 ])
303303assert 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' })
306306try :
307307js_obj = json .loads (qs [0 ][3 ])
308308except ValueError :
@@ -311,7 +311,7 @@ def test_formats(config):
311311assert len (notices )== 0
312312check_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' })
315315assert len (qs )== 1
316316assert len (notices )== 0
317317try :
@@ -320,7 +320,7 @@ def test_formats(config):
320320assert False ,'Invalid xml format'
321321check_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' })
324324try :
325325yaml_doc = yaml .load (qs [0 ][3 ],Loader = yaml .FullLoader )
326326except :
@@ -339,15 +339,15 @@ def test_timing_buffers_conflicts(config):
339339timing_pattern = '(?:running time=\d+.\d+)|(?:actual time=\d+.\d+..\d+.\d+)'
340340buffers_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 })
343343assert len (qs )== 1 and not re .search (timing_pattern ,qs [0 ][3 ])
344344assert 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 })
347347assert len (qs )== 1 and not re .search (buffers_pattern ,qs [0 ][3 ])
348348assert 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 })
351351assert len (qs )== 1 and not re .search (timing_pattern ,qs [0 ][3 ]) \
352352and not re .search (buffers_pattern ,qs [0 ][3 ])
353353assert len (notices )== 2 and 'WARNING: timing statistics disabled\n ' in notices \