[ruby-oci8-commit] [239] branches/ruby-oci8-1.0: * lib/oci8.rb.in: fix OCI8#non_blocking = false problem.

nobody at rubyforge.org nobody at rubyforge.org
Sat Jan 12 02:12:45 EST 2008


Revision: 239
Author:   kubo
Date:     2008-01-12 02:12:45 -0500 (Sat, 12 Jan 2008)

Log Message:
-----------
* lib/oci8.rb.in: fix OCI8#non_blocking = false problem.
    Once the connection became non-bocking mode, it could
    not be reset to blocking mode.
    (This problem is reported by Cagdas Gerede.)
* test/test_break.rb: add a testcase to test the above problem.

Modified Paths:
--------------
    branches/ruby-oci8-1.0/ChangeLog
    branches/ruby-oci8-1.0/lib/oci8.rb.in
    branches/ruby-oci8-1.0/test/test_break.rb

Modified: branches/ruby-oci8-1.0/ChangeLog
===================================================================
--- branches/ruby-oci8-1.0/ChangeLog	2008-01-12 06:51:43 UTC (rev 238)
+++ branches/ruby-oci8-1.0/ChangeLog	2008-01-12 07:12:45 UTC (rev 239)
@@ -1,4 +1,11 @@
 2008-01-12  KUBO Takehiro  <kubo at jiubao.org>
+	* lib/oci8.rb.in: fix OCI8#non_blocking = false problem.
+	    Once the connection became non-bocking mode, it could
+	    not be reset to blocking mode.
+	    (This problem is reported by Cagdas Gerede.)
+	* test/test_break.rb: add a testcase to test the above problem.
+
+2008-01-12  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/oradate.c, ext/oci8/oranumber.c: fix SEGV bugs.
 	    OraDate.new made a core dump on x86_64 linux.
 	    (This problem is reported by Alun Eyre.)

Modified: branches/ruby-oci8-1.0/lib/oci8.rb.in
===================================================================
--- branches/ruby-oci8-1.0/lib/oci8.rb.in	2008-01-12 06:51:43 UTC (rev 238)
+++ branches/ruby-oci8-1.0/lib/oci8.rb.in	2008-01-12 07:12:45 UTC (rev 239)
@@ -315,7 +315,7 @@
   end # non_blocking?
 
   def non_blocking=(nb)
-    if nb && ! non_blocking?
+    if (nb ? true : false) != non_blocking?
       # If the argument and the current status are different,
       # toggle blocking / non-blocking.
       @srv = @svc.attrGet(OCI_ATTR_SERVER) unless @srv

Modified: branches/ruby-oci8-1.0/test/test_break.rb
===================================================================
--- branches/ruby-oci8-1.0/test/test_break.rb	2008-01-12 06:51:43 UTC (rev 238)
+++ branches/ruby-oci8-1.0/test/test_break.rb	2008-01-12 07:12:45 UTC (rev 239)
@@ -36,6 +36,17 @@
     th.join
   end
 
+  def test_set_blocking_mode
+    conn = OCI8.new($dbuser, $dbpass, $dbname)
+    conn.non_blocking = true
+    assert_equal(true, conn.non_blocking?)
+    conn.non_blocking = false
+    assert_equal(false, conn.non_blocking?)
+    conn.non_blocking = true
+    assert_equal(true, conn.non_blocking?)
+    conn.logoff()
+  end
+
   def test_blocking_mode
     conn = OCI8.new($dbuser, $dbpass, $dbname)
     conn.non_blocking = false




More information about the ruby-oci8-commit mailing list