ruby-oci8 2.1.7 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +136 -0
- data/NEWS +61 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/dist-files +5 -0
- data/docs/install-instant-client.md +2 -0
- data/ext/oci8/attr.c +0 -9
- data/ext/oci8/bind.c +86 -28
- data/ext/oci8/connection_pool.c +32 -17
- data/ext/oci8/extconf.rb +21 -0
- data/ext/oci8/hook_funcs.c +215 -0
- data/ext/oci8/lob.c +363 -168
- data/ext/oci8/metadata.c +43 -26
- data/ext/oci8/object.c +115 -36
- data/ext/oci8/oci8.c +392 -269
- data/ext/oci8/oci8.h +88 -33
- data/ext/oci8/oci8lib.c +59 -28
- data/ext/oci8/ocidatetime.c +100 -36
- data/ext/oci8/ocihandle.c +288 -286
- data/ext/oci8/ocinumber.c +172 -112
- data/ext/oci8/oradate.c +129 -87
- data/ext/oci8/plthook.h +56 -0
- data/ext/oci8/plthook_elf.c +537 -0
- data/ext/oci8/plthook_osx.c +474 -0
- data/ext/oci8/plthook_win32.c +376 -0
- data/ext/oci8/stmt.c +112 -75
- data/lib/oci8/cursor.rb +1 -1
- data/lib/oci8/oci8.rb +71 -0
- data/lib/oci8/properties.rb +18 -3
- metadata +10 -16
data/lib/oci8/cursor.rb
CHANGED
@@ -55,7 +55,7 @@ class OCI8
|
|
55
55
|
# example:
|
56
56
|
# cursor = conn.parse("SELECT * FROM emp WHERE ename = :ename")
|
57
57
|
# cursor.bind_param(1, 'SMITH') # bind by position
|
58
|
-
#
|
58
|
+
# # ...or...
|
59
59
|
# cursor.bind_param(':ename', 'SMITH') # bind by name
|
60
60
|
#
|
61
61
|
# To bind as number, Fixnum and Float are available, but Bignum is
|
data/lib/oci8/oci8.rb
CHANGED
@@ -384,6 +384,77 @@ class OCI8
|
|
384
384
|
def self.client_charset_name
|
385
385
|
@@client_charset_name
|
386
386
|
end
|
387
|
+
|
388
|
+
if OCI8.oracle_client_version >= OCI8::ORAVER_11_1
|
389
|
+
# Returns send timeout in seconds.
|
390
|
+
# Zero means no timeout.
|
391
|
+
# This is equivalent to {http://docs.oracle.com/database/121/NETRF/sqlnet.htm#NETRF228 SQLNET.SEND_TIMEOUT} in client-side sqlnet.ora.
|
392
|
+
#
|
393
|
+
# @return [Float] seconds
|
394
|
+
# @see #recv_timeout
|
395
|
+
# @since 2.1.8 and Oracle 11.1
|
396
|
+
def send_timeout
|
397
|
+
# OCI_ATTR_SEND_TIMEOUT = 435
|
398
|
+
@server_handle.send(:attr_get_ub4, 435).to_f / 1000
|
399
|
+
end
|
400
|
+
|
401
|
+
# Sets send timeout in seconds.
|
402
|
+
# Zero means no timeout.
|
403
|
+
# This is equivalent to {http://docs.oracle.com/database/121/NETRF/sqlnet.htm#NETRF228 SQLNET.SEND_TIMEOUT} in client-side sqlnet.ora.
|
404
|
+
#
|
405
|
+
# If you have trouble by setting this, don't use it because it uses
|
406
|
+
# {http://blog.jiubao.org/2015/01/undocumented-oci-handle-attributes.html an undocumented OCI handle attribute}.
|
407
|
+
#
|
408
|
+
# @param [Float] timeout
|
409
|
+
# @return [void]
|
410
|
+
# @see #recv_timeout=
|
411
|
+
# @since 2.1.8 and Oracle 11.1
|
412
|
+
def send_timeout=(timeout)
|
413
|
+
# OCI_ATTR_SEND_TIMEOUT = 435
|
414
|
+
@server_handle.send(:attr_set_ub4, 435, timeout * 1000)
|
415
|
+
end
|
416
|
+
|
417
|
+
# Returns receive timeout in seconds.
|
418
|
+
# Zero means no timeout.
|
419
|
+
# This is equivalent to {http://docs.oracle.com/database/121/NETRF/sqlnet.htm#NETRF227 SQLNET.RECV_TIMEOUT} in client-side sqlnet.ora.
|
420
|
+
#
|
421
|
+
# @return [Float] seconds
|
422
|
+
# @see #send_timeout
|
423
|
+
# @since 2.1.8 and Oracle 11.1
|
424
|
+
def recv_timeout
|
425
|
+
# OCI_ATTR_RECEIVE_TIMEOUT = 436
|
426
|
+
@server_handle.send(:attr_get_ub4, 436).to_f / 1000
|
427
|
+
end
|
428
|
+
|
429
|
+
# Sets receive timeout in seconds.
|
430
|
+
# Zero means no timeout.
|
431
|
+
# This is equivalent to {http://docs.oracle.com/database/121/NETRF/sqlnet.htm#NETRF227 SQLNET.RECV_TIMEOUT} in client-side sqlnet.ora.
|
432
|
+
#
|
433
|
+
# If you have trouble by setting this, don't use it because it uses
|
434
|
+
# {http://blog.jiubao.org/2015/01/undocumented-oci-handle-attributes.html an undocumented OCI handle attribute}.
|
435
|
+
#
|
436
|
+
# @param [Float] timeout
|
437
|
+
# @return [void]
|
438
|
+
# @see #send_timeout=
|
439
|
+
# @since 2.1.8 and Oracle 11.1
|
440
|
+
def recv_timeout=(timeout)
|
441
|
+
# OCI_ATTR_RECEIVE_TIMEOUT = 436
|
442
|
+
@server_handle.send(:attr_set_ub4, 436, timeout * 1000)
|
443
|
+
end
|
444
|
+
else
|
445
|
+
def send_timeout
|
446
|
+
raise NotImplementedError, 'send_timeout is unimplemented in this Oracle version'
|
447
|
+
end
|
448
|
+
def send_timeout=(timeout)
|
449
|
+
raise NotImplementedError, 'send_timeout= is unimplemented in this Oracle version'
|
450
|
+
end
|
451
|
+
def recv_timeout
|
452
|
+
raise NotImplementedError, 'recv_timeout is unimplemented in this Oracle version'
|
453
|
+
end
|
454
|
+
def recv_timeout=(timeout)
|
455
|
+
raise NotImplementedError, 'revc_timeout= is unimplemented in this Oracle version'
|
456
|
+
end
|
457
|
+
end
|
387
458
|
end
|
388
459
|
|
389
460
|
class OCIError
|
data/lib/oci8/properties.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# properties.rb -- implements OCI8.properties
|
2
2
|
#
|
3
|
-
# Copyright (C) 2010-
|
3
|
+
# Copyright (C) 2010-2015 Kubo Takehiro <kubo@jiubao.org>
|
4
4
|
|
5
5
|
#
|
6
6
|
class OCI8
|
@@ -11,7 +11,8 @@ class OCI8
|
|
11
11
|
:bind_string_as_nchar => false,
|
12
12
|
:float_conversion_type => OCI8.__get_prop(1) ? :ruby : :oracle,
|
13
13
|
:statement_cache_size => 0,
|
14
|
-
:events_mode => ((OCI8.__get_prop(2) & 4) != 0) # 4 <- OCI_EVENTS in oci.h
|
14
|
+
:events_mode => ((OCI8.__get_prop(2) & 4) != 0), # 4 <- OCI_EVENTS in oci.h
|
15
|
+
:cancel_read_at_exit => false,
|
15
16
|
}
|
16
17
|
|
17
18
|
if OCI8.oracle_client_version < OCI8::ORAVER_9_2
|
@@ -56,6 +57,9 @@ class OCI8
|
|
56
57
|
else
|
57
58
|
OCI8.__set_prop(2, OCI8.__get_prop(2) & ~4) # unset OCI_EVENTS
|
58
59
|
end
|
60
|
+
when :cancel_read_at_exit
|
61
|
+
val = val ? true : false
|
62
|
+
OCI8.__set_prop(3, val)
|
59
63
|
end
|
60
64
|
super(name, val)
|
61
65
|
end
|
@@ -120,11 +124,22 @@ class OCI8
|
|
120
124
|
#
|
121
125
|
# require 'oci8'
|
122
126
|
# OCI8.properties[:events_mode] = true # works fine.
|
123
|
-
# ... call some OCI methods ...
|
127
|
+
# # ... call some OCI methods ...
|
124
128
|
# OCI8.properties[:events_mode] = true # raises a runtime error.
|
125
129
|
#
|
126
130
|
# *Since:* 2.1.4
|
127
131
|
#
|
132
|
+
# [:cancel_read_at_exit]
|
133
|
+
#
|
134
|
+
# +true+ when read system calls are canceled at exit. Otherwise, +false+.
|
135
|
+
# The default value is +false+ because it uses unusual technique which
|
136
|
+
# hooks read system calls issued by Oracle client library and it works
|
137
|
+
# only on Linux, OSX and Windows.
|
138
|
+
# This feature is added not to block ruby process termination when
|
139
|
+
# network quality is poor and packets are lost irregularly.
|
140
|
+
#
|
141
|
+
# *Since:* 2.1.8
|
142
|
+
#
|
128
143
|
# @return [a customized Hash]
|
129
144
|
# @since 2.0.5
|
130
145
|
#
|
metadata
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-oci8
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 2
|
7
|
-
- 1
|
8
|
-
- 7
|
9
|
-
version: 2.1.7
|
4
|
+
version: 2.1.8
|
10
5
|
platform: ruby
|
11
6
|
authors:
|
12
7
|
- Kubo Takehiro
|
@@ -14,7 +9,7 @@ autorequire:
|
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
11
|
|
17
|
-
date:
|
12
|
+
date: 2015-04-04 00:00:00 +09:00
|
18
13
|
default_executable:
|
19
14
|
dependencies: []
|
20
15
|
|
@@ -60,6 +55,7 @@ files:
|
|
60
55
|
- ext/oci8/env.c
|
61
56
|
- ext/oci8/error.c
|
62
57
|
- ext/oci8/extconf.rb
|
58
|
+
- ext/oci8/hook_funcs.c
|
63
59
|
- ext/oci8/lob.c
|
64
60
|
- ext/oci8/metadata.c
|
65
61
|
- ext/oci8/object.c
|
@@ -73,6 +69,10 @@ files:
|
|
73
69
|
- ext/oci8/oradate.c
|
74
70
|
- ext/oci8/oranumber_util.c
|
75
71
|
- ext/oci8/oranumber_util.h
|
72
|
+
- ext/oci8/plthook.h
|
73
|
+
- ext/oci8/plthook_elf.c
|
74
|
+
- ext/oci8/plthook_osx.c
|
75
|
+
- ext/oci8/plthook_win32.c
|
76
76
|
- ext/oci8/post-config.rb
|
77
77
|
- ext/oci8/stmt.c
|
78
78
|
- ext/oci8/thread_util.c
|
@@ -131,27 +131,21 @@ require_paths:
|
|
131
131
|
- lib
|
132
132
|
- ext/oci8
|
133
133
|
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
-
none: false
|
135
134
|
requirements:
|
136
135
|
- - ">="
|
137
136
|
- !ruby/object:Gem::Version
|
138
|
-
segments:
|
139
|
-
- 1
|
140
|
-
- 8
|
141
|
-
- 0
|
142
137
|
version: 1.8.0
|
138
|
+
version:
|
143
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
-
none: false
|
145
140
|
requirements:
|
146
141
|
- - ">="
|
147
142
|
- !ruby/object:Gem::Version
|
148
|
-
segments:
|
149
|
-
- 0
|
150
143
|
version: "0"
|
144
|
+
version:
|
151
145
|
requirements: []
|
152
146
|
|
153
147
|
rubyforge_project: ruby-oci8
|
154
|
-
rubygems_version: 1.3.
|
148
|
+
rubygems_version: 1.3.5
|
155
149
|
signing_key:
|
156
150
|
specification_version: 3
|
157
151
|
summary: Ruby interface for Oracle using OCI8 API
|