Identifiers should not be escaped using raw2sql, only database values, so the old API was behaving incorrectly. The correct behaviour is to double quote, and throw an error if identifiers contain double quotes, but it would be excessive to implement this across the code base.

I did quite recently add Convert::id2sql which could be used here, but again it would be quite excessive to implement this consistently across the whole codebase. Maybe in the future we could develop a standard quoting mechanism for database tables and columns?

The fact that throughout the code there are thousands of fields, tables, and so on manually escaped with double quotes means there's probably room for a simpler solution, but I'm not sure what that would be. In the short term the code should at least be consistent, hence the change I made above.