
quote_name doesn't allow cross-database table names
Reported by cdinger (at gmail) | December 7th, 2009 @ 09:45 PM
The quote_name method in the MySQL adapter doesn't allow you to define a DataMapper resource that uses a table in another database. For example, it's impossible to do:
storage_names[:default] = 'some_schema.table_name'
because quote_name produces some_schema.table_name
instead of some_schema
.table_name
This is useful for pulling in legacy data from other schemas.
Since MySQL never allows periods in database object names (http://dev.mysql.com/doc/refman/5.0/en/identifiers.html), the following patch seems perfectly safe:
http://github.com/cdinger/dm-core/commit/4ccb3a7a08423c67c626c35719...
Thanks for considering!
Chris
Comments and changes to this ticket
-
cdinger (at gmail) December 7th, 2009 @ 09:47 PM
Ah. The backticks got removed. The third line should be something like:
'some_schema.table_name' instead of 'some_schema'.'table_name'
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »