You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksey Plekhanov (Jira)" <ji...@apache.org> on 2021/12/07 07:51:00 UTC

[jira] [Updated] (IGNITE-15979) Calcite engine. Script test runner ignores "statement error" queries result

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

Aleksey Plekhanov updated IGNITE-15979:
---------------------------------------
    Description: 
Script test runner ignores successful execution for "statement error" queries. For example, if a query should fail, but was executed without errors test is passed (but should fail).

To fix it, we should modify {{SqlScriptRunner.execute}} method:
{code:java}
IgniteException err = null;

try {
    sql(qry);

    if (expected != ExpectedStatementStatus.OK)
        err = new IgniteException("Error expected at: " + posDesc + ". Statement: " + this);
}
catch (Throwable e) {
    if (expected != ExpectedStatementStatus.ERROR)
        err = new IgniteException("Error at: " + posDesc + ". Statement: " + this, e);
}

if (err != null)
    throw err; {code}
And investigate new failing script tests.

  was:
Script test runner ignores successful execution for "statement error" queries. For example, if a query should fail, but was executed without errors test is passed (but should fail).

To fix it, we should modify {{SqlScriptRunner.execute}} method:
{code:java}
gniteException err = null;

try {
    sql(qry);

    if (expected != ExpectedStatementStatus.OK)
        err = new IgniteException("Error expected at: " + posDesc + ". Statement: " + this);
}
catch (Throwable e) {
    if (expected != ExpectedStatementStatus.ERROR)
        err = new IgniteException("Error at: " + posDesc + ". Statement: " + this, e);
}

if (err != null)
    throw err; {code}
And investigate new failing script tests.


> Calcite engine. Script test runner ignores "statement error" queries result
> ---------------------------------------------------------------------------
>
>                 Key: IGNITE-15979
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15979
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Priority: Major
>              Labels: calcite2-required, calcite3-required
>
> Script test runner ignores successful execution for "statement error" queries. For example, if a query should fail, but was executed without errors test is passed (but should fail).
> To fix it, we should modify {{SqlScriptRunner.execute}} method:
> {code:java}
> IgniteException err = null;
> try {
>     sql(qry);
>     if (expected != ExpectedStatementStatus.OK)
>         err = new IgniteException("Error expected at: " + posDesc + ". Statement: " + this);
> }
> catch (Throwable e) {
>     if (expected != ExpectedStatementStatus.ERROR)
>         err = new IgniteException("Error at: " + posDesc + ". Statement: " + this, e);
> }
> if (err != null)
>     throw err; {code}
> And investigate new failing script tests.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)