ruby-oci8 2.2.3-x86-mingw32 → 2.2.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,103 @@
1
+ 2017-06-11 Kubo Takehiro <kubo@jiubao.org>
2
+ * NEWS: Add changes between 2.2.3 and 2.2.4.
3
+ * lib/oci8/version.rb: update to 2.2.3.
4
+ * docs/ldap-auth-and-function-interposition.md,
5
+ docs/hanging-after-inactivity.md: updated
6
+
7
+ 2017-06-08 Kubo Takehiro <kubo@jiubao.org>
8
+ * lib/oci8.rb: Remove added dll directory after 'require oci8lib.so'.
9
+ (RubyInstaller2 for Windows only)
10
+
11
+ 2017-06-06 Kubo Takehiro <kubo@jiubao.org>
12
+ * docs/hanging-after-inactivity.md: revise
13
+ * dist-files: add docs/hanging-after-inactivity.md.
14
+
15
+ 2017-06-06 Kubo Takehiro <kubo@jiubao.org>
16
+ * mkpkg-win32.rb: Use RubyInstaller2 to compile binary gems for
17
+ ruby 2.4 on Windows.
18
+
19
+ 2017-05-31 Kubo Takehiro <kubo@jiubao.org>
20
+ * docs/hanging-after-inactivity.md:
21
+ Add a document about tcp_keepalive and tcp_keepalive_time properties.
22
+ * README.md, docs/timeout-parameters.md, lib/oci8/properties.rb:
23
+ Add links to the TCP keepalive document.
24
+
25
+ 2017-05-21 Kubo Takehiro <kubo@jiubao.org>
26
+ * docs/install-instant-client.md: Add a link to the Visual
27
+ C++ 2013 redistributable package required to use Oracle 12.2.
28
+
29
+ 2017-05-08 Kubo Takehiro <kubo@jiubao.org>
30
+ * lib/oci8.rb: Fix for RubyInstaller2 for Windows.
31
+ https://github.com/oneclick/rubyinstaller2/issues/11
32
+
33
+ 2017-05-07 Kubo Takehiro <kubo@jiubao.org>
34
+ * ext/oci8/oraconf.rb: Use Win32::Registry instead of Win32API
35
+ to compile ruby-oci8 on the latest cygwin.
36
+ (github issue #167)
37
+
38
+ 2017-02-14 Kubo Takehiro <kubo@jiubao.org>
39
+ * test/test_connstr.rb: fix test to pass the previous commit.
40
+
41
+ 2017-02-14 Kubo Takehiro <kubo@jiubao.org>
42
+ * ext/oci8/hook_funcs.c, ext/oci8/oci8.c, ext/oci8/oci8.h,
43
+ lib/oci8/oci8.rb, lib/oci8/properties.rb:
44
+ Add tcp_keepalive options to OCI8.properties.
45
+
46
+ 2017-01-14 Kubo Takehiro <kubo@jiubao.org>
47
+ * ext/oci8/env.c, ext/oci8/error.c, ext/oci8/oci8.h,
48
+ ext/oci8/oci8lib.c: Fix memory leaks when `require 'oci8'` raises a LoadError.
49
+
50
+ 2017-01-08 Kubo Takehiro <kubo@jiubao.org>
51
+ * docs/install-binary-package.md, docs/install-instant-client.md:
52
+ Update documents for installation on Windows.
53
+
54
+ 2017-01-07 Kubo Takehiro <kubo@jiubao.org>
55
+ * ext/oci8/oci8lib.c: If libclntsh.so exports and imports same
56
+ functions, their PLT entries are forcedly modified to point
57
+ to itself not to use functions in other libraries.
58
+ (Only on Linux and macOS)
59
+ * README.md, docs/ldap-auth-and-function-interposition.md:
60
+ Add document about "LDAP Authentication and Function Interposition."
61
+
62
+ 2016-12-28 Yavor Nikolov <nikolov.javor@gmail.com>
63
+ * README.md: add build status and Gem version badges
64
+ (merged at 2016-12-29)
65
+
66
+ 2016-12-28 Yavor Nikolov <nikolov.javor@gmail.com>
67
+ * README.md: add title, demote sections to H2
68
+ (merged at 2016-12-29)
69
+
70
+ 2016-12-28 Yavor Nikolov <nikolov.javor@gmail.com>
71
+ * lib/oci8/cursor.rb: Fix misleading cursor.bind_param header comment
72
+ Reword an obsolete description of bind_param - since currently there is no
73
+ restriction for Bignum nor for very large Integer values.
74
+ (merged at 2016-12-29)
75
+
76
+ 2016-12-27 Yavor Nikolov <nikolov.javor@gmail.com>
77
+ * dist-files, test/test_all.rb, test/test_bind_integer.rb:
78
+ Tests for binding integer cursor in parameters
79
+ Add tests for binding a range of small and large integer variables
80
+ directly (not through OraNumber).
81
+ (merged at 2016-12-29)
82
+
83
+ 2016-12-26 Yavor Nikolov <nikolov.javor@gmail.com>
84
+ * circle.yml, cisetup/create_ruby_user.sql, cisetup/oracle/download.sh,
85
+ cisetup/oracle/install.sh, cisetup/setup_accounts.sh:
86
+ Add Circle CI build
87
+ (merged at 2016-12-28)
88
+
89
+ 2016-12-26 Yavor Nikolov <nikolov.javor@gmail.com>
90
+ * test/test_oci8.rb: Fix date/time test (expected time timezone).
91
+ Time.now offset leads to unstable test due to DST sensitivity.
92
+ The solution is to take the offset of the specific local date/time.
93
+ (merged at 2016-12-28)
94
+
95
+ 2016-12-25 Koichi ITO <koic.ito@gmail.com>
96
+ * ext/oci8/encoding.c, ext/oci8/oci8.c, ext/oci8/ocihandle.c
97
+ ext/oci8/oraconf.rb, ext/oci8/oradate.c, ext/oci8/stmt.c
98
+ lib/oci8/cursor.rb: Integer Unification in Ruby 2.4.0+
99
+ (merged at 2016-12-29)
100
+
1
101
  2016-12-27 Kubo Takehiro <kubo@jiubao.org>
2
102
  * NEWS: Add changes between 2.2.2 and 2.2.3.
3
103
  * lib/oci8/version.rb: update to 2.2.3.
data/NEWS CHANGED
@@ -1,5 +1,44 @@
1
1
  # @markup markdown
2
2
 
3
+ 2.2.4
4
+ =====
5
+
6
+ New Features
7
+ ------------
8
+
9
+ ### TCP keepalive parameters
10
+
11
+ `tcp_keepalive` and `tcp_keepalive_time` parameters were added.
12
+ This may fix hanging caused by a firewall after a long period of inactivity
13
+
14
+ See {file:docs/hanging-after-inactivity.md this document} for more detail.
15
+
16
+ ### Workaround of function interposition on Linux and macOS
17
+
18
+ When both `oci8` and `pg` are required and LDAP authentication is used,
19
+ it may trigger segmentation faults or unexpected behaviours.
20
+ This issue was fixed by forcibly modified PLT (Procedure Linkage Table)
21
+ entries in the Oracle client library.
22
+
23
+ See {file:docs/ldap-auth-and-function-interposition.md this document} for more detail.
24
+
25
+ Fixed Issues
26
+ ------------
27
+
28
+ ### Support RubyInstaller2 for Windows
29
+
30
+ Fix for RubyInstaller2 for Windows as suggested [here](https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#dll-loading).
31
+
32
+ ### Fix for latest cygwin
33
+
34
+ Use Win32::Registry instead of Win32API to compile ruby-oci8 on the latest cygwin.
35
+
36
+ (contributed by tomasjura. [github issue #167](https://github.com/kubo/ruby-oci8/issues/167))
37
+
38
+ ### Removed too specific ruby version constraint in binary gems.
39
+
40
+ (contributed by davidbrs. [github issue #156](https://github.com/kubo/ruby-oci8/issues/156))
41
+
3
42
  2.2.3
4
43
  =====
5
44
 
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
+ Ruby-oci8
2
+ =========
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/ruby-oci8.svg)](http://badge.fury.io/rb/ruby-oci8)
5
+ [![Circle CI](https://circleci.com/gh/kubo/ruby-oci8.png?style=shield)](https://circleci.com/gh/kubo/ruby-oci8)
6
+
1
7
  What is ruby-oci8
2
- =================
8
+ -----------------
3
9
 
4
10
  Ruby-oci8 is a ruby interface for Oracle Database. The latest version
5
11
  is available for all Oracle versions after Oracle 10g including Oracle
@@ -11,24 +17,24 @@ Note that ruby 1.8 support was dropped in ruby-oci8 2.2.0.
11
17
  Use ruby-oci8 2.1.8 for ruby 1.8.
12
18
 
13
19
  What's new
14
- ==========
20
+ ----------
15
21
 
16
22
  See {file:NEWS}.
17
23
 
18
24
  Sample one-liner
19
- ================
25
+ ----------------
20
26
 
21
27
  Connect to scott/tiger, select `emp` and print as CSV format.
22
28
 
23
29
  ruby -r oci8 -e "OCI8.new('scott', 'tiger').exec('select * from emp') do |r| puts r.join(','); end"
24
30
 
25
31
  Homepage
26
- ========
32
+ --------
27
33
 
28
34
  * http://www.rubydoc.info/github/kubo/ruby-oci8
29
35
 
30
36
  Installation
31
- ============
37
+ ------------
32
38
 
33
39
  * {file:docs/install-full-client.md Install for Oracle Full Client}
34
40
  * {file:docs/install-instant-client.md Install for Oracle Instant Client}
@@ -36,20 +42,22 @@ Installation
36
42
  * {file:docs/install-on-osx.md Install on OS X}
37
43
 
38
44
  Report issues
39
- =============
45
+ -------------
40
46
 
41
47
  * {file:docs/report-installation-issue.md Report Installation Issues}
42
48
  * [The issues page on github](https://github.com/kubo/ruby-oci8/issues)
43
49
 
44
50
  Other documents
45
- ===============
51
+ ---------------
46
52
 
47
53
  * {file:docs/timeout-parameters.md Timeout Parameters}
48
54
  * {file:docs/conflicts-local-connections-and-processes.md Conflicts between Local Connections and Child Process Handling on Unix}
55
+ * {file:docs/hanging-after-inactivity.md Hanging After a Long Period of Inactivity}
49
56
  * {file:docs/bind-array-to-in_cond.md Bind an Array to IN-condition}
57
+ * {file:docs/ldap-auth-and-function-interposition.md LDAP Authentication and Function Interposition}
50
58
 
51
59
  License
52
- =======
60
+ -------
53
61
 
54
62
  * {file:COPYING 2-clause BSD-style license} from ruby-oci8 2.1.3
55
63
  * {file:COPYING_old old Ruby license} until 2.1.2
data/dist-files CHANGED
@@ -16,6 +16,7 @@ docs/install-full-client.md
16
16
  docs/install-instant-client.md
17
17
  docs/install-on-osx.md
18
18
  docs/conflicts-local-connections-and-processes.md
19
+ docs/hanging-after-inactivity.md
19
20
  docs/osx-install-dev-tools.png
20
21
  docs/platform-specific-issues.md
21
22
  docs/report-installation-issue.md
@@ -87,6 +88,7 @@ test/test_bind_array.rb
87
88
  test/test_bind_raw.rb
88
89
  test/test_bind_string.rb
89
90
  test/test_bind_time.rb
91
+ test/test_bind_integer.rb
90
92
  test/test_break.rb
91
93
  test/test_clob.rb
92
94
  test/test_connection_pool.rb
@@ -1,4 +1,4 @@
1
- @ Bind an Array to IN-condition
1
+ # @title Bind an Array to IN-condition
2
2
 
3
3
  Bind an Array to IN-condition
4
4
  =============================
@@ -1,7 +1,10 @@
1
1
  # @title Conflicts between Local Connections and Child Process Handling on Unix
2
2
 
3
+ Conflicts between Local Connections and Child Process Handling on Unix
4
+ ======================================================================
5
+
3
6
  Background
4
- ==========
7
+ ----------
5
8
 
6
9
  When a local (not-TCP) Oracle connection is established on Unix,
7
10
  Oracle client library changes signal handlers in the process to reap
@@ -9,7 +12,7 @@ all dead child processes. However it conflicts with child process
9
12
  handling in ruby.
10
13
 
11
14
  Problem 1: It trashes child process handling of Open3::popen.
12
- ==========
15
+ ----------
13
16
 
14
17
  require 'oci8'
15
18
  require 'open3'
@@ -35,7 +38,7 @@ The above code outputs the following result:
35
38
  the child process on the process termination before ruby detects it.
36
39
 
37
40
  Problem 2: It creates defunct processes after disconnection if signal handlers are reset.
38
- ==========
41
+ ----------
39
42
 
40
43
  The `system` function overwrites signal handlers.
41
44
  It fixes the problem 1 as follows.
@@ -80,7 +83,7 @@ If a program repeatedly creates a local connection and disconnects it,
80
83
  the number of defunct processes increases gradually.
81
84
 
82
85
  Solution: BEQUEATH_DETACH=YES
83
- ==========
86
+ ----------
84
87
 
85
88
  By setting [BEQUEATH_DETACH=YES][] in `sqlnet.ora`, Oracle client library
86
89
  doesn't change signal handlers. The above two problems are fixed.
@@ -0,0 +1,61 @@
1
+ # @title Hanging After a Long Period of Inactivity
2
+
3
+ Hanging After a Long Period of Inactivity
4
+ =========================================
5
+
6
+ When a database connection hangs after a long period of inactivity,
7
+ this document may help you.
8
+
9
+ When a firewall resides between Oracle database server and client, the
10
+ firewall sometimes drops inactive connections as dead ones. If a
11
+ client connects to an Oracle server and tries to use the connection
12
+ after a long sleep (> 1 hour), the client may hang due to the
13
+ dropped connection. This issue will be solved by setting TCP keepalive
14
+ packets whose keepalive time parameter is smaller than the inactive
15
+ connection timeout in the firewall.
16
+
17
+ TCP keepalive is enabled by [(ENABLE=broken)][] in a connect
18
+ descriptor. If you use easy connect naming such as `//hostname/service_name`,
19
+ ruby-oci8 sets the parameter on behalf of you when the `tcp_keepalive`
20
+ property is set. (This is available since ruby-oci8 2.2.4.)
21
+
22
+ OCI8.properties[:tcp_keepalive] = true
23
+ conn = OCI8.new(username, password, '//hostname/service_name')
24
+
25
+ This is equivalent to the following:
26
+
27
+ connect_descriptor = "(DESCRIPTION=(ENABLE=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=service_name)))"
28
+ conn = OCI8.new(username, password, connect_descriptor)
29
+
30
+ The default TCP keepalive time is two hours, which may be larger
31
+ than the inactive connection timeout in the firewall. The default
32
+ value in the system is configurable via [procfs and sysctl on Linux][]
33
+ or [registry parameters on Windows][]. If you have no privilege to
34
+ customize the system, you can change it in an application layer
35
+ by the tcp_keepalive_time property.
36
+
37
+ OCI8.properties[:tcp_keepalive_time] = 600 # 10 minutes
38
+
39
+ `OCI8.properties[:tcp_keepalive_time]` is supported on the following
40
+ platforms since ruby-oci8 2.2.4.
41
+
42
+ * Linux i386 and x86_64
43
+ * macOS
44
+ * Windows x86 and x64
45
+ * Solaris x86_64
46
+
47
+ This feature is implemented with hackish way. When
48
+ `tcp_keepalive_time` is set, Oracle client library's
49
+ procedure linkage table is modified to intercept [setsockopt][] system
50
+ calls. When Oracle client library issues a system call which enables
51
+ TCP keepalive, ruby-oci8 changes the TCP keepalive time of the
52
+ connection immediately after the system call.
53
+
54
+ I hope that Oracle adds a new OCI handle attribute to support this
55
+ feature natively in the future.
56
+
57
+ [(ENABLE=broken)]: https://docs.oracle.com/database/121/NETRF/tnsnames.htm#CHDCDGCE
58
+ [procfs and sysctl on Linux]: http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html
59
+ [registry parameters on Windows]: https://blogs.technet.microsoft.com/nettracer/2010/06/03/things-that-you-may-want-to-know-about-tcp-keepalives/
60
+ [plthook]: https://github.com/kubo/plthook
61
+ [setsockopt]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html
@@ -1,24 +1,28 @@
1
1
  # @title Install Binary Package
2
2
 
3
- Windows 32-bit (mingw32 ruby)
4
- =============================
3
+ Install Binary Package
4
+ ======================
5
5
 
6
- Run the following command:
6
+ Windows
7
+ -------
7
8
 
8
- gem install ruby-oci8
9
+ You need to install Oracle client in advance.
10
+ If you don't have installed Oracle client, install {file:docs/install-instant-client.md#Install_Oracle_Instant_Client_Packages instant client}. Only the Basic or Basic Lite package is needed to use ruby-oci8.
11
+ However it is better to install SQL*Plus also because it is usable to check whether
12
+ a problem is in Oracle setting or in ruby-oci8.
13
+
14
+ Run the following command to install ruby-oci8.
9
15
 
10
- Windows 32-bit (mswin32 ruby)
11
- =============================
16
+ gem install ruby-oci8
12
17
 
13
- Run the following command:
18
+ If you uses mswin32 ruby, use the following command instead.
14
19
 
15
20
  gem install --platform x86-mingw32 ruby-oci8
16
-
17
- Ruby-oci8 gem for x86-mingw32 works on mswin32 ruby.
18
- If it doesn't work, see {file:docs/install-instant-client.md} or {file:docs/install-full-client.md}.
21
+ or
22
+ gem install --platform x64-mingw32 ruby-oci8
19
23
 
20
24
  Other platforms
21
- ===============
25
+ ---------------
22
26
 
23
27
  We doesn't make binary gems for other platforms.
24
28
  If you need to distribute a binary gem, compile ruby-oci8 and run the following command.
@@ -1,7 +1,10 @@
1
1
  # @title Install for Oracle Full Client
2
2
 
3
+ Install for Oracle Full Client
4
+ ==============================
5
+
3
6
  Introduction
4
- ============
7
+ ------------
5
8
 
6
9
  This page explains the way to install ruby-oci8 for Oracle Full Client
7
10
  installations.
@@ -11,18 +14,16 @@ For Windows, look at {file:docs/install-binary-package.md} unless you
11
14
  have a special need to compile ruby-oci8 by yourself.
12
15
 
13
16
  Check the environment
14
- =====================
17
+ ---------------------
15
18
 
16
- Oracle installation
17
- -------------------
19
+ ### Oracle installation
18
20
 
19
21
  Run the following command and confirm it works fine. If it doesn't
20
22
  work well, you need to ask to your database administrator.
21
23
 
22
24
  sqlplus USERNAME/PASSWORD
23
25
 
24
- ruby installation
25
- -----------------
26
+ ### ruby installation
26
27
 
27
28
  Run the following command. If it ends with "can't find header files
28
29
  for ruby" or "ruby: no such file to load -- mkmf (LoadError)", you need
@@ -30,8 +31,7 @@ to install ruby-devel(redhat) or ruby-dev(debian/ubuntu).
30
31
 
31
32
  ruby -r mkmf -e ""
32
33
 
33
- development tools
34
- -----------------
34
+ ### development tools
35
35
 
36
36
  You need a C compiler and development tools such as make or nmake.
37
37
  Note that they must be same with ones used to compile the ruby.
@@ -39,15 +39,14 @@ For example, you need Oracle Solaris Studio, not gcc, for ruby
39
39
  compiled by Oracle Solaris Studio.
40
40
 
41
41
  Installation
42
- ============
42
+ ------------
43
43
 
44
44
  If you get a problem in the following steps, look at {file:docs/platform-specific-issues.md}
45
45
  and {file:docs/report-installation-issue.md}.
46
46
 
47
- Set the library search path
48
- ---------------------------
47
+ ### Set the library search path
49
48
 
50
- ### UNIX
49
+ #### UNIX
51
50
 
52
51
  Set the library search path, whose name depends on the OS, to point to
53
52
  $ORACLE\_HOME/lib. If the database is 64-bit and the ruby is 32-bit,
@@ -74,27 +73,25 @@ Do not forget to export the variable as follows:
74
73
  $ LD_LIBRARY_PATH=$ORACLE_HOME/lib
75
74
  $ export LD_LIBRARY_PATH
76
75
 
77
- ### Windows(mswin32, mingw32, cygwin)
76
+ #### Windows(mswin32, mingw32, cygwin)
78
77
 
79
78
  If sqlplus runs correctly, library search path has no problem.
80
79
 
81
- gem package
82
- -----------
80
+ ### gem package
83
81
 
84
82
  Run the following command.
85
83
 
86
84
  gem install ruby-oci8
87
85
 
88
- tar.gz package
89
- --------------
86
+ ### tar.gz package
90
87
 
91
- ### Download the source code
88
+ #### Download the source code
92
89
 
93
90
  Download the latest tar.gz package from [download page][].
94
91
 
95
- ### Run make and install
92
+ #### Run make and install
96
93
 
97
- #### UNIX or Windows(mingw32, cygwin)
94
+ ##### UNIX or Windows(mingw32, cygwin)
98
95
 
99
96
  gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
100
97
  cd ruby-oci8-VERSION
@@ -104,7 +101,7 @@ Download the latest tar.gz package from [download page][].
104
101
  note: If you use '`sudo`', use it only when running '`make install`'.
105
102
  '`sudo`' doesn't pass library search path to the executing command for security reasons.
106
103
 
107
- #### Windows(mswin32)
104
+ ##### Windows(mswin32)
108
105
 
109
106
  gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
110
107
  cd ruby-oci8-VERSION