forked from kubo/ruby-oci8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NEWS
223 lines (155 loc) · 7.4 KB
/
NEWS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
2.0.4:
* New Features
- OCI8.error_message(message_no) -> string
Gets the Oracle error message specified by message id.
Its language depends on NLS_LANGUAGE.
Note: This method is unavailable if the Oracle client
version is 8.0.
# When NLS_LANG is AMERICAN_AMERICA.AL32UTF8
OCI8.error_message(1)
# => "ORA-00001: unique constraint (%s.%s) violated"
# When NLS_LANG is FRENCH_FRANCE.AL32UTF8
OCI8.error_message(1)
# => "ORA-00001: violation de contrainte unique (%s.%s)"
- OraNumber#dump -> string
Returns OraNumber's internal representation whose format
is same with the return value of Oracle SQL function DUMP().
OraNumber.new(100).dump #=> "Typ=2 Len=2: 194,2"
OraNumber.new(123).dump #=> "Typ=2 Len=3: 194,2,24"
OraNumber.new(0.1).dump #=> "Typ=2 Len=2: 192,11"
* Fixed issues
- Fractional second part is lost when ruby's Time instance is bound
to Oracle datatype TIMESTAMP.
(reported by Raimonds Simanovskis)
- OraNumber#to_i and OraNumber#to_s fail when its scale is larger
than 38.
(reported by Raimonds Simanovskis)
- Memory leak about 30 bytes per one place holder for object type.
- Segmentation fault when a collection of string is bound.
(reported by Raimonds Simanovskis)
- Segmentation fault when GC starts while initializing a bind
object for object type.
(reported by Remi Gagnon)
- Segmentation fault when OCI8::Cursor#fetch is called prior to
OCI8::Cursor#exec.
- Detailed error message is not reported when PL/SQL NO_DATA_FOUND
exception is raised.
(reported by Raimonds Simanovskis)
2.0.3:
* Incompatible Changes
- Number column in a SQL statement
Changes the default data type for number column which fit neither
Integer nor Float from OraNumber to BigDecimal.
conn.exec("select 1.0 from dual") do |row|
p row[0] # => BigDecimal("1") if the ruby-oci8 version is 2.0.3.
# => OraNumber(1) if the version is 2.0.2.
end
- Priority of OraNumber within numerical types
The return types of basic arithmetic operations with other numerical
types are changed.
2.0.3:
OraNumber + Integer => OraNumber (OraNumber wins.)
OraNumber + Float => Float (OraNumber loses.)
OraNumber + Rational => Rational (OraNumber loses.)
OraNumber + BigDecimal => BigDecimal (OraNumber loses.)
2.0.2:
OraNumber + Integer => OraNumber (OraNumber wins always.)
OraNumber + Float => OraNumber
OraNumber + Rational => OraNumber
OraNumber + BigDecimal => OraNumber
- Interval day to second
The retrived value of Oracle data type "interval day to second"
was changed from the number of days as a Rational to the number
of seconds as a Float by default.
Use OCI8::BindType::IntervalDS.unit = :day to make it compatible
with the previous versions.
conn.exec("select to_dsinterval('0 00:00:01') from dual") do |row|
p row[0] # => 1.0 if the version is 2.0.3 and
# OCI8::BindType::IntervalDS.unit is :second.
# => (1/86400) if the version is 2.0.3 and
# OCI8::BindType::IntervalDS.unit is :day or
# the version is 2.0.2.
end
- Date, timestamp, timestamp with time zone data types and ruby 1.9.2
These data types are retrived always as Time values when the
ruby version is 1.9.2 because the Time class is enhanced to
represent any time zone and is free from year 2038 problem.
Prior to ruby 1.9.2, if the time cannot be represented by
Unix time or the time zone is neither utc nor local, they are
retrived as DateTime values.
- Non-blocking mode and ruby 1.9
non-blocking mode is enabled by default when the ruby is 1.9.
* New Features
- BigDecimal and Rational are availabe as bind values.
- New methods OCI8#module=, OCI8#action= and OCI8#client_info= are added.
These methods change the module name, the action name and the client_info
in the current session respectively.
After Oracle 10g client, these don't perform network round trips.
The change is reflected to the server by the next round trip such as
OCI8#exec, OCI8#ping, etc.
Prior to Oracle 10g client, these call PL/SQL functions such as
DBMS_APPLICATION_INFO.SET_MODULE, DBMS_APPLICATION_INFO.SET_ACTION,
and DBMS_APPLICATION_INFO.SET_CLIENT_INFO internally.
The change is reflected immediately by a network round trip.
- OCI8::BindType.default_timezone
The default time zone of Time or DateTime values.
This parameter is used only when
(1) date values are fetched and the Oracle client version is 8.x
or
(2) object types have date data type attributes.
Note that if the Oracle client version is 9i or upper, the time
zone is determined by the session time zone. The default value
is local time zone. You can change it to GMT by executing the
following SQL statement for each connection.
alter session set time_zone = '00:00'
* Other specification changes
- Add a global function OraNumber(obj) as a shortcut of OraNumber.new(obj)
as Rational and BigDecimal do.
- Fix to accept nil attribute in object type's
constructors. This works only for simple data types such as number,
string. But it doesn't for complex types such as object types.
(requested by Remi Gagnon)
- add DATE datatype support in object types.
- Change OCI8::LOB#write to accept an object which is not a String and
doesn't respond to 'to_str' as IO#write does.
(requested by Christopher Jones)
- Change the initial polling interval of
non-blocking mode for ruby 1.8 from 100 msec to 10 msec, which
is same with ruby-oci8 1.0.
* Fixed installation issues.
- Fix oraconf.rb for ruby 1.8.5 with Oracle 8.x which needs some object
files to link with.
(reported by Jayson Cena)
- Fix oraconf.rb for ruby 1.9.2 preview1.
(pointed by Raimonds Simanovskis)
- Fix oraconf.rb to compile for AIX instant clients.
(reported by Kazuya Teramoto)
2.0.2:
* add new methods
- OCI8#select_one(sql, *bindvars) -> first_row
- OCI8#ping -> true or false
Verifies that the Oracle connection is alive.
OCI8#ping also can be used to flush all the pending OCI
client-side calls to the server if any exist.
- OCI8#client_identifier = client_id
Look at the following link to know what is the client identifier.
http://it.toolbox.com/blogs/database-solutions/oracle-session-tracing-part-i-16356
Note that the specified identifier doesn't change the v$session
immediately. It is done by the next network round trip
such as OCI8#exec or OCI8#ping.
* fix problems when compiling with Oracle 9.2 and 8.0.
(reported by Axel Reinhold)
* [dbi] fix to pass a newly added sanity check in dbi 0.4.1.
(reported by Dirk Herzhauser)
* fix an error when executing "select NULL from dual".
http://rubyforge.org/forum/forum.php?thread_id=32468&forum_id=1078
(contributed by Raimonds Simanovskis)
* [ruby 1.9] fix OCI8::BLOB to read/write binary. Prior to 2.0.1,
it was treated as text tagged with NLS_LANG encoding.
* [ruby 1.9] fix to bind string data by the length got from String#bytesize
converted to OCI8.encoding, not by String#size.
2.0.1:
* release a binary gem for Windows, which contains libraries for both
ruby 1.8 and ruby 1.9.1.
* add OCI8#oracle_server_version.
* fix bugs when fetching and binding time objects.