MS SQL-Server - Create/Drop Database bug ----------------------------------------
Key: JRUBY-2912 URL: http://jira.codehaus.org/browse/JRUBY-2912 Project: JRuby Issue Type: Bug Components: ActiveRecord-JDBC Affects Versions: ActiveRecord-JDBC 0.8.2 Environment: jruby 1.1.3 / ActiveRecord-JDBC / SQL Server 2005 with microsoft sql jdbc driver / Rails 2.1 Reporter: Joern Hartmann Attachments: jdbc_mssql.rb.diff "rake db:test" fails to prepare a test database in the environment described above. With MS SQL and ActiveRecord-JDBC you need to specify a database in the JDBC connection url, which makes the driver select the database right after establishing a connection. This causes the test task to fail either when the test database does not yet exist (because the driver cannot select it) or when it tries to drop an existing test-database because MS SQL does not allow dropping the currently selected database. I could not find a bettar way to fix this issue than patching the create_database and drop_database methods in jdbc_mssql.rb in ActiveRecord-JDBC. I added "USE <database_name>" statements to both methods to make them either select the master database when dropping the current database or the new database after creating one. -- 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