SQL92 identifiers not quoted before execution via JDBC

XMLWordPrintable

    • 2.06

      While trying to add support for the FrontBase SQL 92 compliant database server to JIRA (URL: http://www.frontbase.com/), the following issue is seen:

      Database creation and initialization succeeds. During an import of an existing setup (XML import), the following error is displayed: "Form Errors:
      Failed to import data. Exception:Error in action: com.atlassian.jira.action.admin.DataImport@692b33, result: null Exception occurred: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, PORTALPAGE, PORTLET_ID, COLUMN_NUMBER, POSITION FROM portletconfiguration (Syntax error 80. Expected '(' not found.)"

      The context of the SQL is:

      set transaction isolation level serializable, locking pessimistic, read write;
      set commit false;
      prepare SELECT ID, PORTALPAGE, PORTLET_ID, COLUMN_NUMBER, POSITION FROM portletconfiguration;
      commit;
      rollback;
      set commit true;

      Using the SQL tracing facilities of the database, the error is due to the "POSITION" column name, which is a SQL92 reserved identifier for a string function.

      The appropriate fix would be to double-quote all column names systematically, in which case even SQL identifiers can be used (e.g, one can have a column called "SELECT")

            Assignee:
            Dylan Etkin [Atlassian]
            Reporter:
            Manu Iyengar
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: