ruby-oci8 2.2.11 → 2.2.13

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: 1fedff79278c31d88dee698417671fb84c334ad61d08595662fcef4c792742eb
4
- data.tar.gz: 8af51646f9e6c4f96be8baaf15582b1e510f8655ed4c4f06cc45f0ab2599e8ea
3
+ metadata.gz: 1db88cf1bfe7291cc597bd695db32ea0e730734650c3bdfd40b9295663d0ac5e
4
+ data.tar.gz: 96f6b1b9fff2ba6067421d588495298cb14b5d42aa1fe7d4257c18431fdca654
5
5
  SHA512:
6
- metadata.gz: f3efe23976439e355436b273d28778a1658d01c1d0c57809e3d992600efc98d0455f44936b711026d7eb4dc9599dda6477367edb49823d125a4cc6d2ef3f2349
7
- data.tar.gz: 9ff212eccdc0e737f648aaab32f4958e47f5c551823d6d9613b89cf8f5195561980f5cc5c0d34c7a88e591c045b601ff779cb5a7b562ca26c0efbaa532e198f2
6
+ metadata.gz: da88c45ce3e73abb6cf30ad9633286204c3869a7b5e5f8e5acaeb90a824f7bb91d842c7da807e4639ff6993cf6d2bae96f9f5fe8cd64144f836eeca61c7fc85f
7
+ data.tar.gz: '088b13f4df8245aa95abdb2e2bf744c2088fa3fe87ffd5ffcdfedf0b43a724630d9a3603468269e6bf5790c4480d4e85a79a28af4db18bd05310b39c7dafed74'
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,30 @@
1
1
  # @markup markdown
2
2
 
3
+ 2.2.13 (2024-07-27)
4
+ ===================
5
+
6
+ - Binary gems for Windows x64 and x86 supports ruby 2.7 - 3.3 inclusive.
7
+
8
+ Fixed issues
9
+ ------------
10
+
11
+ - Fix various issues about `OCI8.properties[:tcp_keepalive_time]` on macOS arm64. The feature was removed on the platform
12
+ and it raises `NotImplementedError` instead now.
13
+ - Fix SIGSEGV when using truffleruby. It seems to be caused by `xfree()` outside of ruby threads.
14
+
15
+ Changes
16
+ -------
17
+
18
+ - Change the format of fifth numeral of Oracle version number as two digit zero-padding number
19
+ when the Oracle version is 23 or upper. For example "23.4.0.24.05".
20
+
21
+ 2.2.12 (2022-12-30)
22
+ ===================
23
+
24
+ - Fix warning: undefining the allocator of T_DATA class OraNumber against Ruby 3.2.0dev. (GH-243)
25
+ - Fix warnings on tests and on compile.
26
+ - Remove code for old ruby versions.
27
+
3
28
  2.2.11 (2022-02-22)
4
29
  ===================
5
30
 
@@ -39,7 +39,7 @@ by the `tcp_keepalive_time` property.
39
39
  It is supported on the following platforms since ruby-oci8 2.2.4.
40
40
 
41
41
  * Linux i386 and x86_64
42
- * macOS
42
+ * macOS x86_64
43
43
  * Windows x86 and x64
44
44
  * Solaris x86_64
45
45
 
data/ext/oci8/extconf.rb CHANGED
@@ -155,6 +155,7 @@ when /darwin/
155
155
  else
156
156
  plthook_src = "plthook_elf.c"
157
157
  end
158
+
158
159
  FileUtils.copy(File.dirname(__FILE__) + "/" + plthook_src, CONFTEST_C)
159
160
  if xsystem(cc_command(""))
160
161
  FileUtils.rm_f("#{CONFTEST}.#{$OBJEXT}")
data/ext/oci8/oci8.c CHANGED
@@ -437,7 +437,7 @@ typedef struct {
437
437
 
438
438
  static void *complex_logoff_prepare(oci8_svcctx_t *svcctx)
439
439
  {
440
- complex_logoff_arg_t *cla = xmalloc(sizeof(complex_logoff_arg_t));
440
+ complex_logoff_arg_t *cla = malloc(sizeof(complex_logoff_arg_t));
441
441
  cla->svchp = svcctx->base.hp.svc;
442
442
  cla->usrhp = svcctx->usrhp;
443
443
  cla->srvhp = svcctx->srvhp;
@@ -479,7 +479,7 @@ static void *complex_logoff_execute(void *arg)
479
479
  if (cla->svchp != NULL) {
480
480
  OCIHandleFree(cla->svchp, OCI_HTYPE_SVCCTX);
481
481
  }
482
- xfree(cla);
482
+ free(cla);
483
483
  return (void*)(VALUE)rv;
484
484
  }
485
485
 
data/ext/oci8/oci8.h CHANGED
@@ -29,11 +29,12 @@ extern "C"
29
29
  * hexadecimal -> dotted version number hexadecimal -> dotted version number
30
30
  * 0c102304 -> 12.1.2.3.4 12012034 -> 18.1.2.3.4
31
31
  * ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
32
- * 0c ------------' | | | | 2 bytes 12 ------------' | | | | 2 bytes
33
- * 1 --------------' | | | 1 byte 01 -------------' | | | 2 bytes
34
- * 02 --------------' | | 2 bytes 2 --------------' | | 1 byte
35
- * 3 ---------------' | 1 byte 03 --------------' | 2 bytes
36
- * 04 ---------------' 2 bytes 4 ---------------' 1 byte
32
+ * 0c ------------' | | | | 8 bits 12 ------------' | | | | 8 bits
33
+ * 1 --------------' | | | 4 bits 01 -------------' | | | 8 bits
34
+ * 02 --------------' | | 8 bits 2 --------------' | | 4 bits
35
+ * 3 ---------------' | 4 bits 03 --------------' | 8 bits
36
+ * 04 ---------------' 8 bits 4 ---------------' 4 bits
37
+ * total 32 bits total 32 bits
37
38
  */
38
39
  #define ORAVERNUM(major, minor, update, patch, port_update) \
39
40
  (((major) >= 18) ? (((major) << 24) | ((minor) << 16) | ((update) << 12) | ((patch) << 4) | (port_update)) \
@@ -89,88 +90,6 @@ typedef orasb8 sb8;
89
90
  #endif
90
91
  #endif
91
92
 
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
93
  /* macros depends on the compiler.
175
94
  * LIKELY(x) hint for the compiler that 'x' is 1(TRUE) in many cases.
176
95
  * UNLIKELY(x) hint for the compiler that 'x' is 0(FALSE) in many cases.
@@ -382,7 +301,7 @@ OCIEnv *oci8_make_envhp(void);
382
301
  extern oci8_tls_key_t oci8_tls_key; /* native thread key */
383
302
  OCIError *oci8_make_errhp(void);
384
303
 
385
- static inline OCIError *oci8_get_errhp()
304
+ static inline OCIError *oci8_get_errhp(void)
386
305
  {
387
306
  OCIError *errhp = (OCIError *)oci8_tls_get(oci8_tls_key);
388
307
  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;
@@ -675,28 +675,7 @@ void *oci8_find_symbol(const char *symbol_name)
675
675
 
676
676
  void *oci8_check_typeddata(VALUE obj, const oci8_handle_data_type_t *data_type, int error_if_closed)
677
677
  {
678
- #ifdef HAVE_RB_DATA_TYPE_T_FUNCTION
679
678
  oci8_base_t *hp = Check_TypedStruct(obj, &data_type->rb_data_type);
680
- #else
681
- oci8_base_t *hp;
682
- const char *expected_type_name = data_type->rb_data_type.wrap_struct_name;
683
- const rb_data_type_t *rb_data_type;
684
- const rb_data_type_t *expected_rb_data_type = &data_type->rb_data_type;
685
-
686
- if (TYPE(obj) != T_DATA || !rb_obj_is_kind_of(obj, oci8_cOCIHandle)) {
687
- rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
688
- rb_obj_classname(obj), expected_type_name);
689
- }
690
- hp = DATA_PTR(obj);
691
- rb_data_type = &hp->data_type->rb_data_type;
692
- while (rb_data_type != expected_rb_data_type) {
693
- if (rb_data_type == NULL) {
694
- rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
695
- rb_obj_classname(obj), expected_type_name);
696
- }
697
- rb_data_type = rb_data_type->parent;
698
- }
699
- #endif
700
679
  if (error_if_closed && hp->closed) {
701
680
  rb_raise(eOCIException, "%s was already closed.",
702
681
  rb_obj_classname(obj));
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);
data/ext/oci8/oraconf.rb CHANGED
@@ -130,6 +130,8 @@ class MiniSOReader
130
130
  @cpu = :ia64
131
131
  when 62
132
132
  @cpu = :x86_64
133
+ when 183
134
+ @cpu = :aarch64
133
135
  else
134
136
  raise "Invalid ELF archtype: #{archtype}"
135
137
  end
@@ -379,6 +381,8 @@ EOS
379
381
  @@ld_envs = %w[PATH]
380
382
  so_ext = 'dll'
381
383
  check_proc = make_proc_to_check_cpu(is_32bit ? :i386 : :x86_64)
384
+ when /aarch64-linux/
385
+ check_proc = make_proc_to_check_cpu(:aarch64)
382
386
  when /i.86-linux/
383
387
  check_proc = make_proc_to_check_cpu(:i386)
384
388
  when /ia64-linux/
data/ext/oci8/oradate.c CHANGED
@@ -61,18 +61,7 @@ typedef struct ora_date ora_date_t;
61
61
  if (sec < 0 || 59 < sec) \
62
62
  rb_raise(rb_eRangeError, "Out of range for second %d (expect 0 .. 59)", sec)
63
63
 
64
- #ifdef HAVE_RB_DATA_TYPE_T_FUNCTION
65
64
  #define check_oradate(obj) ((ora_date_t*)Check_TypedStruct((obj), &odate_data_type))
66
- #else
67
- static ora_date_t *check_oradate(VALUE obj)
68
- {
69
- if (!rb_obj_is_kind_of(obj, cOraDate)) {
70
- rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
71
- rb_obj_classname(obj), rb_class2name(cOraDate));
72
- }
73
- return DATA_PTR(obj);
74
- }
75
- #endif
76
65
 
77
66
  static size_t odate_memsize(const void *ptr)
78
67
  {