arjdbc returning internal table name columns if an identical table name exists
------------------------------------------------------------------------------

                 Key: JRUBY-5642
                 URL: http://jira.codehaus.org/browse/JRUBY-5642
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.6
         Environment: Windows7
            Reporter: Jeff Solomon
            Assignee: Thomas E Enebo


We are using JRuby1.6 on Windows and porting our big MRI RoR apps to JRuby RoR.

With MRI RoR, we used active_record to create a table named "domains".

When I access the same database (postgres 8) with JRuby using arjdbc, the 
active_record call "Domain.column_names" yields a union of the actual column 
names and the columns names of an internal postgres metadata table named 
"domains" in the "information_schema" of the Catalog.

The search_path of our database was and still is the default, which is 
"$user",public.

My current workaround is the set "schema_search_path" to "public" in my 
database.yml file which seems to force arjdbc to do the right thing. I can 
track down the code all the way to the file:

  activerecord-jdbc-adapter-1.1.1/src/java/arjdbc/jdbc/RubyJdbcConnection.java

which has a method named 'columns_internal'. When I set my schema_search_path, 
the schema is passed into 'columns_internal' and all is good. Without it, I get 
the union and all hell breaks loose.

Clearly, I could be doing something wrong since I'm not a java nor postgres 
expert. But also, there is a chance that arjdbc hasn't run into the case where 
someone using active_record created a table with the same name as a postgres 
internal table.

BTW all the other tables that don't clash work just fine.

Jeff

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to