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

Multiple consecutive '%' in the string matched by LIKE should simplify to a single '%'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.40.0
    • 1.41.0
    • core

    Description

      sql:

      "select \"net_weight\" like '%' from \"product\""

      would convert  as expected:

      "SELECT NULL OR \"net_weight\" IS NOT NULL\nFROM \"foodmart\".\"product\""

      but sql:

      "select \"net_weight\" like '%%' from \"product\""

      would convert  not as expected:

      "SELECT \"net_weight\" LIKE '%%'\nFROM \"foodmart\".\"product\"" ;

       

      note: "x = x" simplifies to "null or x is not null"
       
      LIKE '%%'  (with any number of '%') should keep the same with LIKE '%' 

      Attachments

        Issue Links

          Activity

            People

              xuzifu666 Yu Xu
              xuzifu666 Yu Xu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: