Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-8099

When using Oracle, if a Test has more than 1000 Test Executions, an SQL error occurs due to the 1000 elements limit on "IN" clauses

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.2.14, 5.1.0, Xray DC V7.4.1
    • Xray DC V7.6.1
    • Database
    • Xray 2024 S4
    • OK

    Description

      Description
      When using Oracle, if a Test has more than 1000 Test Executions, when opening the Test issue, an SQL error occurs due to the 1000 elements limit on "IN" clauses

      Pre-conditions

      • Jira installed in Oracle database
      • At least one Test case with more than 1000 Test Executions

      Actual result/Attachments
      Test runs are not shown, and the following error is shown in the logs:

      2021-09-30 12:07:11,240 http-nio-8080-exec-44 ERROR lfma 651x613785x24 07v3axi 192.168.100.5 /rest/raven/1.0/chart/testrunlist/datapaginated [c.x.r.dao.impl.DAOContextImpl] Error executing SQL select statement
      java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      
      	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
      	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
      	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
      	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
      	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
      	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:747)
      	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:904)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3822)
      	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1165)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
      	at com.xpandit.raven.dao.impl.DAOContextImpl.a(Unknown Source)
      	at com.xpandit.raven.dao.impl.DAOContextImpl.a(Unknown Source)
      	at com.xpandit.raven.dao.impl.DAOContextImpl.a(Unknown Source)
      	at com.xpandit.raven.dao.impl.DAOContextImpl.a(Unknown Source)
      	at com.xpandit.raven.dao.impl.TestRunDAOImpl.a(Unknown Source)
      	at com.xpandit.raven.dao.impl.TestRunDAOImpl.b(Unknown Source)
      	at java.util.Optional.map(Optional.java:215)
      	at com.xpandit.raven.dao.impl.TestRunDAOImpl.a(Unknown Source)
      	at com.xpandit.raven.gadget.testrunslist.ChartDataProviderImpl.a(Unknown Source)
      	at com.xpandit.raven.gadget.testrunslist.ChartDataProviderImpl.a(Unknown Source)
      	at java.util.Optional.map(Optional.java:215)
      	at com.xpandit.raven.gadget.testrunslist.ChartDataProviderImpl.a(Unknown Source)
      	at com.xpandit.raven.rest.internal.chart.i.a(Unknown Source)
      	... 3 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	... 19 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)
      	... 1 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)
      	... 32 filtered
      	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:56)
      	... 13 filtered
      	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      	... 53 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
      	... 1 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
      	... 16 filtered
      	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
      	... 19 filtered
      	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
      	... 5 filtered
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:181)
      	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:137)
      	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:90)
      	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:174)
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:130)
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:121)
      	... 4 filtered
      	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)
      	... 8 filtered
      	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      	... 4 filtered
      	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
      	... 26 filtered
      	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
      	... 23 filtered
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: Error : 1795, Position : 9808, Sql = SELECT TEST_RUN_TABLE_ALIAS."ID" testRunId,TEST_EXEC_TABLE_ALIAS."ID" testExecId,TEST_RUN_TABLE_ALIAS."STATUS" testRunStatus,TEST_TABLE_ALIAS."ID" testId,TEST_TABLE_ALIAS."SUMMARY" testSummary, COALESCE (TEST_RUN_TABLE_ALIAS."ASSIGNEE", (SELECT JI."ASSIGNEE" FROM "JIRAISSUE" JI LEFT JOIN "AO_8B1069_TEST_RUN" TRUN ON JI."ID" = TRUN."TEST_EXEC_ISSUE" WHERE TRUN."ID" = TEST_RUN_TABLE_ALIAS."ID"),  '␞unassigned␞')  "ASSIGNEE",TEST_RUN_TABLE_ALIAS."START_DATE" startDate,TEST_RUN_TABLE_ALIAS."FINISH_DATE" finishDate FROM "AO_8B1069_TEST_RUN" TEST_RUN_TABLE_ALIAS JOIN "JIRAISSUE" TEST_EXEC_TABLE_ALIAS ON TEST_RUN_TABLE_ALIAS."TEST_EXEC_ISSUE" = TEST_EXEC_TABLE_ALIAS."ID" JOIN "JIRAISSUE" TEST_TABLE_ALIAS ON TEST_RUN_TABLE_ALIAS."TEST_ISSUE_ID" = TEST_TABLE_ALIAS."ID" WHERE TEST_EXEC_TABLE_ALIAS."ID" IN ('537981','539842',
      ...
      ,'153684','114365') AND TEST_RUN_TABLE_ALIAS."START_DATE" >= (TO_DATE('2021-09-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS')) AND TEST_RUN_TABLE_ALIAS."FINISH_DATE" <= (TO_DATE('2021-09-30 12:07:11', 'YYYY-MM-DD HH24:MI:SS')) ORDER BY TEST_RUN_TABLE_ALIAS."ID" DESC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY, OriginalSql = SELECT TEST_RUN_TABLE_ALIAS."ID" testRunId,TEST_EXEC_TABLE_ALIAS."ID" testExecId,TEST_RUN_TABLE_ALIAS."STATUS" testRunStatus,TEST_TABLE_ALIAS."ID" testId,TEST_TABLE_ALIAS."SUMMARY" testSummary, COALESCE (TEST_RUN_TABLE_ALIAS."ASSIGNEE", (SELECT JI."ASSIGNEE" FROM "JIRAISSUE" JI LEFT JOIN "AO_8B1069_TEST_RUN" TRUN ON JI."ID" = TRUN."TEST_EXEC_ISSUE" WHERE TRUN."ID" = TEST_RUN_TABLE_ALIAS."ID"),  '␞unassigned␞')  "ASSIGNEE",TEST_RUN_TABLE_ALIAS."START_DATE" startDate,TEST_RUN_TABLE_ALIAS."FINISH_DATE" finishDate FROM "AO_8B1069_TEST_RUN" TEST_RUN_TABLE_ALIAS JOIN "JIRAISSUE" TEST_EXEC_TABLE_ALIAS ON TEST_RUN_TABLE_ALIAS."TEST_EXEC_ISSUE" = TEST_EXEC_TABLE_ALIAS."ID" JOIN "JIRAISSUE" TEST_TABLE_ALIAS ON TEST_RUN_TABLE_ALIAS."TEST_ISSUE_ID" = TEST_TABLE_ALIAS."ID" WHERE TEST_EXEC_TABLE_ALIAS."ID" IN ('537981','539842',
      ...
      ,'153684','114365') AND TEST_RUN_TABLE_ALIAS."START_DATE" >= (TO_DATE('2021-09-20 00:00:00', 'YYYY-MM-DD HH24:MI:SS')) AND TEST_RUN_TABLE_ALIAS."FINISH_DATE" <= (TO_DATE('2021-09-30 12:07:11', 'YYYY-MM-DD HH24:MI:SS')) ORDER BY TEST_RUN_TABLE_ALIAS."ID" DESC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY, Error Msg = ORA-01795: maximum number of expressions in a list is 1000
      
      	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
      	... 280 more
      2021-09-30 12:07:13,531 http-nio-8080-exec-20 ERROR lmfa 651x584679x08 07v3axi 192.168.100.5 /rest/raven/1.0/chart/testrunlist/datapaginated [c.x.r.dao.impl.DAOContextImpl] Error executing SQL select statement
      java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      

      How to reproduce

      1. Open the Test case with more than 1000 Test Executions

      Expected result

      • The Test case should show all Test Runs

      Version

      • Xray version 4.2.14 and 5.1.0

      Attachments

        Activity

          People

            masg Marco Guedes
            rmsp Rogerio Paiva [X] (Inactive)
            Marco Guedes
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 5 minutes
                7h 5m