You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Maksim Zhuravkov (Jira)" <ji...@apache.org> on 2023/02/08 06:46:00 UTC

[jira] [Updated] (IGNITE-18673) Sql. Negative column indexes in ORDER BY clause are not rejected

     [ https://issues.apache.org/jira/browse/IGNITE-18673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maksim Zhuravkov updated IGNITE-18673:
--------------------------------------
    Description: 
The simple example:

{code:java}
SELECT * FROM test ORDER BY -1
{code}
See test_order_by_exceptions.test.

Add statement error: <err message> to other test cases as well.

It seems that this issue is cause the following implementation of IgniteSqlValidator::validateLiteral which skips the validation entirely

{code:java}
@Override
public void validateLiteral(SqlLiteral literal) {
    if (literal.getTypeName() != SqlTypeName.DECIMAL) {
        super.validateLiteral(literal);
    }
}
{code}



  was:
The simple example:

{code:java}
SELECT * FROM test ORDER BY -1
{code}
See test_order_by_exceptions.test.

Add statement error: <err message> to other test cases as well.



> Sql. Negative column indexes in ORDER BY clause are not rejected
> ----------------------------------------------------------------
>
>                 Key: IGNITE-18673
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18673
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Maksim Zhuravkov
>            Priority: Major
>              Labels: calcite2-required, calcite3-required, ignite-3
>             Fix For: 3.0.0-beta2
>
>
> The simple example:
> {code:java}
> SELECT * FROM test ORDER BY -1
> {code}
> See test_order_by_exceptions.test.
> Add statement error: <err message> to other test cases as well.
> It seems that this issue is cause the following implementation of IgniteSqlValidator::validateLiteral which skips the validation entirely
> {code:java}
> @Override
> public void validateLiteral(SqlLiteral literal) {
>     if (literal.getTypeName() != SqlTypeName.DECIMAL) {
>         super.validateLiteral(literal);
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)