ruby-oci8 2.2.10 → 2.2.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ca16dcc5691bc79740b2b6e308315d013c3f482f991325f70a129a7cf34de0c
4
- data.tar.gz: c953f017dab68ed7c2a3934ec29b7312c401516a04b44d32f53c83b0015988b9
3
+ metadata.gz: c98e1080c073f6f2f2a67676f754259e8c20d2ef95d6abbb1015fd62df569d84
4
+ data.tar.gz: 4a14e505c268c3a2b408c9f4881026dd32bbe6e4276df83c77483e0402bb32b1
5
5
  SHA512:
6
- metadata.gz: 3c54d89e2b858e9dcd874d3f9351c707443d1171154c1d9145f3ddd0931e3168809fc3e91ef1cbc1dca2e6b4e699e5eb2e5d05a7e320cfb0926359a71ff9b3d9
7
- data.tar.gz: 611469d0047283c54b7110090bcd9e45a677c3afaba9f6b1c6c4efbaca8afd3092ee1b871d28149459fa82f52f12e36d71bae6cb99e37be0c5ecb148ae300ead
6
+ metadata.gz: 1e73a635ede56087026f6b573c2f1f6624d7a265423a91ab1d7592534f6c132a1e4f1ca812e4a2651f690588f39c8c82040d20fcc9719fa0028a67c230e76e1d
7
+ data.tar.gz: 57497720f51ed3d2062ed8dc5eb07b248d3b19326e7c83a2cd508aaec0e7f3d33b658eb0605134776913cffc631e57b9e6b97d8b6367e5cf59dd83d24e0c749d
data/ChangeLog CHANGED
@@ -1,3 +1,5 @@
1
+ This file has not been not updated. See commit log at https://github.com/kubo/ruby-oci8.
2
+
1
3
  2020-12-30 Kubo Takehiro <kubo@jiubao.org>
2
4
  * NEWS: Add changes between 2.2.8 and 2.2.9.
3
5
  * lib/oci8/version.rb: Update to 2.2.9.
data/NEWS CHANGED
@@ -1,5 +1,21 @@
1
1
  # @markup markdown
2
2
 
3
+ 2.2.12 (2022-12-30)
4
+ ===================
5
+
6
+ - Fix warning: undefining the allocator of T_DATA class OraNumber against Ruby 3.2.0dev. (GH-243)
7
+ - Fix warnings on tests and on compile.
8
+ - Remove code for old ruby versions.
9
+
10
+ 2.2.11 (2022-02-22)
11
+ ===================
12
+
13
+ - Fix "No DLL is not foud to hook" when `OCI8.properties[:tcp_keepalive_time]` is set and Oracle client is 21c on Windows.
14
+
15
+ (reported at rsim/oracle-enhanced#2262)
16
+
17
+ - Fix "OCI8.properties[:tcp_keepalive_time] isn't available" error when ruby version is 3.1 on Windows.
18
+
3
19
  2.2.10 (2022-01-12)
4
20
  ===================
5
21
 
data/ext/oci8/extconf.rb CHANGED
@@ -72,7 +72,7 @@ $objs = ["oci8lib.o", "env.o", "error.o", "oci8.o", "ocihandle.o",
72
72
  "ocinumber.o", "ocidatetime.o", "object.o", "apiwrap.o",
73
73
  "encoding.o", "oranumber_util.o", "thread_util.o", "util.o"]
74
74
 
75
- if RUBY_PLATFORM =~ /mswin32|cygwin|mingw32|bccwin32/
75
+ if RUBY_PLATFORM =~ /mswin32|cygwin|mingw/
76
76
  $defs << "-DUSE_WIN32_C"
77
77
  $objs << "win32.o"
78
78
  end
@@ -148,7 +148,7 @@ end
148
148
  print "checking for plthook... "
149
149
  STDOUT.flush
150
150
  case RUBY_PLATFORM
151
- when /mswin32|cygwin|mingw32|bccwin32/
151
+ when /mswin32|cygwin|mingw/
152
152
  plthook_src = "plthook_win32.c"
153
153
  when /darwin/
154
154
  plthook_src = "plthook_osx.c"
@@ -170,6 +170,38 @@ static int WSAAPI hook_WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount
170
170
  return rv;
171
171
  }
172
172
 
173
+ static int is_target_dll(MODULEENTRY32 *me)
174
+ {
175
+ static const char *basenames[] = {
176
+ "orantcp", // ORACLE_HOME-based client
177
+ "oraociei", // instant client basic
178
+ "oraociicus", // instant client basic lite
179
+ NULL,
180
+ };
181
+ const char **basename = basenames;
182
+ while (*basename != NULL) {
183
+ if (strnicmp(me->szModule, *basename, strlen(*basename)) == 0) {
184
+ break;
185
+ }
186
+ basename++;
187
+ }
188
+ if (*basename == NULL) {
189
+ return 0;
190
+ }
191
+ // basename{zero_or_more_digits}.dll
192
+ const char *p = me->szModule + strlen(*basename);
193
+ while ('0' <= *p && *p <= '9') {
194
+ p++;
195
+ }
196
+ if (stricmp(p, ".dll") != 0) {
197
+ return 0;
198
+ }
199
+ if (GetProcAddress((HMODULE)me->modBaseAddr, "nttini") == NULL) {
200
+ return 0;
201
+ }
202
+ return 1;
203
+ }
204
+
173
205
  void oci8_install_hook_functions()
174
206
  {
175
207
  static int hook_functions_installed = 0;
@@ -217,22 +249,11 @@ void oci8_install_hook_functions()
217
249
  me.dwSize = sizeof(me);
218
250
  if (Module32First(hSnapshot, &me)) {
219
251
  do {
220
- const char *p = NULL;
221
- if (strnicmp(me.szModule, "orantcp", 7) == 0) { // ORACLE_HOME-based client
222
- p = me.szModule + 7;
223
- } else if (strnicmp(me.szModule, "oraociei", 8) == 0) { // instant client basic
224
- p = me.szModule + 8;
225
- } else if (strnicmp(me.szModule, "oraociicus", 10) == 0) { // instant client basic lite
226
- p = me.szModule + 10;
227
- }
228
- if (p != NULL && ('1' <= *p && *p <= '9') && ('0' <= *(p + 1) && *(p + 1) <= '9')
229
- && stricmp(p + 2, ".dll") == 0) {
230
- if (GetProcAddress((HMODULE)me.modBaseAddr, "nttini") != NULL) {
231
- module_found = TRUE;
232
- if (replace_functions(me.modBaseAddr, me.szExePath, tcp_functions) != 0) {
233
- CloseHandle(hSnapshot);
234
- rb_raise(rb_eRuntimeError, "Hook error: %s", hook_errmsg);
235
- }
252
+ if (is_target_dll(&me)) {
253
+ module_found = TRUE;
254
+ if (replace_functions(me.modBaseAddr, me.szExePath, tcp_functions) != 0) {
255
+ CloseHandle(hSnapshot);
256
+ rb_raise(rb_eRuntimeError, "Hook error: %s", hook_errmsg);
236
257
  }
237
258
  }
238
259
  } while (Module32Next(hSnapshot, &me));
data/ext/oci8/oci8.h CHANGED
@@ -89,88 +89,6 @@ typedef orasb8 sb8;
89
89
  #endif
90
90
  #endif
91
91
 
92
- /*
93
- * Use TypedData on ruby 1.9.3 and later.
94
- */
95
- #ifndef HAVE_RB_DATA_TYPE_T_FUNCTION
96
-
97
- /*
98
- * Don't use TypedData even though ruby 1.9.2 has it because the
99
- * definitions are slightly different from ruby 1.9.3 and later.
100
- */
101
- #define rb_data_type_t oci8_data_type_t
102
- #undef TypedData_Make_Struct
103
- #undef TypedData_Wrap_Struct
104
- #undef TypedData_Get_Struct
105
- #undef RTYPEDDATA_DATA
106
- #undef RUBY_DEFAULT_FREE
107
-
108
- /*
109
- * To pass compilation on ruby 1.9.2 and earlier.
110
- */
111
- typedef struct oci8_data_type_struct rb_data_type_t;
112
- struct oci8_data_type_struct {
113
- const char *wrap_struct_name;
114
- struct {
115
- void (*dmark)(void*);
116
- void (*dfree)(void*);
117
- size_t (*dsize)(const void *);
118
- } function;
119
- const rb_data_type_t *parent;
120
- void *data;
121
- };
122
- #define TypedData_Make_Struct(klass, type, data_type, sval) \
123
- Data_Make_Struct((klass), type, (data_type)->function.dmark, (data_type)->function.dfree, (sval))
124
- #define TypedData_Wrap_Struct(klass, data_type, sval) \
125
- Data_Wrap_Struct((klass), (data_type)->function.dmark, (data_type)->function.dfree, (sval))
126
- #define TypedData_Get_Struct(obj, type, data_type, sval) \
127
- Data_Get_Struct((obj), type, (sval))
128
- #define RTYPEDDATA_DATA(obj) DATA_PTR(obj)
129
- #define RUBY_DEFAULT_FREE xfree
130
- #endif
131
-
132
- /* a new function in ruby 1.9.3.
133
- * define a compatible macro for ruby 1.9.2 or lower.
134
- */
135
- #ifndef HAVE_RB_CLASS_SUPERCLASS
136
- #ifdef RCLASS_SUPER
137
- #define rb_class_superclass(cls) RCLASS_SUPER(cls)
138
- #else
139
- #define rb_class_superclass(cls) (RCLASS(cls)->super)
140
- #endif
141
- #endif
142
-
143
- /* new macros in ruby 2.1.0
144
- */
145
- #ifndef RARRAY_AREF
146
- #define RARRAY_AREF(a, i) (RARRAY_PTR(a)[i])
147
- #endif
148
- #ifndef RARRAY_CONST_PTR
149
- #define RARRAY_CONST_PTR(a) RARRAY_PTR(a)
150
- #endif
151
- #ifndef RB_OBJ_WRITE
152
- #define RB_OBJ_WRITE(a, slot, b) do {*(slot) = (b);} while (0)
153
- #endif
154
- #ifndef RB_OBJ_WRITTEN
155
- #define RB_OBJ_WRITTEN(a, oldv, b) do {(void)oldv;} while (0)
156
- #endif
157
-
158
- /* new macros in ruby 2.4.0
159
- */
160
- #ifndef ALWAYS_INLINE
161
- #if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
162
- /* gcc version >= 3.1 */
163
- #define ALWAYS_INLINE(x) __attribute__((always_inline)) x
164
- #endif
165
- #ifdef _MSC_VER
166
- /* microsoft c */
167
- #define ALWAYS_INLINE(x) __forceinline x
168
- #endif
169
- #ifndef ALWAYS_INLINE
170
- #define ALWAYS_INLINE(x) x
171
- #endif
172
- #endif /* ALWAYS_INLINE */
173
-
174
92
  /* macros depends on the compiler.
175
93
  * LIKELY(x) hint for the compiler that 'x' is 1(TRUE) in many cases.
176
94
  * UNLIKELY(x) hint for the compiler that 'x' is 0(FALSE) in many cases.
@@ -382,7 +300,7 @@ OCIEnv *oci8_make_envhp(void);
382
300
  extern oci8_tls_key_t oci8_tls_key; /* native thread key */
383
301
  OCIError *oci8_make_errhp(void);
384
302
 
385
- static inline OCIError *oci8_get_errhp()
303
+ static inline OCIError *oci8_get_errhp(void)
386
304
  {
387
305
  OCIError *errhp = (OCIError *)oci8_tls_get(oci8_tls_key);
388
306
  return LIKELY(errhp != NULL) ? errhp : oci8_make_errhp();
data/ext/oci8/oci8lib.c CHANGED
@@ -191,7 +191,7 @@ static void rebind_internal_symbols(void)
191
191
  __declspec(dllexport)
192
192
  #endif
193
193
  void
194
- Init_oci8lib()
194
+ Init_oci8lib(void)
195
195
  {
196
196
  VALUE cOCI8;
197
197
  OCIEnv *envhp = NULL;
data/ext/oci8/ocihandle.c CHANGED
@@ -217,7 +217,7 @@ static VALUE attr_get_common(int argc, VALUE *argv, VALUE self, enum datatype da
217
217
  }
218
218
  return rb_external_str_new_with_enc(v.charptr, size, oci8_encoding);
219
219
  case DATATYPE_BINARY:
220
- return rb_tainted_str_new(v.charptr, size);
220
+ return rb_str_new(v.charptr, size);
221
221
  case DATATYPE_INTEGER:
222
222
  if (size > sizeof(onum.OCINumberPart) - 1) {
223
223
  rb_raise(rb_eRuntimeError, "Too long size %u", size);
data/ext/oci8/ocinumber.c CHANGED
@@ -1795,6 +1795,7 @@ Init_oci_number(VALUE cOCI8, OCIError *errhp)
1795
1795
  id_BigDecimal = rb_intern("BigDecimal");
1796
1796
 
1797
1797
  cOCINumber = rb_define_class("OraNumber", rb_cNumeric);
1798
+ rb_define_alloc_func(cOCINumber, onum_s_alloc);
1798
1799
  mMath = rb_define_module_under(cOCI8, "Math");
1799
1800
 
1800
1801
  /* constants for internal use. */
@@ -1844,8 +1845,6 @@ Init_oci_number(VALUE cOCI8, OCIError *errhp)
1844
1845
  rb_define_module_function(mMath, "log10", omath_log10, 1);
1845
1846
  rb_define_module_function(mMath, "sqrt", omath_sqrt, 1);
1846
1847
 
1847
- rb_define_alloc_func(cOCINumber, onum_s_alloc);
1848
-
1849
1848
  /* methods of OCI::Number */
1850
1849
  rb_define_global_function("OraNumber", onum_f_new, -1);
1851
1850
  rb_define_method(cOCINumber, "initialize", onum_initialize, -1);
@@ -4,7 +4,7 @@ class OCI8
4
4
  module Util
5
5
 
6
6
  case RUBY_PLATFORM
7
- when /mswin32|cygwin|mingw32|bccwin32/
7
+ when /mswin32|cygwin|mingw/
8
8
 
9
9
  require 'fiddle/import'
10
10
  require 'fiddle/types'
data/lib/oci8/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class OCI8
2
- VERSION = "2.2.10"
2
+ VERSION = "2.2.12"
3
3
  end
data/pre-distclean.rb CHANGED
@@ -1,6 +1,4 @@
1
- rm_f "#{curr_objdir}/lib/oci8.rb"
2
- rm_f "#{curr_objdir}/ext/oci8/oci8lib_18.map"
3
- rm_f "#{curr_objdir}/ext/oci8/oci8lib_191.map"
1
+ rm_f "#{curr_objdir}/ext/oci8/oci8lib_*.map"
4
2
  if RUBY_PLATFORM =~ /cygwin/
5
3
  rm_f "#{curr_objdir}/ext/oci8/OCI.def"
6
4
  rm_f "#{curr_objdir}/ext/oci8/libOCI.a"
data/test/test_object.rb CHANGED
@@ -1,12 +1,6 @@
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
-
10
4
  conn = OCI8.new($dbuser, $dbpass, $dbname)
11
5
  error_message = nil
12
6
  begin
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.10
4
+ version: 2.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kubo Takehiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-12 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'ruby-oci8 is a ruby interface for Oracle using OCI8 API. It is available
14
14
  with Oracle 10g or later including Oracle Instant Client.
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.1.2
155
+ rubygems_version: 3.4.1
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Ruby interface for Oracle using OCI8 API