Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
3.0.12, 3.1.0-a1
-
None
-
MSSQL 2012, PHP 5.3.10, PHP SQLSRV Driver 3.0
Description
The MSSQL Native backups generated by the "backup" feature cannot be restored using the "restore" feature. The backups are syntactically correct and can be restored using tools like SSMS. The problem is that we include a transaction begin/commit in the backup file. The sqlsrv PHP driver cannot perform manual transaction queries. You MUST use the built-in sqlsrv transaction functions. We either need to remove the transaction statements from the backup (not ideal) or ensure that if the query we are about to perform is transaction related, we call the appropriate sqlsrv function instead.
Relevant error:
SQL ERROR [ mssqlnative ]
SQLSTATE: 42000 code: 3997 message: [Microsoft][SQL Server Native Client 11.0][SQL Server]A transaction that was started in a MARS batch is still active at the end of the batch. The transaction is rolled back. [3997]
SQL
– -- phpBB Backup Script – Dump of tables for phpbb3_ – DATE : 03-11-2013 03:50:11 GMT – BEGIN TRANSACTION
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()FILE: [ROOT]/includes/db/mssqlnative.php
LINE: 322
CALL: dbal->sql_error()FILE: [ROOT]/includes/acp/acp_database.php
LINE: 405
CALL: dbal_mssqlnative->sql_query()FILE: [ROOT]/includes/functions_module.php
LINE: 507
CALL: acp_database->main()FILE: [ROOT]/adm/index.php
LINE: 74
CALL: p_master->load_active()