Issue Details (XML | Word | Printable)

Key: ACTIVERECORD_JDBC-32
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: jenshimmelreich
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
activerecord-jdbc

Schema-Handling in RubyJdbcConnection.java

Created: 01/Sep/09 08:49 AM   Updated: 01/Oct/09 08:00 PM   Resolved: 01/Oct/09 08:00 PM
Component/s: None
Affects Version/s: 0.9.1
Fix Version/s: 0.9.2

Time Tracking:
Not Specified

Environment:

$ jruby -v
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.5.0_19) [i386-java]
Rails 2.3.3
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


Tags:


 Description  « Hide

The columns_internal-Funktion uses a heuristic to detect the schema.
It divides the table-name by a dot. The prefix ist the schema, the suffix the table.
Then it looks its second argument up.
If its not null, the function will use it in stead of the extracted part.

(Maybe that other databases are different, We use oracle.)
This will be a problem. The second argument is always the connected
user, in oracle its the default schema. If your user has the right to access
a table in another schema, you can specify the name as a prefix in the
tablename.
set_table_name 'SCHEMA_NAME.TABLE_NAME'
The adapter overrides this explicit schema for this table with the
default schema of the user. And: It will not work anymore.

The commit: 58c7efa71c05ce6f0ac7289ed79e0f113d9c1921
In the Repository: git://github.com/jenshimmelreich/activerecord-jdbc-adapter.git
will solve the problem.



Nick Sieger added a comment - 01/Oct/09 08:00 PM

In 475067b.