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

SQLGrammarException thrown by Define Permissions (Derby)

    Details

      Description

      Attempting to Define Permissions for an existing Role (e.g. User) causes an SQLGrammarException in the log (see attached server.log excerpt). The result being that existing permissions are not viewable on screen (see attached screenshot).

      I added hibernate.show_sql=true to portal-ext.properties and found the following SQL being executed from GroupFinderImpl.findByC_C_N_D ...

      SELECT 
      	Group_.groupId AS groupId, 
      	REPLACE(Group_.name, ' LFR_ORGANIZATION', '') AS groupName, 
      	Group_.type_ AS groupType, Group_.friendlyURL AS groupFriendlyURL 
      FROM Group_   
      INNER JOIN ResourcePermission ON (ResourcePermission.primKey = CAST(Group_.groupId AS CHAR(254))) 
      INNER JOIN ResourceAction ON (ResourceAction.name = ResourcePermission.name) 
      WHERE (Group_.liveGroupId = 0) 
      	AND (ResourcePermission.name = ?) 
      	AND (ResourcePermission.scope = ?) 
      	AND (ResourceAction.actionId = ?) 
      	AND (ResourcePermission.roleId = ?) 
      	AND (MOD(ResourcePermission.actionIds /  ResourceAction.bitwiseValue, 2 != 0) != 0)    
      	AND  (Group_.companyId = ?) 
      	AND (Group_.classNameId = 10021 
      		OR Group_.classNameId = 10001 
      		OR Group_.classNameId = 10003
      		OR Group_.classNameId = 10188) 
      	AND (Group_.liveGroupId = 0) 
      	AND (Group_.name != 'Control Panel') 
      	AND (lower(Group_.name) LIKE ? OR lower(Group_.name) LIKE ? OR ? IS NULL) 
      	AND (lower(Group_.description) LIKE ? OR ? IS NULL) 
      	AND (Group_.type_ != 4)) 
      ORDER BY groupName ASC
      

      I then ran this SQL against the Liferay database using SQuirreL SQL Client (using appropriate parameters) and it fails on the following line ...

      AND (MOD(ResourcePermission.actionIds /  ResourceAction.bitwiseValue, 2 != 0) != 0)
      

      It should probably look like this instead ...

      AND (MOD(ResourcePermission.actionIds /  ResourceAction.bitwiseValue, 2) != 0)
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 24 weeks, 5 days ago

                Packages

                Version Package
                6.2.0 CE M5