Database.query() takes query as a string, and we used this to build queries dynamically in our managed package, to query custom objects of installed organizations.
We have objects in our managed package with API names like 'Billing_Event__c'. Namespace (test__).
We used dynamic query in our Apex which will query customer's custom objects dynamically based on the Id they pass to us, but if their custom object name matches with our managed package object names (i.e they have object name as "Billing_Event__c"), Database.query() now retrieving managed package objects instead of retrieving customers' custom objects.
Schema Global Describe as well returning managed package objects.
This was not the case previously, Database.query() was retrieving records whenever the API names matches with object name, so if we have to query our own managed package objects we had to include namespace like 'test__Billing_Event__c'.
Can any one help to use dynamic query to get customers custom object. i.e results of Billing_Event__c not test__Billing_Event__c.