[
https://issues.apache.org/jira/browse/CALCITE-7088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yu Xu updated CALCITE-7088:
---------------------------
Description:
sql:
{code:java}
"select \"net_weight\" like '%' from \"product\""{code}
would convert as expected:
{code:java}
"SELECT NULL OR \"net_weight\" IS NOT NULL\nFROM \"foodmart\".\"product\""{code}
but sql:
{code:java}
"select \"net_weight\" like '%%' from \"product\""{code}
would convert not as expected:
{code:java}
"SELECT \"net_weight\" LIKE '%%'\nFROM \"foodmart\".\"product\"" ;{code}
*note: "x = x" simplifies to "null or x is not null"*
LIKE '%%...' should keep the same with LIKE '%'
was:
sql:
{code:java}
"select \"product_name\" like '%' from \"product\""; {code}
would convert as expected:
{code:java}
"SELECT TRUE\nFROM \"foodmart\".\"product\"" ;{code}
but sql:
{code:java}
"select \"product_name\" like '%%' from \"product\"";{code}
would convert not as expected:
{code:java}
"SELECT \"product_name\" LIKE '%%'\nFROM \"foodmart\".\"product\"" ;{code}
LIKE '%%...' should keep the same with LIKE '%'
> X LIKE '%%'(Any number of '%') should simply to X=X
> ---------------------------------------------------
>
> Key: CALCITE-7088
> URL: https://issues.apache.org/jira/browse/CALCITE-7088
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.40.0
> Reporter: Yu Xu
> Assignee: Yu Xu
> Priority: Minor
> Fix For: 1.41.0
>
>
> sql:
> {code:java}
> "select \"net_weight\" like '%' from \"product\""{code}
> would convert as expected:
> {code:java}
> "SELECT NULL OR \"net_weight\" IS NOT NULL\nFROM
> \"foodmart\".\"product\""{code}
> but sql:
> {code:java}
> "select \"net_weight\" like '%%' from \"product\""{code}
> would convert not as expected:
> {code:java}
> "SELECT \"net_weight\" LIKE '%%'\nFROM \"foodmart\".\"product\"" ;{code}
>
> *note: "x = x" simplifies to "null or x is not null"*
>
> LIKE '%%...' should keep the same with LIKE '%'
--
This message was sent by Atlassian Jira
(v8.20.10#820010)