History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2027
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Milton Taylor
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

Problems with the H2 jdbc adapter, schema metadata behavior

Created: 23/Jan/08 06:18 PM   Updated: 12/May/08 06:04 PM
Component/s: JRuby-extras, ActiveRecord-JDBC
Affects Version/s: JRuby 1.0.3
Fix Version/s: None

Time Tracking:
Not Specified

Environment: gem: jdbch2-adapter-0.7.1


 Description  « Hide
There's a couple of problems with this adapter:

1. Is it supposed to be aliasing the hsqldb adapter or the generic base class jdbc adpater? I suspect it should be the former, but I couldn't actually see where it does this...sorry ruby newbie.

2. The adapter needs to filter out stuff from the database metadata (tables and columns), in the same way as the postgresjdbc adapter does, otherwise it pulls in h2 internal system tables when it shouln't.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Milton Taylor - 23/Jan/08 06:23 PM
I should have mentioned I found this problem while trying to get redmine going under jruby. Redmine ended up getting erroneous attributes leaking into its users and roles classes, caused by pulling in this extra data from metadata. The adapter should restrict itself to tables of type TABLE, and - by default if no schema name is specified - in the PUBLIC schema .

Perhaps it would be appropriate to make a proper separate adapter for h2?


Charles Oliver Nutter - 26/Jan/08 03:16 AM
It probably would be appropriate. Can you figure out what all it would need to do that it doesn't right now?

Milton Taylor - 26/Jan/08 09:03 PM
I'm fairly sure the only thing it needs (and the implementation of the HSQLDB driver is similar because the relevant code in that adapter is not very good) is to copy the two methods from the postgresjdbc adapter (tables and columns) that fetch all the metadata. The metadata search specs to jdbc should be selective so as to exclude system tables. Likewise, columns need to also do the same thing.

Charles Oliver Nutter - 12/May/08 06:04 PM
I think this is actually a dupe of another bug where it's pulling in metadata it should not. Can you do some research in the bug repo and see if there's been a fix proposed for it?