diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 14:57:52 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 17:34:49 -0700 |
commit | fa4686243cb4850297c865f3e1de56e790ebc0ec (patch) | |
tree | 35ba4bed4173f25506636c42de1b9753050efc4a /activerecord/test | |
parent | 6367e9586708e630906746a867a0f3590d3fbf62 (diff) | |
download | rails-fa4686243cb4850297c865f3e1de56e790ebc0ec.tar.gz rails-fa4686243cb4850297c865f3e1de56e790ebc0ec.tar.bz2 rails-fa4686243cb4850297c865f3e1de56e790ebc0ec.zip |
ignoring certain SQL when using Oracle
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index f6ef155d66..8b0f3a739d 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -48,6 +48,10 @@ end ActiveRecord::Base.connection.class.class_eval do IGNORED_SQL = [/^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /SHOW FIELDS/] + # FIXME: this needs to be refactored so specific database can add their own + # ignored SQL. This ignored SQL is for Oracle. + IGNORED_SQL.concat [/^select .*nextval/i, /^SAVEPOINT/, /^ROLLBACK TO/, /^\s*select .* from ((all|user)_tab_columns|(all|user)_triggers|(all|user)_constraints)/im] + def execute_with_query_record(sql, name = nil, &block) $queries_executed ||= [] $queries_executed << sql unless IGNORED_SQL.any? { |r| sql =~ r } |