Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oracle interval keyword parser failed, throw NoViableAltException #31236

Closed
xigongxiaoche opened this issue May 16, 2024 · 15 comments
Closed

oracle interval keyword parser failed, throw NoViableAltException #31236

xigongxiaoche opened this issue May 16, 2024 · 15 comments

Comments

@xigongxiaoche
Copy link

xigongxiaoche commented May 16, 2024

Bug Report

oracle sql parse failed, but the failed sql can execute in oracle, the failed sql is vaild in antlr rule

failed sql: 
select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth > to_char((sysdate - interval '1' year(3)), 'yyyymmdd'))
success sql:
select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth > to_char((sysdate - interval '1' year(3)), 'yyyymmdd')
select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t)

version

shardingsphere version: 5.3.2
oracle verion: oracle 11g

stacktrace

Exception in thread "main" org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax: select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth > to_char((sysdate - interval '1' year(3)), 'yyyymmdd')), no viable alternative at input 'selectagefrom(select'0-1岁'age,count(*)countNum,'0'sortNumfromT_EMPI_PATIENT_INFOtwheret.birth>to_char((sysdate-interval'1'' at line 1, position 137, near [@30,137:139=''1'',<1001>,1:137]
	at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:70)
	at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:49)
	at org.apache.shardingsphere.sql.parser.api.SQLParserEngine.parse(SQLParserEngine.java:47)
	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:48)
	at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:41)
	at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:30)
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$2(LocalLoadingCache.java:145)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406)
	at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404)
	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387)
	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
	at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:56)
	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:47)
	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:58)
	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:205)
	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:171)
	at org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.prepareStatement(ShardingSphereConnection.java:87)
@TherChenYang TherChenYang self-assigned this May 16, 2024
@TherChenYang
Copy link
Collaborator

@xigongxiaoche Thank you for your feedback, I will check on this issue.

@xigongxiaoche
Copy link
Author

can you give me some suggestion to solve the bug?

@xigongxiaoche
Copy link
Author

At first I think it it because of sysdate keyword not in the antlr rule of 5.3.2 oracle. I add keyword sysdate, but it is invalid

@TherChenYang
Copy link
Collaborator

Hi @xigongxiaoche, can you test with master branch? After testing, the following SQL statement can be parsed correctly in the master.

select
    age
from
    (
        select
            '0-1岁'   age
          , count(*) countNum
          , '0'      sortNum
        from
            T_EMPI_PATIENT_INFO t
        where
            t.birth > to_char((sysdate - interval '1' year(3)), 'yyyymmdd')
    )

@xigongxiaoche
Copy link
Author

Ok, I'll try it

@xigongxiaoche
Copy link
Author

xigongxiaoche commented May 16, 2024

sql not parse successfully in master or 5.4.1,
this is test case:

    <sql-case id="select_interval_with_subquery" value="SELECT age FROM(SELECT '0-1岁' age FROM T_EMPI_PATIENT_INFO t WHERE t.birth &gt; TO_CHAR((SYSDATE - INTERVAL '1' YEAR(3)), 'yyyymmdd'))" db-types="Oracle"  />
    <select sql-case-id="select_interval_with_subquery">
        <from>
            <subquery-table>
                <subquery>
                    <select>
                        <projections start-index="23" stop-index="32">
                            <expression-projection text="'0-1岁'" alias="age" start-index="23" stop-index="32" />
                        </projections>
                        <from>
                            <simple-table name="T_EMPI_PATIENT_INFO" start-index="39" stop-index="57" alias="t"/>
                        </from>
                    </select>
                </subquery>
            </subquery-table>
        </from>
        <projections start-index="7" stop-index="9">
            <column-projection name="age" start-index="7" stop-index="9" />
        </projections>
        <where>
            <expr>
                <binary-operation-expression>
                    <left>
                        <column name="t.birth" start-index="67" stop-index="73"></column>
                    </left>
                    <operator>&gt;</operator>
                    <right>
                        <function function-name="TO_CHAR" start-index="77" stop-index="129" literal-text="TO_CHAR((SYSDATE - INTERVAL '1' YEAR(3)), 'yyyymmdd')"/>
                    </right>
                </binary-operation-expression>
            </expr>
        </where>
    </select>

console output:

org.opentest4j.AssertionFailedError: 
SQL Case ID : select_interval_with_subquery
SQL         : SELECT age FROM(SELECT '0-1岁' age FROM T_EMPI_PATIENT_INFO t WHERE t.birth > TO_CHAR((SYSDATE - INTERVAL '1' YEAR(3)), 'yyyymmdd'))
Actual where segment should exist.
 ==> 
Expected :true
Actual   :false
<Click to see difference>


	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertWhereClause(SelectStatementAssert.java:132)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertIs(SelectStatementAssert.java:70)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.DMLStatementAssert.assertIs(DMLStatementAssert.java:71)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.SQLStatementAssert.assertIs(SQLStatementAssert.java:70)
	at org.apache.shardingsphere.test.it.sql.parser.internal.InternalSQLParserIT.assertSupportedSQL(InternalSQLParserIT.java:58)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

@TherChenYang
Copy link
Collaborator

@xigongxiaoche You claim there are obvious errors here, the WHERE clause is in the subquery; the correct assertion should be

<select sql-case-id="select_interval_with_subquery">
        <projections start-index="7" stop-index="9">
            <column-projection name="age" start-index="7" stop-index="9"/>
        </projections>
        <from>
            <subquery-table>
                <subquery>
                    <select>
                        <projections start-index="24" stop-index="64">
                            <expression-projection text="0-1岁" start-index="24" stop-index="33" alias="age"/>
                            <aggregation-projection type="COUNT" start-index="35" stop-index="42" expression="count(*)" alias="countNum"/>
                            <expression-projection text="0" start-index="54" stop-index="64" alias="sortNum"/>
                        </projections>
                        <from start-index="71" stop-index="91">
                            <simple-table name="T_EMPI_PATIENT_INFO" start-index="71" stop-index="91" alias="t"/>
                        </from>
                        <where start-index="93" stop-index="161">
                            <expr>
                                <binary-operation-expression start-index="99" stop-index="161">
                                    <operator>&gt;</operator>
                                    <left>
                                        <column name="birth" start-index="99" stop-index="105">
                                            <owner name="t" start-index="99" stop-index="99"/>
                                        </column>
                                    </left>
                                    <right>
                                        <function text="to_char((sysdate - interval '1' year(3)), 'yyyymmdd')" function-name="to_char" start-index="109" stop-index="161">
                                            <parameter>
                                                <binary-operation-expression start-index="118" stop-index="147">
                                                    <operator>-</operator>
                                                    <left>
                                                        <column name="sysdate" start-index="118" stop-index="124"/>
                                                    </left>
                                                    <right>
                                                        <common-expression text="interval '1' year(3)" start-index="128" stop-index="147"/>
                                                    </right>
                                                </binary-operation-expression>
                                            </parameter>
                                            <parameter>
                                                <literal-expression value="yyyymmdd" start-index="151" stop-index="160"/>
                                            </parameter>
                                        </function>
                                    </right>
                                </binary-operation-expression>
                            </expr>
                        </where>
                    </select>
                </subquery>
            </subquery-table>
        </from>
    </select>

@xigongxiaoche
Copy link
Author

xigongxiaoche commented May 17, 2024

@TherChenYang
I changed the select tag as follows, but it still failed.

    <select sql-case-id="select_interval_with_subquery">
        <projections start-index="7" stop-index="9">
            <column-projection name="age" start-index="7" stop-index="9"/>
        </projections>
        <from>
            <subquery-table>
                <subquery>
                    <select>
                        <projections start-index="24" stop-index="64">
                            <expression-projection text="0-1岁" start-index="24" stop-index="33" alias="age"/>
                            <aggregation-projection type="COUNT" start-index="35" stop-index="51" expression="count(*)" alias="countNum"/>
                            <expression-projection text="0" start-index="54" stop-index="64" alias="sortNum"/>
                        </projections>
                        <from start-index="71" stop-index="91">
                            <simple-table name="T_EMPI_PATIENT_INFO" start-index="71" stop-index="91" alias="t"/>
                        </from>
                        <where start-index="93" stop-index="161">
                            <expr>
                                <binary-operation-expression start-index="99" stop-index="161">
                                    <operator>&gt;</operator>
                                    <left>
                                        <column name="birth" start-index="99" stop-index="105">
                                            <owner name="t" start-index="99" stop-index="99"/>
                                        </column>
                                    </left>
                                    <right>
                                        <function text="to_char((sysdate - interval '1' year(3)), 'yyyymmdd')" function-name="to_char" start-index="109" stop-index="161">
                                            <parameter>
                                                <binary-operation-expression start-index="117" stop-index="148">
                                                    <operator>-</operator>
                                                    <left>
                                                        <column name="sysdate" start-index="118" stop-index="124"/>
                                                    </left>
                                                    <right>
                                                        <common-expression text="interval '1' year(3)" start-index="128" stop-index="147"/>
                                                    </right>
                                                </binary-operation-expression>
                                            </parameter>
                                            <parameter>
                                                <literal-expression value="yyyymmdd" start-index="152" stop-index="159"/>
                                            </parameter>
                                        </function>
                                    </right>
                                </binary-operation-expression>
                            </expr>
                        </where>
                    </select>
                </subquery>
            </subquery-table>
        </from>
    </select>
    <sql-case id="select_interval_with_subquery" value="select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth &gt; to_char((sysdate - interval '1' year(3)), 'yyyymmdd'))" db-types="Oracle"  />

console failed message:

java.lang.AssertionError: 
SQL Case ID : select_interval_with_subquery
SQL         : select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth > to_char((sysdate - interval '1' year(3)), 'yyyymmdd'))
`SubqueryTableSegment`'s start index assertion error: 

Expected: is <0>
     but: was <16>
<Click to see difference>


	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert.assertStartIndex(SQLSegmentAssert.java:50)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert.assertIs(SQLSegmentAssert.java:44)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.table.TableAssert.assertIs(TableAssert.java:170)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.table.TableAssert.assertIs(TableAssert.java:81)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertTable(SelectStatementAssert.java:115)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertIs(SelectStatementAssert.java:76)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.DMLStatementAssert.assertIs(DMLStatementAssert.java:71)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.SQLStatementAssert.assertIs(SQLStatementAssert.java:70)
	at org.apache.shardingsphere.test.it.sql.parser.internal.InternalSQLParserIT.assertSupportedSQL(InternalSQLParserIT.java:58)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

@TherChenYang
Copy link
Collaborator

@xigongxiaoche This is just a standard format of an assertion. You need to supplement start-Index and stop-Index according to your SQL, which is not related to SQL parsing itself. This is just for testing.

@xigongxiaoche
Copy link
Author

According to your advice, my unit tests passed on 5.4.1 and master. Thank you very much.
According to your advice, my unit tests passed on 5.4.1 and master. Thank you very much.
sql case:

    <select sql-case-id="select_interval_with_subquery">
        <projections start-index="7" stop-index="9">
            <column-projection name="age" start-index="7" stop-index="9"/>
        </projections>
        <from>
            <subquery-table start-index="16" stop-index="162">
                <subquery>
                    <select>
                        <projections start-index="24" stop-index="64">
                            <expression-projection text="0-1岁" start-index="24" stop-index="33" alias="age"/>
                            <aggregation-projection type="COUNT" start-index="35" stop-index="42" expression="count(*)" alias="countNum"/>
                            <expression-projection text="0" start-index="54" stop-index="64" alias="sortNum"/>
                        </projections>
                        <from start-index="71" stop-index="91">
                            <simple-table name="T_EMPI_PATIENT_INFO" start-index="71" stop-index="91" alias="t"/>
                        </from>
                        <where start-index="93" stop-index="161">
                            <expr>
                                <binary-operation-expression start-index="99" stop-index="161">
                                    <operator>&gt;</operator>
                                    <left>
                                        <column name="birth" start-index="99" stop-index="105">
                                            <owner name="t" start-index="99" stop-index="99"/>
                                        </column>
                                    </left>
                                    <right>
                                        <function text="to_char((sysdate - interval '1' year(3)), 'yyyymmdd')" function-name="to_char" start-index="109" stop-index="161">
                                            <parameter>
                                                <binary-operation-expression start-index="118" stop-index="147">
                                                    <operator>-</operator>
                                                    <left>
                                                        <column name="sysdate" start-index="118" stop-index="124"/>
                                                    </left>
                                                    <right>
                                                        <common-expression text="interval '1' year(3)" start-index="128" stop-index="147"/>
                                                    </right>
                                                </binary-operation-expression>
                                            </parameter>
                                            <parameter>
                                                <literal-expression value="yyyymmdd" start-index="151" stop-index="160"/>
                                            </parameter>
                                        </function>
                                    </right>
                                </binary-operation-expression>
                            </expr>
                        </where>
                    </select>
                </subquery>
            </subquery-table>
        </from>
    </select>
    <sql-case id="select_interval_with_subquery" value="select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth &gt; to_char((sysdate - interval '1' year(3)), 'yyyymmdd'))" db-types="Oracle"  />

@xigongxiaoche
Copy link
Author

This bug only occurs in version 5.3.2., version 5.4.1 and master all passed

@xigongxiaoche
Copy link
Author

xigongxiaoche commented May 17, 2024

Currently, I am using version 5.3.2. If I want to address this bug based on this version, could you please inform me which parts need to be modified? Presently, my understanding is that the file requiring modification is sql-parser/dialect/oracle/src/main/antlr4/imports/oracle/BaseRule.g4 and sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleStatementSQLVisitor.java @TherChenYang
this is test case output:

java.lang.AssertionError: 
SQL Case ID : select_interval_with_subquery
SQL         : select age from (select '0-1岁' age,count(*) countNum, '0' sortNum from T_EMPI_PATIENT_INFO t where t.birth > to_char((sysdate - interval '1' year(3)), 'yyyymmdd'))
Aggregation projection inner expression assertion error: 

Expected: is null
     but: was "(*)"
Expected :is null
Actual   :"(*)"
<Click to see difference>


	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.projection.ProjectionAssert.assertAggregationProjection(ProjectionAssert.java:145)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.projection.ProjectionAssert.assertProjection(ProjectionAssert.java:102)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.projection.ProjectionAssert.assertIs(ProjectionAssert.java:76)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertProjection(SelectStatementAssert.java:105)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertIs(SelectStatementAssert.java:68)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.table.TableAssert.assertIs(TableAssert.java:121)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.table.TableAssert.assertIs(TableAssert.java:71)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertTable(SelectStatementAssert.java:112)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert.assertIs(SelectStatementAssert.java:75)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.DMLStatementAssert.assertIs(DMLStatementAssert.java:65)
	at org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.SQLStatementAssert.assertIs(SQLStatementAssert.java:63)
	at org.apache.shardingsphere.test.it.sql.parser.internal.InternalSQLParserIT.assertSupportedSQL(InternalSQLParserIT.java:60)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:94)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask$DefaultDynamicTestExecutor.execute(NodeTestTask.java:226)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask$DefaultDynamicTestExecutor.execute(NodeTestTask.java:204)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:142)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.lambda$execute$2(TestTemplateTestDescriptor.java:110)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1242)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:110)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:44)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

@xigongxiaoche xigongxiaoche reopened this May 17, 2024
@TherChenYang
Copy link
Collaborator

TherChenYang commented May 17, 2024

@xigongxiaoche You can refer to this link for processing. parser module

The main parts that need to be modified

  • Oracle related g4 files
  • Oracle related visitor

@xigongxiaoche
Copy link
Author

Thank you very much

@xigongxiaoche
Copy link
Author

After 5.3.2 oracle BaseRule.g4, the bug fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants