ruby-oci8 1.0.7-x86-mswin32-60 → 2.0.1-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/ChangeLog +1289 -383
  2. data/Makefile +48 -12
  3. data/NEWS +5 -419
  4. data/README +56 -385
  5. data/VERSION +1 -1
  6. data/dist-files +27 -27
  7. data/lib/.document +2 -0
  8. data/lib/dbd/OCI8.rb +2 -17
  9. data/lib/oci8.rb +48 -1622
  10. data/lib/oci8.rb.in +48 -1622
  11. data/lib/oci8/.document +5 -0
  12. data/lib/oci8/compat.rb +108 -0
  13. data/lib/oci8/datetime.rb +491 -0
  14. data/lib/oci8/encoding-init.rb +40 -0
  15. data/lib/oci8/encoding.yml +537 -0
  16. data/lib/oci8/metadata.rb +2077 -0
  17. data/lib/oci8/object.rb +548 -0
  18. data/lib/oci8/oci8.rb +798 -0
  19. data/lib/oci8/oracle_version.rb +144 -0
  20. data/lib/oci8lib_18.so +0 -0
  21. data/lib/oci8lib_191.so +0 -0
  22. data/metaconfig +3 -3
  23. data/ruby-oci8.gemspec +24 -15
  24. data/setup.rb +4 -4
  25. data/test/config.rb +64 -84
  26. data/test/test_all.rb +14 -21
  27. data/test/test_array_dml.rb +333 -0
  28. data/test/test_bind_raw.rb +18 -25
  29. data/test/test_bind_time.rb +78 -91
  30. data/test/test_break.rb +37 -35
  31. data/test/test_clob.rb +33 -89
  32. data/test/test_connstr.rb +5 -4
  33. data/test/test_datetime.rb +469 -0
  34. data/test/test_dbi.rb +99 -60
  35. data/test/test_dbi_clob.rb +3 -8
  36. data/test/test_metadata.rb +65 -51
  37. data/test/test_oci8.rb +151 -55
  38. data/test/test_oracle_version.rb +70 -0
  39. data/test/test_oradate.rb +76 -83
  40. data/test/test_oranumber.rb +405 -71
  41. data/test/test_rowid.rb +6 -11
  42. metadata +21 -25
  43. data/ext/oci8/oci8lib.so +0 -0
  44. data/ruby-oci8.spec +0 -62
  45. data/support/README +0 -4
  46. data/support/runit/assert.rb +0 -281
  47. data/support/runit/cui/testrunner.rb +0 -101
  48. data/support/runit/error.rb +0 -4
  49. data/support/runit/method_mappable.rb +0 -20
  50. data/support/runit/robserver.rb +0 -25
  51. data/support/runit/setuppable.rb +0 -15
  52. data/support/runit/teardownable.rb +0 -16
  53. data/support/runit/testcase.rb +0 -113
  54. data/support/runit/testfailure.rb +0 -25
  55. data/support/runit/testresult.rb +0 -121
  56. data/support/runit/testsuite.rb +0 -43
  57. data/support/runit/version.rb +0 -3
  58. data/test/test_describe.rb +0 -137
@@ -1,43 +0,0 @@
1
- module RUNIT
2
- class TestSuite < Array
3
-
4
- def initialize(*test_classes)
5
- test_classes.each do |k|
6
- if k.kind_of?(Array)
7
- concat k
8
- else
9
- concat k.suite
10
- end
11
- end
12
- end
13
-
14
- def run(result)
15
- each do |t|
16
- t.run(result)
17
- end
18
- end
19
-
20
- def count_test_cases
21
- sum = 0
22
- each do |test|
23
- sum += test.count_test_cases
24
- end
25
- sum
26
- end
27
-
28
- def add(test)
29
- if test.kind_of?(Array)
30
- concat test
31
- else
32
- push test
33
- end
34
- end
35
- alias add_test add
36
-
37
- def extend_test(*mod)
38
- each do |t|
39
- t.extend_test(*mod)
40
- end
41
- end
42
- end
43
- end
@@ -1,3 +0,0 @@
1
- module RUNIT
2
- VERSION = '0.5.2'
3
- end
@@ -1,137 +0,0 @@
1
- # Low-level API
2
- require 'oci8'
3
- require 'runit/testcase'
4
- require 'runit/cui/testrunner'
5
- require File.dirname(__FILE__) + '/config'
6
-
7
- class TestDescribe < RUNIT::TestCase
8
-
9
- def setup
10
- # initialize oracle as object mode.
11
- # This is workaround to use OCIDescribeAny in Oracle 8.0.5 on Linux.
12
- # This bug was fixed in 8.0.6 and 8i.
13
- @env, @svc, @stmt = setup_lowapi()
14
- @desc = @env.alloc(OCIDescribe)
15
- end
16
-
17
- def test_describe_sequence
18
- begin
19
- @stmt.prepare("DROP SEQUENCE test_sequence").execute(@svc)
20
- rescue OCIError
21
- raise if $!.code != 2289 # sequence does not exist
22
- end
23
- minvalue = 1
24
- maxvalue = 1234567890123456789012345678 # bignum
25
- incr = 777
26
- sql = <<-EOS
27
- CREATE SEQUENCE test_sequence
28
- MINVALUE #{minvalue}
29
- MAXVALUE #{maxvalue}
30
- INCREMENT BY #{incr}
31
- ORDER
32
- EOS
33
- @stmt.prepare(sql).execute(@svc)
34
- @desc.describeAny(@svc, "test_sequence", OCI_PTYPE_SEQ)
35
- parm = @desc.attrGet(OCI_ATTR_PARAM)
36
- # common part
37
- assert_equal(OCI_PTYPE_SEQ, parm.attrGet(OCI_ATTR_PTYPE))
38
- # specific part
39
- assert_instance_of(Fixnum, parm.attrGet(OCI_ATTR_OBJID))
40
- assert_equal(minvalue, parm.attrGet(OCI_ATTR_MIN))
41
- assert_equal(maxvalue, parm.attrGet(OCI_ATTR_MAX))
42
- assert_equal(incr, parm.attrGet(OCI_ATTR_INCR))
43
- assert_kind_of(Integer, parm.attrGet(OCI_ATTR_CACHE))
44
- assert_equal(true, parm.attrGet(OCI_ATTR_ORDER))
45
- assert_kind_of(Integer, parm.attrGet(OCI_ATTR_HW_MARK))
46
- @stmt.prepare("DROP SEQUENCE test_sequence").execute(@svc)
47
- end
48
-
49
- def test_describe_synonym
50
- begin
51
- @stmt.prepare("DROP SYNONYM test_synonym").execute(@svc)
52
- rescue OCIError
53
- raise if $!.code != 1434 # private synonym to be dropped does not exist
54
- end
55
- @stmt.prepare("CREATE SYNONYM test_synonym FOR foo.bar@baz").execute(@svc)
56
- @desc.describeAny(@svc, "test_synonym", OCI_PTYPE_SYN)
57
- parm = @desc.attrGet(OCI_ATTR_PARAM)
58
- # common part
59
- assert_equal(OCI_PTYPE_SYN, parm.attrGet(OCI_ATTR_PTYPE))
60
- # specific part
61
- assert_instance_of(Fixnum, parm.attrGet(OCI_ATTR_OBJID))
62
- assert_equal("FOO", parm.attrGet(OCI_ATTR_SCHEMA_NAME))
63
- assert_equal("BAR", parm.attrGet(OCI_ATTR_NAME))
64
- assert_equal("BAZ", parm.attrGet(OCI_ATTR_LINK))
65
- @stmt.prepare("DROP SYNONYM test_synonym").execute(@svc)
66
- end
67
-
68
- def test_describe_table_and_columns
69
- drop_table('test_table')
70
- sql = <<-EOS
71
- CREATE TABLE test_table
72
- (C CHAR(10) NOT NULL,
73
- V VARCHAR2(20),
74
- N NUMBER(10, 2),
75
- D DATE)
76
- STORAGE (
77
- INITIAL 4k
78
- NEXT 4k
79
- MINEXTENTS 1
80
- MAXEXTENTS UNLIMITED
81
- PCTINCREASE 0)
82
- EOS
83
- @stmt.prepare(sql).execute(@svc)
84
- @desc.describeAny(@svc, "test_table", OCI_PTYPE_TABLE)
85
- tab_parm = @desc.attrGet(OCI_ATTR_PARAM)
86
- col_list = tab_parm.attrGet(OCI_ATTR_LIST_COLUMNS)
87
- num_cols = tab_parm.attrGet(OCI_ATTR_NUM_COLS)
88
- # common part for table
89
- assert_equal(OCI_PTYPE_TABLE, tab_parm.attrGet(OCI_ATTR_PTYPE))
90
- # specific part for table
91
- assert_instance_of(Fixnum, tab_parm.attrGet(OCI_ATTR_OBJID))
92
- assert_equal(4, num_cols)
93
- # common part for column list
94
- assert_equal(OCI_PTYPE_LIST, col_list.attrGet(OCI_ATTR_PTYPE))
95
-
96
- col = Array.new(num_cols)
97
- 1.upto(num_cols) do |i|
98
- col[i] = col_list.paramGet(i)
99
- assert_equal(OCI_PTYPE_COL, col[1].attrGet(OCI_ATTR_PTYPE))
100
- end
101
- assert_equal(10, col[1].attrGet(OCI_ATTR_DATA_SIZE))
102
- assert_equal(20, col[2].attrGet(OCI_ATTR_DATA_SIZE))
103
- assert_equal(22, col[3].attrGet(OCI_ATTR_DATA_SIZE))
104
- assert_equal(7, col[4].attrGet(OCI_ATTR_DATA_SIZE))
105
- assert_equal(OCI_TYPECODE_CHAR, col[1].attrGet(OCI_ATTR_DATA_TYPE))
106
- assert_equal(OCI_TYPECODE_VARCHAR, col[2].attrGet(OCI_ATTR_DATA_TYPE))
107
- assert_equal(OCI_TYPECODE_NUMBER, col[3].attrGet(OCI_ATTR_DATA_TYPE))
108
- assert_equal(OCI_TYPECODE_DATE, col[4].attrGet(OCI_ATTR_DATA_TYPE))
109
- assert_equal("C", col[1].attrGet(OCI_ATTR_NAME))
110
- assert_equal("V", col[2].attrGet(OCI_ATTR_NAME))
111
- assert_equal("N", col[3].attrGet(OCI_ATTR_NAME))
112
- assert_equal("D", col[4].attrGet(OCI_ATTR_NAME))
113
- assert_equal(0, col[1].attrGet(OCI_ATTR_PRECISION))
114
- assert_equal(0, col[2].attrGet(OCI_ATTR_PRECISION))
115
- assert_equal(10, col[3].attrGet(OCI_ATTR_PRECISION))
116
- assert_equal(0, col[4].attrGet(OCI_ATTR_PRECISION))
117
- assert_equal(0, col[1].attrGet(OCI_ATTR_SCALE))
118
- assert_equal(0, col[2].attrGet(OCI_ATTR_SCALE))
119
- assert_equal(2, col[3].attrGet(OCI_ATTR_SCALE))
120
- assert_equal(0, col[4].attrGet(OCI_ATTR_SCALE))
121
- assert_equal(false, col[1].attrGet(OCI_ATTR_IS_NULL))
122
- assert_equal(true, col[2].attrGet(OCI_ATTR_IS_NULL))
123
- assert_equal(true, col[3].attrGet(OCI_ATTR_IS_NULL))
124
- assert_equal(true, col[4].attrGet(OCI_ATTR_IS_NULL))
125
- drop_table('test_table')
126
- end
127
-
128
- def teardown
129
- @stmt.free()
130
- @svc.logoff()
131
- @env.free()
132
- end
133
- end
134
-
135
- if $0 == __FILE__
136
- RUNIT::CUI::TestRunner.run(TestDescribe.suite())
137
- end