Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-17039

Confluence upgrade failed due to database case sensitivity

      Summary

      Occasionally upgrade will fail for some customers due to case sensitivity.

      For example:

      2009-09-23 10:57:35,759 ERROR [Main Thread] [confluence.upgrade.upgradetask.ResizeProfileImagesUpgradeTask] doUpgrade SQL error occured whilst performing ResizeProfileImagesUpgradeTask
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'databaseName.OS_USER' doesn't exist
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      

      In reality the table OS_USER actually exists in lower case.

      The upgrade fail because the query to be executed is (see line 57 of confluence.upgrade.upgradetask.ResizeProfileImagesUpgradeTask for Confluence 3.0.1):

      57.   ResultSet rs = statement.executeQuery("select OS_USER.USERNAME, OS_PROPERTYENTRY.STRING_VAL from OS_USER, OS_PROPERTYENTRY where OS_USER.ID = OS_PROPERTYENTRY.ENTITY_ID and OS_PROPERTYENTRY.ENTITY_KEY = '" + UserPreferencesKeys.PROPERTY_USER_PROFILE_PICTURE + "'");
      

      The upgrade task in this case (and other cases involving schema update) need to be smart enough to identify what database casing is used so the upgrade can proceed smoothly.

            [CONFSERVER-17039] Confluence upgrade failed due to database case sensitivity

            To apply this patch:

            1. Download the attachment
            2. Rename the file to ResizeProfileImagesUpgradeTask.class
            3. Copy the file to <confluence>/WEB-INF/classes/com/atlassian/confluence/upgrade/upgradetask (replace the file if it already exists)
            4. Restart the server

            Please note that this patch is designed for upgrading from versions prior to 2.2 only.

            Brian Nguyen (Inactive) added a comment - To apply this patch: Download the attachment Rename the file to ResizeProfileImagesUpgradeTask.class Copy the file to <confluence>/WEB-INF/classes/com/atlassian/confluence/upgrade/upgradetask (replace the file if it already exists) Restart the server Please note that this patch is designed for upgrading from versions prior to 2.2 only.

            Anatoli added a comment -

            Some docs about how mySQL handles case sensitivity of table names: http://doc.51windows.net/mysql/?url=/MySQL/ch09s02.html. mySQL has lower-case-table-names flag that allows you to adjust case sensitivity of table names.

            Note that if you plan to set the lower_case_table_names system variable to 1 on Unix, you must first convert your old database and table names to lowercase before restarting mysqld with the new variable setting.

            Anatoli added a comment - Some docs about how mySQL handles case sensitivity of table names: http://doc.51windows.net/mysql/?url=/MySQL/ch09s02.html . mySQL has lower-case-table-names flag that allows you to adjust case sensitivity of table names. Note that if you plan to set the lower_case_table_names system variable to 1 on Unix, you must first convert your old database and table names to lowercase before restarting mysqld with the new variable setting.

              bnguyen Brian Nguyen (Inactive)
              rhartono Roy Hartono [Atlassian]
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: