[ruby-oci8-commit] [462] trunk/ruby-oci8: fix to pass tests on Oracle 9i.

nobody at rubyforge.org nobody at rubyforge.org
Fri Nov 4 07:32:27 EDT 2011


Revision: 462
Author:   kubo
Date:     2011-11-04 07:32:18 -0400 (Fri, 04 Nov 2011)

Log Message:
-----------
fix to pass tests on Oracle 9i.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/extconf.rb
    trunk/ruby-oci8/ext/oci8/oci8.c
    trunk/ruby-oci8/ext/oci8/oci8.h
    trunk/ruby-oci8/test/test_datetime.rb
    trunk/ruby-oci8/test/test_metadata.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2011-10-29 12:37:04 UTC (rev 461)
+++ trunk/ruby-oci8/ChangeLog	2011-11-04 11:32:18 UTC (rev 462)
@@ -1,3 +1,8 @@
+2011-11-04  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/extconf.rb, ext/oci8/oci8.c, ext/oci8/oci8.h,
+	  test/test_datetime.rb, test/test_metadata.rb: fix to pass tests
+	    on Oracle 9i.
+
 2011-10-29  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/error.c, ext/oci8/oci8.c, lib/oci8/object.rb, lib/oci8/oci8.rb:
 	    reset OCI8#last_error when OCI8#parse or OCI8#exec is called.

Modified: trunk/ruby-oci8/ext/oci8/extconf.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/extconf.rb	2011-10-29 12:37:04 UTC (rev 461)
+++ trunk/ruby-oci8/ext/oci8/extconf.rb	2011-11-04 11:32:18 UTC (rev 462)
@@ -69,6 +69,7 @@
 have_type('OCICallbackLobRead2', 'ociap.h')
 have_type('OCICallbackLobWrite2', 'ociap.h')
 have_type('OCIAdmin*', 'ociap.h')
+have_type('OCIAuthInfo*', 'ociap.h')
 have_type('OCIMsg*', 'ociap.h')
 have_type('OCICPool*', 'ociap.h')
 

Modified: trunk/ruby-oci8/ext/oci8/oci8.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8.c	2011-10-29 12:37:04 UTC (rev 461)
+++ trunk/ruby-oci8/ext/oci8/oci8.c	2011-11-04 11:32:18 UTC (rev 462)
@@ -844,7 +844,7 @@
         size = 0;
     }
 
-    if (oracle_client_version >= ORAVERNUM(9, 2, 0, 3, 0) || size >= 0) {
+    if (oracle_client_version >= ORAVERNUM(9, 2, 0, 3, 0) || size > 0) {
         if (size > 0 && ptr[0] == ':') {
             rb_raise(rb_eArgError, "client identifier should not start with ':'.");
         }

Modified: trunk/ruby-oci8/ext/oci8/oci8.h
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8.h	2011-10-29 12:37:04 UTC (rev 461)
+++ trunk/ruby-oci8/ext/oci8/oci8.h	2011-11-04 11:32:18 UTC (rev 462)
@@ -90,6 +90,9 @@
 #if !defined HAVE_TYPE_OCIADMIN_ && !defined HAVE_TYPE_OCIADMINP
 typedef struct OCIAdmin OCIAdmin;
 #endif
+#if !defined HAVE_TYPE_OCIAUTHINFO_ && !defined HAVE_TYPE_OCIAUTHINFOP
+typedef struct OCIAuthInfo OCIAuthInfo;
+#endif
 #if !defined HAVE_TYPE_OCIMSG_ && !defined HAVE_TYPE_OCIMSGP
 typedef struct OCIMsg  OCIMsg;
 #endif

Modified: trunk/ruby-oci8/test/test_datetime.rb
===================================================================
--- trunk/ruby-oci8/test/test_datetime.rb	2011-10-29 12:37:04 UTC (rev 461)
+++ trunk/ruby-oci8/test/test_datetime.rb	2011-11-04 11:32:18 UTC (rev 462)
@@ -442,7 +442,7 @@
   ts1 TIMESTAMP;
 BEGIN
   ts1 := TO_TIMESTAMP(:in1, 'YYYY-MM-DD HH24:MI:SS.FF');
-  :out := TO_CHAR(ts1 + :in2, 'YYYY-MM-DD HH24:MI:SS.FF6');
+  :out := TO_CHAR(ts1 + :in2, 'YYYY-MM-DD HH24:MI:SS.FF');
 END;
 EOS
     cursor.bind_param(:out, nil, String, 36)

Modified: trunk/ruby-oci8/test/test_metadata.rb
===================================================================
--- trunk/ruby-oci8/test/test_metadata.rb	2011-10-29 12:37:04 UTC (rev 461)
+++ trunk/ruby-oci8/test/test_metadata.rb	2011-11-04 11:32:18 UTC (rev 462)
@@ -1251,14 +1251,16 @@
       :has_lob? => true,
       :has_file? => false,
     }
-    @conn.exec(<<-EOS)
+    if $oracle_version >= OCI8::ORAVER_9_2
+      @conn.exec(<<-EOS)
 CREATE TYPE test_type_has_nclob AS OBJECT (lob NCLOB)
 EOS
-    expected_values << {
-      :obj_name => 'TEST_TYPE_HAS_NCLOB',
-      :has_lob? => true,
-      :has_file? => false,
-    }
+      expected_values << {
+        :obj_name => 'TEST_TYPE_HAS_NCLOB',
+        :has_lob? => true,
+        :has_file? => false,
+      }
+    end
     @conn.exec(<<-EOS)
 CREATE TYPE test_type_has_blob AS OBJECT (lob BLOB)
 EOS




More information about the ruby-oci8-commit mailing list