Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11179

4.3 schema changes don't work with existant log tables

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When I try to enable logging on trunk on a database that has previously had logging enabled (ie. turned off during upgrade) I get a fatal error because it tries to add the new column

      ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp ;

      I get mysql error

      " "1293 ** Incorrect table definition; there can be only one TIMESTAMP column wi...")"

      Dropping the log tables & recreating them seems to work (although of course all log data is lost)

      #3 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB.php(971): PEAR_Error->PEAR_Error("DB Error: a515ac9c2796ca0e23adbe92c68fc9fc", "a515ac9c2796ca0e23adbe92c68fc9fc", 16, (Array:2), "ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #4 C:\utils\eclipseworkspace\civicrm-trunk\packages\PEAR.php(564): DB_Error->DB_Error("a515ac9c2796ca0e23adbe92c68fc9fc", 16, (Array:2), "ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #5 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB\common.php(1903): PEAR->raiseError(NULL, "a515ac9c2796ca0e23adbe92c68fc9fc", NULL, NULL, "ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...", "DB_Error", TRUE)
      #6 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB\mysqli.php(928): DB_common->raiseError("a515ac9c2796ca0e23adbe92c68fc9fc", NULL, NULL, NULL, "1293 ** Incorrect table definition; there can be only one TIMESTAMP column wi...")
      #7 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB\mysqli.php(402): DB_mysqli->mysqliRaiseError()
      #8 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB\common.php(1216): DB_mysqli->simpleQuery("ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #9 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB\DataObject.php(2421): DB_common->query("ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #10 C:\utils\eclipseworkspace\civicrm-trunk\packages\DB\DataObject.php(1613): DB_DataObject->_query("ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #11 C:\utils\eclipseworkspace\civicrm-trunk\CRM\Core\DAO.php(155): DB_DataObject->query("ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #12 C:\utils\eclipseworkspace\civicrm-trunk\CRM\Core\DAO.php(915): CRM_Core_DAO->query("ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...", TRUE)
      #13 C:\utils\eclipseworkspace\civicrm-trunk\CRM\Logging\Schema.php(188): CRM_Core_DAO::executeQuery("ALTER TABLE `wct`.log_civicrm_contact ADD `modified_date` timestamp NULL DE...")
      #14 C:\utils\eclipseworkspace\civicrm-trunk\CRM\Logging\Schema.php(139): CRM_Logging_Schema->fixSchemaDifferencesFor("civicrm_contact", (Array:1))
      #15 C:\utils\eclipseworkspace\civicrm-trunk\CRM\Admin\Form\Setting\Miscellaneous.php(128): CRM_Logging_Schema->enableLogging()

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: