ruby-oci8 2.2.4.1 → 2.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +311 -1
- data/NEWS +278 -46
- data/README.md +5 -2
- data/dist-files +8 -4
- data/docs/bind-array-to-in_cond.md +1 -1
- data/docs/install-instant-client.md +2 -1
- data/docs/install-on-osx.md +29 -116
- data/docs/ldap-auth-and-function-interposition.md +123 -0
- data/docs/number-type-mapping.md +79 -0
- data/ext/oci8/apiwrap.c.tmpl +2 -5
- data/ext/oci8/apiwrap.rb +6 -1
- data/ext/oci8/apiwrap.yml +34 -22
- data/ext/oci8/attr.c +4 -2
- data/ext/oci8/bind.c +366 -6
- data/ext/oci8/connection_pool.c +3 -3
- data/ext/oci8/error.c +18 -33
- data/ext/oci8/extconf.rb +7 -4
- data/ext/oci8/hook_funcs.c +128 -51
- data/ext/oci8/lob.c +31 -75
- data/ext/oci8/metadata.c +2 -2
- data/ext/oci8/object.c +72 -27
- data/ext/oci8/oci8.c +27 -119
- data/ext/oci8/oci8.h +21 -3
- data/ext/oci8/oci8lib.c +50 -37
- data/ext/oci8/ocihandle.c +2 -2
- data/ext/oci8/ocinumber.c +22 -16
- data/ext/oci8/oraconf.rb +130 -257
- data/ext/oci8/oradate.c +1 -1
- data/ext/oci8/plthook_elf.c +384 -300
- data/ext/oci8/plthook_osx.c +10 -10
- data/ext/oci8/stmt.c +51 -16
- data/ext/oci8/win32.c +4 -22
- data/lib/oci8/bindtype.rb +1 -15
- data/lib/oci8/check_load_error.rb +57 -10
- data/lib/oci8/cursor.rb +48 -17
- data/lib/oci8/metadata.rb +9 -1
- data/lib/oci8/object.rb +10 -0
- data/lib/oci8/oci8.rb +26 -25
- data/lib/oci8/oracle_version.rb +11 -1
- data/lib/oci8/version.rb +1 -1
- data/lib/oci8.rb +11 -4
- data/lib/ruby-oci8.rb +0 -3
- data/ruby-oci8.gemspec +2 -3
- data/setup.rb +11 -2
- data/test/README.md +37 -0
- data/test/config.rb +1 -1
- data/test/setup_test_object.sql +21 -13
- data/test/setup_test_package.sql +59 -0
- data/test/test_all.rb +1 -0
- data/test/test_bind_boolean.rb +99 -0
- data/test/test_break.rb +11 -9
- data/test/test_clob.rb +4 -16
- data/test/test_datetime.rb +8 -3
- data/test/test_object.rb +33 -9
- data/test/test_oci8.rb +169 -45
- data/test/test_oranumber.rb +12 -6
- data/test/test_package_type.rb +15 -3
- data/test/test_properties.rb +17 -0
- metadata +40 -57
- data/docs/osx-install-dev-tools.png +0 -0
- data/test/README +0 -42
data/docs/install-on-osx.md
CHANGED
@@ -1,133 +1,46 @@
|
|
1
|
-
# @title Install ruby-oci8 on
|
1
|
+
# @title Install ruby-oci8 on macOS
|
2
2
|
|
3
|
-
Install ruby-oci8 on
|
3
|
+
Install ruby-oci8 on macOS
|
4
4
|
=========================
|
5
5
|
|
6
|
-
|
6
|
+
**Note: Ruby-oci8 doesn't run on Apple Silicon because Oracle instant client
|
7
|
+
for Apple Silicon has not been released yet.**
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
Install C compiler
|
12
|
-
------------------
|
13
|
-
|
14
|
-
You need to install the command line developer tools or the Xcode.
|
15
|
-
(The latter includes the former.)
|
16
|
-
|
17
|
-
Run `"cc --version"` in a terminal to check whether they are installed.
|
18
|
-
|
19
|
-
If the cc version is printed, the tools are installed.
|
20
|
-
|
21
|
-
If the follwoing dialog is displayed, click its Install button to
|
22
|
-
install the tools.
|
23
|
-
You have no need to install the Xcode to compile ruby-oci8.
|
24
|
-
It requires command line tools, not an IDE such as the Xcode.
|
25
|
-
|
26
|
-
![dialog](osx-install-dev-tools.png)
|
9
|
+
Prerequisite
|
10
|
+
------------
|
27
11
|
|
28
|
-
|
29
|
-
please re-run as root via sudo."` is printed, you need to run
|
30
|
-
`"sudo cc --version"`, enter your password, look at the license
|
31
|
-
and type `"agree"`.
|
12
|
+
* Command line tools for Xcode or Xcode (by executing `xcode-select --install`) or [Xcode]
|
32
13
|
|
33
14
|
Install Oracle Instant Client Packages
|
34
15
|
--------------------------------------
|
35
16
|
|
36
|
-
|
37
|
-
|
38
|
-
Download the following packages from [Oracle Technology Network][]
|
39
|
-
|
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
|
-
* Instant Client Package - SDK (`instantclient-sdk-macos.x64-12.1.0.2.0.zip`)
|
42
|
-
* Instant Client Package - SQL*Plus (`instantclient-sdk-macos.x64-12.1.0.2.0.zip`) (optionally)
|
43
|
-
|
44
|
-
### Install Oracle Instant Client Packages via Homebrew
|
45
|
-
|
46
|
-
To install `Oracle Instant Client Basic` via [Homebrew][]
|
47
|
-
|
48
|
-
* Copy downloaded zip files to `/Library/Caches/Homebrew`
|
49
|
-
(if the environment variable `HOMEBREW_CACHE`
|
50
|
-
is not set and `$HOME/Library/Caches/Homebrew` doesn't exist.)
|
51
|
-
|
52
|
-
* Run the followining commands:
|
53
|
-
|
54
|
-
brew tap InstantClientTap/instantclient
|
55
|
-
brew install instantclient-basic
|
56
|
-
brew install instantclient-sdk
|
57
|
-
brew install instantclient-sqlplus # (optionally)
|
58
|
-
|
59
|
-
* Set the environment variable `OCI_DIR` while performing the following installation steps
|
60
|
-
if Homebrew is installed outside `/usr/local`.
|
61
|
-
|
62
|
-
export OCI_DIR=$(brew --prefix)/lib
|
63
|
-
|
64
|
-
To install `Oracle Instant Client Basic Lite` via [Homebrew][]
|
65
|
-
|
66
|
-
* Copy downloaded zip files to `/Library/Caches/Homebrew`
|
67
|
-
(if the environment variable `HOMEBREW_CACHE`
|
68
|
-
is not set and `$HOME/Library/Caches/Homebrew` doesn't exist.)
|
69
|
-
|
70
|
-
* Run the followining commands:
|
71
|
-
|
72
|
-
brew tap InstantClientTap/instantclient
|
73
|
-
brew install instantclient-basiclite
|
74
|
-
brew install instantclient-sdk
|
75
|
-
brew install instantclient-sqlplus --with-basiclite # (optionally)
|
76
|
-
|
77
|
-
* Set the environment variable `OCI_DIR` while performing the following installation steps
|
78
|
-
if Homebrew is installed outside `/usr/local`.
|
79
|
-
|
80
|
-
export OCI_DIR=$(brew --prefix)/lib
|
81
|
-
|
82
|
-
### Install Oracle Instant Client Manually
|
83
|
-
|
84
|
-
If you don't use [Homebrew][], do the following:
|
85
|
-
|
86
|
-
Unzip the packages as follows:
|
87
|
-
|
88
|
-
mkdir -p /opt/oracle
|
89
|
-
cd /opt/oracle
|
90
|
-
|
91
|
-
Copy downloaded files to /opt/oracle before running the following commands.
|
92
|
-
|
93
|
-
unzip instantclient-basic-macos.x64-12.1.0.2.0.zip
|
94
|
-
unzip instantclient-sdk-macos.x64-12.1.0.2.0.zip
|
95
|
-
unzip instantclient-sqlplus-macos.x64-12.1.0.2.0.zip
|
96
|
-
|
97
|
-
Make a symbolic link to link the library.
|
98
|
-
|
99
|
-
cd /opt/oracle/instantclient_12_1
|
100
|
-
ln -s libclntsh.dylib.12.1 libclntsh.dylib
|
101
|
-
|
102
|
-
Set the environment variable OCI_DIR while performing the following installation steps.
|
103
|
-
|
104
|
-
export OCI_DIR=/opt/oracle/instantclient_12_1
|
105
|
-
|
106
|
-
Installation
|
107
|
-
------------
|
108
|
-
|
109
|
-
If you get a problem in the following steps, look at {file:docs/report-installation-issue.md}.
|
110
|
-
|
111
|
-
### gem package
|
112
|
-
|
113
|
-
Run the following command.
|
17
|
+
If you have installed [Homebrew], use the following command:
|
114
18
|
|
115
|
-
|
19
|
+
```shell
|
20
|
+
$ brew tap InstantClientTap/instantclient
|
21
|
+
$ brew install instantclient-basic # or instantclient-basiclite
|
22
|
+
$ brew install instantclient-sdk
|
23
|
+
$ brew install instantclient-sqlplus # (optionally)
|
24
|
+
```
|
116
25
|
|
117
|
-
|
26
|
+
Otherwise, look at this [page][OTN] and set the environment variable
|
27
|
+
`OCI_DIR` to point the the directory where instant client is installed.
|
28
|
+
Ruby-oci8 installation script checks the directory.
|
118
29
|
|
119
|
-
|
30
|
+
```shell
|
31
|
+
export OCI_DIR=$HOME/Downloads/instantclient_19_8 # for example
|
32
|
+
```
|
120
33
|
|
121
|
-
|
34
|
+
Install ruby-oci8
|
35
|
+
-----------------
|
122
36
|
|
123
|
-
|
37
|
+
Note that `/usr/bin/ruby` isn't available. You need to use [`rbenv`] or so.
|
124
38
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
make install
|
39
|
+
```shell
|
40
|
+
$ gem install ruby-oci8
|
41
|
+
```
|
129
42
|
|
130
|
-
[download page]: https://bintray.com/kubo/generic/ruby-oci8
|
131
43
|
[Homebrew]: http://brew.sh/
|
132
|
-
[
|
133
|
-
[
|
44
|
+
[OTN]: https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html#ic_osx_inst
|
45
|
+
[Xcode]: https://apps.apple.com/us/app/xcode/id497799835
|
46
|
+
[`rbenv`]: https://github.com/rbenv/rbenv
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# @title LDAP Authentication and Function Interposition
|
2
|
+
|
3
|
+
LDAP Authentication and Function Interposition
|
4
|
+
==============================================
|
5
|
+
|
6
|
+
Problems
|
7
|
+
--------
|
8
|
+
|
9
|
+
The following code may trigger segmentation faults or unexpected behaviours.
|
10
|
+
|
11
|
+
require 'pg' # or any modules using LDAP such as ActiveLdap
|
12
|
+
require 'oci8'
|
13
|
+
|
14
|
+
conn = OCI8.new('username/password@dbname.example.com')
|
15
|
+
...
|
16
|
+
|
17
|
+
It happens when all the following conditions are satisfied.
|
18
|
+
|
19
|
+
* The platform is Unix
|
20
|
+
* The PostgreSQL client library, which `pg` depends, was compiled with LDAP support.
|
21
|
+
* LDAP authentication is used to connect to an Oracle server.
|
22
|
+
|
23
|
+
It is caused by function interposition as follows:
|
24
|
+
|
25
|
+
* The ruby process loads `pq` and its depending libraries such as
|
26
|
+
`libpq.so`(PostgreSQL client library) and `libldap_r.so`(LDAP library).
|
27
|
+
* Then it loads `oci8` and its depending libraries such as
|
28
|
+
`libclntsh.so`(Oracle client library).
|
29
|
+
* When LDAP authentication is used, `libclntsh.so` tries to use
|
30
|
+
LDAP functions in the library.
|
31
|
+
* However it uses LDAP functions in `libldap_r.so` because the function
|
32
|
+
in the firstly loaded library is used when more than one library exports
|
33
|
+
functions whose names are same.
|
34
|
+
* It triggers segmentation faults or unexpected behaviours because
|
35
|
+
implementations of LDAP functions are different even though their names
|
36
|
+
are same.
|
37
|
+
|
38
|
+
The reverse may cause same results by the following code.
|
39
|
+
|
40
|
+
require 'oci8'
|
41
|
+
require 'pg'
|
42
|
+
|
43
|
+
... connect to PostgreSQL using LDAP ...
|
44
|
+
|
45
|
+
### Note for macOS
|
46
|
+
|
47
|
+
Libraries in two-level namespaces are free from function interposition on macOS.
|
48
|
+
See the second paragraph of [this document][mach-o]. If `TWOLEVEL` is
|
49
|
+
found in the output of `otool -hV /path/to/library`, it is in a
|
50
|
+
two-level namespace. Otherwise it is in a single-level (flat) namespace.
|
51
|
+
|
52
|
+
Oracle client library (`libclntsh.dylib.12.1`) is in a flat namespace.
|
53
|
+
It suffers from function interposition.
|
54
|
+
|
55
|
+
$ otool -hV libclntsh.dylib.12.1
|
56
|
+
Mach header
|
57
|
+
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
|
58
|
+
MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 19 2360 DYLDLINK NO_REEXPORTED_DYLIBS MH_HAS_TLV_DESCRIPTORS
|
59
|
+
|
60
|
+
PostgreSQL client library (`libpq.5.dylib`) installed by [brew][] depends on an OS-supplied LDAP library.
|
61
|
+
|
62
|
+
$ otool -L libpq.5.dylib
|
63
|
+
libpq.5.dylib:
|
64
|
+
/usr/local/opt/postgresql/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.9.0)
|
65
|
+
/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
66
|
+
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
67
|
+
/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
|
68
|
+
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
|
69
|
+
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
|
70
|
+
|
71
|
+
The OS-supplied LDAP library is in a two-level namespace.
|
72
|
+
|
73
|
+
$ otool -hV /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
|
74
|
+
Mach header
|
75
|
+
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
|
76
|
+
MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 22 2528 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS APP_EXTENSION_SAFE
|
77
|
+
|
78
|
+
As a result, the PostgreSQL client library is free from function interposition.
|
79
|
+
|
80
|
+
Solution 1
|
81
|
+
----------
|
82
|
+
|
83
|
+
If you don't connect to PostgreSQL using LDAP, use the following code.
|
84
|
+
|
85
|
+
require 'oci8' # This must be before "require 'pg'".
|
86
|
+
require 'pg'
|
87
|
+
|
88
|
+
conn = OCI8.new('username/password@dbname.example.com')
|
89
|
+
...
|
90
|
+
... connect to a PostgreSQL server ...
|
91
|
+
|
92
|
+
Oracle client library uses LDAP functions in `libclntsh.so` because `libclntsh.so`
|
93
|
+
is loaded before `libldap_r.so`.
|
94
|
+
|
95
|
+
Don't connect to PostgreSQL using LDAP because `libpq.so` tries to use
|
96
|
+
LDAP functions in `libldap_r.so` but faultily uses functions in `libclntsh.so`.
|
97
|
+
|
98
|
+
Note for macOS: This fixes all function interposition issues if the LDAP library
|
99
|
+
in a two-level namespace.
|
100
|
+
|
101
|
+
Solution 2
|
102
|
+
----------
|
103
|
+
|
104
|
+
If LDAP is used to connect to both Oracle and PostgreSQL and the platform
|
105
|
+
is Linux or macOS, use ruby-oci8 2.2.4 or later and use the following code.
|
106
|
+
|
107
|
+
require 'pg'
|
108
|
+
require 'oci8' # This must be after "require 'pg'".
|
109
|
+
|
110
|
+
conn = OCI8.new('username/password@dbname.example.com')
|
111
|
+
...
|
112
|
+
... connect to a PostgreSQL server using LDAP ...
|
113
|
+
|
114
|
+
PostgreSQL client library uses LDAP functions in `libldap_r.so` because `libldap_r.so`
|
115
|
+
is loaded before `libclntsh.so`.
|
116
|
+
|
117
|
+
Oracle client library uses LDAP functions in `libclntsh.so` because ruby-oci8
|
118
|
+
forcedly modifies PLT (Procedure Linkage Table) entries to point to
|
119
|
+
functions in `libclntsh.so` if they point to functions in other libraries.
|
120
|
+
(PLT is equivalent to IAT (Import Address Table) on Windows.)
|
121
|
+
|
122
|
+
[mach-o]: https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/executing_files.html
|
123
|
+
[brew]: http://brew.sh/
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# @title Number Type Mapping between Oracle and Ruby
|
2
|
+
|
3
|
+
Number Type Mapping between Oracle and Ruby
|
4
|
+
===========================================
|
5
|
+
|
6
|
+
Default mapping
|
7
|
+
---------------
|
8
|
+
|
9
|
+
Oracle numbers in select statements are fetched as followings by default:
|
10
|
+
|
11
|
+
| Oracle Data Type | Ruby Class |
|
12
|
+
|---|---|
|
13
|
+
| NUMBER(prec) or NUMBER(prec, 0) | Integer |
|
14
|
+
| NUMBER(prec, scale) where prec < 15 and scale != 0 | Float |
|
15
|
+
| NUMBER(prec, scale) where prec >= 15 and scale != 0 | BigDecimal |
|
16
|
+
| FLOAT or FLOAT(prec) | Float |
|
17
|
+
| NUMBER without precision and scale | BigDecimal |
|
18
|
+
| number type returned by functions or calculated number | BigDecimal |
|
19
|
+
| BINARY_FLOAT | Float |
|
20
|
+
| BINARY_DOUBLE | Float |
|
21
|
+
|
22
|
+
When the data type is within Integer or Float class, it is fetched
|
23
|
+
as Integer or Float. Otherwise, BigDecimal.
|
24
|
+
|
25
|
+
Note that the mapping is determined by the column definition in
|
26
|
+
select statements, not by the actual value fetched.
|
27
|
+
For example the column in `select count(*) from table_name` is
|
28
|
+
fetched as BigDecimal because it is returned from `count` function.
|
29
|
+
|
30
|
+
The mapping is customizable by `OCI8::BindType::Mapping`.
|
31
|
+
The default values of Oracle number data type mapping are:
|
32
|
+
|
33
|
+
# NUMBER or FLOAT data type, used for the first six rows in the above table
|
34
|
+
OCI8::BindType::Mapping[:number] = OCI8::BindType::Number
|
35
|
+
# BINARY_FLOAT data type, used for the seventh row in the above table
|
36
|
+
OCI8::BindType::Mapping[:binary_float] = OCI8::BindType::BinaryDouble
|
37
|
+
# BINARY_DOUBLE data type, used for the eighth row in the above table
|
38
|
+
OCI8::BindType::Mapping[:binary_double] = OCI8::BindType::BinaryDouble
|
39
|
+
|
40
|
+
`OCI8::BindType::Number` checks precision and scale to determine
|
41
|
+
ruby class. The first four rows in the above table are hard-coded.
|
42
|
+
The fifth and sixth rows are, however, customizable by
|
43
|
+
`OCI8::BindType::Mapping[:number_no_prec_setting]` and
|
44
|
+
`OCI8::BindType::Mapping[:number_unknown_prec]` respectively.
|
45
|
+
|
46
|
+
The default values are:
|
47
|
+
|
48
|
+
OCI8::BindType::Mapping[:number_no_prec_setting] = OCI8::BindType::BigDecimal
|
49
|
+
OCI8::BindType::Mapping[:number_unknown_prec] = OCI8::BindType::BigDecimal
|
50
|
+
|
51
|
+
The mapping may be changed as follows in future.
|
52
|
+
|
53
|
+
| Oracle Data Type | Ruby Class |
|
54
|
+
|---|---|
|
55
|
+
| NUMBER(prec) or NUMBER(prec, 0) | Integer |
|
56
|
+
| other NUMBER | OraNumber |
|
57
|
+
| BINARY_FLOAT | Float |
|
58
|
+
| BINARY_DOUBLE | Float |
|
59
|
+
|
60
|
+
Customize mapping
|
61
|
+
-----------------
|
62
|
+
|
63
|
+
Add the following code to fetch all number or float columns as {OraNumber}.
|
64
|
+
|
65
|
+
OCI8::BindType::Mapping[:number] = OCI8::BindType::OraNumber
|
66
|
+
|
67
|
+
Otherwise, add the following code to customize the fifth and sixth rows only
|
68
|
+
in the above table.
|
69
|
+
|
70
|
+
OCI8::BindType::Mapping[:number_no_prec_setting] = OCI8::BindType::OraNumber
|
71
|
+
OCI8::BindType::Mapping[:number_unknown_prec] = OCI8::BindType::OraNumber
|
72
|
+
|
73
|
+
If you want to fetch numbers as Integer or Float by its actual value, use
|
74
|
+
the following code:
|
75
|
+
|
76
|
+
# Fetch numbers as Integer when their fractional part is zero.
|
77
|
+
# Otherwise, Float. For example when a column contains 10 and
|
78
|
+
# 10.1, they are fetched as Integer and Float respectively.
|
79
|
+
OCI8::BindType::Mapping[:number] = OCI8::BindType::BasicNumberType
|
data/ext/oci8/apiwrap.c.tmpl
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
%>
|
5
5
|
#define API_WRAP_C 1
|
6
6
|
#include "apiwrap.h"
|
7
|
-
#define BLOCKING_FUNCTION_EPILOGUE(svcctx) do { (svcctx)->executing_thread = Qnil; } while (0)
|
8
7
|
|
9
8
|
<%
|
10
9
|
prev_name = ''
|
@@ -59,11 +58,9 @@ static void *oci8_<%=f.name%>_cb(void *user_data)
|
|
59
58
|
%> data->rv = <%=f.name%>(<%= f.args.collect do |a| 'data->' + a.name; end.join(', ') %>);
|
60
59
|
<% end %>
|
61
60
|
<% if f.ret == 'sword'
|
62
|
-
%>
|
63
|
-
return (void*)(VALUE)data->rv;
|
61
|
+
%> return (void*)(VALUE)data->rv;
|
64
62
|
<% else
|
65
|
-
%>
|
66
|
-
return NULL;
|
63
|
+
%> return NULL;
|
67
64
|
<% end %>
|
68
65
|
}
|
69
66
|
#else
|
data/ext/oci8/apiwrap.rb
CHANGED
@@ -35,7 +35,11 @@ class FuncDef
|
|
35
35
|
ver_major = (ver / 100)
|
36
36
|
ver_minor = (ver / 10) % 10
|
37
37
|
ver_update = ver % 10
|
38
|
-
@version =
|
38
|
+
@version = if ver_major >= 18
|
39
|
+
((ver_major << 24) | (ver_minor << 16) | (ver_update << 12))
|
40
|
+
else
|
41
|
+
((ver_major << 24) | (ver_minor << 20) | (ver_update << 12))
|
42
|
+
end
|
39
43
|
case @version
|
40
44
|
when 0x08000000; @version_num = 'ORAVER_8_0'
|
41
45
|
when 0x08100000; @version_num = 'ORAVER_8_1'
|
@@ -44,6 +48,7 @@ class FuncDef
|
|
44
48
|
when 0x0a100000; @version_num = 'ORAVER_10_1'
|
45
49
|
when 0x0a200000; @version_num = 'ORAVER_10_2'
|
46
50
|
when 0x0b100000; @version_num = 'ORAVER_11_1'
|
51
|
+
when 0x12000000; @version_num = 'ORAVER_18'
|
47
52
|
end
|
48
53
|
@version_str = "#{ver_major}.#{ver_minor}.#{ver_update}"
|
49
54
|
@ret = val[:ret] || 'sword'
|
data/ext/oci8/apiwrap.yml
CHANGED
@@ -83,6 +83,17 @@ OCIBindByPos:
|
|
83
83
|
- ub4 *curelep
|
84
84
|
- ub4 mode
|
85
85
|
|
86
|
+
# round trip: 0
|
87
|
+
OCIBindDynamic:
|
88
|
+
:version: 800
|
89
|
+
:args:
|
90
|
+
- OCIBind *bindp
|
91
|
+
- OCIError *errhp
|
92
|
+
- void *ictxp
|
93
|
+
- OCICallbackInBind icbfp
|
94
|
+
- void *octxp
|
95
|
+
- OCICallbackOutBind ocbfp
|
96
|
+
|
86
97
|
# round trip: 0
|
87
98
|
OCIBindObject:
|
88
99
|
:version: 800
|
@@ -180,6 +191,15 @@ OCIDefineByPos:
|
|
180
191
|
- ub2 *rcodep
|
181
192
|
- ub4 mode
|
182
193
|
|
194
|
+
# round trip: 0
|
195
|
+
OCIDefineDynamic:
|
196
|
+
:version: 800
|
197
|
+
:args:
|
198
|
+
- OCIDefine *defnp
|
199
|
+
- OCIError *errhp
|
200
|
+
- dvoid *octxp
|
201
|
+
- OCICallbackDefine ocbfp
|
202
|
+
|
183
203
|
# round trip: 0
|
184
204
|
OCIDefineObject:
|
185
205
|
:version: 800
|
@@ -321,13 +341,6 @@ OCILobLocatorIsInit:
|
|
321
341
|
- CONST OCILobLocator *locp
|
322
342
|
- boolean *is_initialized
|
323
343
|
|
324
|
-
# round trip: 1
|
325
|
-
OCILogoff:
|
326
|
-
:version: 800
|
327
|
-
:args:
|
328
|
-
- OCISvcCtx *svchp
|
329
|
-
- OCIError *errhp
|
330
|
-
|
331
344
|
# round trip: 0
|
332
345
|
OCINumberAbs:
|
333
346
|
:version: 800
|
@@ -1149,21 +1162,6 @@ OCIIntervalSetYearMonth:
|
|
1149
1162
|
- sb4 mnth
|
1150
1163
|
- OCIInterval *result
|
1151
1164
|
|
1152
|
-
# round trip: 1
|
1153
|
-
OCILogon2_nb:
|
1154
|
-
:version: 900
|
1155
|
-
:args:
|
1156
|
-
- OCIEnv *envhp
|
1157
|
-
- OCIError *errhp
|
1158
|
-
- OCISvcCtx **svchp
|
1159
|
-
- CONST text *username
|
1160
|
-
- ub4 uname_len
|
1161
|
-
- CONST text *password
|
1162
|
-
- ub4 passwd_len
|
1163
|
-
- CONST text *dbname
|
1164
|
-
- ub4 dbname_len
|
1165
|
-
- ub4 mode
|
1166
|
-
|
1167
1165
|
# round trip: 0 (not docmented. I guess.)
|
1168
1166
|
OCIRowidToChar:
|
1169
1167
|
:version: 900
|
@@ -1308,3 +1306,17 @@ OCIPing_nb:
|
|
1308
1306
|
- OCISvcCtx *svchp
|
1309
1307
|
- OCIError *errhp
|
1310
1308
|
- ub4 mode
|
1309
|
+
|
1310
|
+
#
|
1311
|
+
# Oracle 18.1
|
1312
|
+
#
|
1313
|
+
OCIServerRelease2:
|
1314
|
+
:version: 1800
|
1315
|
+
:args:
|
1316
|
+
- dvoid *hndlp
|
1317
|
+
- OCIError *errhp
|
1318
|
+
- OraText *bufp
|
1319
|
+
- ub4 bufsz
|
1320
|
+
- ub1 hndltype
|
1321
|
+
- ub4 *version
|
1322
|
+
- ub4 mode
|
data/ext/oci8/attr.c
CHANGED
@@ -15,8 +15,9 @@ typedef struct {
|
|
15
15
|
OCIRowid *ridp;
|
16
16
|
} rowid_arg_t;
|
17
17
|
|
18
|
-
static VALUE get_rowid_attr(
|
18
|
+
static VALUE get_rowid_attr(VALUE varg)
|
19
19
|
{
|
20
|
+
rowid_arg_t *arg = (rowid_arg_t *)varg;
|
20
21
|
oci8_base_t *base = arg->base;
|
21
22
|
ub4 attrtype = arg->attrtype;
|
22
23
|
char buf[MAX_ROWID_LEN];
|
@@ -36,8 +37,9 @@ static VALUE get_rowid_attr(rowid_arg_t *arg)
|
|
36
37
|
return rb_external_str_new_with_enc(buf, buflen, rb_usascii_encoding());
|
37
38
|
}
|
38
39
|
|
39
|
-
static VALUE rowid_ensure(
|
40
|
+
static VALUE rowid_ensure(VALUE varg)
|
40
41
|
{
|
42
|
+
rowid_arg_t *arg = (rowid_arg_t *)varg;
|
41
43
|
if (arg->ridp != NULL) {
|
42
44
|
OCIDescriptorFree(arg->ridp, OCI_DTYPE_ROWID);
|
43
45
|
}
|