rsim/oracle-enhanced — Issue #133:  OracleEnhancedAdapter explain should explain query failed. Blank string looks returned
Author: yahonda
Created: 2011-12-05 09:28:18+00:00
State: open

rake spec with rails-master branch(3.2.beta) fails as follows.

```ruby

[yahonda@worksl6 oracle-enhanced]$ rake spec
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
/home/yahonda/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb
==> Running specs with MRI version 1.9.3
==> Running specs with Rails version 3.2-master
/home/yahonda/Dropbox/git/oracle-enhanced/spec/spec_helper.rb:191: warning: variable $KCODE is no longer effective; ignored

Failures:

1) OracleEnhancedAdapter explain should explain query
Failure/Error: explain.should include("Cost")
expected "" to include "Cost"
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-expectations-2.7.0/lib/rspec/expectations/fail_with.rb:32:in `fail_with'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-expectations-2.7.0/lib/rspec/expectations/handler.rb:19:in `handle_matcher'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/kernel.rb:12:in `should'
# ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:745:in `block (3 levels) in '
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example.rb:51:in `instance_eval'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example.rb:51:in `block in run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example.rb:110:in `with_around_hooks'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example.rb:48:in `run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:306:in `block in run_examples'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:302:in `map'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:302:in `run_examples'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:274:in `run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:275:in `block in run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:275:in `map'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb:275:in `run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:24:in `block (2 levels) in run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:24:in `map'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:24:in `block in run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb:12:in `report'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:21:in `run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
# /home/yahonda/.rvm/gems/ruby-1.9.3-p0@rails_master/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'

Finished in 97.34 seconds
336 examples, 1 failure, 1 pending

Failed examples:

rspec ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:743 # OracleEnhancedAdapter explain should explain query
rake aborted!
ruby /home/yahonda/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/active_record/connection_adapters/oracle_enhanced_structure_dump_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_dbms_output_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_procedures_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_context_index_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb failed

Tasks: TOP => spec
(See full trace by running task with --trace)
[yahonda@worksl6 oracle-enhanced]$
```

```sql

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE	11.2.0.3.0	Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL>
```

```ruby
[yahonda@worksl6 oracle-enhanced]$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
```

It looks explain just returns blank string.