aminghadersohi commented on code in PR #44261:
URL: https://github.com/apache/superset/pull/44261#discussion_r4024252815
##########
superset/versioning/activity/queries.py:
##########
@@ -418,10 +418,17 @@ def _select_change_rows_for_kinds(
vc.c.sequence.desc(),
vc.c.entity_id.desc(),
)
+ # stream_results rides the STATEMENT, never the connection:
+ # ``Connection.execution_options`` mutates the session's
+ # connection in place, permanently flipping every later
+ # statement on the request into a server-side cursor — on
+ # PostgreSQL that wraps subsequent INSERTs/SAVEPOINTs in
+ # ``DECLARE ... CURSOR FOR`` and they fail with a syntax
+ # error (observed: Continuum's transaction insert and the
+ # DBEventLogger write after an activity read; sc-120955).
result = (
db.session.connection()
- .execution_options(stream_results=True)
- .execute(stmt)
+ .execute(stmt.execution_options(stream_results=True))
Review Comment:
Verified on PG16/SA 2.0.52 that statement-level `stream_results` really does
stream — the fix holds. But deleting the option entirely still passes this test
and the whole versioning suite, so nothing pins that this path streams. A
`before_cursor_execute` spy asserting `cursor.name` catches it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]