SOQL ignores : WHERE RequiredLookup__c = null

I was indeed able to replicate this, but it's worth noting that this applies only to required relationship fields. That is, if you instead made a null filter against a new, required text field then the SOQL query would return the expected rows-I believe this is what led to the initial confusion.

As for a simple workaround you can create a new formula field with a checkbox return type that is simply set to ISBLANK(RequiredLookup__c) and then change your SOQL filter to return only records where this field is true.


Salesforce support confirmed this behaviour and they are willing to fix it. Therefore they asked me to create the following Idea. Please promote. Thank you!

https://success.salesforce.com/ideaView?id=0873A000000lEPMQA2