ruby-oci8 1.0.6-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/ChangeLog +693 -0
  2. data/Makefile +51 -0
  3. data/NEWS +407 -0
  4. data/README +415 -0
  5. data/VERSION +1 -0
  6. data/dist-files +71 -0
  7. data/doc/api.en.html +527 -0
  8. data/doc/api.en.rd +554 -0
  9. data/doc/api.ja.html +525 -0
  10. data/doc/api.ja.rd +557 -0
  11. data/doc/manual.css +35 -0
  12. data/ext/oci8/oci8lib.so +0 -0
  13. data/lib/dbd/OCI8.rb +591 -0
  14. data/lib/oci8.rb +1655 -0
  15. data/lib/oci8.rb.in +1655 -0
  16. data/metaconfig +142 -0
  17. data/pre-distclean.rb +7 -0
  18. data/ruby-oci8.gemspec +54 -0
  19. data/ruby-oci8.spec +62 -0
  20. data/setup.rb +1331 -0
  21. data/support/README +4 -0
  22. data/support/runit/assert.rb +281 -0
  23. data/support/runit/cui/testrunner.rb +101 -0
  24. data/support/runit/error.rb +4 -0
  25. data/support/runit/method_mappable.rb +20 -0
  26. data/support/runit/robserver.rb +25 -0
  27. data/support/runit/setuppable.rb +15 -0
  28. data/support/runit/teardownable.rb +16 -0
  29. data/support/runit/testcase.rb +113 -0
  30. data/support/runit/testfailure.rb +25 -0
  31. data/support/runit/testresult.rb +121 -0
  32. data/support/runit/testsuite.rb +43 -0
  33. data/support/runit/version.rb +3 -0
  34. data/test/README +4 -0
  35. data/test/config.rb +129 -0
  36. data/test/test_all.rb +48 -0
  37. data/test/test_bind_raw.rb +53 -0
  38. data/test/test_bind_time.rb +191 -0
  39. data/test/test_break.rb +81 -0
  40. data/test/test_clob.rb +101 -0
  41. data/test/test_connstr.rb +80 -0
  42. data/test/test_dbi.rb +327 -0
  43. data/test/test_dbi_clob.rb +58 -0
  44. data/test/test_describe.rb +137 -0
  45. data/test/test_metadata.rb +243 -0
  46. data/test/test_oci8.rb +273 -0
  47. data/test/test_oradate.rb +263 -0
  48. data/test/test_oranumber.rb +149 -0
  49. data/test/test_rowid.rb +38 -0
  50. metadata +105 -0
@@ -0,0 +1,51 @@
1
+ VERSION = `cat VERSION`
2
+ RUBY = ruby
3
+ GEM = gem
4
+ CONFIG_OPT =
5
+
6
+ all: build
7
+
8
+ build: config.save setup
9
+
10
+ config.save: lib/oci8.rb.in
11
+ $(RUBY) setup.rb config $(CONFIG_OPT)
12
+
13
+ setup:
14
+ $(RUBY) setup.rb setup
15
+
16
+ check: build
17
+ $(RUBY) setup.rb test
18
+
19
+ clean:
20
+ $(RUBY) setup.rb clean
21
+
22
+ distclean:
23
+ $(RUBY) setup.rb distclean
24
+
25
+ install:
26
+ $(RUBY) setup.rb install
27
+
28
+ site-install:
29
+ $(RUBY) setup.rb install
30
+
31
+ gem:
32
+ $(GEM) build ruby-oci8.gemspec
33
+
34
+ binary_gem: build
35
+ $(GEM) build ruby-oci8.gemspec -- current
36
+
37
+ # internal use only
38
+ dist: ruby-oci8.spec
39
+ -rm -rf ruby-oci8-$(VERSION)
40
+ mkdir ruby-oci8-$(VERSION)
41
+ tar cf - `cat dist-files` | (cd ruby-oci8-$(VERSION); tar xf - )
42
+ tar cfz ruby-oci8-$(VERSION).tar.gz ruby-oci8-$(VERSION)
43
+
44
+ dist-check: dist
45
+ cd ruby-oci8-$(VERSION) && $(MAKE) RUBY="$(RUBY)"
46
+ cd ruby-oci8-$(VERSION) && $(MAKE) RUBY="$(RUBY)" check
47
+ cd ruby-oci8-$(VERSION)/src && $(MAKE) RUBY="$(RUBY)" sitearchdir=../work sitelibdir=../work site-install
48
+ cd ruby-oci8-$(VERSION)/test && $(RUBY) -I../work -I../support test_all.rb
49
+
50
+ ruby-oci8.spec: ruby-oci8.spec.in
51
+ $(RUBY) -rerb -e "open('ruby-oci8.spec', 'w').write(ERB.new(open('ruby-oci8.spec.in').read).result)"
data/NEWS ADDED
@@ -0,0 +1,407 @@
1
+ 1.0.6:
2
+
3
+ * fix a problem when compiling for Oracle 8.0.
4
+ (reported by Axel Reinhold as a ruby-oci8 2.0 issue)
5
+
6
+ * [dbi] fix to pass a newly added sanity check in dbi 0.4.1.
7
+ (reported by Dirk Herzhauser as a ruby-oci8 2.0 issue)
8
+
9
+ * [dbi] fix dbh#columns for Oracle 8.1 or lower.
10
+ The data dictionary all_constraints doesn't have index_name
11
+ column on Oracle 8i. Rewrite DBI::DBD::OCI8::Database#columns
12
+ by using all_cons_columns.
13
+ (backport from ruby-oci8 trunk)
14
+
15
+ 1.0.5:
16
+
17
+ No changes except who try to install on Mac OS X ppc.
18
+
19
+ - fix big/little endian checking problem on Mac OS X ppc.
20
+ (contributed by unknown. See: Bug ID 24284 on rubyforge.)
21
+
22
+ 1.0.4:
23
+
24
+ 1. [dbi] support ruby-dbi 0.4
25
+ (Thanks to James Cao and Peter Zingg.)
26
+
27
+ Ruby-dbi 0.4 is supported by DBD::OCI8 after 6 months from the
28
+ release of 0.4.
29
+
30
+ If you are using ruby-dbi 0.1.1, you need to copy dbd/OCI8.rb
31
+ to DBD/OCI8/OCI8.rb. The file itself works fine with ruby-dbi
32
+ 0.1.1, but the dbi cannot find the file by default.
33
+
34
+ 2. Rowid column data are fetched as a String by default.
35
+
36
+ 3. The return type of OCI8::Cursor#rowid is changed from OCIRowid
37
+ to String.
38
+
39
+ Note: It needs one network roundtrip to convert OCIRowid to
40
+ String on server side when using Oracle 8.x client.
41
+ On Oracle 9.0 or upper it is converted in the client side.
42
+
43
+ 4. An exception is raised if a connection is used in a process which is
44
+ different with a process to establish the connection.
45
+
46
+ If you encounter an exception "The connection cannot be reused in the
47
+ forked process," see the following link.
48
+
49
+ http://groups.google.com/group/phusion-passenger/browse_thread/thread/b00d4770bc1d00b8
50
+
51
+ 5. fix for 11.1.0.7.0 instant rpm package.
52
+ (reported by Luis Parravicini.)
53
+
54
+ The directory tree is a bit different with that of 11.1.0.6.0
55
+ or earlier.
56
+
57
+ 6. suppress compilation warnings.
58
+ (contributed by Daniel Berger)
59
+
60
+ 1.0.3:
61
+
62
+ 1. add workaround code for a losing character problem when reading CLOB.
63
+ (reported by Efren Yevale and Thomas Witt and fixed with Thomas Witt's help.)
64
+
65
+ The problem is happened at the following condition.
66
+
67
+ (a) Oracle client version is 10.2.0.4 or 11.1.0.6.
68
+ It doesn't happend when using 10.2.0.3 client or lower.
69
+ It doesn't depend on Oracle server version.
70
+
71
+ (b) The character set is a variable-length one.
72
+ e.g. AL32UTF8
73
+
74
+ 2. fix a problem when reading BLOB/CLOB over 1GB.
75
+ (reported by Jonathan Hadders.)
76
+
77
+ 3. [rails] fix a problem that OraNumber#to_json returns "{}" when using Rails.
78
+ (reported by Alex Moore)
79
+
80
+ Rails add to_json method. But it doesn't know what OraNumber is.
81
+ OraNumber#to_json is added for Rails.
82
+
83
+ 4. [dbi] fix a problem when using Oracle 8i and ruby-dbi.
84
+ (reported by Glauco Magnelli.)
85
+
86
+ 1.0.2:
87
+
88
+ 1. add a gemspec file.
89
+ (Thanks to Jesse Hu)
90
+
91
+ To make a pure ruby gems package:
92
+ gem build ruby-oci8.gemspec
93
+
94
+ To make a binary gems package:
95
+ gem build ruby-oci8.gemspec -- current
96
+
97
+
98
+ 2. [BUG FIX] fix a segv bug in gc mark.
99
+ (Thanks to authorNari)
100
+
101
+ 1.0.1:
102
+
103
+ 1. [SPEC CHANGE] OCI8#exec and OCI8::Cursor#exec's return value is changed
104
+ for statement except select, insert, update and delete statement.
105
+
106
+ It had been true. But now it is the number of rows processed for all
107
+ non-select statements.
108
+
109
+ For example:
110
+
111
+ # 1.0.0 or before
112
+ conn = OCI8.new('user/pass')
113
+ conn.exec('rename FOO_TABLE to BAR_TABLE') # => true
114
+
115
+ # 1.0.1
116
+ conn = OCI8.new('user/pass')
117
+ conn.exec('rename FOO_TABLE to BAR_TABLE') # => 0
118
+
119
+ 2. fix a bug that OraDate.new made a core dump on x86_64 linux.
120
+ (reported by Alun Eyre)
121
+
122
+ 3. fix OCI8#non_blocking = false problem.
123
+ Once the connection became non-bocking mode, it could
124
+ not be reset to blocking mode. Now it can be reset.
125
+ (reported by Cagdas Gerede)
126
+
127
+ 4. support cursors in a result set.
128
+ (contributed by Randy Gordon)
129
+
130
+ For example:
131
+ conn = OCI8.new('ruby/oci8')
132
+ sql = 'SELECT CURSOR(SELECT * FROM foo where foo.c1 = bar.c1 ) FROM bar'
133
+ conn.exec(sql) do |row|
134
+ cursor_in_result_set = row[0]
135
+ cursor_in_result_set.fetch do |row|
136
+ puts row.join(',')
137
+ end
138
+ end
139
+
140
+ 5. fix oraconf.rb for official x86_64 linux rpms.
141
+ (contributed by Pat)
142
+
143
+ 1.0.0:
144
+
145
+ 1. fix a BUG when binding a Bignum. This bug was added in
146
+ ruby-oci8 1.0.0-rc2. (reported by Daniel Berger)
147
+
148
+ 2. add OCI8#describe_table(table_name), OCI8::Cursor#column_metadata,
149
+ OCI8::Metadata::Table, OCI8::Metadata::View and OCI8::Metadata::Column.
150
+
151
+ table information:
152
+ con = OCI8.new('username/password')
153
+ table_info = con.describe_table('table_name') #=> OCI8::Metadata::Table
154
+ table_info.columns #=> an array of OCI8::Metadata::Column.
155
+
156
+ query information:
157
+ con = OCI8.new('username/password')
158
+ csr = con.exec('select * from table_name')
159
+ csr.column_metadata #=> an array of OCI8::Metadata::Column.
160
+
161
+ 5. add OCI8::BindType::BinaryDouble if oci8lib.so is compiled for
162
+ Oracle 10g client. You can fetch exactly same values in Oracle.
163
+
164
+ You could fetch the values in previous version by adding the
165
+ following line.
166
+
167
+ OCI8::BindType::Mapping[101] = OCI8::BindType::Float
168
+ (This is default in ruby-oci8 1.0.0-rc2.)
169
+
170
+ But a fetched value may not be exactly same with the value in
171
+ Oracle. That's because OCI8::BindType::Float's network
172
+ representation is Oracle NUMBER data type. A BINARY_DOUBLE
173
+ value in Oracle become NUMBER on the network and is converted
174
+ to Float on the client side. It makes a bit difference by
175
+ round-off error.
176
+
177
+ In addition, Oracle NUMBER doesn't have NaN, +Infinity and -Infinity.
178
+ You cannot fetch the values by older versions.
179
+
180
+ Note: When you bind a Float value, it is bound by
181
+ OCI8::BindType::Float by default. You have two ways to bind
182
+ it by OCI8::BindType::BinaryDouble.
183
+
184
+ a. bind explicitly.
185
+
186
+ con = OCI8.new('ruby/oci8')
187
+ csr = con.parse('insert into table_name values (:1)')
188
+ csr.bind_param(1, 10.5, OCI8::SQLT_IBDOUBLE)
189
+ csr.exec
190
+
191
+ b. change the default behaviour if and only if you are sure that
192
+ the Oracle client version and Oracle server version are both
193
+ 10g or upper.
194
+
195
+ # use OCI8::BindType::BinaryDouble for ruby's Float values.
196
+ OCI8::BindType::Mapping[Float] = OCI8::BindType::BinaryDouble
197
+ con = OCI8.new('ruby/oci8')
198
+ csr = con.exec('insert into table_name values (:1)', 10.5)
199
+
200
+ 4. OCI8::Cursor#fetch_hash accepts a block as a iterator.
201
+
202
+ 5. [dbi] support external OS authentication.
203
+ (contributed by Dan Fitch)
204
+
205
+ dbh = DBI.connect('dbi:OCI8', nil, nil)
206
+
207
+ 6. [dbi] add DatabaseHandle#columns and improve StatementHandle#column_info
208
+ (suggested by Venkat Pa)
209
+
210
+ 7. [bug] fix a problem when binding ''(empty string) via dbi.
211
+
212
+ 1.0.0-rc3:
213
+
214
+ 1. support external OS authentication.
215
+ (suggested by Dan Fitch)
216
+
217
+ conn = OCI8.new('/')
218
+ or
219
+ conn = OCI8.new(nil, nil)
220
+
221
+ 2. incompatible change on connect string.
222
+
223
+ You need to pass only one argument to OCI8.new to parse the
224
+ first argument as a SQL*Plus-like connect string.
225
+
226
+ For example, OCI8.new('scott/tiger', nil) was parsed as the
227
+ username is 'scott' and the password is 'tiger' in 1.0.0-rc2.
228
+ But from now on, it is treated as the username is 'scott/tiger'
229
+ and the password is nil because it has two arguments. You need
230
+ to use OCI8.new('scott/tiger') instead.
231
+
232
+ 3. fix NCLOB support on Oracle 9i.
233
+ (reported by Matthew Noble)
234
+
235
+ 1.0.0-rc2's NCLOB support worked on Oracle 10g only.
236
+
237
+ 4. fix a problem to compile with a third-party x86_64 rpm package.
238
+ (contributed by Jeff Abbott)
239
+
240
+ The x86_64 source rpm packages are found on the following URLs.
241
+ http://freshrpms.net/docs/oracle/
242
+ http://remi.collet.free.fr/index.php?2007/01/22/279-oracle-instant-client-10203-on-x86_64
243
+
244
+ 5. '--with-instant-client' option become obsolete and is ignored.
245
+
246
+ Use LD_LIBRARY_PATH(Linux), PATH(Windows), etc. to indicate
247
+ the instant client's location.
248
+
249
+ 6. fix some other minor problems.
250
+
251
+ 1.0.0-rc2:
252
+
253
+ 1. support SQL*Plus-like connect strings.
254
+ (contributed by Oracle Corporation)
255
+
256
+ require 'oci8'
257
+ conn = OCI8.new('username/password@tns_name')
258
+ # instead of OCI8.new('username', 'password', 'tns_name')
259
+
260
+ 2. Add a rpm spec file.
261
+ (contributed by Brian Candler)
262
+
263
+ rpmbuild -tb ruby-oci8-x.y.z.tar.gz
264
+
265
+ /usr/src/redhat/RPMS/i386/ruby-oci8-x.y.z-1.i386.rpm
266
+
267
+ 3. support BINARY_FLOAT and BINADY_DOUBLE columns.
268
+ (This problem is reported by Duncan McCaffery.)
269
+
270
+ 4. support NCLOB columns.
271
+ (This problem is reported by Dmitry Zadvornykh.)
272
+
273
+ cursor = conn.exec('select nclob_column from nclob_table')
274
+ cursor.fetch # => [ instance of OCI8::NCLOB ]
275
+
276
+ 5. add new CLOB/NCLOB/BLOB insert method.
277
+ (This is available on Oracle 8.1.5 or later.)
278
+
279
+ cursor = conn.parse("INSERT INTO clob_table VALUES (:1)")
280
+ cursor.bind_param(1, OCI8::CLOB.new(conn, lob_data))
281
+ cursor.exec
282
+
283
+ cursor = conn.parse("INSERT INTO nclob_table VALUES (:1)")
284
+ cursor.exec(OCI8::NCLOB.new(conn, lob_data))
285
+
286
+ conn.exec("INSERT INTO blob_table VALUES (:1)",
287
+ OCI8::BLOB.new(conn, lob_data))
288
+
289
+ This is added to insert CLOB as a SDO_GEOMETRY's parameter
290
+ to solve a problem reported by Pete Schwamb.
291
+
292
+ 6. add an error location in C code to OCIException's backtrace.
293
+ This is for debug information.
294
+
295
+ 1.0.0-rc1:
296
+
297
+ 1. support BFILE columns.
298
+
299
+ 2. check whether Full Client or Instant Client by checking load library
300
+ path on configuration to compile.
301
+
302
+ 3. raise an OCIError with "OCI Library Initialization Error" message if
303
+ no message can not be retrieved when requiring oci8lib.so.
304
+
305
+ 4. raise "OCI Library Initialization Error" when first connect instead
306
+ of requiring oci8lib.so. This is a workaround to prevent Rails from
307
+ being stopped on invalid Oracle environment.
308
+
309
+ 0.1.16:
310
+
311
+ 1. Add LONG and LONG RAW support longer than 65535 bytes.
312
+
313
+ Use OCI8#long_read_len and OCI8#long_read_len= to set max long length.
314
+ The default value is 65535.
315
+
316
+ 2. OraDate and OraNumber can be serialized by Marshal now.
317
+
318
+ 3. OraDate and OraNumber can be serialized by YAML now.
319
+
320
+ 4. Fix bug on OraDate#dup, OraDate#clone, OraNumber#dup and OraNumber#clone.
321
+ (reported by Daniel Berger.)
322
+
323
+ These methods had not duplicated their contents, which caused segmentation
324
+ fault. Now they duplicate their contents also by adding initialize_copy
325
+ method.
326
+
327
+ 5. Add a workaround code on cygwin environment variables problem.
328
+
329
+ Cygwin manages environment variables by itself. They don't synchroize
330
+ with Win32's ones. When setting Oracle's environment variables, they
331
+ are set to cygwin's environment. But Oracle client library read
332
+ Win32's. Now Oracle-related variables are forcedly set to Win32.
333
+
334
+ 6. Accept all Fixnum values when binding as a Fixnum on 64-bit ruby.
335
+
336
+ A Fixnum is a 31-bit integer on 32-bit ruby, 63-bit integer on 64-bit
337
+ ruby. But it had been bound to 32-bit integer on ruby-oci8. Now it is
338
+ bound to integer whose bit width is same with ruby.
339
+
340
+ 0.1.15:
341
+
342
+ 1. no new features. :-<
343
+
344
+ 2. suppress memory usage when binding a placeholder which is already bound.
345
+
346
+ require 'oci8'
347
+ conn = OCI8.new('ruby', 'oci8')
348
+ cursor = conn.parse('select * from foo where key = :key')
349
+ 0.upto(10000) do |key|
350
+ # bind values had not freed until cursor.close.
351
+ # Now they are freed when GC is run.
352
+ cursor.bind_param('key', key)
353
+ cursor.exec
354
+ .... fetch ....
355
+ end
356
+
357
+ 3. fix potentially segmentation fault while exiting process.
358
+ When exiting process, ruby's objects are GCed with unexpectable
359
+ order. If an OCIEnv instance was GCed in prior to OCIRowid objects,
360
+ it caused segmentation fault.
361
+
362
+ 4. add a workaround code when setting $0.
363
+ The following code made enviroment variables empty strings on
364
+ Unix when using ruby 1.8.4, ruby-oci8 0.1.14 and Oracle 10.1.0.
365
+ (Oracle 10.2.0 and ruby 1.8.2 doesn't have this problem.)
366
+
367
+ require 'oci8'
368
+ ENV['HOME'] # --> valid value
369
+ $0 = 'foo'
370
+ ENV['HOME'] # --> ''
371
+
372
+ 5. fix registry search path on compilation.
373
+ (OracleXE Windows version)
374
+
375
+ 0.1.14:
376
+
377
+ 1. add OCI8#prefetch_rows=.
378
+
379
+ This specifies the number of rows in a single round trip.
380
+ See: http://www.easysoft.com/products/data_access/odbc_oracle_driver/performance_tuning_guide.html#multiple_rows
381
+ In addition, setting zero may become a workaround
382
+ of some Oracle internal problems.
383
+ The default value is one.
384
+
385
+ 2. fix bug when binding a Bignum.
386
+ 3. (low-level API) add attrSet(OCI_ATTR_DESC_PUBLIC, -1).
387
+ 4. (low-level API) add a constant OCI_PTYPE_UNK.
388
+ 5. (internal) use OCIEnv.logon when no priviledge login.
389
+ 6. (internal) delete code to register malloc/realloc/free callbacks to OCI.
390
+
391
+ 0.1.13:
392
+
393
+ 1. fix a memory leak.
394
+ (fixed by Nathaniel Talbott.)
395
+
396
+ It is recommended to update to 0.1.13 if a program executes many
397
+ queries. That's bacause 0.1.12 cause 70-byte memory leak per a
398
+ query.
399
+
400
+ 2. ruby's DateTime support is added.
401
+ (suggested by Daniel Berger.)
402
+
403
+ To fetch Oracle's DATE datatype as ruby's DateTime by default, add
404
+ the following code to your program.
405
+
406
+ OCI8::BindType::Mapping[OCI8::SQLT_DAT] = OCI8::BindType::DateTime
407
+ OCI8::BindType::Mapping[OCI8::SQLT_TIMESTAMP] = OCI8::BindType::DateTime