fix(backend): document MySQL MAX_EXECUTION_TIME limitation for write queries

Add code comment noting that MySQL's MAX_EXECUTION_TIME only applies to
SELECT statements; write operations rely on the database's wait_timeout.
This commit is contained in:
Zamil Majdy
2026-03-27 01:26:18 +07:00
parent e6cf899a6d
commit 9cfa53a2ff

View File

@@ -436,6 +436,9 @@ class SQLQueryBlock(Block):
if read_only:
conn.execute(text("SET default_transaction_read_only = ON"))
elif engine.dialect.name == "mysql":
# NOTE: MAX_EXECUTION_TIME only applies to SELECT statements.
# Write queries (INSERT/UPDATE/DELETE) are not bounded by this
# setting; they rely on the database's wait_timeout instead.
conn.execute(
text(f"SET SESSION MAX_EXECUTION_TIME = {timeout * 1000}")
)