activerecord-jdbcmysql-adapter causing error for truncation
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
调研方向
使用 Gemfile 中的全部三个 JDBC 适配器,从 Rails 控制台复现 truncation 失败,然后检查 database_cleaner-1.0.1/lib/database_cleaner/active_record/truncation.rb 第 176 行和第 209 行附近的代码。移除 mysql JDBC 适配器后,比较适配器的加载行为;当 truncation 能够正常工作且受支持的适配器仍保持打包时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
We have an application that needs to support multiple database engines, so our Gemfile contains multiple JDBC adapters as so:
gem 'activerecord-jdbcpostgresql-adapter', '~>1.3.7'
gem 'activerecord-jdbcmssql-adapter', '~>1.3.7'
gem 'activerecord-jdbcmysql-adapter', '~>1.3.7'
The app works as we expect, and each setup with a different database works well, however we've just introduced the mysql adapter, and have now found that the database cleaner is failing to truncate the database.
On my machine, I have a postgres database running. If I open up a rails console, and attempt to clean the database with :truncation I get the following error
TypeError: superclass mismatch for class Mysql2Adapter
We haven't changed any code in our app, and if I comment out the mysql JDBC adapter from the Gemfile and bundle install again, I am once again able to clean the database.
This is the stack trace that I get with the error
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/active_record/truncation.rb:209:in `ConnectionAdapters'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/active_record/truncation.rb:176:in `ActiveRecord'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/active_record/truncation.rb:175:in `(root)'
from org/jruby/RubyKernel.java:1065:in `require'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/base.rb:1:in `(root)'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/base.rb:108:in `orm_strategy'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/base.rb:34:in `create_strategy'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/base.rb:38:in `clean_with'
from org/jruby/RubyArray.java:1613:in `each'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/configuration.rb:85:in `clean_with'
from /Users/adrianh/.rvm/gems/jruby-1.7.12/gems/database_cleaner-1.0.1/lib/database_cleaner/configuration.rb:85:in `clean_with'
It's very similar (exact same error message) to other issues I've found here, however the line numbers are different so I'm assuming the issue is something different, given that the others have also been resolved and this is still appearing.
- 主要语言
- Ruby
- 星标
- 76
- 派生
- 76
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DatabaseCleaner/database_cleaner-active_record 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 5/5 一周以上 新手友好度 30/100
DatabaseCleaner/database_cleaner-active_record#128 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
DatabaseCleaner/database_cleaner-active_record#127 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 25/100
查看 DatabaseCleaner/database_cleaner-active_record 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
security
难度 2/5 1-3 小时 新手友好度 65/100
IBM/ai-security-baseline#25 ·
-
security
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 62/100