Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5684

Parser fails to differentiate between empty string '' and escaped string literal single quote

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Blocker
    • Resolution: Invalid
    • None
    • 1.34.0
    • core
    • None

    Description

      In the example query below (redshift):

       

      SELECT CASE WHEN table.columnA IS NOT NULL THEN '' ELSE table.columnA END columnA FROM table where (columnA LIKE '%example%') 

      When the parser reaches "THEN ''" it considers the second single quote as an escape character so rather than returning the correct string literal which is an empty string '' it returns:

       

      '' ELSE table.columnA END columnA FROM table where (columnA LIKE '

      The query is valid on redshift

      Attachments

        Activity

          People

            Unassigned Unassigned
            zineeddine998 Zine eddine Zidane
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: