ruby-oci8 2.0.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/ChangeLog +1912 -0
  2. data/Makefile +96 -0
  3. data/NEWS +223 -0
  4. data/README +86 -0
  5. data/VERSION +1 -0
  6. data/dist-files +77 -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/lib/.document +1 -0
  13. data/lib/dbd/OCI8.rb +591 -0
  14. data/lib/oci8.rb +82 -0
  15. data/lib/oci8.rb.in +82 -0
  16. data/lib/oci8/.document +5 -0
  17. data/lib/oci8/bindtype.rb +319 -0
  18. data/lib/oci8/compat.rb +113 -0
  19. data/lib/oci8/datetime.rb +619 -0
  20. data/lib/oci8/encoding-init.rb +40 -0
  21. data/lib/oci8/encoding.yml +537 -0
  22. data/lib/oci8/metadata.rb +2077 -0
  23. data/lib/oci8/object.rb +562 -0
  24. data/lib/oci8/oci8.rb +571 -0
  25. data/lib/oci8/oracle_version.rb +144 -0
  26. data/lib/oci8lib_18.so +0 -0
  27. data/lib/oci8lib_191.so +0 -0
  28. data/metaconfig +142 -0
  29. data/pre-distclean.rb +7 -0
  30. data/ruby-oci8.gemspec +63 -0
  31. data/setup.rb +1331 -0
  32. data/test/README +4 -0
  33. data/test/config.rb +109 -0
  34. data/test/test_all.rb +50 -0
  35. data/test/test_appinfo.rb +63 -0
  36. data/test/test_array_dml.rb +333 -0
  37. data/test/test_bind_raw.rb +46 -0
  38. data/test/test_bind_time.rb +178 -0
  39. data/test/test_break.rb +83 -0
  40. data/test/test_clob.rb +79 -0
  41. data/test/test_connstr.rb +81 -0
  42. data/test/test_datetime.rb +622 -0
  43. data/test/test_dbi.rb +366 -0
  44. data/test/test_dbi_clob.rb +53 -0
  45. data/test/test_encoding.rb +100 -0
  46. data/test/test_metadata.rb +257 -0
  47. data/test/test_oci8.rb +434 -0
  48. data/test/test_oracle_version.rb +70 -0
  49. data/test/test_oradate.rb +256 -0
  50. data/test/test_oranumber.rb +655 -0
  51. data/test/test_rowid.rb +33 -0
  52. metadata +108 -0
@@ -0,0 +1,96 @@
1
+ VERSION = `cat VERSION`
2
+ RUBY = ruby -w
3
+ RDOC = rdoc
4
+
5
+ all: build
6
+
7
+ build: config.save setup
8
+
9
+ config.save: lib/oci8.rb.in
10
+ $(RUBY) setup.rb config
11
+
12
+ setup:
13
+ $(RUBY) setup.rb setup
14
+
15
+ check: build
16
+ $(RUBY) setup.rb test
17
+
18
+ clean:
19
+ $(RUBY) setup.rb clean
20
+
21
+ distclean:
22
+ $(RUBY) setup.rb distclean
23
+
24
+ install:
25
+ $(RUBY) setup.rb install
26
+
27
+ site-install:
28
+ $(RUBY) setup.rb install
29
+
30
+ format_c_source:
31
+ astyle --options=none --style=linux --indent=spaces=4 --brackets=linux --suffix=none ext/oci8/*.[ch]
32
+
33
+ # internal use only
34
+ .PHONY: rdoc check-rdoc-version run-rdoc
35
+
36
+ rdoc: check-rdoc-version run-rdoc
37
+
38
+ check-rdoc-version:
39
+ @echo check rdoc version
40
+ @expr match "`$(RDOC) --version`" '^rdoc 2\.4' > /dev/null || (echo 'rdoc version is not 2.4.'; exit 1)
41
+
42
+ run-rdoc:
43
+ TZ= $(RDOC) -o rdoc -c us-ascii --threads=1 -W http://ruby-oci8.rubyforge.org/svn/trunk/ruby-oci8/ ext/oci8 lib
44
+
45
+ dist:
46
+ -rm -rf ruby-oci8-$(VERSION)
47
+ mkdir ruby-oci8-$(VERSION)
48
+ tar cf - `cat dist-files` | (cd ruby-oci8-$(VERSION); tar xf - )
49
+ tar cfz ruby-oci8-$(VERSION).tar.gz ruby-oci8-$(VERSION)
50
+
51
+ dist-check: dist
52
+ cd ruby-oci8-$(VERSION) && $(MAKE) RUBY="$(RUBY)"
53
+ cd ruby-oci8-$(VERSION) && $(MAKE) RUBY="$(RUBY)" check
54
+ cd ruby-oci8-$(VERSION)/src && $(MAKE) RUBY="$(RUBY)" sitearchdir=../work sitelibdir=../work site-install
55
+ cd ruby-oci8-$(VERSION)/test && $(RUBY) -I../work -I../support test_all.rb
56
+
57
+ #
58
+ # for Windows
59
+ #
60
+ RUBY_18 = c:\ruby
61
+ RUBY_191 = c:\ruby-1.9.1
62
+ GEMPKG = ruby-oci8-2.0.3-x86-mswin32-60.gem
63
+
64
+ ext\oci8\oci8lib_18.so:
65
+ $(RUBY_18)\bin\ruby -r fileutils -e "FileUtils.rm_rf('ruby18')"
66
+ md ruby18
67
+ cd ruby18
68
+ $(RUBY_18)\bin\ruby ..\setup.rb config -- --with-runtime-check
69
+ $(RUBY_18)\bin\ruby ..\setup.rb setup
70
+ rem $(RUBY_18)\bin\ruby ..\setup.rb test
71
+ cd ..
72
+ copy ruby18\ext\oci8\oci8lib_18.so ext\oci8\oci8lib_18.so
73
+
74
+ ext\oci8\oci8lib_191.so:
75
+ $(RUBY_191)\bin\ruby -r fileutils -e "FileUtils.rm_rf('ruby191')"
76
+ md ruby191
77
+ cd ruby191
78
+ $(RUBY_191)\bin\ruby ..\setup.rb config -- --with-runtime-check
79
+ $(RUBY_191)\bin\ruby ..\setup.rb setup
80
+ rem $(RUBY_191)\bin\ruby ..\setup.rb test
81
+ cd ..
82
+ copy ruby191\ext\oci8\oci8lib_191.so ext\oci8\oci8lib_191.so
83
+ copy ruby191\lib\oci8.rb lib\oci8.rb
84
+
85
+ $(GEMPKG): ext\oci8\oci8lib_18.so ext\oci8\oci8lib_191.so ruby-oci8.gemspec
86
+ $(RUBY_191)\bin\gem build ruby-oci8.gemspec -- current
87
+
88
+ test-win32-ruby18: $(GEMPKG)
89
+ $(RUBY_18)\bin\gem install $(GEMPKG) --no-rdoc --no-ri --local
90
+ $(RUBY_18)\bin\ruby -rubygems test\test_all.rb
91
+
92
+ test-win32-ruby191: $(GEMPKG)
93
+ $(RUBY_191)\bin\gem install $(GEMPKG) --no-rdoc --no-ri --local
94
+ $(RUBY_191)\bin\ruby test\test_all.rb
95
+
96
+ test-win32: test-win32-ruby18 test-win32-ruby191
data/NEWS ADDED
@@ -0,0 +1,223 @@
1
+ 2.0.4:
2
+
3
+ * New Features
4
+
5
+ - OCI8.error_message(message_no) -> string
6
+
7
+ Gets the Oracle error message specified by message id.
8
+ Its language depends on NLS_LANGUAGE.
9
+
10
+ Note: This method is unavailable if the Oracle client
11
+ version is 8.0.
12
+
13
+ # When NLS_LANG is AMERICAN_AMERICA.AL32UTF8
14
+ OCI8.error_message(1)
15
+ # => "ORA-00001: unique constraint (%s.%s) violated"
16
+
17
+ # When NLS_LANG is FRENCH_FRANCE.AL32UTF8
18
+ OCI8.error_message(1)
19
+ # => "ORA-00001: violation de contrainte unique (%s.%s)"
20
+
21
+ - OraNumber#dump -> string
22
+
23
+ Returns OraNumber's internal representation whose format
24
+ is same with the return value of Oracle SQL function DUMP().
25
+
26
+ OraNumber.new(100).dump #=> "Typ=2 Len=2: 194,2"
27
+ OraNumber.new(123).dump #=> "Typ=2 Len=3: 194,2,24"
28
+ OraNumber.new(0.1).dump #=> "Typ=2 Len=2: 192,11"
29
+
30
+ * Fixed issues
31
+
32
+ - Fractional second part is lost when ruby's Time instance is bound
33
+ to Oracle datatype TIMESTAMP.
34
+ (reported by Raimonds Simanovskis)
35
+
36
+ - OraNumber#to_i and OraNumber#to_s fail when its scale is larger
37
+ than 38.
38
+ (reported by Raimonds Simanovskis)
39
+
40
+ - Memory leak about 30 bytes per one place holder for object type.
41
+
42
+ - Segmentation fault when a collection of string is bound.
43
+ (reported by Raimonds Simanovskis)
44
+
45
+ - Segmentation fault when GC starts while initializing a bind
46
+ object for object type.
47
+ (reported by Remi Gagnon)
48
+
49
+ - Segmentation fault when OCI8::Cursor#fetch is called prior to
50
+ OCI8::Cursor#exec.
51
+
52
+ - Detailed error message is not reported when PL/SQL NO_DATA_FOUND
53
+ exception is raised.
54
+ (reported by Raimonds Simanovskis)
55
+
56
+ 2.0.3:
57
+
58
+ * Incompatible Changes
59
+
60
+ - Number column in a SQL statement
61
+
62
+ Changes the default data type for number column which fit neither
63
+ Integer nor Float from OraNumber to BigDecimal.
64
+
65
+ conn.exec("select 1.0 from dual") do |row|
66
+ p row[0] # => BigDecimal("1") if the ruby-oci8 version is 2.0.3.
67
+ # => OraNumber(1) if the version is 2.0.2.
68
+ end
69
+
70
+ - Priority of OraNumber within numerical types
71
+
72
+ The return types of basic arithmetic operations with other numerical
73
+ types are changed.
74
+
75
+ 2.0.3:
76
+ OraNumber + Integer => OraNumber (OraNumber wins.)
77
+ OraNumber + Float => Float (OraNumber loses.)
78
+ OraNumber + Rational => Rational (OraNumber loses.)
79
+ OraNumber + BigDecimal => BigDecimal (OraNumber loses.)
80
+
81
+ 2.0.2:
82
+ OraNumber + Integer => OraNumber (OraNumber wins always.)
83
+ OraNumber + Float => OraNumber
84
+ OraNumber + Rational => OraNumber
85
+ OraNumber + BigDecimal => OraNumber
86
+
87
+ - Interval day to second
88
+
89
+ The retrived value of Oracle data type "interval day to second"
90
+ was changed from the number of days as a Rational to the number
91
+ of seconds as a Float by default.
92
+ Use OCI8::BindType::IntervalDS.unit = :day to make it compatible
93
+ with the previous versions.
94
+
95
+ conn.exec("select to_dsinterval('0 00:00:01') from dual") do |row|
96
+ p row[0] # => 1.0 if the version is 2.0.3 and
97
+ # OCI8::BindType::IntervalDS.unit is :second.
98
+ # => (1/86400) if the version is 2.0.3 and
99
+ # OCI8::BindType::IntervalDS.unit is :day or
100
+ # the version is 2.0.2.
101
+ end
102
+
103
+ - Date, timestamp, timestamp with time zone data types and ruby 1.9.2
104
+
105
+ These data types are retrived always as Time values when the
106
+ ruby version is 1.9.2 because the Time class is enhanced to
107
+ represent any time zone and is free from year 2038 problem.
108
+
109
+ Prior to ruby 1.9.2, if the time cannot be represented by
110
+ Unix time or the time zone is neither utc nor local, they are
111
+ retrived as DateTime values.
112
+
113
+ - Non-blocking mode and ruby 1.9
114
+
115
+ non-blocking mode is enabled by default when the ruby is 1.9.
116
+
117
+ * New Features
118
+
119
+ - BigDecimal and Rational are availabe as bind values.
120
+
121
+ - New methods OCI8#module=, OCI8#action= and OCI8#client_info= are added.
122
+
123
+ These methods change the module name, the action name and the client_info
124
+ in the current session respectively.
125
+
126
+ After Oracle 10g client, these don't perform network round trips.
127
+ The change is reflected to the server by the next round trip such as
128
+ OCI8#exec, OCI8#ping, etc.
129
+
130
+ Prior to Oracle 10g client, these call PL/SQL functions such as
131
+ DBMS_APPLICATION_INFO.SET_MODULE, DBMS_APPLICATION_INFO.SET_ACTION,
132
+ and DBMS_APPLICATION_INFO.SET_CLIENT_INFO internally.
133
+ The change is reflected immediately by a network round trip.
134
+
135
+ - OCI8::BindType.default_timezone
136
+
137
+ The default time zone of Time or DateTime values.
138
+ This parameter is used only when
139
+ (1) date values are fetched and the Oracle client version is 8.x
140
+ or
141
+ (2) object types have date data type attributes.
142
+
143
+ Note that if the Oracle client version is 9i or upper, the time
144
+ zone is determined by the session time zone. The default value
145
+ is local time zone. You can change it to GMT by executing the
146
+ following SQL statement for each connection.
147
+
148
+ alter session set time_zone = '00:00'
149
+
150
+ * Other specification changes
151
+
152
+ - Add a global function OraNumber(obj) as a shortcut of OraNumber.new(obj)
153
+ as Rational and BigDecimal do.
154
+
155
+ - Fix to accept nil attribute in object type's
156
+ constructors. This works only for simple data types such as number,
157
+ string. But it doesn't for complex types such as object types.
158
+ (requested by Remi Gagnon)
159
+
160
+ - add DATE datatype support in object types.
161
+
162
+ - Change OCI8::LOB#write to accept an object which is not a String and
163
+ doesn't respond to 'to_str' as IO#write does.
164
+ (requested by Christopher Jones)
165
+
166
+ - Change the initial polling interval of
167
+ non-blocking mode for ruby 1.8 from 100 msec to 10 msec, which
168
+ is same with ruby-oci8 1.0.
169
+
170
+ * Fixed installation issues.
171
+
172
+ - Fix oraconf.rb for ruby 1.8.5 with Oracle 8.x which needs some object
173
+ files to link with.
174
+ (reported by Jayson Cena)
175
+
176
+ - Fix oraconf.rb for ruby 1.9.2 preview1.
177
+ (pointed by Raimonds Simanovskis)
178
+
179
+ - Fix oraconf.rb to compile for AIX instant clients.
180
+ (reported by Kazuya Teramoto)
181
+
182
+ 2.0.2:
183
+
184
+ * add new methods
185
+ - OCI8#select_one(sql, *bindvars) -> first_row
186
+
187
+ - OCI8#ping -> true or false
188
+
189
+ Verifies that the Oracle connection is alive.
190
+ OCI8#ping also can be used to flush all the pending OCI
191
+ client-side calls to the server if any exist.
192
+
193
+ - OCI8#client_identifier = client_id
194
+
195
+ Look at the following link to know what is the client identifier.
196
+ http://it.toolbox.com/blogs/database-solutions/oracle-session-tracing-part-i-16356
197
+
198
+ Note that the specified identifier doesn't change the v$session
199
+ immediately. It is done by the next network round trip
200
+ such as OCI8#exec or OCI8#ping.
201
+
202
+ * fix problems when compiling with Oracle 9.2 and 8.0.
203
+ (reported by Axel Reinhold)
204
+
205
+ * [dbi] fix to pass a newly added sanity check in dbi 0.4.1.
206
+ (reported by Dirk Herzhauser)
207
+
208
+ * fix an error when executing "select NULL from dual".
209
+ http://rubyforge.org/forum/forum.php?thread_id=32468&forum_id=1078
210
+ (contributed by Raimonds Simanovskis)
211
+
212
+ * [ruby 1.9] fix OCI8::BLOB to read/write binary. Prior to 2.0.1,
213
+ it was treated as text tagged with NLS_LANG encoding.
214
+
215
+ * [ruby 1.9] fix to bind string data by the length got from String#bytesize
216
+ converted to OCI8.encoding, not by String#size.
217
+
218
+ 2.0.1:
219
+
220
+ * release a binary gem for Windows, which contains libraries for both
221
+ ruby 1.8 and ruby 1.9.1.
222
+ * add OCI8#oracle_server_version.
223
+ * fix bugs when fetching and binding time objects.
data/README ADDED
@@ -0,0 +1,86 @@
1
+ = How to make
2
+
3
+ * <tt>ruby</tt> and <tt>make</tt> (or nmake on MSVC) commands in the environment variable <tt>PATH</tt>?
4
+ * <tt>ruby</tt> is 1.8.0 or later? (Use ruby-oci8 0.1.x for ruby 1.6.x.)
5
+
6
+ == For OCI installed by Oracle Universal Installer
7
+ make sure the environment variable ORACLE_HOME (or registry on Windows)
8
+ is set correctly. run the the following commands.
9
+
10
+ make (or nmake on MSVC)
11
+
12
+ == For OCI installed by Oracle Instant Installer
13
+
14
+ linux:
15
+ ruby setup.rb config -- --with-instant-client
16
+ make
17
+
18
+ others:
19
+ ruby setup.rb config -- --with-instant-client=/path/to/instantclient10_1
20
+ make (or nmake on MSVC)
21
+
22
+ = On compilation failure
23
+
24
+ Please report the following information to kubo@jiubao.org.
25
+
26
+ * last 100 lines of 'ext/oci8/mkmf.log'.
27
+ * the results of the following commands:
28
+ ruby -r rbconfig -e "p Config::CONFIG['host']"
29
+ ruby -r rbconfig -e "p Config::CONFIG['CC']"
30
+ ruby -r rbconfig -e "p Config::CONFIG['CFLAGS']"
31
+ ruby -r rbconfig -e "p Config::CONFIG['LDSHARED']"
32
+ ruby -r rbconfig -e "p Config::CONFIG['LDFLAGS']"
33
+ ruby -r rbconfig -e "p Config::CONFIG['LIBS']"
34
+ ruby -r rbconfig -e "p Config::CONFIG['GNU_LD']"
35
+ * if you use gcc:
36
+ gcc --print-prog-name=ld
37
+ gcc --print-prog-name=as
38
+ * on platforms which can use both 32bit/64bit binaries:
39
+ file $ORACLE_HOME/bin/oracle
40
+ file `which ruby`
41
+ echo $LD_LIBRARY_PATH
42
+
43
+ = How to run unit test
44
+
45
+ before runing unit test,
46
+ 1. connect to Oracle as system:
47
+
48
+ $ sqlplus system/<password_of_system>
49
+
50
+ 2. create user ruby:
51
+
52
+ SQL> CREATE USER ruby IDENTIFIED BY oci8;
53
+
54
+ or
55
+
56
+ SQL> CREATE USER ruby IDENTIFIED BY oci8
57
+ 2 DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
58
+
59
+ 3. grant the privilege to connect and execute.
60
+
61
+ SQL> GRANT connect, resource TO ruby;
62
+
63
+ 4. If the Oracle version is 8i or later:
64
+
65
+ SQL> CREATE TABLE ruby.test_clob (filename VARCHAR2(40), content CLOB);
66
+
67
+ 5. connect to Oracle as sys
68
+
69
+ $ sqlplus 'sys/<password_of_sys> as sysdba'
70
+
71
+ 6. grant the privilege for the unittest of blocking-mode.
72
+
73
+ SQL> GRANT EXECUTE ON dbms_lock TO ruby;
74
+
75
+ 7. change test/config.rb as you like
76
+
77
+ Then you can run:
78
+ $ make check
79
+ or
80
+ $ nmake check (If your compiler is MS Visual C++.)
81
+
82
+ = TODO
83
+
84
+ * more proper handling of OCI_SUCCESS_WITH_INFO.
85
+ * more proper handling of NUMBER without its scale values.
86
+ * support Timestamp.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.0.4
@@ -0,0 +1,77 @@
1
+ ChangeLog
2
+ Makefile
3
+ NEWS
4
+ README
5
+ VERSION
6
+ dist-files
7
+ metaconfig
8
+ pre-distclean.rb
9
+ ruby-oci8.gemspec
10
+ setup.rb
11
+ doc/api.en.html
12
+ doc/api.en.rd
13
+ doc/api.ja.html
14
+ doc/api.ja.rd
15
+ doc/manual.css
16
+ ext/oci8/.document
17
+ ext/oci8/MANIFEST
18
+ ext/oci8/apiwrap.c.tmpl
19
+ ext/oci8/apiwrap.h.tmpl
20
+ ext/oci8/apiwrap.rb
21
+ ext/oci8/apiwrap.yml
22
+ ext/oci8/attr.c
23
+ ext/oci8/bind.c
24
+ ext/oci8/encoding.c
25
+ ext/oci8/env.c
26
+ ext/oci8/error.c
27
+ ext/oci8/extconf.rb
28
+ ext/oci8/lob.c
29
+ ext/oci8/metadata.c
30
+ ext/oci8/oci8.c
31
+ ext/oci8/oci8.h
32
+ ext/oci8/oci8lib.c
33
+ ext/oci8/ocidatetime.c
34
+ ext/oci8/ocihandle.c
35
+ ext/oci8/ocinumber.c
36
+ ext/oci8/oraconf.rb
37
+ ext/oci8/oradate.c
38
+ ext/oci8/oranumber_util.c
39
+ ext/oci8/oranumber_util.h
40
+ ext/oci8/post-config.rb
41
+ ext/oci8/stmt.c
42
+ ext/oci8/object.c
43
+ ext/oci8/win32.c
44
+ ext/oci8/xmldb.c
45
+ lib/.document
46
+ lib/oci8.rb.in
47
+ lib/dbd/OCI8.rb
48
+ lib/oci8/.document
49
+ lib/oci8/bindtype.rb
50
+ lib/oci8/compat.rb
51
+ lib/oci8/datetime.rb
52
+ lib/oci8/encoding-init.rb
53
+ lib/oci8/encoding.yml
54
+ lib/oci8/metadata.rb
55
+ lib/oci8/object.rb
56
+ lib/oci8/oci8.rb
57
+ lib/oci8/oracle_version.rb
58
+ test/README
59
+ test/config.rb
60
+ test/test_all.rb
61
+ test/test_appinfo.rb
62
+ test/test_array_dml.rb
63
+ test/test_bind_raw.rb
64
+ test/test_bind_time.rb
65
+ test/test_break.rb
66
+ test/test_clob.rb
67
+ test/test_connstr.rb
68
+ test/test_encoding.rb
69
+ test/test_datetime.rb
70
+ test/test_dbi.rb
71
+ test/test_dbi_clob.rb
72
+ test/test_metadata.rb
73
+ test/test_oci8.rb
74
+ test/test_oracle_version.rb
75
+ test/test_oradate.rb
76
+ test/test_oranumber.rb
77
+ test/test_rowid.rb