kubo/ruby-oci8 — Issue #3: make check got 1 error when Oracle Spatial is not installed
Author: yahonda
Created: 2011-11-29 03:23:03+00:00
State: open

Hi,

make check got 1 error when Oracle Spatial is not installed

```sql
3) Error:
test_column_metadata(TestMetadata):
OCIError: ORA-00902: invalid datatype
```

```ruby
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ echo $TZ
America/New_York
[yahonda@myoel5 ruby-oci8]$ make check
ruby -w setup.rb setup
setup.rb:278: warning: assigned but unused variable - vname
setup.rb:278: warning: assigned but unused variable - desc
setup.rb:278: warning: assigned but unused variable - default2
setup.rb:109: Use RbConfig instead of obsolete and deprecated Config.
---> lib
---> lib/dbd
<--- lib/dbd
---> lib/oci8
<--- lib/oci8
<--- lib
---> ext
---> ext/oci8
make
make[1]: Entering directory `/home/yahonda/Dropbox/git/ruby-oci8/ext/oci8'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/yahonda/Dropbox/git/ruby-oci8/ext/oci8'
<--- ext/oci8
<--- ext
ruby -w setup.rb test
setup.rb:278: warning: assigned but unused variable - vname
setup.rb:278: warning: assigned but unused variable - desc
setup.rb:278: warning: assigned but unused variable - default2
setup.rb:109: Use RbConfig instead of obsolete and deprecated Config.
mkdir -p ./test
/home/yahonda/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -w -I/home/yahonda/Dropbox/git/ruby-oci8/ext/oci8 -I/home/yahonda/Dropbox/git/ruby-oci8/lib -I/home/yahonda/Dropbox/git/ruby-oci8/support -I/home/yahonda/Dropbox/git/ruby-oci8/test /home/yahonda/Dropbox/git/ruby-oci8/test/test_all.rb
/home/yahonda/Dropbox/git/ruby-oci8/lib/oci8/object.rb:374: warning: assigned but unused variable - args
lib/rational.rb is deprecated
/home/yahonda/Dropbox/git/ruby-oci8/test/test_bind_time.rb:86: warning: assigned but unused variable - day_in
/home/yahonda/Dropbox/git/ruby-oci8/test/test_bind_time.rb:87: warning: assigned but unused variable - time_out
/home/yahonda/Dropbox/git/ruby-oci8/test/test_oci8.rb:218: warning: assigned but unused variable - dttm
/home/yahonda/Dropbox/git/ruby-oci8/test/test_metadata.rb:887: warning: assigned but unused variable - descs
/home/yahonda/Dropbox/git/ruby-oci8/test/test_metadata.rb:987: warning: assigned but unused variable - descs
Run options:

# Running tests:

..F..............................F.............................E........F......F....................................................................

Finished tests in 53.515697s, 2.7655 tests/s, 142.3881 assertions/s.

1) Failure:
test_set_client_info(TestAppInfo) [/home/yahonda/Dropbox/git/ruby-oci8/test/test_appinfo.rb:57]:
Expected "ruby-oci8:9216" to be nil.

2) Failure:
test_busy_and_open_count(TestConnectionPool) [/home/yahonda/Dropbox/git/ruby-oci8/test/test_connection_pool.rb:101]:
<3> expected but was
<2>.

3) Error:
test_column_metadata(TestMetadata):
OCIError: ORA-00902: invalid datatype
stmt.c:241:in oci8lib_191.so
/home/yahonda/Dropbox/git/ruby-oci8/lib/oci8/oci8.rb:427:in `exec'
/home/yahonda/Dropbox/git/ruby-oci8/lib/oci8/oci8.rb:255:in `exec_internal'
/home/yahonda/Dropbox/git/ruby-oci8/lib/oci8/oci8.rb:248:in `exec'
/home/yahonda/Dropbox/git/ruby-oci8/test/test_metadata.rb:1376:in `test_column_metadata'

4) Failure:
test_bind_cursor(TestOCI8) [/home/yahonda/Dropbox/git/ruby-oci8/test/test_oci8.rb:221]:
<2002-08-03 23:59:59 -0400> expected but was
<2002-08-03 23:59:59 -0500>.

5) Failure:
test_select(TestOCI8) [/home/yahonda/Dropbox/git/ruby-oci8/test/test_oci8.rb:128]:
<2002-08-03 23:59:59 -0400> expected but was
<2002-08-03 23:59:59 -0500>.

148 tests, 7620 assertions, 4 failures, 1 errors, 0 skips
[yahonda@myoel5 ruby-oci8]$
```

```sql
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

```

```sql
----- Error Stack Dump -----
ORA-00902: invalid datatype
----- Current SQL Statement for this session (sql_id=0sv4u38ahc752) -----
CREATE TABLE test_table (C1 CHAR(10) NOT NULL,C2 CHAR(10 CHAR),C3 NCHAR(10),C4 VARCHAR2(10),C5 VARCHAR2(10 CHAR),C6 NVARCHAR2(10),C7 RAW(10),C8 CLOB,C9 NCLOB,C10 BLOB,C11 BFILE,C12 NUMBER,C13 NUMBER(10),C14 NUMBER(10,2),C15 FLOAT,C16 FLOAT(10),C17 BINARY_FLOAT,C18 BINARY_DOUBLE,C19 DATE,C20 TIMESTAMP,C21 TIMESTAMP(9),C22 TIMESTAMP WITH TIME ZONE,C23 TIMESTAMP(9) WITH TIME ZONE,C24 TIMESTAMP WITH LOCAL TIME ZONE,C25 TIMESTAMP(9) WITH LOCAL TIME ZONE,C26 INTERVAL YEAR TO MONTH,C27 INTERVAL YEAR(4) TO MONTH,C28 INTERVAL DAY TO SECOND,C29 INTERVAL DAY(4) TO SECOND(9),C30 MDSYS.SDO_GEOMETRY)
STORAGE (
INITIAL 100k
NEXT 100k
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0)
```

ORA-00902 is caused by MDSYS.SDO_GEOMETRY datatype does not exist at Oracle database.
Once Oracle Spatial is installed and configured, this error disappears then "unsupported return type" message appears.

```ruby
# Running tests:
.................................F.............................unsupported return type (MDSYS.SDO_GEOMETRY.GET_WKB)
unsupported return type (MDSYS.SDO_GEOMETRY.GET_WKT)
unsupported return type (MDSYS.SDO_GEOMETRY.ST_COORDDIM)
.........F......F....................................................................
```

It looks my environmental issue, if anyone got the same error I hope this helps.