rsim/oracle-enhanced — Issue #144: NativeException: java.sql.SQLException: Missing IN or OUT parameter at index:: 1
Author: yahonda
Created: 2012-02-01 02:49:49+00:00
State: open

Unit test with jruby execued then got the following failure.

```ruby
Failures:

1) OracleEnhancedAdapter explain should explain query with binds
Failure/Error: explain = TestPost.where(TestPost.arel_table[pk.name].eq(sub)).bind([pk, 1]).explain
ActiveRecord::StatementInvalid:
NativeException: java.sql.SQLException: Missing IN or OUT parameter at index:: 1: EXPLAIN PLAN FOR SELECT "TEST_POSTS".* FROM "TEST_POSTS" WHERE "TEST_POSTS"."ID" = :a1
# oracle/jdbc/driver/OraclePreparedStatement.java:1821:in `processCompletedBindRow'
# oracle/jdbc/driver/OraclePreparedStatement.java:3579:in `executeInternal'
# oracle/jdbc/driver/OraclePreparedStatement.java:3628:in `executeQuery'
# oracle/jdbc/driver/OraclePreparedStatementWrapper.java:1493:in `executeQuery'
# ./lib/active_record/connection_adapters/oracle_enhanced_jdbc_connection.rb:345:in `exec'
# ./lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:627:in `exec_query'
# ./lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:1306:in `log'
# ./lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:607:in `exec_query'
# ./lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:659:in `explain'
# ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:753:in `(root)'

Finished in 210.24 seconds
345 examples, 1 failure, 2 pending

Failed examples:

rspec ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:750 # OracleEnhancedAdapter explain should explain query with binds
org.jruby.exceptions.RaiseException: (SystemExit) exit
rake aborted!
/home/yahonda/.rvm/rubies/jruby-1.6.6/bin/jruby -S rspec ./spec/active_record/connection_adapters/oracle_enhanced_schema_statements_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_connection_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_schema_dump_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_emulate_oracle_adapter_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_context_index_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_structure_dump_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_data_types_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_dirty_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_core_ext_spec.rb ./spec/active_record/connection_adapters/oracle_enhanced_cpk_spec.rb failed

Tasks: TOP => spec
(See full trace by running task with --trace)
```

Here is the exact version. JDBC(ojdbc6.jar) is copied from 11.2.0.3 database server.

```ruby
$ ruby -v
jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572) (Java HotSpot(TM) 64-Bit Server VM 1.7.0) [linux-amd64-java]

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit 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>
```

I'd like to see if this failure happens with other versions.