A function commits or rolls back a transaction
What it finds
A function that commits or rolls back: MySQL rejects it, PostgreSQL fails when it runs, and Oracle fails when the function is called from a query, unless it is an autonomous transaction. Functions compute values; procedures control transactions.
From the rule's source, transaction_control_in_function.rs.
Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/sql:transaction-control-in-function" = "error"To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.
tx0 explain tx0/sql:transaction-control-in-function shows the same in the terminal. Found a false positive? Report it.