@@ -128,7 +128,7 @@ def test_live_export_uses_one_snapshot(environment_name, source_sav, tmp_path, m
128128 )
129129 engine = create_engine (database_url )
130130 tables = normative_catalog (MetaData ())
131- readers , isolations , native_transactions = [], [], []
131+ readers , isolations , transaction_checks = [], [], []
132132 committed = False
133133
134134 def weaker_default (connection ):
@@ -175,10 +175,17 @@ def interleave(connection, _cursor, statement, _parameters, _context, _many):
175175 readers .append (connection )
176176 raw = connection .connection .driver_connection
177177 isolations .append (connection .dialect .get_isolation_level (raw ))
178- native_transactions .append (
179- raw .info .transaction_status != 0
180- if connection .dialect .name == "postgresql" else bool (raw .server_status & 1 )
181- )
178+ if connection .dialect .name == "postgresql" :
179+ transaction_checks .append (("native_transaction_active" , raw .info .transaction_status != 0 ))
180+ elif environment_name == "OPENSTATSPEC_DOLT_URL" :
181+ # Dolt's explicit BEGIN supplies an OK packet with a valid IN_TRANS bit.
182+ transaction_checks .append (("begin_in_trans" , bool (raw .server_status & 1 )))
183+ else :
184+ # PyMySQL updates server_status from OK, not SELECT EOF packets:
185+ # IN_TRANS may still describe the isolation setter's COMMIT.
186+ # Autocommit off implies a native txn at this real table SELECT;
187+ # the interleaving below proves snapshot safety, not a measured bit.
188+ transaction_checks .append (("autocommit_disabled" , not raw .get_autocommit ()))
182189 if committed or "FROM variable " not in sql or "ORDER BY variable.source_ordinal" not in sql :
183190 return
184191 with engine .begin () as writer :
@@ -227,7 +234,7 @@ def write_after_read(*args, **kwargs):
227234 event .remove (Engine , "before_cursor_execute" , only_reads )
228235 event .remove (Engine , "engine_connect" , weaker_default )
229236 record_property ("catalog_isolations" , isolations )
230- record_property ("catalog_native_transactions " , native_transactions )
237+ record_property ("catalog_transaction_checks " , transaction_checks )
231238 record_property ("writer_committed" , committed )
232239 assert committed
233240 assert not result .diagnostics
@@ -237,7 +244,7 @@ def write_after_read(*args, **kwargs):
237244 for key in ("var_labels" , "var_value_labels" ):
238245 assert actual_meta [key ] == expected_meta [key ]
239246 assert isolations and set (isolations ) == {"REPEATABLE READ" }
240- assert all (native_transactions ), "first catalog read must be in a native transaction"
247+ assert transaction_checks and all (passed for _ , passed in transaction_checks ), transaction_checks
241248 assert all (connection .closed for connection in readers )
242249 _ , variables , rows = wide .read_wide_dataset (
243250 database_url = database_url , dataset_id = imported ["dataset_id" ],
0 commit comments