ruby-oci8 2.2.3 → 2.2.4
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 +100 -0
- data/NEWS +39 -0
- data/README.md +16 -8
- data/dist-files +2 -0
- data/docs/bind-array-to-in_cond.md +1 -1
- data/docs/conflicts-local-connections-and-processes.md +7 -4
- data/docs/hanging-after-inactivity.md +61 -0
- data/docs/install-binary-package.md +15 -11
- data/docs/install-full-client.md +18 -21
- data/docs/install-instant-client.md +44 -27
- data/docs/install-on-osx.md +13 -15
- data/docs/platform-specific-issues.md +17 -50
- data/docs/report-installation-issue.md +3 -0
- data/docs/timeout-parameters.md +3 -0
- data/ext/oci8/encoding.c +5 -5
- data/ext/oci8/env.c +8 -2
- data/ext/oci8/error.c +25 -2
- data/ext/oci8/hook_funcs.c +131 -6
- data/ext/oci8/oci8.c +18 -13
- data/ext/oci8/oci8.h +10 -2
- data/ext/oci8/oci8lib.c +129 -2
- data/ext/oci8/ocihandle.c +34 -34
- data/ext/oci8/oraconf.rb +26 -80
- data/ext/oci8/oradate.c +18 -18
- data/ext/oci8/plthook.h +10 -0
- data/ext/oci8/plthook_elf.c +83 -2
- data/ext/oci8/plthook_osx.c +31 -0
- data/ext/oci8/plthook_win32.c +9 -0
- data/ext/oci8/stmt.c +1 -1
- data/lib/oci8.rb +38 -1
- data/lib/oci8/cursor.rb +9 -8
- data/lib/oci8/oci8.rb +7 -3
- data/lib/oci8/properties.rb +22 -0
- data/lib/oci8/version.rb +1 -1
- data/ruby-oci8.gemspec +1 -5
- data/test/test_all.rb +1 -0
- data/test/test_bind_integer.rb +47 -0
- data/test/test_connstr.rb +29 -13
- data/test/test_oci8.rb +1 -1
- metadata +5 -3
data/test/test_all.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'oci8'
|
2
|
+
require File.dirname(__FILE__) + '/config'
|
3
|
+
|
4
|
+
class TestBindInteger < Minitest::Test
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@conn = get_oci8_connection
|
8
|
+
end
|
9
|
+
|
10
|
+
POSITIVE_INTS = [
|
11
|
+
100,
|
12
|
+
2**30,
|
13
|
+
2**31,
|
14
|
+
2**32,
|
15
|
+
2**33,
|
16
|
+
2**62,
|
17
|
+
2**63,
|
18
|
+
2**64,
|
19
|
+
('9' * 38).to_i
|
20
|
+
]
|
21
|
+
|
22
|
+
def bind_and_get(input_value, output_type)
|
23
|
+
cursor = @conn.parse("BEGIN :out := :in; END;")
|
24
|
+
cursor.bind_param(:out, output_type)
|
25
|
+
cursor.bind_param(:in, input_value)
|
26
|
+
cursor.exec
|
27
|
+
result = cursor[:out]
|
28
|
+
cursor.close
|
29
|
+
result
|
30
|
+
end
|
31
|
+
|
32
|
+
(POSITIVE_INTS + [0] + POSITIVE_INTS.map(&:-@)).each do |num|
|
33
|
+
define_method("test_bind_param_with_input_of '#{num}'") do
|
34
|
+
assert_equal(OraNumber.new(num.to_s), bind_and_get(num, OraNumber))
|
35
|
+
end
|
36
|
+
|
37
|
+
define_method("test_bind_param_with_output_of '#{num}'") do
|
38
|
+
result = bind_and_get(OraNumber.new(num.to_s), Integer)
|
39
|
+
assert_equal(num, result)
|
40
|
+
assert_kind_of(Integer, result)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def teardown
|
45
|
+
@conn.logoff
|
46
|
+
end
|
47
|
+
end
|
data/test/test_connstr.rb
CHANGED
@@ -80,9 +80,9 @@ class TestConnStr < Minitest::Test
|
|
80
80
|
DESC_TEST_CASE =
|
81
81
|
[
|
82
82
|
# Cannot distinguish net service names from easy connect strings in this case.
|
83
|
-
["sales-server", nil, nil, "sales-server"],
|
83
|
+
["sales-server", nil, nil, false, "sales-server"],
|
84
84
|
# Easy Connect string with host.
|
85
|
-
["//sales-server", nil, nil, <<EOS],
|
85
|
+
["//sales-server", nil, nil, false, <<EOS],
|
86
86
|
(DESCRIPTION=
|
87
87
|
(CONNECT_DATA=
|
88
88
|
(SERVICE_NAME=))
|
@@ -92,7 +92,7 @@ class TestConnStr < Minitest::Test
|
|
92
92
|
(PORT=1521)))
|
93
93
|
EOS
|
94
94
|
# Easy Connect string with host and port.
|
95
|
-
["sales-server:3456", nil, nil, <<EOS],
|
95
|
+
["sales-server:3456", nil, nil, false, <<EOS],
|
96
96
|
(DESCRIPTION=
|
97
97
|
(CONNECT_DATA=
|
98
98
|
(SERVICE_NAME=))
|
@@ -102,7 +102,7 @@ EOS
|
|
102
102
|
(PORT=3456)))
|
103
103
|
EOS
|
104
104
|
# The host name is sales-server and the service name is sales.
|
105
|
-
["sales-server/sales", nil, nil, <<EOS],
|
105
|
+
["sales-server/sales", nil, nil, false, <<EOS],
|
106
106
|
(DESCRIPTION=
|
107
107
|
(CONNECT_DATA=
|
108
108
|
(SERVICE_NAME=sales))
|
@@ -112,7 +112,7 @@ EOS
|
|
112
112
|
(PORT=1521)))
|
113
113
|
EOS
|
114
114
|
# Easy Connect string with IPv6 address.
|
115
|
-
["[2001:0db8:0:0::200C:417A]:80/sales", nil, nil, <<EOS],
|
115
|
+
["[2001:0db8:0:0::200C:417A]:80/sales", nil, nil, false, <<EOS],
|
116
116
|
(DESCRIPTION=
|
117
117
|
(CONNECT_DATA=
|
118
118
|
(SERVICE_NAME=sales))
|
@@ -122,7 +122,7 @@ EOS
|
|
122
122
|
(PORT=80)))
|
123
123
|
EOS
|
124
124
|
# Easy Connect string with IPv6 host address.
|
125
|
-
["sales-server:80/sales", nil, nil, <<EOS],
|
125
|
+
["sales-server:80/sales", nil, nil, false, <<EOS],
|
126
126
|
(DESCRIPTION=
|
127
127
|
(CONNECT_DATA=
|
128
128
|
(SERVICE_NAME=sales))
|
@@ -132,7 +132,7 @@ EOS
|
|
132
132
|
(PORT=80)))
|
133
133
|
EOS
|
134
134
|
# Easy Connect string with host, service name, and server.
|
135
|
-
["sales-server/sales:dedicated/inst1", nil, nil, <<EOS],
|
135
|
+
["sales-server/sales:dedicated/inst1", nil, nil, false, <<EOS],
|
136
136
|
(DESCRIPTION=
|
137
137
|
(CONNECT_DATA=
|
138
138
|
(SERVICE_NAME=sales)
|
@@ -143,7 +143,7 @@ EOS
|
|
143
143
|
(HOST=sales-server)
|
144
144
|
(PORT=1521)))
|
145
145
|
EOS
|
146
|
-
["sales-server//inst1", nil, nil, <<EOS],
|
146
|
+
["sales-server//inst1", nil, nil, false, <<EOS],
|
147
147
|
(DESCRIPTION=
|
148
148
|
(CONNECT_DATA=
|
149
149
|
(SERVICE_NAME=)
|
@@ -154,7 +154,7 @@ EOS
|
|
154
154
|
(PORT=1521)))
|
155
155
|
EOS
|
156
156
|
#
|
157
|
-
["sales-server/sales", 20, nil, <<EOS],
|
157
|
+
["sales-server/sales", 20, nil, false, <<EOS],
|
158
158
|
(DESCRIPTION=
|
159
159
|
(CONNECT_DATA=
|
160
160
|
(SERVICE_NAME=sales))
|
@@ -165,7 +165,7 @@ EOS
|
|
165
165
|
(TRANSPORT_CONNECT_TIMEOUT=20))
|
166
166
|
EOS
|
167
167
|
#
|
168
|
-
["sales-server/sales", nil, 30, <<EOS],
|
168
|
+
["sales-server/sales", nil, 30, false, <<EOS],
|
169
169
|
(DESCRIPTION=
|
170
170
|
(CONNECT_DATA=
|
171
171
|
(SERVICE_NAME=sales))
|
@@ -176,7 +176,7 @@ EOS
|
|
176
176
|
(CONNECT_TIMEOUT=30))
|
177
177
|
EOS
|
178
178
|
#
|
179
|
-
["sales-server/sales", 20, 30, <<EOS],
|
179
|
+
["sales-server/sales", 20, 30, false, <<EOS],
|
180
180
|
(DESCRIPTION=
|
181
181
|
(CONNECT_DATA=
|
182
182
|
(SERVICE_NAME=sales))
|
@@ -186,6 +186,21 @@ EOS
|
|
186
186
|
(PORT=1521))
|
187
187
|
(TRANSPORT_CONNECT_TIMEOUT=20)
|
188
188
|
(CONNECT_TIMEOUT=30))
|
189
|
+
EOS
|
190
|
+
["sales-server/sales", 20, 30, true, <<EOS],
|
191
|
+
(DESCRIPTION=
|
192
|
+
(CONNECT_DATA=
|
193
|
+
(SERVICE_NAME=sales)
|
194
|
+
)
|
195
|
+
(ADDRESS=
|
196
|
+
(PROTOCOL=TCP)
|
197
|
+
(HOST=sales-server)
|
198
|
+
(PORT=1521)
|
199
|
+
)
|
200
|
+
(TRANSPORT_CONNECT_TIMEOUT=20)
|
201
|
+
(CONNECT_TIMEOUT=30)
|
202
|
+
(ENABLE=BROKEN)
|
203
|
+
)
|
189
204
|
EOS
|
190
205
|
]
|
191
206
|
|
@@ -195,9 +210,10 @@ EOS
|
|
195
210
|
easy_connect_string = test_case[0]
|
196
211
|
tcp_connnect_timeout= test_case[1]
|
197
212
|
outbound_connnect_timeout = test_case[2]
|
198
|
-
|
213
|
+
tcp_keepalive = test_case[3]
|
214
|
+
expected_result = test_case[4].gsub(/\s/, '')
|
199
215
|
# use instance_eval to call a private method to_connect_descriptor
|
200
|
-
result = obj.instance_eval { to_connect_descriptor(easy_connect_string, tcp_connnect_timeout, outbound_connnect_timeout) }
|
216
|
+
result = obj.instance_eval { to_connect_descriptor(easy_connect_string, tcp_connnect_timeout, outbound_connnect_timeout, tcp_keepalive) }
|
201
217
|
assert_equal(expected_result, result, easy_connect_string)
|
202
218
|
end
|
203
219
|
end
|
data/test/test_oci8.rb
CHANGED
@@ -216,8 +216,8 @@ EOS
|
|
216
216
|
assert_nil(rv[4])
|
217
217
|
assert_nil(rv[5])
|
218
218
|
else
|
219
|
-
dttm = DateTime.civil(2000 + i, 8, 3, 23, 59, 59, Time.now.utc_offset.to_r/86400)
|
220
219
|
tm = Time.local(2000 + i, 8, 3, 23, 59, 59)
|
220
|
+
dttm = DateTime.civil(2000 + i, 8, 3, 23, 59, 59, tm.utc_offset.to_r/86400)
|
221
221
|
dt = Date.civil(2000 + i, 8, 3)
|
222
222
|
assert_equal(tm, rv[3])
|
223
223
|
assert_equal(dttm, rv[4])
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 2.2.
|
8
|
+
- 4
|
9
|
+
version: 2.2.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kubo Takehiro
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2017-06-11 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- docs/install-instant-client.md
|
48
48
|
- docs/install-on-osx.md
|
49
49
|
- docs/conflicts-local-connections-and-processes.md
|
50
|
+
- docs/hanging-after-inactivity.md
|
50
51
|
- docs/osx-install-dev-tools.png
|
51
52
|
- docs/platform-specific-issues.md
|
52
53
|
- docs/report-installation-issue.md
|
@@ -118,6 +119,7 @@ files:
|
|
118
119
|
- test/test_bind_raw.rb
|
119
120
|
- test/test_bind_string.rb
|
120
121
|
- test/test_bind_time.rb
|
122
|
+
- test/test_bind_integer.rb
|
121
123
|
- test/test_break.rb
|
122
124
|
- test/test_clob.rb
|
123
125
|
- test/test_connection_pool.rb
|