Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-16957

upgrading from 5.0.x to 5.1.1.5 ACTIVITI MySQL script is incorrectly setting collation

    Details

    • Type: Service Pack Request
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 5.1.1
    • Fix Version/s: None
    • Component/s: Upgrades, Workflow
    • Labels:
      None
    • Environment:
      MariaDB
      Alfresco 5.1.1
    • Bug Priority:
      Category 3
    • ACT Numbers:

      00740148

      Description

      STEPS TO REPRODUCE

      -Create an environment using MariaDB with 5.0.2
      -Set the DB schema default to UTF8_Default (or any other but no uft8_bin)
      -Upgrade the environment to 5.1.1

      While upgrading from 5.0.2 to 5.1.1.5 using MariaDB this error that is preventing the upgrade process to complete:

      Statement execution failed:
      SQL: alter table ACT_PROCDEF_INFO
      add constraint ACT_FK_INFO_JSON_BA
      foreign key (INFO_JSON_ID_)
      references ACT_GE_BYTEARRAY (ID_)
      Error: Can't create table `alfresco`.`#sql-5002_1f` (errno: 150 "Foreign key constraint is incorrectly formed") 
      

      This is caused by the line 34 of the script (bundled in the alfresco-repository.5.1.1.jar):

      alfresco/dbscripts/upgrade/5.1/org.hibernate.dialect.MySQLInnoDBDialect/activiti-upgrade-5-19-0.sql
      [...]
      ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; <----- problem here
      [...]
      

      Some databases do not have utf8_bin as default (could be ut8_default) and the FK creation fails to validate (the newly created table needs to be same collation and datatype as the existing one)

      The "collate" parameter does not need to be specified so it will take the default (that would match the existing table collation)

        Attachments

          Structure

            Activity

              People

              • Assignee:
                closedissues Closed Issues
                Reporter:
                asolerasenci Antonio Soler-Asenci [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 3 hours
                  1d 3h

                    Structure Helper Panel