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

When REST without optional project result in ORA-01795: #50

Open
ipoppo opened this issue Jun 20, 2018 · 4 comments
Open

When REST without optional project result in ORA-01795: #50

ipoppo opened this issue Jun 20, 2018 · 4 comments

Comments

@ipoppo
Copy link

ipoppo commented Jun 20, 2018

When call REST API without optional project e.g. http://jira/rest/jira-worklog-query/1.2.1/find/worklogs?startDate=2017-08-01&endDate=2017-08-01&user=someusers

Result in following error:

ORA-01795: maximum number of expressions in a list is 1000

SQL statement is checked with JavaMelody.

SELECT worklog.id, worklog.startdate, worklog.issueid, worklog.author, worklog.timeworked, worklog.worklogbody, worklog.updated FROM worklog, jiraissue WHERE worklog.issueid=jiraissue.id AND worklog.startdate>=? AND worklog.startdate<? AND worklog.author IN (?) AND jiraissue.project IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,...)

The SQL is compiled to include all project in JIRA system instead of omitted WHERE clause.

        .where(intervalPredicate
            .and(worklog.author.in(userKeys))
>>         .and(issue.project.in(projectIds)))
        .orderBy(worklog.id.asc())
@bordatesz
Copy link

Hello there,
I see you have more than 1k Jira project. Unfortunetly, Oracle databases has a limit of 1k so you should narrow your search somehow. We'll think about how to improve the query, but since it is an open source project, we'll be happy to accept any improvement.

@ipoppo
Copy link
Author

ipoppo commented Jun 20, 2018

Added pull request #51

@daniel-toth-everit
Copy link
Contributor

Hi @ipoppo !
Thanks for the PR. I will check it as soon as possible.

@ipoppo
Copy link
Author

ipoppo commented Jun 20, 2018

Since I have to compile for JIRA 5.x too, I have also push 1.2.x to my repo. If you want to merge my patch please create branch 1.2.x and tomorrow I will submit the changes.

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

3 participants