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

Urgent - SOQL Subquery Limit Issue #122

Open
iamankush opened this issue Apr 12, 2017 · 6 comments
Open

Urgent - SOQL Subquery Limit Issue #122

iamankush opened this issue Apr 12, 2017 · 6 comments

Comments

@iamankush
Copy link

iamankush commented Apr 12, 2017

Hi Enforce Team,

Thank you for the amazing product.
I need your help with a very specific scenario while parsing the LIMIT in SOQL with subquery when using WHERE clause.
e.g. SELECT Id, Member_ID_HF__c, Name , (SELECT ID FROM Assets WHERE Company_Number_HF__c!=null LIMIT 1) FROM Account WHERE Id = :objParentRecord.objId

It works fine if I add limit 1 but if I remove the limit 1, it breaks the unit test. When I am trying to debug SOQL with SOQL expressions class, i am not able to figure out what is the issue.

Edit1 : the error is showing EOF at the end of parsed query in junit. Not sure why but still analyzing.

Please help with this issue as this one is really urgent for me to fix for a project deliverable. Your help is appreciated. Please let me know in case you need more details.

Regards,
Ankush

@iamankush
Copy link
Author

@goldmane Could you please help ?

@goldmane
Copy link
Contributor

@iamankush - I was able to reproduce the error and noticed that it was incorrectly parsing the where clause, specifically not allowing the null keyword to be used as an operand. Check PR #123 to see if this resolves your issue

@iamankush
Copy link
Author

Thanks a lot Awesome Eric ! Your help is really appreciated! we have 3 more issues which we are facing. I will raise the issues and will keep you posted!

@goldmane

@iamankush iamankush reopened this Apr 17, 2017
@iamankush
Copy link
Author

iamankush commented Apr 17, 2017

Hi @goldmane Eric,

Could you please try the same query in your test class? This fix does not solve my issue.

Exact query which do not parse - SELECT Id, Member_ID_HF__c, Name , (SELECT ID FROM Assets WHERE Company_Number_HF__c!=null) FROM Account WHERE Id = :objParentRecord.objId

It doesnt seems to be a problem with null , see below query:
assertThat(parser).matches("SELECT Id, Member_ID_HF__c, Name , (SELECT ID FROM Assets WHERE Company_Number_HF_c!='0'),Name FROM Account WHERE Id = :objParentRecord.objId");

Could you please help me with this issue?

@iamankush
Copy link
Author

@abd3
Copy link
Collaborator

abd3 commented Apr 27, 2018

@rahulAppirio can you check whether #129 fixes this, or if we can add the code snippet above to a unit test and resolve this? @iamankush you can build the updated version of this plugin which may resolve your issue.

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

No branches or pull requests

3 participants