Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11999

Cannot use database restore feature with generated backups in MSSQL Native

    XMLWordPrintable

Details

    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()

      Attachments

        Activity

          People

            CHItA CHItA
            Noxwizard Patrick Webster
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: