alter_column_type command gets sent to DB2, causing numerous upgrade errors
Description
Attachments
Activity

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 AMEdited
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 AMEdited
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
Details
Assignee
Raven SongRaven Song(Deactivated)Reporter
Michael BowermanMichael Bowerman(Deactivated)Branch Version/s
7.0.xBackported to Branch
CommittedFix Priority
3Git Pull Request
7.0 Fix Pack Version
15Story Points
1.25Components
Affects versions
Priority
Medium
Details
Details
Assignee

Reporter

Branch Version/s
Backported to Branch
Fix Priority
Git Pull Request
7.0 Fix Pack Version
Story Points
Components
Affects versions
Priority
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

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 bealter table [tableName] alter column [columnName] set data type [newType]
.Steps to Reproduce
Start up Liferay 6.2 connected to a DB2 database (I used DB2 10.5).
Shut down Liferay.
Use the DXP Upgrade tool to upgrade your DB2 database to DXP.
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)