ruby-oci8 2.2.10-x64-mingw-ucrt

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +14 -0
  3. data/COPYING +30 -0
  4. data/COPYING_old +64 -0
  5. data/ChangeLog +3826 -0
  6. data/Makefile +92 -0
  7. data/NEWS +1209 -0
  8. data/README.md +66 -0
  9. data/dist-files +112 -0
  10. data/docs/bind-array-to-in_cond.md +38 -0
  11. data/docs/conflicts-local-connections-and-processes.md +98 -0
  12. data/docs/hanging-after-inactivity.md +63 -0
  13. data/docs/install-binary-package.md +44 -0
  14. data/docs/install-full-client.md +111 -0
  15. data/docs/install-instant-client.md +194 -0
  16. data/docs/install-on-osx.md +46 -0
  17. data/docs/ldap-auth-and-function-interposition.md +123 -0
  18. data/docs/number-type-mapping.md +79 -0
  19. data/docs/platform-specific-issues.md +164 -0
  20. data/docs/report-installation-issue.md +50 -0
  21. data/docs/timeout-parameters.md +94 -0
  22. data/lib/.document +1 -0
  23. data/lib/dbd/OCI8.rb +591 -0
  24. data/lib/oci8/.document +8 -0
  25. data/lib/oci8/bindtype.rb +333 -0
  26. data/lib/oci8/check_load_error.rb +146 -0
  27. data/lib/oci8/compat.rb +117 -0
  28. data/lib/oci8/connection_pool.rb +179 -0
  29. data/lib/oci8/cursor.rb +605 -0
  30. data/lib/oci8/datetime.rb +605 -0
  31. data/lib/oci8/encoding-init.rb +45 -0
  32. data/lib/oci8/encoding.yml +537 -0
  33. data/lib/oci8/metadata.rb +2148 -0
  34. data/lib/oci8/object.rb +641 -0
  35. data/lib/oci8/oci8.rb +756 -0
  36. data/lib/oci8/ocihandle.rb +591 -0
  37. data/lib/oci8/oracle_version.rb +153 -0
  38. data/lib/oci8/properties.rb +196 -0
  39. data/lib/oci8/version.rb +3 -0
  40. data/lib/oci8.rb +190 -0
  41. data/lib/oci8lib_310.so +0 -0
  42. data/lib/ruby-oci8.rb +1 -0
  43. data/metaconfig +142 -0
  44. data/pre-distclean.rb +7 -0
  45. data/ruby-oci8.gemspec +85 -0
  46. data/setup.rb +1342 -0
  47. data/test/README.md +37 -0
  48. data/test/config.rb +201 -0
  49. data/test/setup_test_object.sql +199 -0
  50. data/test/setup_test_package.sql +59 -0
  51. data/test/test_all.rb +56 -0
  52. data/test/test_appinfo.rb +62 -0
  53. data/test/test_array_dml.rb +332 -0
  54. data/test/test_bind_array.rb +70 -0
  55. data/test/test_bind_boolean.rb +99 -0
  56. data/test/test_bind_integer.rb +47 -0
  57. data/test/test_bind_raw.rb +45 -0
  58. data/test/test_bind_string.rb +105 -0
  59. data/test/test_bind_time.rb +177 -0
  60. data/test/test_break.rb +125 -0
  61. data/test/test_clob.rb +85 -0
  62. data/test/test_connection_pool.rb +124 -0
  63. data/test/test_connstr.rb +220 -0
  64. data/test/test_datetime.rb +585 -0
  65. data/test/test_dbi.rb +365 -0
  66. data/test/test_dbi_clob.rb +53 -0
  67. data/test/test_encoding.rb +103 -0
  68. data/test/test_error.rb +87 -0
  69. data/test/test_metadata.rb +2674 -0
  70. data/test/test_object.rb +546 -0
  71. data/test/test_oci8.rb +624 -0
  72. data/test/test_oracle_version.rb +68 -0
  73. data/test/test_oradate.rb +255 -0
  74. data/test/test_oranumber.rb +792 -0
  75. data/test/test_package_type.rb +981 -0
  76. data/test/test_properties.rb +17 -0
  77. data/test/test_rowid.rb +32 -0
  78. metadata +123 -0
@@ -0,0 +1,546 @@
1
+ require 'oci8'
2
+ require File.dirname(__FILE__) + '/config'
3
+
4
+ class Time
5
+ def inspect
6
+ self.strftime("%Y-%m-%d %H:%M:%S.%N %:z")
7
+ end
8
+ end
9
+
10
+ conn = OCI8.new($dbuser, $dbpass, $dbname)
11
+ error_message = nil
12
+ begin
13
+ conn.describe_type('rb_test_int_array')
14
+ conn.describe_type('rb_test_flt_array')
15
+ conn.describe_type('rb_test_num_array')
16
+ conn.describe_type('rb_test_bdbl_array')
17
+ conn.describe_type('rb_test_bflt_array')
18
+ conn.describe_type('rb_test_str_array')
19
+ conn.describe_type('rb_test_raw_array')
20
+ conn.describe_type('rb_test_obj_elem_array')
21
+ conn.describe_type('rb_test_obj_elem_ary_of_ary')
22
+ conn.describe_type('rb_test_obj')
23
+ conn.describe_table('rb_test_obj_tab1')
24
+ conn.describe_table('rb_test_obj_tab2')
25
+
26
+ class RbTestObj < OCI8::Object::Base
27
+ end
28
+
29
+ begin
30
+ version = RbTestObj.test_object_version(conn)
31
+ error_message = "Invalid test object version" if version != 4
32
+ rescue NoMethodError
33
+ raise unless $!.to_s.include?('test_object_version')
34
+ error_message = "rb_test_obj.test_object_version is not declared."
35
+ end
36
+ rescue OCIError
37
+ raise if $!.code != 4043
38
+ error_message = $!.to_s
39
+ ensure
40
+ conn.logoff
41
+ end
42
+
43
+ raise <<EOS if error_message
44
+
45
+ #{error_message}
46
+ You need to execute SQL statements in #{File.dirname(__FILE__)}/setup_test_object.sql as follows:
47
+
48
+ $ sqlplus USERNAME/PASSWORD
49
+ SQL> @test/setup_test_object.sql
50
+
51
+ EOS
52
+
53
+
54
+ class RbTestIntArray < OCI8::Object::Base
55
+ end
56
+
57
+ class RbTestObjBase < OCI8::Object::Base
58
+ end
59
+
60
+ class RbTestObjSub < RbTestObjBase
61
+ end
62
+
63
+ class TestObj1 < Minitest::Test
64
+ Delta = 0.00001
65
+
66
+ def setup
67
+ @conn = get_oci8_connection
68
+ RbTestObj.default_connection = @conn
69
+ end
70
+
71
+ def teardown
72
+ @conn.logoff
73
+ end
74
+
75
+ class ExpectedValObjElem
76
+ def initialize(x, y)
77
+ @attributes = {:x => x, :y => y}
78
+ end
79
+ def ==(val)
80
+ @attributes[:x] == val.x and @attributes[:y] == val.y
81
+ end
82
+ end
83
+
84
+ class ExpectedVal
85
+ include Minitest::Assertions
86
+
87
+ attr_reader :n
88
+ attr_reader :int_val
89
+ attr_reader :flt_val
90
+ attr_reader :num_val
91
+ attr_reader :bdbl_val
92
+ attr_reader :bflt_val
93
+ attr_reader :str_val
94
+ attr_reader :raw_val
95
+ attr_reader :clob_val
96
+ attr_reader :nclob_val
97
+ attr_reader :blob_val
98
+ attr_reader :obj_val
99
+ attr_reader :int_array_val
100
+ attr_reader :flt_array_val
101
+ attr_reader :num_array_val
102
+ attr_reader :bdbl_array_val
103
+ attr_reader :bflt_array_val
104
+ attr_reader :str_array_val
105
+ attr_reader :raw_array_val
106
+ attr_reader :obj_array_val
107
+ attr_reader :obj_ary_of_ary_val
108
+ attr_reader :date_val
109
+ attr_reader :timestamp_val
110
+ attr_reader :timestamp_tz_val
111
+
112
+ attr_accessor :assertions
113
+
114
+ def initialize
115
+ @n = 0.0
116
+ @assertions = 0
117
+ end
118
+
119
+ def to_test_datetime(n, type)
120
+ year = (1990 + n).round
121
+ month = (n.round * 5) % 12 + 1
122
+ mday = (n.round * 7) % 27 + 1
123
+ hour = (n.round * 9) % 24
124
+ minute = (n.round * 11) % 60
125
+ sec = (n.round * 13) % 60
126
+ nsec = if type == :date
127
+ 0
128
+ else
129
+ ((n.round * 333_333_333) % 1_000_000_000).to_r / 1_000_000_000
130
+ end
131
+ tz = if type == :timestamp_tz
132
+ tzh = (n.round * 15) % 24 - 11
133
+ tzm = (n.round * 17) % 60
134
+ format('%+03d:%02d', tzh, tzm)
135
+ else
136
+ nil
137
+ end
138
+ convert_to_time(year, month, mday, hour, minute, sec, nsec, tz)
139
+ end
140
+ private :to_test_datetime
141
+
142
+ def next
143
+ @n += 1.2
144
+ @n = (@n * 10).round / 10.0
145
+ @int_val = @n.round
146
+ @flt_val = @n
147
+ @num_val = @n
148
+ @bdbl_val = @n
149
+ @bflt_val = @n
150
+ @str_val = @n.to_s
151
+ @str_val = $` if /.0$/ =~ @str_val
152
+ @raw_val = @str_val
153
+ @clob_val = @str_val
154
+ @nclob_val = @str_val
155
+ @blob_val = @str_val
156
+ @obj_val = ExpectedValObjElem.new(@int_val, @int_val + 1)
157
+ @date_val = to_test_datetime(@n, :date)
158
+ @timestamp_val = to_test_datetime(@n, :timestamp)
159
+ @timestamp_tz_val = to_test_datetime(@n, :timestamp_tz)
160
+ if @int_val == 1
161
+ @int_array_val = nil
162
+ @flt_array_val = nil
163
+ @num_array_val = nil
164
+ @bdbl_array_val = nil
165
+ @bflt_array_val = nil
166
+ @str_array_val = nil
167
+ @raw_array_val = nil
168
+ @obj_array_val = nil
169
+ @obj_ary_of_ary_val = nil
170
+ # @date_array_val = nil
171
+ else
172
+ @int_array_val = []
173
+ @flt_array_val = []
174
+ @num_array_val = []
175
+ @bdbl_array_val = []
176
+ @bflt_array_val = []
177
+ @str_array_val = []
178
+ @raw_array_val = []
179
+ @obj_array_val = []
180
+ @obj_ary_of_ary_val = []
181
+ # @date_array_val = []
182
+ 0.upto(2) do |i|
183
+ val = (@n + i).to_s
184
+ val = $` if /.0$/ =~ val
185
+ @int_array_val[i] = @int_val + i
186
+ @flt_array_val[i] = @n + i
187
+ @num_array_val[i] = @n + i
188
+ @bdbl_array_val[i] = @n + i
189
+ @bflt_array_val[i] = @n + i
190
+ @str_array_val[i] = val
191
+ @raw_array_val[i] = val
192
+ @obj_array_val[i] = ExpectedValObjElem.new(@int_val + i, @int_val + i + 1)
193
+ # @date_array_val[i] = to_test_date(@n + i)
194
+ end
195
+ @obj_ary_of_ary_val[0] = @obj_array_val
196
+ end
197
+ @n <= 20
198
+ end
199
+
200
+ def should_be_equal(val)
201
+ if val.is_a? Array
202
+ int_val = val[0]
203
+ flt_val = val[1]
204
+ num_val = val[2]
205
+ bdbl_val = val[3]
206
+ bflt_val = val[4]
207
+ str_val = val[5]
208
+ raw_val = val[6]
209
+ clob_val = val[7] && val[7].read
210
+ nclob_val = val[8] && val[8].read
211
+ blob_val = val[9] && val[9].read
212
+ obj_val = val[10]
213
+ int_array_val = val[11]
214
+ flt_array_val = val[12]
215
+ num_array_val = val[13]
216
+ bdbl_array_val = val[14]
217
+ bflt_array_val = val[15]
218
+ str_array_val = val[16]
219
+ raw_array_val = val[17]
220
+ obj_array_val = val[18]
221
+ obj_ary_of_ary_val = val[19]
222
+ date_val = val[20]
223
+ timestamp_val = val[21]
224
+ timestamp_tz_val = val[22]
225
+ else
226
+ assert_instance_of(RbTestObj, val)
227
+ int_val = val.int_val
228
+ flt_val = val.flt_val
229
+ num_val = val.num_val
230
+ bdbl_val = val.bdbl_val
231
+ bflt_val = val.bflt_val
232
+ str_val = val.str_val
233
+ raw_val = val.raw_val
234
+ clob_val = val.clob_val && val.clob_val.read
235
+ nclob_val = val.nclob_val && val.nclob_val.read
236
+ blob_val = val.blob_val && val.blob_val.read
237
+ obj_val = val.obj_val
238
+ int_array_val = val.int_array_val
239
+ flt_array_val = val.flt_array_val
240
+ num_array_val = val.num_array_val
241
+ bdbl_array_val = val.bdbl_array_val
242
+ bflt_array_val = val.bflt_array_val
243
+ str_array_val = val.str_array_val
244
+ raw_array_val = val.raw_array_val
245
+ obj_array_val = val.obj_array_val
246
+ obj_ary_of_ary_val = val.obj_ary_of_ary_val
247
+ date_val = val.date_val
248
+ timestamp_val = val.timestamp_val
249
+ timestamp_tz_val = val.timestamp_tz_val
250
+ end
251
+
252
+ assert_equal(@int_val, int_val)
253
+ assert_in_delta(@flt_val, flt_val, Delta)
254
+ assert_in_delta(@num_val, num_val, Delta)
255
+ assert_in_delta(@bdbl_val, bdbl_val, Delta)
256
+ assert_in_delta(@bflt_val, bflt_val, Delta)
257
+ assert_equal(@str_val, str_val)
258
+ assert_equal(@raw_val, raw_val)
259
+ assert_equal(@clob_val, clob_val)
260
+ assert_equal(@nclob_val, nclob_val)
261
+ assert_equal(@blob_val, blob_val)
262
+ assert_equal(@obj_val, obj_val)
263
+ if @int_array_val
264
+ assert_equal(@int_array_val, int_array_val.to_ary)
265
+ else
266
+ assert_nil(@int_array_val, int_array_val)
267
+ end
268
+ assert_array_in_delta(@flt_array_val, flt_array_val && flt_array_val.to_ary)
269
+ assert_array_in_delta(@num_array_val, num_array_val && num_array_val.to_ary)
270
+ assert_array_in_delta(@bdbl_array_val, bdbl_array_val && bdbl_array_val.to_ary)
271
+ assert_array_in_delta(@bflt_array_val, bflt_array_val && bflt_array_val.to_ary)
272
+ if @str_array_val
273
+ assert_equal(@str_array_val, str_array_val.to_ary)
274
+ else
275
+ assert_nil(str_array_val)
276
+ end
277
+ if @raw_array_val
278
+ assert_equal(@raw_array_val, raw_array_val.to_ary)
279
+ else
280
+ assert_nil(raw_array_val)
281
+ end
282
+ if @obj_array_val
283
+ assert_equal(@obj_array_val, obj_array_val.to_ary)
284
+ else
285
+ assert_nil(obj_array_val)
286
+ end
287
+ if @obj_ary_of_ary_val
288
+ assert_equal(@obj_ary_of_ary_val, obj_ary_of_ary_val.to_ary.collect { |elem| elem.to_ary })
289
+ else
290
+ assert_nil(obj_ary_of_ary_val)
291
+ end
292
+ assert_equal(@date_val, date_val)
293
+ assert_equal(@timestamp_val, timestamp_val)
294
+ assert_equal(@timestamp_tz_val, timestamp_tz_val)
295
+ end
296
+
297
+ def assert_array_in_delta(exp, val)
298
+ if exp && val
299
+ assert_equal(exp.size, val.size)
300
+ exp.each_with_index do |elem, idx|
301
+ assert_in_delta(elem, val[idx], Delta)
302
+ end
303
+ elsif exp.nil?
304
+ assert_nil(val)
305
+ else
306
+ assert_equal(exp, val)
307
+ end
308
+ end
309
+ end
310
+
311
+ def test_select1
312
+ expected_val = ExpectedVal.new
313
+ @conn.exec("select * from rb_test_obj_tab1 order by n") do |row|
314
+ assert(expected_val.next)
315
+
316
+ assert_in_delta(expected_val.n, row[0], Delta)
317
+ expected_val.should_be_equal(row[1])
318
+ end
319
+ assert(!expected_val.next)
320
+ end
321
+
322
+ def test_select2
323
+ expected_val = ExpectedVal.new
324
+ orig_val = OCI8::BindType::Mapping[:date]
325
+ begin
326
+ @conn.exec("select * from rb_test_obj_tab2 order by int_val") do |row|
327
+ assert(expected_val.next)
328
+ expected_val.should_be_equal(row)
329
+ end
330
+ assert(!expected_val.next)
331
+ ensure
332
+ OCI8::BindType::Mapping[:date] = orig_val
333
+ end
334
+ end
335
+
336
+ def test_select3
337
+ expected_val = ExpectedVal.new
338
+ @conn.exec("select value(p) from rb_test_obj_tab2 p order by int_val") do |row|
339
+ assert(expected_val.next)
340
+ expected_val.should_be_equal(row[0])
341
+ end
342
+ assert(!expected_val.next)
343
+ end
344
+
345
+ def _test_select4 # TODO
346
+ expected_val = ExpectedVal.new
347
+ @conn.exec("select ref(p) from rb_test_obj_tab2 p order by int_val") do |row|
348
+ assert(expected_val.next)
349
+
350
+ expected_val.should_be_equal(row[0])
351
+ end
352
+ assert(!expected_val.next)
353
+ end
354
+
355
+ def test_explicit_constructor
356
+ expected_val = ExpectedVal.new
357
+ while expected_val.next
358
+ obj = RbTestObj.new(expected_val.n)
359
+ expected_val.should_be_equal(obj)
360
+ obj.inspect
361
+ end
362
+ end
363
+
364
+ def _test_implicit_constructor # TODO
365
+ expected_val = ExpectedVal.new
366
+ while expected_val.next
367
+ obj = RbTestObj.new(expected_val.int_val, expected_val.flt_val, expected_val.str_val, expected_val.raw_val, expected_val.str_array_val, expected_val.raw_array_val, expected_val.num_array_val)
368
+ expected_val.should_be_equal(obj)
369
+ end
370
+ end
371
+
372
+ def _test_implicit_constructor2 # TODO
373
+ obj = RbTestObj.new(nil, nil, nil)
374
+ assert_nil(obj.int_val)
375
+ assert_nil(obj.flt_val)
376
+ assert_nil(obj.str_val)
377
+ end
378
+
379
+ def _test_class_func
380
+ expected_val = ExpectedVal.new
381
+ while expected_val.next
382
+ obj = RbTestObj.class_func(expected_val.n)
383
+ expected_val.should_be_equal(obj)
384
+ end
385
+ end
386
+
387
+ def test_class_proc1
388
+ expected_val = ExpectedVal.new
389
+ while expected_val.next
390
+ obj = RbTestObj.new(0)
391
+ RbTestObj.class_proc1(obj, expected_val.n)
392
+ expected_val.should_be_equal(obj)
393
+ end
394
+ end
395
+
396
+ def _test_class_proc2
397
+ expected_val = ExpectedVal.new
398
+ while expected_val.next
399
+ obj = RbTestObj.new
400
+ obj.int_val = expected_val.int_val - 1
401
+ obj.flt_val = expected_val.flt_val
402
+ obj.num_val = expected_val.num_val
403
+ obj.bdbl_val = expected_val.bdbl_val
404
+ obj.bflt_val = expected_val.bflt_val
405
+ obj.str_val = expected_val.str_val
406
+ obj.raw_val = expected_val.raw_val
407
+ obj.clob_val = expected_val.clob_val
408
+ obj.nclob_val = expected_val.nclob_val
409
+ obj.blob_val = expected_val.blob_val
410
+ obj.obj_val = expected_val.obj_val
411
+ obj.int_array_val = expected_val.int_array_val
412
+ obj.flt_array_val = expected_val.flt_array_val
413
+ obj.num_array_val = expected_val.num_array_val
414
+ obj.bdbl_array_val = expected_val.bdbl_array_val
415
+ obj.bflt_array_val = expected_val.bflt_array_val
416
+ obj.str_array_val = expected_val.str_array_val
417
+ obj.raw_array_val = expected_val.raw_array_val
418
+ obj.obj_array_val = expected_val.obj_array_val
419
+ obj.obj_ary_of_ary_val = expected_val.obj_ary_of_ary_val
420
+ RbTestObj.class_proc2(obj)
421
+ expected_val.should_be_equal(obj)
422
+ end
423
+ end
424
+
425
+ def test_member_func
426
+ expected_val = ExpectedVal.new
427
+ while expected_val.next
428
+ obj = RbTestObj.new(expected_val.n)
429
+ assert_equal(expected_val.int_val, obj.member_func)
430
+ end
431
+ end
432
+
433
+ def _test_plsql_member_func
434
+ expected_val = ExpectedVal.new
435
+ while expected_val.next
436
+ obj = RbTestObj.new(expected_val.n)
437
+ rv = @conn.exec(<<EOS, obj, [nil, Integer])
438
+ declare
439
+ obj rb_test_obj := :obj;
440
+ begin
441
+ :rv := obj.member_func;
442
+ end;
443
+ EOS
444
+ assert_equal(expected_val.int_val, rv[1])
445
+ end
446
+ end
447
+
448
+ def test_member_proc
449
+ expected_val = ExpectedVal.new
450
+ while expected_val.next
451
+ obj = RbTestObj.new
452
+ obj.member_proc(expected_val.int_val)
453
+ assert_equal(expected_val.int_val, obj.int_val)
454
+ end
455
+ end
456
+
457
+ def test_bind_nil
458
+ csr = @conn.parse(<<EOS)
459
+ DECLARE
460
+ obj RB_TEST_OBJ := :in;
461
+ BEGIN
462
+ IF obj IS NULL THEN
463
+ :out := 'IS NULL';
464
+ ELSE
465
+ :out := 'IS NOT NULL';
466
+ END IF;
467
+ END;
468
+ EOS
469
+ csr.bind_param(:in, nil, RbTestObj)
470
+ csr.bind_param(:out, nil, String, 11)
471
+ csr.exec
472
+ assert_equal('IS NULL', csr[:out])
473
+ csr[:in] = RbTestObj.new(@conn)
474
+ csr.exec
475
+ assert_equal('IS NOT NULL', csr[:out])
476
+ csr[:in] = nil
477
+ csr.exec
478
+ assert_equal('IS NULL', csr[:out])
479
+ end
480
+
481
+ def test_bind_array
482
+ csr = @conn.parse <<EOS
483
+ DECLARE
484
+ ary RB_TEST_INT_ARRAY := :in;
485
+ BEGIN
486
+ IF ary IS NULL THEN
487
+ :cnt := -1;
488
+ ELSE
489
+ :cnt := ary.count;
490
+ IF :cnt != 0 THEN
491
+ :out1 := ary(1);
492
+ :out2 := ary(2);
493
+ :out3 := ary(3);
494
+ END IF;
495
+ END IF;
496
+ END;
497
+ EOS
498
+ [nil, [], [1, nil, 3]].each do |ary|
499
+ csr.bind_param(:in, ary, :named_type, 'rb_test_int_array')
500
+ csr.bind_param(:cnt, nil, Integer)
501
+ csr.bind_param(:out1, nil, Integer)
502
+ csr.bind_param(:out2, nil, Integer)
503
+ csr.bind_param(:out3, nil, Integer)
504
+ csr.exec
505
+ if ary
506
+ assert_equal(ary.length, csr[:cnt])
507
+ else
508
+ assert_equal(-1, csr[:cnt])
509
+ end
510
+ if ary && ary[0]
511
+ assert_equal(ary[0], csr[:out1])
512
+ else
513
+ assert_nil(csr[:out1])
514
+ end
515
+ if ary && ary[1]
516
+ assert_equal(ary[1], csr[:out2])
517
+ else
518
+ assert_nil(csr[:out2])
519
+ end
520
+ if ary && ary[2]
521
+ assert_equal(ary[2], csr[:out3])
522
+ else
523
+ assert_nil(csr[:out3])
524
+ end
525
+ end
526
+ end
527
+
528
+ def test_get_subtype
529
+ csr = @conn.parse("BEGIN :result := rb_test_obj_get_object(:1); END;")
530
+ csr.bind_param(1, nil, RbTestObjBase)
531
+ csr.bind_param(2, nil, Integer)
532
+
533
+ csr[2] = 0
534
+ csr.exec
535
+ val = csr[1]
536
+ assert_instance_of(RbTestObjBase, val)
537
+ assert_equal(val.id, 'base')
538
+
539
+ csr[2] = 1
540
+ csr.exec
541
+ val = csr[1]
542
+ assert_instance_of(RbTestObjSub, val)
543
+ assert_equal(val.id, 'sub')
544
+ assert_equal(val.subid, 'subid')
545
+ end
546
+ end