[ruby-oci8-commit] [288] trunk/ruby-oci8: * ext/oci8/apiwrap.rb, ext/oci8/apiwrap.yml, ext/ oci8/oci8.h,
nobody at rubyforge.org
nobody at rubyforge.org
Tue Sep 9 04:05:29 EDT 2008
Revision: 288
Author: kubo
Date: 2008-09-09 04:05:28 -0400 (Tue, 09 Sep 2008)
Log Message:
-----------
* ext/oci8/apiwrap.rb, ext/oci8/apiwrap.yml, ext/oci8/oci8.h,
ext/oci8/ocidatetime.c, lib/oci8.rb.in, lib/oci8/datetime.rb,
lib/oci8/metadata.rb, lib/oci8/oci8.rb, test/test_break.rb,
test/test_datetime.rb, test/test_dbi.rb, test/test_metadata.rb:
fix Oracle version number mistakes. rename ORAVER_9_1 to
ORAVER_9_0.
Modified Paths:
--------------
trunk/ruby-oci8/ChangeLog
trunk/ruby-oci8/ext/oci8/apiwrap.rb
trunk/ruby-oci8/ext/oci8/apiwrap.yml
trunk/ruby-oci8/ext/oci8/oci8.h
trunk/ruby-oci8/ext/oci8/ocidatetime.c
trunk/ruby-oci8/lib/oci8/datetime.rb
trunk/ruby-oci8/lib/oci8/metadata.rb
trunk/ruby-oci8/lib/oci8/oci8.rb
trunk/ruby-oci8/lib/oci8.rb.in
trunk/ruby-oci8/test/test_break.rb
trunk/ruby-oci8/test/test_datetime.rb
trunk/ruby-oci8/test/test_dbi.rb
trunk/ruby-oci8/test/test_metadata.rb
Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/ChangeLog 2008-09-09 08:05:28 UTC (rev 288)
@@ -1,3 +1,11 @@
+2008-09-09 KUBO Takehiro <kubo at jiubao.org>
+ * ext/oci8/apiwrap.rb, ext/oci8/apiwrap.yml, ext/oci8/oci8.h,
+ ext/oci8/ocidatetime.c, lib/oci8.rb.in, lib/oci8/datetime.rb,
+ lib/oci8/metadata.rb, lib/oci8/oci8.rb, test/test_break.rb,
+ test/test_datetime.rb, test/test_dbi.rb, test/test_metadata.rb:
+ fix Oracle version number mistakes. rename ORAVER_9_1 to
+ ORAVER_9_0.
+
2008-08-31 KUBO Takehiro <kubo at jiubao.org>
* ext/oci8/bind.c, ext/oci8/stmt.c: disable DYNAMIC_FETCH to fetch
LONG or LONG RAW columns. It doesn't work well.
Modified: trunk/ruby-oci8/ext/oci8/apiwrap.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/apiwrap.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/ext/oci8/apiwrap.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -39,7 +39,7 @@
case @version
when 0x08000000; @version_num = 'ORAVER_8_0'
when 0x08100000; @version_num = 'ORAVER_8_1'
- when 0x09100000; @version_num = 'ORAVER_9_1'
+ when 0x09000000; @version_num = 'ORAVER_9_0'
when 0x09200000; @version_num = 'ORAVER_9_2'
when 0x0a100000; @version_num = 'ORAVER_10_1'
when 0x0a200000; @version_num = 'ORAVER_10_2'
Modified: trunk/ruby-oci8/ext/oci8/apiwrap.yml
===================================================================
--- trunk/ruby-oci8/ext/oci8/apiwrap.yml 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/ext/oci8/apiwrap.yml 2008-09-09 08:05:28 UTC (rev 288)
@@ -1015,12 +1015,12 @@
- OCIError *errhp
#
-# Oracle 9.1
+# Oracle 9.0
#
# round trip: 0 (not docmented. I guess.)
OCIDateTimeConstruct:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- OCIDateTime *datetime
@@ -1036,7 +1036,7 @@
# round trip: 0 (not docmented. I guess.)
OCIDateTimeGetDate:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- const OCIDateTime *date
@@ -1046,7 +1046,7 @@
# round trip: 0 (not docmented. I guess.)
OCIDateTimeGetTime:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- OCIDateTime *datetime
@@ -1057,7 +1057,7 @@
# round trip: 0 (not docmented. I guess.)
OCIDateTimeGetTimeZoneOffset:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- const OCIDateTime *datetime
@@ -1066,7 +1066,7 @@
# round trip: 0 (not docmented. I guess.)
OCIIntervalGetDaySecond:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- sb4 *dy
@@ -1078,7 +1078,7 @@
# round trip: 0 (not docmented. I guess.)
OCIIntervalGetYearMonth:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- sb4 *yr
@@ -1087,7 +1087,7 @@
# round trip: 0 (not docmented. I guess.)
OCIIntervalSetDaySecond:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- sb4 dy
@@ -1099,7 +1099,7 @@
# round trip: 0 (not docmented. I guess.)
OCIIntervalSetYearMonth:
- :version: 910
+ :version: 900
:args: - dvoid *hndl
- OCIError *err
- sb4 yr
@@ -1108,7 +1108,7 @@
# round trip: 0 (not docmented. I guess.)
OCIRowidToChar:
- :version: 910
+ :version: 900
:args: - OCIRowid *rowidDesc
- OraText *outbfp
- ub2 *outbflp
Modified: trunk/ruby-oci8/ext/oci8/oci8.h
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8.h 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/ext/oci8/oci8.h 2008-09-09 08:05:28 UTC (rev 288)
@@ -33,8 +33,8 @@
#define ORAVER_8_0 ORAVERNUM(8, 0, 0, 0, 0)
#define ORAVER_8_1 ORAVERNUM(8, 1, 0, 0, 0)
-#define ORAVER_9_1 ORAVERNUM(9, 1, 0, 0, 0)
-#define ORAVER_9_2 ORAVERNUM(9, 1, 0, 0, 0)
+#define ORAVER_9_0 ORAVERNUM(9, 0, 0, 0, 0)
+#define ORAVER_9_2 ORAVERNUM(9, 2, 0, 0, 0)
#define ORAVER_10_1 ORAVERNUM(10, 1, 0, 0, 0)
#define ORAVER_10_2 ORAVERNUM(10, 2, 0, 0, 0)
#define ORAVER_11_1 ORAVERNUM(11, 1, 0, 0, 0)
Modified: trunk/ruby-oci8/ext/oci8/ocidatetime.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/ocidatetime.c 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/ext/oci8/ocidatetime.c 2008-09-09 08:05:28 UTC (rev 288)
@@ -100,7 +100,7 @@
SQLT_ODT,
};
-#if defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= ORAVER_9_1
+#if defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= ORAVER_9_0
VALUE oci8_make_ocitimestamp(OCIDateTime *dttm)
{
@@ -432,14 +432,14 @@
SQLT_INTERVAL_DS
};
-#endif /* defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= ORAVER_9_1 */
+#endif /* defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= ORAVER_9_0 */
void Init_oci_datetime(void)
{
oci8_define_bind_class("OCIDate", &bind_ocidate_class);
-#if defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= ORAVER_9_1
- if (oracle_client_version >= ORAVER_9_1) {
+#if defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= ORAVER_9_0
+ if (oracle_client_version >= ORAVER_9_0) {
oci8_define_bind_class("OCITimestamp", &bind_ocitimestamp_class);
oci8_define_bind_class("OCIIntervalYM", &bind_ociinterval_ym_class);
oci8_define_bind_class("OCIIntervalDS", &bind_ociinterval_ds_class);
Modified: trunk/ruby-oci8/lib/oci8/datetime.rb
===================================================================
--- trunk/ruby-oci8/lib/oci8/datetime.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/lib/oci8/datetime.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -95,7 +95,7 @@
end
end
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
def ocitimestamp_to_datetime(ary)
year, month, day, hour, minute, sec, fsec, tz_hour, tz_min = ary
@@ -165,7 +165,7 @@
end
end
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
class DateTimeViaOCITimestamp < OCI8::BindType::OCITimestamp
include OCI8::BindType::Util
@@ -275,7 +275,7 @@
# cursor.close
#
class DateTime
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
def self.create(con, val, param, max_array_size)
DateTimeViaOCITimestamp.new(con, val, param, max_array_size)
end
@@ -287,7 +287,7 @@
end
class Time
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
def self.create(con, val, param, max_array_size)
TimeViaOCITimestamp.new(con, val, param, max_array_size)
end
@@ -298,7 +298,7 @@
end
end
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
#--
# OCI8::BindType::IntervalYM
#++
Modified: trunk/ruby-oci8/lib/oci8/metadata.rb
===================================================================
--- trunk/ruby-oci8/lib/oci8/metadata.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/lib/oci8/metadata.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -998,7 +998,7 @@
__charset_form
end
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
# The fractional seconds precision of a datetime or interval.
#
# (unavailable on Oracle 8.1 or lower)
@@ -1332,7 +1332,7 @@
## Table 6-13 Attributes Belonging to Columns of Tables or Views
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
# returns the type of length semantics of the column.
# [<tt>:byte</tt>] byte-length semantics
# [<tt>:char</tt>] character-length semantics.
@@ -1438,7 +1438,7 @@
## Table 6-8 Attributes Belonging to Type Attributes
## But Column also have these.
- if OCI8.oracle_client_version >= ORAVER_9_1
+ if OCI8.oracle_client_version >= ORAVER_9_0
# The fractional seconds precision of a datetime or interval.
#
# (unavailable on Oracle 8.1 or lower)
Modified: trunk/ruby-oci8/lib/oci8/oci8.rb
===================================================================
--- trunk/ruby-oci8/lib/oci8/oci8.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/lib/oci8/oci8.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -701,7 +701,7 @@
# DATE SQLT_DAT 7 0 0
OCI8::BindType::Mapping[:date] = OCI8::BindType::Time
-if OCI8.oracle_client_version >= OCI8::ORAVER_9_1
+if OCI8.oracle_client_version >= OCI8::ORAVER_9_0
OCI8::BindType::Mapping[:timestamp] = OCI8::BindType::Time
OCI8::BindType::Mapping[:timestamp_tz] = OCI8::BindType::DateTime
OCI8::BindType::Mapping[:timestamp_ltz] = OCI8::BindType::Time
Modified: trunk/ruby-oci8/lib/oci8.rb.in
===================================================================
--- trunk/ruby-oci8/lib/oci8.rb.in 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/lib/oci8.rb.in 2008-09-09 08:05:28 UTC (rev 288)
@@ -23,7 +23,7 @@
class OCI8
ORAVER_8_0 = 0x08000000 # 8.0
ORAVER_8_1 = 0x08100000 # 8.1
- ORAVER_9_1 = 0x09100000 # 9.1
+ ORAVER_9_0 = 0x09000000 # 9.0
ORAVER_9_2 = 0x09200000 # 9.2
ORAVER_10_1 = 0x0a100000 # 10.1
ORAVER_10_2 = 0x0a200000 # 10.2
Modified: trunk/ruby-oci8/test/test_break.rb
===================================================================
--- trunk/ruby-oci8/test/test_break.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/test/test_break.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -64,7 +64,7 @@
assert_equal(true, @conn.non_blocking?)
expect = []
if is_windows_server
- if $oracle_server_version >= OCI8::ORAVER_9_1
+ if $oracle_server_version >= OCI8::ORAVER_9_0
# raise after sleeping #{TIME_IN_PLSQL} seconds.
expect[PLSQL_DONE] = "Invalid status"
expect[OCIBREAK] = TIME_IN_PLSQL
Modified: trunk/ruby-oci8/test/test_datetime.rb
===================================================================
--- trunk/ruby-oci8/test/test_datetime.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/test/test_datetime.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -71,7 +71,7 @@
end
def test_timestamp_select
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
['2005-12-31 23:59:59.999999000',
'2006-01-01 00:00:00.000000000'].each do |date|
@@ -84,7 +84,7 @@
end
def test_timestamp_out_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
BEGIN
@@ -103,7 +103,7 @@
end
def test_timestamp_in_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
BEGIN
@@ -122,7 +122,7 @@
end
def test_timestamp_tz_select
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
['2005-12-31 23:59:59.999999000 +08:30',
'2006-01-01 00:00:00.000000000 -08:30'].each do |date|
@@ -135,7 +135,7 @@
end
def test_timestamp_tz_out_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
BEGIN
@@ -154,7 +154,7 @@
end
def test_timestamp_tz_in_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
BEGIN
@@ -227,7 +227,7 @@
end
def test_interval_ym_select
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
[['2006-01-01', '2004-03-01'],
['2006-01-01', '2005-03-01'],
@@ -245,7 +245,7 @@
end
def test_interval_ym_out_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
DECLARE
@@ -274,7 +274,7 @@
end
def test_interval_ym_in_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
DECLARE
@@ -301,7 +301,7 @@
end
def test_interval_ds_select
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
[['2006-01-01', '2004-03-01'],
['2006-01-01', '2005-03-01'],
@@ -329,7 +329,7 @@
end
def test_interval_ds_out_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
DECLARE
@@ -368,7 +368,7 @@
end
def test_interval_ds_in_bind
- return if $oracle_version < OCI8::ORAVER_9_1
+ return if $oracle_version < OCI8::ORAVER_9_0
cursor = @conn.parse(<<-EOS)
DECLARE
Modified: trunk/ruby-oci8/test/test_dbi.rb
===================================================================
--- trunk/ruby-oci8/test/test_dbi.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/test/test_dbi.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -102,7 +102,7 @@
sth = @dbh.prepare("INSERT INTO test_table VALUES (:C, :V, :N, :D1, :D2, :D3, :D4, :INT, :BIGNUM)")
1.upto(10) do |i|
if i == 1
- if OCI8::oracle_client_version >= OCI8::ORAVER_9_1
+ if OCI8::oracle_client_version >= OCI8::ORAVER_9_0
dt = nil
v = ''
sth.execute(format("%10d", i * 10), v, i, dt, dt, dt, dt, i, i)
@@ -192,7 +192,7 @@
# data_size factor for nchar charset_form.
sth = @dbh.execute("select N'1' from dual")
cfrm = sth.column_info[0]['precision']
- if $oracle_version >= OCI8::ORAVER_9_1
+ if $oracle_version >= OCI8::ORAVER_9_0
# data_size factor for char semantics.
sth = @dbh.execute("select CAST('1' AS CHAR(1 char)) from dual")
csem = sth.column_info[0]['precision']
@@ -202,16 +202,16 @@
ora80 = OCI8::ORAVER_8_0
ora81 = OCI8::ORAVER_8_1
- ora91 = OCI8::ORAVER_9_1
+ ora90 = OCI8::ORAVER_9_0
ora101 = OCI8::ORAVER_10_1
coldef =
[
# oracle_version, definition, sql_type, type_name, nullable, precision,scale,indexed,primary,unique,default
[ora80, "CHAR(10) NOT NULL", DBI::SQL_CHAR, 'CHAR', false, 10, nil, true, true, true, nil],
- [ora91, "CHAR(10 CHAR)", DBI::SQL_CHAR, 'CHAR', true, 10 * csem, nil, false,false,false,nil],
+ [ora90, "CHAR(10 CHAR)", DBI::SQL_CHAR, 'CHAR', true, 10 * csem, nil, false,false,false,nil],
[ora80, "NCHAR(10)", DBI::SQL_CHAR, 'NCHAR', true, 10 * cfrm, nil, true, false,true, nil],
[ora80, "VARCHAR2(10) DEFAULT 'a''b'", DBI::SQL_VARCHAR, 'VARCHAR2', true, 10, nil, true, false,false, "a'b"],
- [ora91, "VARCHAR2(10 CHAR)", DBI::SQL_VARCHAR, 'VARCHAR2', true, 10 * csem, nil, false,false,false,nil],
+ [ora90, "VARCHAR2(10 CHAR)", DBI::SQL_VARCHAR, 'VARCHAR2', true, 10 * csem, nil, false,false,false,nil],
[ora80, "NVARCHAR2(10)", DBI::SQL_VARCHAR, 'NVARCHAR2',true, 10 * cfrm, nil, false,false,false,nil],
[ora80, "RAW(10)", DBI::SQL_VARBINARY, 'RAW', true, 10, nil, false,false,false,nil],
[ora81, "CLOB", DBI::SQL_CLOB, 'CLOB', true, 4000, nil, false,false,false,nil],
@@ -226,16 +226,16 @@
[ora101,"BINARY_FLOAT", DBI::SQL_FLOAT, 'BINARY_FLOAT', true, 7, nil, false,false,false,nil],
[ora101,"BINARY_DOUBLE", DBI::SQL_DOUBLE, 'BINARY_DOUBLE', true, 16, nil, false,false,false,nil],
[ora80, "DATE", DBI::SQL_DATE, 'DATE', true, 19, nil, false,false,false,nil],
- [ora91, "TIMESTAMP", DBI::SQL_TIMESTAMP, 'TIMESTAMP', true, 20 + 6, nil, false,false,false,nil],
- [ora91, "TIMESTAMP(9)", DBI::SQL_TIMESTAMP, 'TIMESTAMP', true, 20 + 9, nil, false,false,false,nil],
- [ora91, "TIMESTAMP WITH TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH TIME ZONE', true, 27 + 6, nil, false,false,false,nil],
- [ora91, "TIMESTAMP(9) WITH TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH TIME ZONE', true, 27 + 9, nil, false,false,false,nil],
- [ora91, "TIMESTAMP WITH LOCAL TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH LOCAL TIME ZONE', true, 20 + 6, nil, false,false,false,nil],
- [ora91, "TIMESTAMP(9) WITH LOCAL TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH LOCAL TIME ZONE', true, 20 + 9, nil, false,false,false,nil],
- [ora91, "INTERVAL YEAR TO MONTH", DBI::SQL_OTHER, 'INTERVAL YEAR TO MONTH', true, 2 + 3, nil, false,false,false,nil],
- [ora91, "INTERVAL YEAR(4) TO MONTH", DBI::SQL_OTHER, 'INTERVAL YEAR TO MONTH', true, 4 + 3, nil, false,false,false,nil],
- [ora91, "INTERVAL DAY TO SECOND", DBI::SQL_OTHER, 'INTERVAL DAY TO SECOND', true, 2 + 10 + 6, nil, false,false,false,nil],
- [ora91, "INTERVAL DAY(4) TO SECOND(9)",DBI::SQL_OTHER, 'INTERVAL DAY TO SECOND', true, 4 + 10 + 9, nil, false,false,false,nil],
+ [ora90, "TIMESTAMP", DBI::SQL_TIMESTAMP, 'TIMESTAMP', true, 20 + 6, nil, false,false,false,nil],
+ [ora90, "TIMESTAMP(9)", DBI::SQL_TIMESTAMP, 'TIMESTAMP', true, 20 + 9, nil, false,false,false,nil],
+ [ora90, "TIMESTAMP WITH TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH TIME ZONE', true, 27 + 6, nil, false,false,false,nil],
+ [ora90, "TIMESTAMP(9) WITH TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH TIME ZONE', true, 27 + 9, nil, false,false,false,nil],
+ [ora90, "TIMESTAMP WITH LOCAL TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH LOCAL TIME ZONE', true, 20 + 6, nil, false,false,false,nil],
+ [ora90, "TIMESTAMP(9) WITH LOCAL TIME ZONE", DBI::SQL_TIMESTAMP, 'TIMESTAMP WITH LOCAL TIME ZONE', true, 20 + 9, nil, false,false,false,nil],
+ [ora90, "INTERVAL YEAR TO MONTH", DBI::SQL_OTHER, 'INTERVAL YEAR TO MONTH', true, 2 + 3, nil, false,false,false,nil],
+ [ora90, "INTERVAL YEAR(4) TO MONTH", DBI::SQL_OTHER, 'INTERVAL YEAR TO MONTH', true, 4 + 3, nil, false,false,false,nil],
+ [ora90, "INTERVAL DAY TO SECOND", DBI::SQL_OTHER, 'INTERVAL DAY TO SECOND', true, 2 + 10 + 6, nil, false,false,false,nil],
+ [ora90, "INTERVAL DAY(4) TO SECOND(9)",DBI::SQL_OTHER, 'INTERVAL DAY TO SECOND', true, 4 + 10 + 9, nil, false,false,false,nil],
]
coldef.reject! do |c| c[0] > $oracle_version end
Modified: trunk/ruby-oci8/test/test_metadata.rb
===================================================================
--- trunk/ruby-oci8/test/test_metadata.rb 2008-08-31 14:11:39 UTC (rev 287)
+++ trunk/ruby-oci8/test/test_metadata.rb 2008-09-09 08:05:28 UTC (rev 288)
@@ -25,7 +25,7 @@
# data_size factor for nchar charset_form.
cursor = @conn.exec("select N'1' from dual")
cfrm = cursor.column_metadata[0].data_size
- if $oracle_version >= OCI8::ORAVER_9_1
+ if $oracle_version >= OCI8::ORAVER_9_0
# data_size factor for char semantics.
cursor = @conn.exec("select CAST('1' AS CHAR(1 char)) from dual")
csem = cursor.column_metadata[0].data_size
@@ -35,16 +35,16 @@
ora80 = OCI8::ORAVER_8_0
ora81 = OCI8::ORAVER_8_1
- ora91 = OCI8::ORAVER_9_1
+ ora90 = OCI8::ORAVER_9_0
ora101 = OCI8::ORAVER_10_1
coldef =
[
# oracle_version, definition, data_type, csfrm, null?,csem?,csize, data_size,prec,scale,fsprec,lfprec
[ora80, "CHAR(10) NOT NULL", :char, :implicit, false, false, 10, 10, 0, 0, 0, 0],
- [ora91, "CHAR(10 CHAR)", :char, :implicit, true, true, 10, 10 * csem, 0, 0, 0, 0],
+ [ora90, "CHAR(10 CHAR)", :char, :implicit, true, true, 10, 10 * csem, 0, 0, 0, 0],
[ora80, "NCHAR(10)", :char, :nchar, true, true, 10, 10 * cfrm, 0, 0, 0, 0],
[ora80, "VARCHAR2(10)", :varchar2, :implicit, true, false, 10, 10, 0, 0, 0, 0],
- [ora91, "VARCHAR2(10 CHAR)", :varchar2, :implicit, true, true, 10, 10 * csem, 0, 0, 0, 0],
+ [ora90, "VARCHAR2(10 CHAR)", :varchar2, :implicit, true, true, 10, 10 * csem, 0, 0, 0, 0],
[ora80, "NVARCHAR2(10)", :varchar2, :nchar, true, true, 10, 10 * cfrm, 0, 0, 0, 0],
[ora80, "RAW(10)", :raw, nil, true, false, 0, 10, 0, 0, 0, 0],
@@ -84,7 +84,7 @@
# | FLOAT(10) | implicit | 129 | 10 |
# | | explicit | 10 | 129 |
# +----------------+----------+-------------+-------------+
- [ora80, "NUMBER", :number, nil, true, false, 0, 22, 0, $oracle_version >= ora91 ? -127 : 0, :nc, :nc],
+ [ora80, "NUMBER", :number, nil, true, false, 0, 22, 0, $oracle_version >= ora90 ? -127 : 0, :nc, :nc],
[ora80, "NUMBER(10)", :number, nil, true, false, 0, 22, 10, 0, :nc, :nc],
[ora80, "NUMBER(10,2)", :number, nil, true, false, 0, 22, 10, 2, :nc, :nc],
[ora80, "FLOAT", :number, nil, true, false, 0, 22, 126, -127, :nc, :nc],
@@ -118,12 +118,12 @@
# | TIMESTAMP(9) WITH LOCAL TIME ZONE | implicit | 0 | 0 |
# | | explicit | 9 | 9 |
# +-----------------------------------+----------+-----------+-------------+
- [ora91, "TIMESTAMP", :timestamp, nil, true, false, 0, 11, :nc, 6, 6, :nc],
- [ora91, "TIMESTAMP(9)", :timestamp, nil, true, false, 0, 11, :nc, 9, 9, :nc],
- [ora91, "TIMESTAMP WITH TIME ZONE", :timestamp_tz, nil, true, false, 0, 13, :nc, 6, 6, :nc],
- [ora91, "TIMESTAMP(9) WITH TIME ZONE", :timestamp_tz, nil, true, false, 0, 13, :nc, 9, 9, :nc],
- [ora91, "TIMESTAMP WITH LOCAL TIME ZONE", :timestamp_ltz, nil, true, false, 0, 11, :nc, 6, 6, :nc],
- [ora91, "TIMESTAMP(9) WITH LOCAL TIME ZONE", :timestamp_ltz, nil, true, false, 0, 11, :nc, 9, 9, :nc],
+ [ora90, "TIMESTAMP", :timestamp, nil, true, false, 0, 11, :nc, 6, 6, :nc],
+ [ora90, "TIMESTAMP(9)", :timestamp, nil, true, false, 0, 11, :nc, 9, 9, :nc],
+ [ora90, "TIMESTAMP WITH TIME ZONE", :timestamp_tz, nil, true, false, 0, 13, :nc, 6, 6, :nc],
+ [ora90, "TIMESTAMP(9) WITH TIME ZONE", :timestamp_tz, nil, true, false, 0, 13, :nc, 9, 9, :nc],
+ [ora90, "TIMESTAMP WITH LOCAL TIME ZONE", :timestamp_ltz, nil, true, false, 0, 11, :nc, 6, 6, :nc],
+ [ora90, "TIMESTAMP(9) WITH LOCAL TIME ZONE", :timestamp_ltz, nil, true, false, 0, 11, :nc, 9, 9, :nc],
# Don't check scale and fsprecision for INTERVAL YEAR TO MONTH
#
@@ -137,8 +137,8 @@
# | INTERVAL YEAR(4) TO MONTH | implicit | 0 | 0 |
# | | explicit | 4 | 4 |
# +------------------------------+----------+-----------+-------------+
- [ora91, "INTERVAL YEAR TO MONTH", :interval_ym, nil, true, false, 0, 5, 2, :nc, :nc, 2],
- [ora91, "INTERVAL YEAR(4) TO MONTH", :interval_ym, nil, true, false, 0, 5, 4, :nc, :nc, 4],
+ [ora90, "INTERVAL YEAR TO MONTH", :interval_ym, nil, true, false, 0, 5, 2, :nc, :nc, 2],
+ [ora90, "INTERVAL YEAR(4) TO MONTH", :interval_ym, nil, true, false, 0, 5, 4, :nc, :nc, 4],
# Don't check precision and scale for INTERVAL DAY TO SECOND
#
@@ -152,8 +152,8 @@
# | INTERVAL DAY(4) TO SECOND(9) | implicit | 4 | 9 |
# | | explicit | 9 | 4 |
# +------------------------------+----------+-----------+-----------+
- [ora91, "INTERVAL DAY TO SECOND", :interval_ds, nil, true, false, 0, 11, :nc, :nc, 6, 2],
- [ora91, "INTERVAL DAY(4) TO SECOND(9)",:interval_ds, nil, true, false, 0, 11, :nc, :nc, 9, 4],
+ [ora90, "INTERVAL DAY TO SECOND", :interval_ds, nil, true, false, 0, 11, :nc, :nc, 6, 2],
+ [ora90, "INTERVAL DAY(4) TO SECOND(9)",:interval_ds, nil, true, false, 0, 11, :nc, :nc, 9, 4],
]
coldef.reject! do |c| c[0] > $oracle_version end
@@ -178,7 +178,7 @@
assert_equal(coldef[i][3], md.charset_form, "'#{coldef[i][1]}': charset_form")
assert_equal(coldef[i][4], md.nullable?, "'#{coldef[i][1]}': nullable? ")
# string type
- if $oracle_version >= OCI8::ORAVER_9_1
+ if $oracle_version >= OCI8::ORAVER_9_0
assert_equal(coldef[i][5], md.char_used?, "'#{coldef[i][1]}': char_used? ")
assert_equal(coldef[i][6], md.char_size, "'#{coldef[i][1]}': char_size")
end
@@ -186,7 +186,7 @@
# number, timestamp and interval type
assert_equal(coldef[i][8], md.precision, "'#{coldef[i][1]}': precision") if coldef[i][8] != :nc
assert_equal(coldef[i][9], md.scale, "'#{coldef[i][1]}': scale") if coldef[i][9] != :nc
- if $oracle_version >= OCI8::ORAVER_9_1
+ if $oracle_version >= OCI8::ORAVER_9_0
assert_equal(coldef[i][10], md.fsprecision, "'#{coldef[i][1]}': fsprecision") if coldef[i][10] != :nc
assert_equal(coldef[i][11], md.lfprecision, "'#{coldef[i][1]}': lfprecision") if coldef[i][11] != :nc
end
@@ -216,7 +216,7 @@
assert_equal(coldef[i][3], md.charset_form, "'#{coldef[i][1]}': charset_form")
assert_equal(coldef[i][4], md.nullable?, "'#{coldef[i][1]}': nullable? ")
# string type
- if $oracle_version >= OCI8::ORAVER_9_1
+ if $oracle_version >= OCI8::ORAVER_9_0
assert_equal(coldef[i][5], md.char_used?, "'#{coldef[i][1]}': char_used? ")
assert_equal(coldef[i][6], md.char_size, "'#{coldef[i][1]}': char_size")
end
@@ -224,7 +224,7 @@
# number, timestamp and interval type
assert_equal(coldef[i][8], md.precision, "'#{coldef[i][1]}': precision") if coldef[i][8] != :nc
assert_equal(coldef[i][9], md.scale, "'#{coldef[i][1]}': scale") if coldef[i][9] != :nc
- if $oracle_version >= OCI8::ORAVER_9_1
+ if $oracle_version >= OCI8::ORAVER_9_0
assert_equal(coldef[i][10], md.fsprecision, "'#{coldef[i][1]}': fsprecision") if coldef[i][10] != :nc
assert_equal(coldef[i][11], md.lfprecision, "'#{coldef[i][1]}': lfprecision") if coldef[i][11] != :nc
end
More information about the ruby-oci8-commit
mailing list