Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2273

org.teiid.query.sql.lang.SubqueryFromClause does not quote keywords in the alias

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.2
    • 7.7
    • Query Engine
    • None

      new SubqueryFromClause("user", QueryParser.getQueryParser() .parseCommand("select 1")).toString()
      yields
      (SELECT 1) AS user

      it should be
      (SELECT 1) AS "user"

      Briefly looking at the code, I think the problem is in org.teiid.query.sql.visitor.SQLStringVisitor.escapeSinglePart(String).escape.

      Shouldn't it check SQLStringVisitor.isReservedWord(String)?

              rhn-engineering-shawkins Steven Hawkins
              markaddleman_jira Mark Addleman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: