ruby-oci8 2.2.0.2 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,42 @@
1
+ 2015-11-01 Kubo Takehiro <kubo@jiubao.org>
2
+ * NEWS: Add changes between 2.2.0.2 and 2.2.1.
3
+ * lib/oci8/version.rb: update to 2.2.1.
4
+
5
+ 2015-11-01 Kubo Takehiro <kubo@jiubao.org>
6
+ * ext/oci8/extconf.rb, ext/oci8/oci8.h: Delete unnecessary checks.
7
+ * ext/oci8/oraconf.rb: Reduce time to build an import library on
8
+ Mingw32 and Cygwin.
9
+
10
+ 2015-11-01 Kubo Takehiro <kubo@jiubao.org>
11
+ * lib/oci8/oci8.rb: delete code for Oracle 8i.
12
+
13
+ 2015-10-26 Kubo Takehiro <kubo@jiubao.org>
14
+ * ext/oci8/oci8lib.c: Fix handle leaks when OCI8#ping is used and
15
+ the Oracle client version is 10gR1.
16
+ This bug was introduced in ruby-oci8 2.2.0.
17
+
18
+ 2015-10-26 Kubo Takehiro <kubo@jiubao.org>
19
+ * ext/oci8/oci8lib.c: Revive code dropped in ruby-oci8 2.2.0.
20
+ This prevents potential SEGV on ruby process termination.
21
+
22
+ 2015-10-26 Kubo Takehiro <kubo@jiubao.org>
23
+ * ext/oci8/ocinumber.c: Drop code for ruby 1.8.
24
+ Rational has been a built-in type since ruby 1.9.
25
+
26
+ 2015-10-20 Kubo Takehiro <kubo@jiubao.org>
27
+ * ext/oci8/bind.c, lib/oci8/bindtype.rb, test/test_all.rb,
28
+ test/test_bind_boolean.rb: Support boolean type binding.
29
+
30
+ 2015-10-19 Kubo Takehiro <kubo@jiubao.org>
31
+ * ext/oci8/apiwrap.yml: Delete unused OCI function definitions.
32
+
33
+ 2015-10-19 Kubo Takehiro <kubo@jiubao.org>
34
+ * ext/oci8/extconf.rb: Use macros OCI_MAJOR_VERSION and OCI_MINOR_VERSION
35
+ in oci.h to check the target Oracle client version.
36
+
37
+ 2015-10-12 Kubo Takehiro <kubo@jiubao.org>
38
+ * NEWS: Add changes between 2.2.0.1 and 2.2.0.2.
39
+
1
40
  2015-10-12 Kubo Takehiro <kubo@jiubao.org>
2
41
  * lib/oci8/version.rb: Update the version to 2.2.0.2 to
3
42
  release binary gems for mingw32.
data/NEWS CHANGED
@@ -1,10 +1,47 @@
1
1
  # @markup markdown
2
2
 
3
+ 2.2.1
4
+ =====
5
+
6
+ New Features
7
+ ------------
8
+
9
+ ### Add OCI8::Metadata::Boolean
10
+
11
+ Support boolean type binding. This feature requires Oracle 12c client and server.
12
+ This doens't work when either Oracle server or client is 11g or lower.
13
+
14
+ Fixed Issues
15
+ ------------
16
+
17
+ The following two issues were introduced in ruby-oci8 2.2.0.
18
+
19
+ ### Fix handle leaks in OCI8#ping
20
+
21
+ This bug affects Oracle 10gR1 client only.
22
+
23
+ ### Fix potential segmentation fault on ruby process termination
24
+
25
+ Other Changes
26
+ -------------
27
+
28
+ - Reduce compilation time by dropping unnecessary checks.
29
+
30
+ - Delete unused code which was added to support old Oracle and ruby 1.8.
31
+
32
+ 2.2.0.2
33
+ =======
34
+
35
+ Nothing was changed except the version.
36
+
37
+ The forth version was incremented to release binary gems for mingw32.
38
+ The binary gems for 2.2.0.1 didn't work by faultily packaging.
39
+
3
40
  2.2.0.1
4
41
  =======
5
42
 
6
43
  If ruby-oci8 2.2.0 is installed, you have no need to update it to
7
- 2.2.0.1. Source code itself was not chaned between 2.2.0 and 2.2.0.1.
44
+ 2.2.0.1. Source code itself was not changed between 2.2.0 and 2.2.0.1.
8
45
 
9
46
  ### Change the required ruby version in the ruby-oci8 gem
10
47
 
@@ -811,30 +811,6 @@ OCIStmtFetch_nb:
811
811
  - ub2 orientation
812
812
  - ub4 mode
813
813
 
814
- OCIStmtGetPieceInfo:
815
- :version: 800
816
- :args:
817
- - OCIStmt *stmtp
818
- - OCIError *errhp
819
- - dvoid **hndlpp
820
- - ub4 *typep
821
- - ub1 *in_outp
822
- - ub4 *iterp
823
- - ub4 *idxp
824
- - ub1 *piecep
825
-
826
- OCIStmtSetPieceInfo:
827
- :version: 800
828
- :args:
829
- - dvoid *hndlp
830
- - ub4 type
831
- - OCIError *errhp
832
- - CONST dvoid *bufp
833
- - ub4 *alenp
834
- - ub1 piece
835
- - CONST dvoid *indp
836
- - ub2 *rcodep
837
-
838
814
  # round trip: 0
839
815
  OCIStringAssignText:
840
816
  :version: 800
@@ -1003,26 +979,6 @@ OCINumberIsInt:
1003
979
  - OCIError *err
1004
980
  - CONST OCINumber *number
1005
981
  - boolean *result
1006
- :code_if_not_found: |
1007
- /* pseude code
1008
- * work = trunc(number);
1009
- * if (number == work) {
1010
- * result = TRUE;
1011
- * } else {
1012
- * result = FALSE;
1013
- * }
1014
- */
1015
- OCINumber work;
1016
- sword rv;
1017
- sword cmp;
1018
- rv = oci8_OCINumberTrunc(err, number, 0, &work, file, line);
1019
- if (rv != OCI_SUCCESS)
1020
- return rv;
1021
- rv = oci8_OCINumberCmp(err, number, &work, &cmp, file, line);
1022
- if (rv != OCI_SUCCESS)
1023
- return rv;
1024
- *result = (cmp == 0) ? TRUE : FALSE;
1025
- return OCI_SUCCESS;
1026
982
 
1027
983
  # round trip: 0
1028
984
  OCINumberPrec:
@@ -1040,13 +996,6 @@ OCINumberSetPi:
1040
996
  :args:
1041
997
  - OCIError *err
1042
998
  - OCINumber *num
1043
- :code_if_not_found: |
1044
- static const OCINumber pi = {
1045
- {0x15, 0xc1, 0x04, 0x0f, 0x10, 0x5d, 0x42, 0x24, 0x5a, 0x50,
1046
- 0x21, 0x27, 0x2f, 0x1b, 0x2c, 0x27, 0x21, 0x50, 0x33, 0x1d,
1047
- 0x55, 0x15}
1048
- };
1049
- *num = pi;
1050
999
 
1051
1000
  # round trip: 0
1052
1001
  OCINumberShift:
@@ -1064,31 +1013,6 @@ OCINumberSign:
1064
1013
  - OCIError *err
1065
1014
  - CONST OCINumber *number
1066
1015
  - sword *result
1067
- :code_if_not_found: |
1068
- /* pseude code
1069
- * number <=> 0
1070
- */
1071
- OCINumber zero;
1072
- sword rv;
1073
- sword cmp;
1074
- OCINumberSetZero(err, &zero);
1075
- rv = oci8_OCINumberCmp(err, number, &zero, &cmp, file, line);
1076
- if (rv != OCI_SUCCESS)
1077
- return rv;
1078
- if (cmp > 0)
1079
- *result = 1;
1080
- else if (cmp < 0)
1081
- *result = -1;
1082
- else
1083
- *result = 0;
1084
- return OCI_SUCCESS;
1085
-
1086
- # round trip: 0
1087
- OCIReset:
1088
- :version: 810
1089
- :args:
1090
- - dvoid *hndlp
1091
- - OCIError *errhp
1092
1016
 
1093
1017
  #
1094
1018
  # Oracle 9.0
@@ -1160,16 +1084,6 @@ OCIDateTimeGetTime:
1160
1084
  - ub1 *ss
1161
1085
  - ub4 *fsec
1162
1086
 
1163
- # round trip: 0 (not docmented. I guess.)
1164
- OCIIntervalFromText:
1165
- :version: 900
1166
- :args:
1167
- - dvoid *hndl
1168
- - OCIError *err
1169
- - CONST OraText *inpstr
1170
- - size_t str_len
1171
- - OCIInterval *result
1172
-
1173
1087
  # round trip: 0 (not docmented. I guess.)
1174
1088
  OCIDateTimeGetTimeZoneOffset:
1175
1089
  :version: 900
@@ -1378,25 +1292,6 @@ OCIClientVersion:
1378
1292
  - sword *patch_num
1379
1293
  - sword *port_update_num
1380
1294
 
1381
- # round trip: 1
1382
- OCIDBStartup_nb:
1383
- :version: 1020
1384
- :args:
1385
- - OCISvcCtx *svchp
1386
- - OCIError *errhp
1387
- - OCIAdmin *admhp
1388
- - ub4 mode
1389
- - ub4 flags
1390
-
1391
- # round trip: 1
1392
- OCIDBShutdown_nb:
1393
- :version: 1020
1394
- :args:
1395
- - OCISvcCtx *svchp
1396
- - OCIError *errhp
1397
- - OCIAdmin *admhp
1398
- - ub4 mode
1399
-
1400
1295
  # round trip: 1
1401
1296
  OCIPing_nb:
1402
1297
  :version: 1020
@@ -1404,23 +1299,3 @@ OCIPing_nb:
1404
1299
  - OCISvcCtx *svchp
1405
1300
  - OCIError *errhp
1406
1301
  - ub4 mode
1407
-
1408
- #
1409
- # Oracle 11.1
1410
- #
1411
-
1412
- OCIArrayDescriptorAlloc:
1413
- :version: 1110
1414
- :args:
1415
- - const void *parenth
1416
- - void **descpp
1417
- - const ub4 type
1418
- - ub4 array_size
1419
- - const size_t xtramem_sz
1420
- - void **usrmempp
1421
-
1422
- OCIArrayDescriptorFree:
1423
- :version: 1110
1424
- :args:
1425
- - void **descp
1426
- - const ub4 type
@@ -224,9 +224,6 @@ static void bind_binary_double_init(oci8_bind_t *obind, VALUE svc, VALUE val, VA
224
224
  obind->alloc_sz = sizeof(double);
225
225
  }
226
226
 
227
- #ifndef SQLT_BDOUBLE
228
- #define SQLT_BDOUBLE 22
229
- #endif
230
227
  static const oci8_bind_data_type_t bind_binary_double_data_type = {
231
228
  {
232
229
  {
@@ -257,6 +254,58 @@ static VALUE bind_binary_double_alloc(VALUE klass)
257
254
  return oci8_allocate_typeddata(klass, &bind_binary_double_data_type.base);
258
255
  }
259
256
 
257
+ /*
258
+ * bind_boolean
259
+ */
260
+ static VALUE bind_boolean_get(oci8_bind_t *obind, void *data, void *null_struct)
261
+ {
262
+ return *(int*)data ? Qtrue : Qfalse;
263
+ }
264
+
265
+ static void bind_boolean_set(oci8_bind_t *obind, void *data, void **null_structp, VALUE val)
266
+ {
267
+ *(int*)data = RTEST(val) ? -1 : 0;
268
+ }
269
+
270
+ static void bind_boolean_init(oci8_bind_t *obind, VALUE svc, VALUE val, VALUE length)
271
+ {
272
+ obind->value_sz = sizeof(int);
273
+ obind->alloc_sz = sizeof(int);
274
+ }
275
+
276
+ #ifndef SQLT_BOL
277
+ #define SQLT_BOL 252
278
+ #endif
279
+ static const oci8_bind_data_type_t bind_boolean_data_type = {
280
+ {
281
+ {
282
+ "OCI8::BindType::Boolean",
283
+ {
284
+ NULL,
285
+ oci8_handle_cleanup,
286
+ oci8_handle_size,
287
+ },
288
+ &oci8_bind_data_type.rb_data_type, NULL,
289
+ #ifdef RUBY_TYPED_WB_PROTECTED
290
+ RUBY_TYPED_WB_PROTECTED,
291
+ #endif
292
+ },
293
+ oci8_bind_free,
294
+ sizeof(oci8_bind_t)
295
+ },
296
+ bind_boolean_get,
297
+ bind_boolean_set,
298
+ bind_boolean_init,
299
+ NULL,
300
+ NULL,
301
+ SQLT_BOL,
302
+ };
303
+
304
+ static VALUE bind_boolean_alloc(VALUE klass)
305
+ {
306
+ return oci8_allocate_typeddata(klass, &bind_boolean_data_type.base);
307
+ }
308
+
260
309
  static VALUE oci8_bind_get(VALUE self)
261
310
  {
262
311
  oci8_bind_t *obind = TO_BIND(self);
@@ -422,4 +471,7 @@ void Init_oci8_bind(VALUE klass)
422
471
  oci8_define_bind_class("String", &bind_string_data_type, bind_string_alloc);
423
472
  oci8_define_bind_class("RAW", &bind_raw_data_type, bind_raw_alloc);
424
473
  oci8_define_bind_class("BinaryDouble", &bind_binary_double_data_type, bind_binary_double_alloc);
474
+ if (oracle_client_version >= ORAVER_12_1) {
475
+ oci8_define_bind_class("Boolean", &bind_boolean_data_type, bind_boolean_alloc);
476
+ }
425
477
  }
@@ -25,77 +25,44 @@ $CFLAGS += oraconf.cflags
25
25
  saved_libs = $libs
26
26
  $libs += oraconf.libs
27
27
 
28
- oci_actual_client_version = 0x08000000
29
- funcs = {}
30
- YAML.load(open(File.dirname(__FILE__) + '/apiwrap.yml')).each do |key, val|
31
- key = key[0..-4] if key[-3..-1] == '_nb'
32
- ver = val[:version]
33
- ver_major = (ver / 100)
34
- ver_minor = (ver / 10) % 10
35
- ver_update = ver % 10
36
- ver = ((ver_major << 24) | (ver_minor << 20) | (ver_update << 12))
37
- funcs[ver] ||= []
38
- funcs[ver] << key
39
- end
40
-
41
28
  saved_defs = $defs.clone
42
- funcs.keys.sort.each do |version|
43
- next if version == 0x08000000
44
- verstr = format('%d.%d.%d', ((version >> 24) & 0xFF), ((version >> 20) & 0xF), ((version >> 12) & 0xFF))
45
- puts "checking for Oracle #{verstr} API - start"
46
- result = catch :result do
47
- funcs[version].sort.each do |func|
48
- unless have_func(func)
49
- throw :result, "fail"
50
- end
51
- end
52
- oci_actual_client_version = version
53
- "pass"
29
+ fmt = "%s"
30
+ def fmt.%(x)
31
+ x ? super : "failed"
32
+ end
33
+ oci_major_version = checking_for 'OCI_MAJOR_VERSION in oci.h', fmt do
34
+ try_constant('OCI_MAJOR_VERSION', 'oci.h')
35
+ end
36
+ if oci_major_version
37
+ oci_minor_version = checking_for 'OCI_MINOR_VERSION in oci.h', fmt do
38
+ try_constant('OCI_MINOR_VERSION', 'oci.h')
39
+ end
40
+ else
41
+ if have_func('OCILobGetLength2')
42
+ oci_major_version = 10
43
+ oci_minor_version = 1
44
+ elsif have_func('OCIStmtPrepare2')
45
+ raise "Ruby-oci8 #{OCI8::VERSION} doesn't support Oracle 9iR2. Use ruby-oci8 2.1.x instead."
46
+ elsif have_func('OCILogon2')
47
+ raise "Ruby-oci8 #{OCI8::VERSION} doesn't support Oracle 9iR1. Use ruby-oci8 2.1.x instead."
48
+ elsif have_func('OCIEnvCreate')
49
+ raise "Ruby-oci8 #{OCI8::VERSION} doesn't support Oracle 8i. Use ruby-oci8 2.0.x instead."
50
+ else
51
+ raise "Ruby-oci8 #{OCI8::VERSION} doesn't support Oracle 8. Use ruby-oci8 2.0.x instead."
54
52
  end
55
- puts "checking for Oracle #{verstr} API - #{result}"
56
- break if result == 'fail'
57
53
  end
58
54
  $defs = saved_defs
59
55
 
60
- have_type('oratext', 'ociap.h')
61
- have_type('OCIDateTime*', 'ociap.h')
62
- have_type('OCIInterval*', 'ociap.h')
63
- have_type('OCICallbackLobRead2', 'ociap.h')
64
- have_type('OCICallbackLobWrite2', 'ociap.h')
65
- have_type('OCIAdmin*', 'ociap.h')
66
- have_type('OCIAuthInfo*', 'ociap.h')
67
- have_type('OCIMsg*', 'ociap.h')
68
- have_type('OCICPool*', 'ociap.h')
69
-
70
56
  if with_config('oracle-version')
71
- oci_client_version = OCI8::OracleVersion.new(with_config('oracle-version')).to_i
57
+ oraver = OCI8::OracleVersion.new(with_config('oracle-version'))
72
58
  else
73
- oci_client_version = oci_actual_client_version
59
+ oraver = OCI8::OracleVersion.new(oci_major_version, oci_minor_version)
74
60
  end
75
- $defs << "-DORACLE_CLIENT_VERSION=#{format('0x%08x', oci_client_version)}"
61
+ $defs << "-DORACLE_CLIENT_VERSION=#{format('0x%08x', oraver.to_i)}"
76
62
 
77
63
  if with_config('runtime-check')
78
64
  $defs << "-DRUNTIME_API_CHECK=1"
79
65
  $libs = saved_libs
80
- else
81
- oraver = OCI8::OracleVersion.new(oci_client_version)
82
- if oraver < OCI8::OracleVersion.new(10)
83
- case "#{oraver.major}.#{oraver.minor}"
84
- when "8.0"
85
- ora_name = "Oracle 8"
86
- oci8_ver = "2.0.x"
87
- when "8.1"
88
- ora_name = "Oracle 8i"
89
- oci8_ver = "2.0.x"
90
- when "9.1"
91
- ora_name = "Oracle 9iR1"
92
- oci8_ver = "2.1.x"
93
- when "9.2"
94
- ora_name = "Oracle 9iR2"
95
- oci8_ver = "2.1.x"
96
- end
97
- raise "Ruby-oci8 #{OCI8::VERSION} doesn't support #{ora_name}. Use ruby-oci8 #{oci8_ver} instead."
98
- end
99
66
  end
100
67
 
101
68
  $objs = ["oci8lib.o", "env.o", "error.o", "oci8.o", "ocihandle.o",
@@ -58,38 +58,6 @@ typedef oraub8 ub8;
58
58
  typedef orasb8 sb8;
59
59
  #endif /* ORAXB8_DEFINED */
60
60
 
61
- #ifndef HAVE_TYPE_ORATEXT
62
- typedef unsigned char oratext;
63
- #endif
64
- #if !defined HAVE_TYPE_OCIDATETIME_ && !defined HAVE_TYPE_OCIDATETIMEP
65
- typedef struct OCIDateTime OCIDateTime;
66
- #endif
67
- #if !defined HAVE_TYPE_OCIINTERVAL_ && !defined HAVE_TYPE_OCIINTERVALP
68
- typedef struct OCIInterval OCIInterval;
69
- #endif
70
- #ifndef HAVE_TYPE_OCICALLBACKLOBREAD2
71
- typedef sb4 (*OCICallbackLobRead2)(dvoid *ctxp, CONST dvoid *bufp, oraub8 len,
72
- ub1 piece, dvoid **changed_bufpp,
73
- oraub8 *changed_lenp);
74
- #endif
75
- #ifndef HAVE_TYPE_OCICALLBACKLOBWRITE2
76
- typedef sb4 (*OCICallbackLobWrite2)(dvoid *ctxp, dvoid *bufp, oraub8 *lenp,
77
- ub1 *piece, dvoid **changed_bufpp,
78
- oraub8 *changed_lenp);
79
- #endif
80
- #if !defined HAVE_TYPE_OCIADMIN_ && !defined HAVE_TYPE_OCIADMINP
81
- typedef struct OCIAdmin OCIAdmin;
82
- #endif
83
- #if !defined HAVE_TYPE_OCIAUTHINFO_ && !defined HAVE_TYPE_OCIAUTHINFOP
84
- typedef struct OCIAuthInfo OCIAuthInfo;
85
- #endif
86
- #if !defined HAVE_TYPE_OCIMSG_ && !defined HAVE_TYPE_OCIMSGP
87
- typedef struct OCIMsg OCIMsg;
88
- #endif
89
- #if !defined HAVE_TYPE_OCICPOOL_ && !defined HAVE_TYPE_OCICPOOLP
90
- typedef struct OCICPool OCICPool;
91
- #endif
92
-
93
61
  #if defined RBX_CAPI_RUBY_H
94
62
  /* rubinius 2.0 */
95
63
  #ifndef HAVE_RB_ENC_STR_BUF_CAT
@@ -54,7 +54,6 @@ void oci8_base_free(oci8_base_t *base)
54
54
  base->hp.ptr = NULL;
55
55
  }
56
56
 
57
- #ifdef HAVE_RB_SET_END_PROC
58
57
  static void at_exit_func(VALUE val)
59
58
  {
60
59
  oci8_in_finalizer = 1;
@@ -62,7 +61,6 @@ static void at_exit_func(VALUE val)
62
61
  oci8_shutdown_sockets();
63
62
  #endif
64
63
  }
65
- #endif
66
64
 
67
65
  static VALUE bind_base_alloc(VALUE klass)
68
66
  {
@@ -118,9 +116,7 @@ Init_oci8lib()
118
116
  oci8_id_mul_op = rb_intern("*");
119
117
  oci8_id_div_op = rb_intern("/");
120
118
  #endif
121
- #ifdef HAVE_RB_SET_END_PROC
122
119
  rb_set_end_proc(at_exit_func, Qnil);
123
- #endif
124
120
 
125
121
  Init_oci8_thread_util();
126
122
  Init_oci8_error();
@@ -385,10 +381,6 @@ static VALUE exec_sql(cb_arg_t *arg)
385
381
  ub4 pos;
386
382
  sword rv;
387
383
 
388
- rv = OCIHandleAlloc(oci8_envhp, (dvoid*)&arg->stmtp, OCI_HTYPE_STMT, 0, NULL);
389
- if (rv != OCI_SUCCESS) {
390
- oci8_env_raise(oci8_envhp, rv);
391
- }
392
384
  chker2(OCIStmtPrepare2(arg->svcctx->base.hp.svc, &arg->stmtp, oci8_errhp,
393
385
  (text*)arg->sql_text, strlen(arg->sql_text), NULL, 0,
394
386
  OCI_NTV_SYNTAX, OCI_DEFAULT),
@@ -23,10 +23,8 @@ static ID id_finite_p;
23
23
  static ID id_split;
24
24
  static ID id_numerator;
25
25
  static ID id_denominator;
26
- static ID id_Rational;
27
26
  static ID id_BigDecimal;
28
27
 
29
- static VALUE cRational;
30
28
  static VALUE cBigDecimal;
31
29
 
32
30
  static VALUE cOCINumber;
@@ -51,19 +49,6 @@ static int rboci8_type(VALUE obj)
51
49
  VALUE klass;
52
50
 
53
51
  switch (type) {
54
- case T_OBJECT:
55
- klass = CLASS_OF(obj);
56
- if (cRational != 0) {
57
- if (klass == cRational) {
58
- return T_RATIONAL;
59
- }
60
- } else {
61
- if (strcmp(rb_class2name(klass), "Rational") == 0) {
62
- cRational = rb_const_get(rb_cObject, id_Rational);
63
- return T_RATIONAL;
64
- }
65
- }
66
- break;
67
52
  case T_DATA:
68
53
  klass = CLASS_OF(obj);
69
54
  if (klass == cOCINumber) {
@@ -1805,7 +1790,6 @@ Init_oci_number(VALUE cOCI8, OCIError *errhp)
1805
1790
  id_split = rb_intern("split");
1806
1791
  id_numerator = rb_intern("numerator");
1807
1792
  id_denominator = rb_intern("denominator");
1808
- id_Rational = rb_intern("Rational");
1809
1793
  id_BigDecimal = rb_intern("BigDecimal");
1810
1794
 
1811
1795
  cOCINumber = rb_define_class("OraNumber", rb_cNumeric);
@@ -696,7 +696,7 @@ EOS
696
696
  original_libs = $libs
697
697
  begin
698
698
  $libs += " -L#{CONFIG['libdir']} " + @libs
699
- have_func("OCIInitialize", "oci.h")
699
+ have_func("OCIEnvCreate", "oci.h")
700
700
  ensure
701
701
  $libs = original_libs
702
702
  end
@@ -708,11 +708,12 @@ EOS
708
708
  case RUBY_PLATFORM
709
709
  when /cygwin|x64-mingw32/
710
710
  regex = ([nil].pack('P').size == 8) ? / T (OCI\w+)/ : / T _(OCI\w+)/
711
+ oci_funcs = YAML.load(open(File.dirname(__FILE__) + '/apiwrap.yml'))
711
712
  open("OCI.def", "w") do |f|
712
713
  f.puts("EXPORTS")
713
714
  open("|nm #{lib_dir}/MSVC/OCI.LIB") do |r|
714
715
  while line = r.gets
715
- f.puts($1) if regex =~ line
716
+ f.puts($1) if regex =~ line and oci_funcs.include?($1)
716
717
  end
717
718
  end
718
719
  end
@@ -216,6 +216,10 @@ OCI8::BindType::Mapping[OCI8::NCLOB] = OCI8::BindType::NCLOB
216
216
  OCI8::BindType::Mapping[OCI8::BLOB] = OCI8::BindType::BLOB
217
217
  OCI8::BindType::Mapping[OCI8::BFILE] = OCI8::BindType::BFILE
218
218
  OCI8::BindType::Mapping[OCI8::Cursor] = OCI8::BindType::Cursor
219
+ if defined? OCI8::BindType::Boolean
220
+ OCI8::BindType::Mapping[TrueClass] = OCI8::BindType::Boolean
221
+ OCI8::BindType::Mapping[FalseClass] = OCI8::BindType::Boolean
222
+ end
219
223
 
220
224
  # implicitly define
221
225
 
@@ -351,22 +351,7 @@ class OCI8
351
351
  # @see OCI8.oracle_client_version
352
352
  # @return [OCI8::OracleVersion]
353
353
  def oracle_server_version
354
- unless defined? @oracle_server_version
355
- if vernum = oracle_server_vernum
356
- # If the Oracle client is Oracle 9i or upper,
357
- # get the server version from the OCI function OCIServerRelease.
358
- @oracle_server_version = OCI8::OracleVersion.new(vernum)
359
- else
360
- # Otherwise, get it from v$version.
361
- self.exec('select banner from v$version') do |row|
362
- if /^Oracle.*?(\d+\.\d+\.\d+\.\d+\.\d+)/ =~ row[0]
363
- @oracle_server_version = OCI8::OracleVersion.new($1)
364
- break
365
- end
366
- end
367
- end
368
- end
369
- @oracle_server_version
354
+ @oracle_server_version ||= OCI8::OracleVersion.new(oracle_server_vernum)
370
355
  end
371
356
 
372
357
  # Returns the Oracle database character set name such as AL32UTF8.
@@ -1,3 +1,3 @@
1
1
  class OCI8
2
- VERSION = "2.2.0.2"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -31,6 +31,7 @@ end
31
31
 
32
32
  if $oracle_version >= OCI8::ORAVER_12_1
33
33
  require "#{srcdir}/test_package_type"
34
+ require "#{srcdir}/test_bind_boolean.rb"
34
35
  end
35
36
 
36
37
  # Ruby/DBI
metadata CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 2
8
- - 0
9
- - 2
10
- version: 2.2.0.2
8
+ - 1
9
+ version: 2.2.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - Kubo Takehiro
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2015-10-12 00:00:00 +09:00
17
+ date: 2015-11-01 00:00:00 +09:00
19
18
  default_executable:
20
19
  dependencies: []
21
20