Error
Error Code:
1694
MariaDB Error 1694: Modifying sql_log_bin in Transaction
Description
Error 1694 occurs when an attempt is made to change the `@@session.sql_log_bin` variable while an active transaction is in progress for the current session. MariaDB prevents this modification mid-transaction to ensure the integrity and consistency of the binary log, which is crucial for replication and point-in-time recovery.
Error Message
Cannot modify @@session.sql_log_bin inside a transaction
Known Causes
3 known causesActive Transaction Conflict
You are attempting to alter the `sql_log_bin` session variable after a `START TRANSACTION` statement or within an implicitly started transaction.
Automated Script Inconsistency
An application or script is trying to set `sql_log_bin` without first checking for or committing/rolling back any existing open transactions.
Implicit Transaction Context
Certain DDL statements or specific auto-commit configurations might inadvertently create an implicit transaction, causing this error if `sql_log_bin` is then modified.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service