alter_column_type command gets sent to DB2, causing numerous upgrade errors

Description

Description
In our Compatibility Matrix, we claim to support DB2, yet during the upgrade process, we send many commands to DB2 that are invalid syntax for it. In particular, we send a lot of alter_column_type [tableName] [columnName] [newType] commands, which is invalid syntax for DB2. The correct syntax for DB2 would be alter table [tableName] alter column [columnName] set data type [newType].

Steps to Reproduce

  1. Start up Liferay 6.2 connected to a DB2 database (I used DB2 10.5).

  2. Shut down Liferay.

  3. Use the DXP Upgrade tool to upgrade your DB2 database to DXP.

  4. Observe the logs as the upgrade moves forward.

Expected Results: The upgrade would complete successfully with no errors.
Actual Results: The upgrade completes, but many errors of the following nature appear in the logs:

This causes many columns to retain their old type instead of being given the new type that is necessary for DXP.

Can't test in master because DB2 is not supported in master. However, the necessary logic to fix this issue appears to be missing from the DB2SQLTransformerLogic class in master, so we should commit the fix to master too (c8370cfc99afbd064a3905d0b4b5239b3766eca7).
Reproduced in ee-7.0.x (f51c2a99cb6c9b5e7fd6dab46b73a322029c8faa)

Attachments

1

Activity

Show:

Raven SongMay 9, 2017 at 5:14 PM

PASSED Manual Testing following the steps in the description.

Fixed on:
Tomcat 8.0.32 + MySQL 5.6. Portal ee-7.0.x GIT ID: d32789bebe19410531e80857181407ddc2c5d6b7.

The upgrade complete successfully and doesn't appear com.ibm.db2.jcc.am.SqlSyntaxErrorException errror.

Raven SongMay 9, 2017 at 5:10 PM

Hi , thanks for your explain. I will close it as fix.

Michael BowermanMay 9, 2017 at 7:43 AM
Edited

Many errors appear in the logs, but the com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=alter_column_type RepositoryEntry;BEGIN-OF-STATEMENT;<create_variable>, DRIVER=4.19.66 error does not appear anywhere in the logs. This ticket was only meant to fix all the instances of that particular error. We'll deal with the other errors in a separate ticket(s).

Raven SongMay 9, 2017 at 12:56 AM
Edited

FAILED Manual Testing following the steps in the description.

Failed on:
Tomcat 8.0.32 + MySQL 5.6. Portal ee-7.0.x GIT ID: d32789bebe19410531e80857181407ddc2c5d6b7.

The upgrade completes, but many errors appear in the logs(see attachment).

Miguel Ángel Pastor OlivarMay 8, 2017 at 6:42 AM

Just started reviewing migue/liferay-portal-ee#83.

 

Sent from GH

Fixed

Details

Assignee

Reporter

Branch Version/s

7.0.x

Backported to Branch

Committed

Fix Priority

3

Git Pull Request

7.0 Fix Pack Version

15

Story Points

Components

Affects versions

Priority

Zendesk Support

Created May 1, 2017 at 3:45 PM
Updated June 26, 2023 at 1:16 AM
Resolved May 9, 2017 at 7:47 AM
Loading...