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

ServiceBuilder doesn't escape SQL keyword "output" as a db column name

    Details

      Description

      Sybase has problems when the column name output is used in a ServiceBuilder-built module.

      E.g. the following content in a service.xml:

      <entity local-service="true" name="Example">
      
      	<!-- PK fields -->
      
      	<column name="exampleId" primary="true" type="long" />
      
      	<!-- Audit fields -->
      
      	<column name="companyId" type="long" />
      	<column name="userId" type="long" />
      	<column name="userName" type="String" />
      	<column name="createDate" type="Date" />
      	<column name="modifiedDate" type="Date" />
      
      	<!-- Other fields -->
      
      	<column name="name" type="String" />
      	<column name="output" type="String" />
      </entity>
      

      works with ServiceBuilder without errors on buildService, and works with many RDBMSs (e.g. MySQL, PostgreSQL), but it causes errors on Sybase on startup when trying to apply the tables.sql, with

      Caused by: com.sybase.jdbc4.jdbc.SybSQLException: Incorrect syntax near the keyword 'output'.
      

      According to this page, output was a reserved word in older SQL standards (1992 and 1999), but not newer ones. Apparently Sybase still doesn't allow it (although, interestingly, Sybase doesn't mention that in their documentation).

      ^ All that to say, I think ServiceBuilder should escape this reserved word when it's used as a column name.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brian.chan Brian Chan
                Reporter:
                ethan.bustad Ethan Bustad
                Participants of an Issue:
                Recent user:
                Jason Pince
                Engineering Assignee:
                Peter Shin
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  15 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.X
                  7.1.X
                  7.2.X
                  7.2.1 CE GA2
                  Master