Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-107454

AlterColumnType including nullable clause fails in DB2

    Details

    • Fix Priority:
      3

      Description

      Steps to reproduce it:

      1. Startup master with DB2
      2. Go to Groovy script and execute this:
      import com.liferay.portal.kernel.dao.db.DB;
      import com.liferay.portal.kernel.dao.db.DBManagerUtil;
      import com.liferay.portal.kernel.dao.db.DBInspector;
      import com.liferay.portal.kernel.dao.jdbc.DataAccess;
      import java.sql.Connection;Connection con =
      
      DataAccess.getConnection();
      
      DBInspector dbInspector = new DBInspector(con);
      
      DB db = DBManagerUtil.getDB();
      
      db.runSQL("alter_column_type Ticket companyId LONG not null");
      
      out.println(dbInspector.hasColumnType("Ticket", "companyId", "LONG not null"));
      

      Results:
      An exception like this is thrown:

      2020-01-22 00:11:26.567 ERROR [http-nio-8080-exec-7][EditServerMVCActionCommand:541] SanitizerLogWrapper warning: Following message contains CRLF characters
      DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=null;DATA TYPE bigint not;VOLATILE, DRIVER=4.9.78
       

      Expected results:
      Prints true because the column is not null

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Alberto Chaparro
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                44 weeks, 3 days ago

                  Packages

                  Version Package