ruby-oci8 2.2.5.1-x64-mingw32 → 2.2.6-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +68 -0
- data/NEWS +39 -0
- data/README.md +1 -1
- data/dist-files +1 -0
- data/docs/install-on-osx.md +1 -1
- data/lib/oci8.rb +2 -0
- data/lib/oci8/metadata.rb +9 -1
- data/lib/oci8/object.rb +10 -0
- data/lib/oci8/oci8.rb +6 -0
- data/lib/oci8/oracle_version.rb +11 -1
- data/lib/oci8/version.rb +1 -1
- data/lib/oci8lib_200.so +0 -0
- data/lib/oci8lib_210.so +0 -0
- data/lib/oci8lib_220.so +0 -0
- data/lib/oci8lib_230.so +0 -0
- data/lib/oci8lib_240.so +0 -0
- data/lib/oci8lib_250.so +0 -0
- data/lib/ruby-oci8.rb +0 -3
- data/test/setup_test_object.sql +21 -13
- data/test/test_all.rb +1 -0
- data/test/test_clob.rb +3 -16
- data/test/test_object.rb +33 -9
- data/test/test_oci8.rb +15 -1
- data/test/test_package_type.rb +15 -3
- data/test/test_properties.rb +17 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7fe17496eb09344b2b6509c3995909a8cf3c34d
|
4
|
+
data.tar.gz: 8f742ce1c8ac716cbb38ad34eecc494e85e5a015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f95a3e9110ca757f29be2ee9062043d255ff6d871a0bddf7c350ae5c728b9024dfcddf5582c9b39b6bc997798ec0e62590af3771224c8919c6b3bb074c916bb
|
7
|
+
data.tar.gz: 1a3c3453b9a91ef6444d975d3d266ef2c8a8ba13275e51fd0e60eec629526b0ce922c3653e5561a5607dd97c944fd9ed9686e9e8d6dd5bb1fec6270b3d4e0c8f
|
data/ChangeLog
CHANGED
@@ -1,3 +1,71 @@
|
|
1
|
+
2018-08-22 Kubo Takehiro <kubo@jiubao.org>
|
2
|
+
* NEWS: Add changes between 2.2.5.1 and 2.2.6
|
3
|
+
* lib/oci8/version.rb: Update to 2.2.6
|
4
|
+
* mkpkg-win32.rb: Don't test with self-build ruby 2.4.
|
5
|
+
|
6
|
+
2018-08-22 Kubo Takehiro <kubo@jiubao.org>
|
7
|
+
* ext/oci8/oci8lib.c: Load a Oracle client library which doesn't have
|
8
|
+
version number suffix also on Unix when runtime-check is enabled.
|
9
|
+
Oracle version numbers are incremented yearly sice Oracle 18c.
|
10
|
+
|
11
|
+
2018-08-22 Kubo Takehiro <kubo@jiubao.org>
|
12
|
+
* ext/oci8/hook_funcs.c, ext/oci8/win32.c: Suppress warnings:
|
13
|
+
"'raise_error' defined but not used" and "'strncpy' specified
|
14
|
+
bound 512 equals destination size".
|
15
|
+
|
16
|
+
2018-08-19 Kubo Takehiro <kubo@jiubao.org>
|
17
|
+
* ext/oci8/hook_funcs.c: Not depend on Oracle version number
|
18
|
+
of Oracle client file name suffix when hooking functions.
|
19
|
+
(rsim/oracle-enhanced#1754)
|
20
|
+
* test/test_all.rb, test/test_properties.rb, dist-files:
|
21
|
+
Add tests for hooking.
|
22
|
+
|
23
|
+
2018-08-18 Kubo Takehiro <kubo@jiubao.org>
|
24
|
+
* test/test_oci8.rb: Fix to pass a test when the client is 11g
|
25
|
+
and the server is 18c. client_driver in v$session_connect_info
|
26
|
+
has an extra space at the end.
|
27
|
+
|
28
|
+
2018-08-18 Kubo Takehiro <kubo@jiubao.org>
|
29
|
+
* ext/oci8/apiwrap.rb, ext/oci8/apiwrap.yml, ext/oci8/oci8.c,
|
30
|
+
ext/oci8/oci8.h, lib/oci8/oci8.rb, lib/oci8/oracle_version.rb,
|
31
|
+
test/test_oci8.rb: Fix OCI8#oracle_server_version to get
|
32
|
+
full version of Oracle 18c.
|
33
|
+
|
34
|
+
2018-08-18 Kubo Takehiro <kubo@jiubao.org>
|
35
|
+
* lib/oci8/metadata.rb: Update doc comments of OCI8::Metadata::ArgBase#level
|
36
|
+
and OCI8::Metadata::ArgBase#arguments.
|
37
|
+
* test/test_package_type.rb, lib/oci8.rb: Fix to pass tests on Oracle 18c.
|
38
|
+
Detailed user-defined type information used in arguments isn't available
|
39
|
+
on Oracle 18c.
|
40
|
+
|
41
|
+
2018-08-12 Kubo Takehiro <kubo@jiubao.org>
|
42
|
+
* test/test_clob.rb: Skip TestCLob#test_github_issue_20 because it
|
43
|
+
takes 4 minutes to test it in my Linux box.
|
44
|
+
|
45
|
+
2018-08-12 Kubo Takehiro <kubo@jiubao.org>
|
46
|
+
* ext/oci8/lob.c, test/test_clob.rb: LOB#sync, LOB#sync= and LOB#flush
|
47
|
+
do nothing now. They have not worked by mistake from the beginning
|
48
|
+
because incorrect arguments has been passed to OCILobOpen().
|
49
|
+
Moreover it crashed Oracle 18c server-side processes and caused
|
50
|
+
"ORA-03113: end-of-file on communication channel."
|
51
|
+
(github issue #198)
|
52
|
+
|
53
|
+
2018-01-28 Kubo Takehiro <kubo@jiubao.org>
|
54
|
+
* ext/oci8/object.c, lib/oci8/object.rb: Add timestamp with time zone
|
55
|
+
data type support in object type attributes.
|
56
|
+
(github issue #185)
|
57
|
+
* test/setup_test_object.sql, test/test_object.rb: Add tests for
|
58
|
+
timestamp and timestamp with time zone.
|
59
|
+
|
60
|
+
2018-01-23 Kubo Takehiro <kubo@jiubao.org>
|
61
|
+
* ext/oci8/object.c, ext/oci8/oci8.h, lib/oci8/object.rb:
|
62
|
+
Add timestamp data type support in object type attributes.
|
63
|
+
(github issue #185)
|
64
|
+
|
65
|
+
2017-12-27 Kubo Takehiro <kubo@jiubao.org>
|
66
|
+
* mkpkg-win32.rb: Remove '-rubygems' in the command line to run tests.
|
67
|
+
`ubygems.rb` was removed in ruby 2.5.
|
68
|
+
|
1
69
|
2017-12-27 Kubo Takehiro <kubo@jiubao.org>
|
2
70
|
* NEWS: Add changes between 2.2.5 and 2.2.5.1
|
3
71
|
* lib/oci8/version.rb: Update to 2.2.5.1
|
data/NEWS
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
# @markup markdown
|
2
2
|
|
3
|
+
2.2.6
|
4
|
+
=====
|
5
|
+
|
6
|
+
This release fixed issues about Oracle 18c except one.
|
7
|
+
|
8
|
+
Fixed issue
|
9
|
+
-----------
|
10
|
+
|
11
|
+
### Setting some properties failed with Oracle 18c client
|
12
|
+
|
13
|
+
Setting `OCI8::properties[:tcp_keepalive_time]` or `OCI8::properties[:cancel_read_at_exit]`
|
14
|
+
failed with the error message "No shared library is found to hook" when Oracle
|
15
|
+
client version is 18c.
|
16
|
+
(rsim/oracle-enhanced#1754)
|
17
|
+
|
18
|
+
### Fix `OCI8#oracle_server_version` to get full version of Oracle 18c
|
19
|
+
|
20
|
+
`OCI8#oracle_server_version` returned Oracle version number whose
|
21
|
+
number components after the first dot are zeros such as '18.0.0.0.0'
|
22
|
+
even when the server version is `18.3.0.0.0`. This issue was fixed by
|
23
|
+
using a new OCI function. However the function is available since
|
24
|
+
Oracle 18c client. So when the Oracle client version is 12c or earlier
|
25
|
+
and the Oracle server version is 18c or later, it cannot get the *full*
|
26
|
+
Oracle version number.
|
27
|
+
|
28
|
+
### Fix tests when the Oracle server version is 18c.
|
29
|
+
|
30
|
+
### LOB#sync, LOB#sync= and LOB#flush do nothing now.
|
31
|
+
|
32
|
+
They have not worked by mistake from the beginning because incorrect
|
33
|
+
arguments has been passed to OCILobOpen(). Moreover it crashed Oracle
|
34
|
+
18c server-side processes and caused "ORA-03113: end-of-file on
|
35
|
+
communication channel."
|
36
|
+
(github issue #198)
|
37
|
+
|
38
|
+
### `unsupported typecode timestamp` when timestamp with time zone is in object type attributes.
|
39
|
+
|
40
|
+
(github issue #185)
|
41
|
+
|
3
42
|
2.2.5.1
|
4
43
|
=======
|
5
44
|
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@ Ruby-oci8
|
|
2
2
|
=========
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/ruby-oci8.svg)](http://badge.fury.io/rb/ruby-oci8)
|
5
|
-
[![
|
5
|
+
[![Build Status](https://travis-ci.org/kubo/ruby-oci8.svg?branch=master)](https://travis-ci.org/kubo/ruby-oci8)
|
6
6
|
|
7
7
|
What is ruby-oci8
|
8
8
|
-----------------
|
data/dist-files
CHANGED
data/docs/install-on-osx.md
CHANGED
@@ -39,7 +39,7 @@ Download the following packages from [Oracle Technology Network][]
|
|
39
39
|
|
40
40
|
* Instant Client Package - Basic (`instantclient-basic-macos.x64-12.1.0.2.0.zip`) or Basic Lite (`instantclient-basiclite-macos.x64-12.1.0.2.0.zip`)
|
41
41
|
* Instant Client Package - SDK (`instantclient-sdk-macos.x64-12.1.0.2.0.zip`)
|
42
|
-
* Instant Client Package - SQL*Plus (`instantclient-
|
42
|
+
* Instant Client Package - SQL*Plus (`instantclient-sqlplus-macos.x64-12.1.0.2.0.zip`) (optionally)
|
43
43
|
|
44
44
|
### Install Oracle Instant Client Packages via Homebrew
|
45
45
|
|
data/lib/oci8.rb
CHANGED
@@ -140,6 +140,8 @@ class OCI8
|
|
140
140
|
ORAVER_11_1 = OCI8::OracleVersion.new(11, 1)
|
141
141
|
# @private
|
142
142
|
ORAVER_12_1 = OCI8::OracleVersion.new(12, 1)
|
143
|
+
# @private
|
144
|
+
ORAVER_18 = OCI8::OracleVersion.new(18)
|
143
145
|
|
144
146
|
# @private
|
145
147
|
@@oracle_client_version = OCI8::OracleVersion.new(self.oracle_client_vernum)
|
data/lib/oci8/metadata.rb
CHANGED
@@ -1503,7 +1503,11 @@ class OCI8
|
|
1503
1503
|
attr_get_sb1(OCI_ATTR_SCALE)
|
1504
1504
|
end
|
1505
1505
|
|
1506
|
-
# The
|
1506
|
+
# The nest level.
|
1507
|
+
#
|
1508
|
+
# Oracle manual says that it always returns zero. However it returns
|
1509
|
+
# the depth of {OCI8::ArgBase#arguments} calls when #arguments returns
|
1510
|
+
# a non-empty array.
|
1507
1511
|
def level
|
1508
1512
|
attr_get_ub2(OCI_ATTR_LEVEL)
|
1509
1513
|
end
|
@@ -1607,6 +1611,10 @@ class OCI8
|
|
1607
1611
|
|
1608
1612
|
# The list of arguments at the next level (when the argument is
|
1609
1613
|
# of a record or table type).
|
1614
|
+
#
|
1615
|
+
# This method returns an array containing type information when
|
1616
|
+
# the type is a user-defined type and the Oracle server version
|
1617
|
+
# is 12c or earlier. Otherwise, it returns an empty array.
|
1610
1618
|
def arguments
|
1611
1619
|
@arguments ||= list_arguments.to_a
|
1612
1620
|
end
|
data/lib/oci8/object.rb
CHANGED
@@ -493,6 +493,16 @@ EOS
|
|
493
493
|
Proc.new do |val| datetime_to_array(val, :date) end, # set_proc
|
494
494
|
Proc.new do |val| array_to_time(val, :local) end, # get_proc
|
495
495
|
]
|
496
|
+
when :timestamp
|
497
|
+
[ATTR_TIMESTAMP, con, SIZE_OF_POINTER, 2, ALIGNMENT_OF_POINTER,
|
498
|
+
Proc.new do |val| datetime_to_array(val, :timestamp) end, # set_proc
|
499
|
+
Proc.new do |val| array_to_time(val, :local) end, # get_proc
|
500
|
+
]
|
501
|
+
when :timestamp_tz
|
502
|
+
[ATTR_TIMESTAMP_TZ, con, SIZE_OF_POINTER, 2, ALIGNMENT_OF_POINTER,
|
503
|
+
Proc.new do |val| datetime_to_array(val, :timestamp_tz) end, # set_proc
|
504
|
+
Proc.new do |val| array_to_time(val, nil) end, # get_proc
|
505
|
+
]
|
496
506
|
when :binary_double
|
497
507
|
[ATTR_BINARY_DOUBLE, nil, SIZE_OF_DOUBLE, 2, ALIGNMENT_OF_DOUBLE]
|
498
508
|
when :binary_float
|
data/lib/oci8/oci8.rb
CHANGED
@@ -340,6 +340,12 @@ class OCI8
|
|
340
340
|
|
341
341
|
# Returns the Oracle server version.
|
342
342
|
#
|
343
|
+
# When the Oracle client version is 12c or earlier and
|
344
|
+
# the Oracle server version is 18c or later, this method
|
345
|
+
# doesn't return *full* version number such as '18.3.0.0.0'.
|
346
|
+
# It returns version number whose number components after
|
347
|
+
# the first dot are zeros such as '18.0.0.0.0'.
|
348
|
+
#
|
343
349
|
# @see OCI8.oracle_client_version
|
344
350
|
# @return [OCI8::OracleVersion]
|
345
351
|
def oracle_server_version
|
data/lib/oci8/oracle_version.rb
CHANGED
@@ -66,6 +66,12 @@ class OCI8
|
|
66
66
|
major, minor, update, patch, port_update = arg.split('.').collect do |v|
|
67
67
|
v.to_i
|
68
68
|
end
|
69
|
+
elsif arg >= 0x12000000
|
70
|
+
major = (arg & 0xFF000000) >> 24
|
71
|
+
minor = (arg & 0x00FF0000) >> 16
|
72
|
+
update = (arg & 0x0000F000) >> 12
|
73
|
+
patch = (arg & 0x00000FF0) >> 4
|
74
|
+
port_update = (arg & 0x0000000F)
|
69
75
|
elsif arg >= 0x08000000
|
70
76
|
major = (arg & 0xFF000000) >> 24
|
71
77
|
minor = (arg & 0x00F00000) >> 20
|
@@ -80,7 +86,11 @@ class OCI8
|
|
80
86
|
@update = update || 0
|
81
87
|
@patch = patch || 0
|
82
88
|
@port_update = port_update || 0
|
83
|
-
@vernum =
|
89
|
+
@vernum = if @major >= 18
|
90
|
+
(@major << 24) | (@minor << 16) | (@update << 12) | (@patch << 4) | @port_update
|
91
|
+
else
|
92
|
+
(@major << 24) | (@minor << 20) | (@update << 12) | (@patch << 8) | @port_update
|
93
|
+
end
|
84
94
|
end
|
85
95
|
|
86
96
|
# Compares +self+ and +other+.
|
data/lib/oci8/version.rb
CHANGED
data/lib/oci8lib_200.so
CHANGED
Binary file
|
data/lib/oci8lib_210.so
CHANGED
Binary file
|
data/lib/oci8lib_220.so
CHANGED
Binary file
|
data/lib/oci8lib_230.so
CHANGED
Binary file
|
data/lib/oci8lib_240.so
CHANGED
Binary file
|
data/lib/oci8lib_250.so
CHANGED
Binary file
|
data/lib/ruby-oci8.rb
CHANGED
data/test/setup_test_object.sql
CHANGED
@@ -61,6 +61,8 @@ create type rb_test_obj as object (
|
|
61
61
|
obj_array_val rb_test_obj_elem_array,
|
62
62
|
obj_ary_of_ary_val rb_test_obj_elem_ary_of_ary,
|
63
63
|
date_val date,
|
64
|
+
timestamp_val timestamp(9),
|
65
|
+
timestamp_tz_val timestamp(9) with time zone,
|
64
66
|
-- date_array_val rb_test_date_array,
|
65
67
|
|
66
68
|
constructor function rb_test_obj(n number) return self as result,
|
@@ -72,19 +74,23 @@ create type rb_test_obj as object (
|
|
72
74
|
member procedure member_proc(n in integer)
|
73
75
|
)
|
74
76
|
/
|
75
|
-
create
|
76
|
-
|
77
|
+
create type body rb_test_obj is
|
77
78
|
constructor function rb_test_obj(n number) return self as result is
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
to_char(mod(round(n) * 5, 12) + 1, 'FM00') ||
|
82
|
-
to_char(mod(round(n) * 7, 27) + 1, 'FM00') ||
|
83
|
-
to_char(mod(round(n) * 9, 24), 'FM00') ||
|
84
|
-
to_char(mod(round(n) * 11, 60), 'FM00') ||
|
85
|
-
to_char(mod(round(n) * 13, 60), 'FM00'), 'yyyymmddhh24miss');
|
86
|
-
end;
|
79
|
+
str varchar(28);
|
80
|
+
ts timestamp(9);
|
81
|
+
ts_tz timestamp(9) with time zone;
|
87
82
|
begin
|
83
|
+
str := to_char(1990 + n, 'FM0000') ||
|
84
|
+
to_char(mod(round(n) * 5, 12) + 1, 'FM00') ||
|
85
|
+
to_char(mod(round(n) * 7, 27) + 1, 'FM00') ||
|
86
|
+
to_char(mod(round(n) * 9, 24), 'FM00') ||
|
87
|
+
to_char(mod(round(n) * 11, 60), 'FM00') ||
|
88
|
+
to_char(mod(round(n) * 13, 60), 'FM00') ||
|
89
|
+
to_char(mod(round(n) * 333333333, 1000000000), 'FM000000000');
|
90
|
+
ts := to_timestamp(str, 'yyyymmddhh24missff9');
|
91
|
+
str := str || to_char(mod(round(n) * 15, 24) - 11, 'FMS00') ||
|
92
|
+
to_char(mod(round(n) * 17, 60), 'FM00');
|
93
|
+
ts_tz := to_timestamp_tz(str, 'yyyymmddhh24missff9tzhtzm');
|
88
94
|
self.int_val := n;
|
89
95
|
self.flt_val := n;
|
90
96
|
self.num_val := n;
|
@@ -96,7 +102,9 @@ create or replace type body rb_test_obj is
|
|
96
102
|
self.nclob_val := to_clob(n);
|
97
103
|
self.blob_val := to_blob(utl_raw.cast_to_raw(to_char(n)));
|
98
104
|
self.obj_val := rb_test_obj_elem(n, n + 1);
|
99
|
-
self.date_val :=
|
105
|
+
self.date_val := ts;
|
106
|
+
self.timestamp_val := ts;
|
107
|
+
self.timestamp_tz_val := ts_tz;
|
100
108
|
if self.int_val != 1 then
|
101
109
|
self.int_array_val := rb_test_int_array(n, n + 1, n + 2);
|
102
110
|
self.flt_array_val := rb_test_flt_array(n, n + 1, n + 2);
|
@@ -120,7 +128,7 @@ create or replace type body rb_test_obj is
|
|
120
128
|
|
121
129
|
static function test_object_version return integer is
|
122
130
|
begin
|
123
|
-
return
|
131
|
+
return 4;
|
124
132
|
end;
|
125
133
|
|
126
134
|
static function class_func(n number) return rb_test_obj is
|
data/test/test_all.rb
CHANGED
@@ -26,6 +26,7 @@ require "#{srcdir}/test_oracle_version"
|
|
26
26
|
require "#{srcdir}/test_error"
|
27
27
|
require "#{srcdir}/test_connection_pool"
|
28
28
|
require "#{srcdir}/test_object"
|
29
|
+
require "#{srcdir}/test_properties.rb"
|
29
30
|
|
30
31
|
if OCI8.respond_to? :encoding
|
31
32
|
require "#{srcdir}/test_encoding"
|
data/test/test_clob.rb
CHANGED
@@ -24,22 +24,6 @@ class TestCLob < Minitest::Test
|
|
24
24
|
lob.close
|
25
25
|
end
|
26
26
|
|
27
|
-
def test_insert_with_flush
|
28
|
-
filename = File.basename($lobfile)
|
29
|
-
@conn.exec("DELETE FROM test_table WHERE filename = :1", filename)
|
30
|
-
@conn.exec("INSERT INTO test_table(filename, content) VALUES (:1, EMPTY_CLOB())", filename)
|
31
|
-
cursor = @conn.exec("SELECT content FROM test_table WHERE filename = :1 FOR UPDATE", filename)
|
32
|
-
lob = cursor.fetch[0]
|
33
|
-
lob.sync = false
|
34
|
-
open($lobfile) do |f|
|
35
|
-
while s = f.read(1000)
|
36
|
-
lob.write(s)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
lob.flush
|
40
|
-
lob.close
|
41
|
-
end
|
42
|
-
|
43
27
|
def test_insert_symbol
|
44
28
|
filename = 'test_symbol'
|
45
29
|
value = :foo_bar
|
@@ -76,6 +60,9 @@ class TestCLob < Minitest::Test
|
|
76
60
|
|
77
61
|
# https://github.com/kubo/ruby-oci8/issues/20
|
78
62
|
def test_github_issue_20
|
63
|
+
# Skip this test if FULLTEST isn't set because it takes 4 minutes in my Linux box.
|
64
|
+
return if ENV['FULLTEST']
|
65
|
+
|
79
66
|
lob1 = OCI8::CLOB.new(@conn, ' ' * (1024 * 1024))
|
80
67
|
lob1.read(1) # to suppress `warning: assigned but unused variable - lob1`
|
81
68
|
begin
|
data/test/test_object.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
require 'oci8'
|
2
2
|
require File.dirname(__FILE__) + '/config'
|
3
3
|
|
4
|
+
class Time
|
5
|
+
def inspect
|
6
|
+
self.strftime("%Y-%m-%d %H:%M:%S.%N %:z")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
4
10
|
conn = OCI8.new($dbuser, $dbpass, $dbname)
|
5
11
|
error_message = nil
|
6
12
|
begin
|
@@ -22,7 +28,7 @@ begin
|
|
22
28
|
|
23
29
|
begin
|
24
30
|
version = RbTestObj.test_object_version(conn)
|
25
|
-
error_message = "Invalid test object version" if version !=
|
31
|
+
error_message = "Invalid test object version" if version != 4
|
26
32
|
rescue NoMethodError
|
27
33
|
raise unless $!.to_s.include?('test_object_version')
|
28
34
|
error_message = "rb_test_obj.test_object_version is not declared."
|
@@ -100,7 +106,8 @@ class TestObj1 < Minitest::Test
|
|
100
106
|
attr_reader :obj_array_val
|
101
107
|
attr_reader :obj_ary_of_ary_val
|
102
108
|
attr_reader :date_val
|
103
|
-
|
109
|
+
attr_reader :timestamp_val
|
110
|
+
attr_reader :timestamp_tz_val
|
104
111
|
|
105
112
|
attr_accessor :assertions
|
106
113
|
|
@@ -109,16 +116,28 @@ class TestObj1 < Minitest::Test
|
|
109
116
|
@assertions = 0
|
110
117
|
end
|
111
118
|
|
112
|
-
def
|
119
|
+
def to_test_datetime(n, type)
|
113
120
|
year = (1990 + n).round
|
114
121
|
month = (n.round * 5) % 12 + 1
|
115
122
|
mday = (n.round * 7) % 27 + 1
|
116
123
|
hour = (n.round * 9) % 24
|
117
124
|
minute = (n.round * 11) % 60
|
118
125
|
sec = (n.round * 13) % 60
|
119
|
-
|
126
|
+
nsec = if type == :date
|
127
|
+
0
|
128
|
+
else
|
129
|
+
((n.round * 333_333_333) % 1_000_000_000).to_r / 1_000_000_000
|
130
|
+
end
|
131
|
+
tz = if type == :timestamp_tz
|
132
|
+
tzh = (n.round * 15) % 24 - 11
|
133
|
+
tzm = (n.round * 17) % 60
|
134
|
+
format('%+03d:%02d', tzh, tzm)
|
135
|
+
else
|
136
|
+
nil
|
137
|
+
end
|
138
|
+
convert_to_time(year, month, mday, hour, minute, sec, nsec, tz)
|
120
139
|
end
|
121
|
-
private :
|
140
|
+
private :to_test_datetime
|
122
141
|
|
123
142
|
def next
|
124
143
|
@n += 1.2
|
@@ -135,7 +154,9 @@ class TestObj1 < Minitest::Test
|
|
135
154
|
@nclob_val = @str_val
|
136
155
|
@blob_val = @str_val
|
137
156
|
@obj_val = ExpectedValObjElem.new(@int_val, @int_val + 1)
|
138
|
-
@date_val =
|
157
|
+
@date_val = to_test_datetime(@n, :date)
|
158
|
+
@timestamp_val = to_test_datetime(@n, :timestamp)
|
159
|
+
@timestamp_tz_val = to_test_datetime(@n, :timestamp_tz)
|
139
160
|
if @int_val == 1
|
140
161
|
@int_array_val = nil
|
141
162
|
@flt_array_val = nil
|
@@ -199,7 +220,8 @@ class TestObj1 < Minitest::Test
|
|
199
220
|
obj_array_val = val[18]
|
200
221
|
obj_ary_of_ary_val = val[19]
|
201
222
|
date_val = val[20]
|
202
|
-
|
223
|
+
timestamp_val = val[21]
|
224
|
+
timestamp_tz_val = val[22]
|
203
225
|
else
|
204
226
|
assert_instance_of(RbTestObj, val)
|
205
227
|
int_val = val.int_val
|
@@ -223,7 +245,8 @@ class TestObj1 < Minitest::Test
|
|
223
245
|
obj_array_val = val.obj_array_val
|
224
246
|
obj_ary_of_ary_val = val.obj_ary_of_ary_val
|
225
247
|
date_val = val.date_val
|
226
|
-
|
248
|
+
timestamp_val = val.timestamp_val
|
249
|
+
timestamp_tz_val = val.timestamp_tz_val
|
227
250
|
end
|
228
251
|
|
229
252
|
assert_equal(@int_val, int_val)
|
@@ -267,7 +290,8 @@ class TestObj1 < Minitest::Test
|
|
267
290
|
assert_nil(obj_ary_of_ary_val)
|
268
291
|
end
|
269
292
|
assert_equal(@date_val, date_val)
|
270
|
-
|
293
|
+
assert_equal(@timestamp_val, timestamp_val)
|
294
|
+
assert_equal(@timestamp_tz_val, timestamp_tz_val)
|
271
295
|
end
|
272
296
|
|
273
297
|
def assert_array_in_delta(exp, val)
|
data/test/test_oci8.rb
CHANGED
@@ -491,9 +491,23 @@ EOS
|
|
491
491
|
else
|
492
492
|
raise "Unknown column size #{column_size}"
|
493
493
|
end
|
494
|
-
driver_name = cursor.fetch[0]
|
494
|
+
driver_name = cursor.fetch[0].strip
|
495
495
|
cursor.close
|
496
496
|
assert_equal(expected_value, driver_name)
|
497
497
|
end
|
498
498
|
end
|
499
|
+
|
500
|
+
def test_server_version
|
501
|
+
cursor = @conn.exec("select * from product_component_version where product like 'Oracle Database %'")
|
502
|
+
row = cursor.fetch_hash
|
503
|
+
cursor.close
|
504
|
+
ver = if OCI8::oracle_client_version >= OCI8::ORAVER_18
|
505
|
+
row['VERSION_FULL'] || row['VERSION']
|
506
|
+
else
|
507
|
+
# OCI8#oracle_server_version could not get infomation corresponding
|
508
|
+
# to VERSION_FULL when the Oracle client version is below 18.1.
|
509
|
+
row['VERSION']
|
510
|
+
end
|
511
|
+
assert_equal(ver, @conn.oracle_server_version.to_s)
|
512
|
+
end
|
499
513
|
end # TestOCI8
|
data/test/test_package_type.rb
CHANGED
@@ -639,7 +639,11 @@ class TestPackageType < Minitest::Test
|
|
639
639
|
:sub_name => "TABLE_OF_PLS_INTEGER",
|
640
640
|
:link => "",
|
641
641
|
#:type_metadata => nil,
|
642
|
-
:arguments =>
|
642
|
+
:arguments => ($oracle_server_version >= OCI8::ORAVER_18) ?
|
643
|
+
{
|
644
|
+
:class => Array,
|
645
|
+
:size => 0,
|
646
|
+
} : {
|
643
647
|
:class => Array,
|
644
648
|
:size => 1,
|
645
649
|
[0] => {
|
@@ -729,7 +733,11 @@ class TestPackageType < Minitest::Test
|
|
729
733
|
:sub_name => "TABLE_OF_REC1",
|
730
734
|
:link => "",
|
731
735
|
#:type_metadata => nil,
|
732
|
-
:arguments =>
|
736
|
+
:arguments => ($oracle_server_version >= OCI8::ORAVER_18) ?
|
737
|
+
{
|
738
|
+
:class => Array,
|
739
|
+
:size => 0,
|
740
|
+
} : {
|
733
741
|
:class => Array,
|
734
742
|
:size => 1,
|
735
743
|
[0] => {
|
@@ -846,7 +854,11 @@ class TestPackageType < Minitest::Test
|
|
846
854
|
:sub_name => "TABLE_OF_REC1",
|
847
855
|
:link => "",
|
848
856
|
#:type_metadata => nil,
|
849
|
-
:arguments =>
|
857
|
+
:arguments => ($oracle_server_version >= OCI8::ORAVER_18) ?
|
858
|
+
{
|
859
|
+
:class => Array,
|
860
|
+
:size => 0,
|
861
|
+
} : {
|
850
862
|
:class => Array,
|
851
863
|
:size => 1,
|
852
864
|
[0] => {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'oci8'
|
2
|
+
require File.dirname(__FILE__) + '/config'
|
3
|
+
|
4
|
+
class TestProperties < Minitest::Test
|
5
|
+
def test_tcp_keepalive_time
|
6
|
+
begin
|
7
|
+
oldval = OCI8.properties[:tcp_keepalive_time]
|
8
|
+
begin
|
9
|
+
OCI8.properties[:tcp_keepalive_time] = 600
|
10
|
+
assert(true)
|
11
|
+
ensure
|
12
|
+
OCI8.properties[:tcp_keepalive_time] = oldval
|
13
|
+
end
|
14
|
+
rescue NotImplementedError
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-oci8
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.6
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Kubo Takehiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
ruby-oci8 is a ruby interface for Oracle using OCI8 API. It is available with Oracle 10g or later including Oracle Instant Client.
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- test/test_oradate.rb
|
93
93
|
- test/test_oranumber.rb
|
94
94
|
- test/test_package_type.rb
|
95
|
+
- test/test_properties.rb
|
95
96
|
- test/test_rowid.rb
|
96
97
|
- lib/oci8lib_200.so
|
97
98
|
- lib/oci8lib_210.so
|