rsim/oracle-enhanced — Issue #131: rake test_oracle error with test_validate_straight_inheritance_uniqueness
Author: yahonda
Created: 2011-12-01 18:03:54+00:00
State: open

At rails master branch, ActiveRecord unit tests for Oracle got the following error.

```ruby
$ cd activerecord
$ rake test_oracle
... snip ...

Finished tests in 304.690001s, 10.2662 tests/s, 31.5468 assertions/s.

1) Error:
test_validate_straight_inheritance_uniqueness(UniquenessValidationTest):
OCIError: ORA-02289: sequence does not exist
stmt.c:312:in oci8lib_191.so
/home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/ruby-oci8-2.0.6/lib/oci8/oci8.rb:288:in `exec'
/home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/ruby-oci8-2.0.6/lib/oci8/oci8.rb:116:in `exec'
/home/yahonda/Dropbox/git/oracle-enhanced/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:469:in `exec'
/home/yahonda/Dropbox/git/oracle-enhanced/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:172:in `select'
/home/yahonda/Dropbox/git/oracle-enhanced/lib/active_record/connection_adapters/oracle_enhanced_connection.rb:83:in `select_one'
/home/yahonda/Dropbox/git/oracle-enhanced/lib/active_record/connection_adapters/oracle_enhanced_connection.rb:89:in `select_value'
/home/yahonda/Dropbox/git/oracle-enhanced/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:756:in `next_sequence_value'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/relation.rb:46:in `insert'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/persistence.rb:316:in `create'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/timestamp.rb:57:in `create'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/callbacks.rb:268:in `block in create'
/home/yahonda/Dropbox/git/rails/activesupport/lib/active_support/callbacks.rb:393:in `_run_create_callbacks'
/home/yahonda/Dropbox/git/rails/activesupport/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/callbacks.rb:268:in `create'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/persistence.rb:297:in `create_or_update'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/callbacks.rb:264:in `block in create_or_update'
/home/yahonda/Dropbox/git/rails/activesupport/lib/active_support/callbacks.rb:393:in `_run_save_callbacks'
/home/yahonda/Dropbox/git/rails/activesupport/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/callbacks.rb:264:in `create_or_update'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/persistence.rb:37:in `save'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/validations.rb:50:in `save'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:241:in `block (2 levels) in save'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:190:in `transaction'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:208:in `transaction'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:241:in `block in save'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/transactions.rb:240:in `save'
/home/yahonda/Dropbox/git/rails/activerecord/lib/active_record/base.rb:526:in `create'
/home/yahonda/Dropbox/git/rails/activerecord/test/cases/validations/uniqueness_validation_test.rb:269:in `test_validate_straight_inheritance_uniqueness'
/home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/mocha-0.10.0/lib/mocha/integration/mini_test/version_230_to_251.rb:28:in `run'

3128 tests, 9612 assertions, 0 failures, 1 errors, 0 skips
rake aborted!
Command failed with status (1): [/home/yahonda/.rvm/rubies/ruby-1.9.3-p0/bi...]
```

This error happens with this sql statement.

```sql
----- Error Stack Dump -----
ORA-02289: sequence does not exist
----- Current SQL Statement for this session (sql_id=3t40mc9yhcdrx) -----
SELECT "_seq".NEXTVAL FROM dual
```

Based on the SQL statement, "_seq" and reviewed recent commits for master branch, This following commit may be related with this error.

https://github.com/rails/rails/commit/1a474cc8e41522ae079871d297c0e61ee4f6ef35

I did not get to the point how to address this error.