chriskite / phactory

A Database Factory for PHP Unit Tests
http://phactory.org
MIT License
140 stars 39 forks source link

Backticks on table name causes problems in multi-database testing #26

Open assembledadam opened 11 years ago

assembledadam commented 11 years ago

Referring to the patch here: https://github.com/chriskite/phactory/pull/14

This is great for fixing table names that are reserved words (although this really should be avoided in the first place IMO), but it causes issues when working and testing with multiple databases.

If using a multi-database set-up the syntax "database_name.table_name" doesn't work with surrounding backticks, as it treats the whole expression as a table name.

I'm having to revert this patch on my copy to get it working, is there a workaround to this?

Perhaps maintaining a list of reserved words and escaping those explicitly, or detecting and seperating expressions containing a '.', although this would genuine table names containing a fullstop/period.. or alternatively modding the code to allow you to specify database as a separate argument?