I see what's the problem and also why it is the way it is.
This call:
using (IRetrievalQuery query = RetrievalProcedures.GetGetTestDataCallAsQuery("test"))
creates a StoredProcedureCall instance and on it it calls ToRetrievalQuery(). This method performs name overwriting, namely the global overwrites:
public IRetrievalQuery ToRetrievalQuery()
{
DbCommand cmd = _creator.CreateCommand((DbConnection)null);
cmd.CommandText = _dataAccessProvider.ProduceCorrectStoredProcedureName(_storedProcedureName);
cmd.CommandType = CommandType.StoredProcedure;
IRetrievalQuery toReturn = new RetrievalQuery(cmd);
toReturn.NoNameOverwriting = true;
foreach(DbParameter parameter in _parameters)
{
toReturn.Parameters.Add(parameter);
}
return toReturn;
}
There is no adapter present at that time so it doesn't use the overwrites which are defined on the adapter. It does flag the query to not use any more name overwrites as it already has done name overwrites on the name.
When you call this line:
using (IDataReader reader = adapter.FetchDataReader(query, CommandBehavior.CloseConnection))
it sees the query and checks whether the query contains a stored proc. If so, it will again call the name overwriter to overwrite catalog/schema names if required, if NoNameOverwriting is false (which is false if there hasn't been done any name overwriting). In your case however the names have been overwritten already so nothing is done.
The method FetchDataReader(query, commandbehavior) is a virtual method. You could override it in your custom adapter and check whether the command is a stored proc and nonameoverwriting is true, and set it to false in that case and then call the base method. This allows you to not having to use the config file.
So it's not a bug but a chain of calls to different methods which in the end don't do what is expected because the query creation method on the RetrievalProcedures class already performs name overwriting but doesn't use the adapter instance. We can't change that as that's a breaking change which affects code which does anticipate on that fact (e.g. code which executes the stored proc call query directly), hence the flag we added to make it possible to again run name overwriting in case one needs to (which is your situation).
Hopefully this clears things up a bit.