ruby-oci8 2.1.3-x86-mingw32 → 2.1.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -75,6 +75,22 @@ class TestCLob < Test::Unit::TestCase
75
75
  lob.close
76
76
  end
77
77
 
78
+ # https://github.com/kubo/ruby-oci8/issues/20
79
+ def test_github_issue_20
80
+ lob1 = OCI8::CLOB.new(@conn, ' ' * (1024 * 1024))
81
+ begin
82
+ lob2 = OCI8::CLOB.new(@conn, ' ' * (128 * 1024 * 1024))
83
+ rescue OCIError
84
+ raise if $!.code != 24817
85
+ # ORA-24817: Unable to allocate the given chunk for current lob operation
86
+ GC.start
87
+ # allocate smaller size
88
+ lob2 = OCI8::CLOB.new(@conn, ' ' * (16 * 1024 * 1024))
89
+ end
90
+ lob1 = nil # lob1's value will be freed in GC.
91
+ lob2.read # GC must run here to reproduce the issue.
92
+ end
93
+
78
94
  def teardown
79
95
  drop_table('test_table')
80
96
  @conn.logoff
@@ -25,7 +25,7 @@ STORAGE (
25
25
  MAXEXTENTS UNLIMITED
26
26
  PCTINCREASE 0)
27
27
  EOS
28
- ascii_8bit = Encoding.find('ASCII-8BIT')
28
+ ascii_8bit = "\xab\xcd".force_encoding('ASCII-8BIT')
29
29
  @conn.exec(<<EOS)
30
30
  INSERT INTO test_table VALUES ('abcd', 'abcd', 'abcd', 'abcd', 'abcd', 'abcd', 'abcd')
31
31
  EOS
@@ -34,16 +34,16 @@ EOS
34
34
  assert_equal(OCI8.encoding, row[0].encoding);
35
35
  assert_equal('abcd', row[1], 'VARCHAR2(10)')
36
36
  assert_equal(OCI8.encoding, row[1].encoding);
37
- assert_equal("\xab\xcd", row[2], 'RAW(10)')
38
- assert_equal(ascii_8bit, row[2].encoding);
39
- assert_equal("\xab\xcd", row[3], 'LONG RAW')
40
- assert_equal(ascii_8bit, row[3].encoding);
37
+ assert_equal(ascii_8bit, row[2], 'RAW(10)')
38
+ assert_equal(ascii_8bit.encoding, row[2].encoding);
39
+ assert_equal(ascii_8bit, row[3], 'LONG RAW')
40
+ assert_equal(ascii_8bit.encoding, row[3].encoding);
41
41
  assert_equal('abcd', (data = row[4].read), 'CLOB')
42
42
  assert_equal(OCI8.encoding, data.encoding);
43
43
  assert_equal('abcd', (data = row[5].read), 'NCLOB')
44
44
  assert_equal(OCI8.encoding, data.encoding);
45
- assert_equal("\xab\xcd", (data = row[6].read), 'BLOB')
46
- assert_equal(ascii_8bit, data.encoding);
45
+ assert_equal(ascii_8bit, (data = row[6].read), 'BLOB')
46
+ assert_equal(ascii_8bit.encoding, data.encoding);
47
47
 
48
48
  if OCI8.encoding.name == "UTF-8" and ['WE8ISO8859P1', 'WE8ISO8859P15', 'AL32UTF8', 'UTF8'].include? @conn.database_charset_name
49
49
  utf_8 = "\u00A1\u00A2\u00A3\u00A5\u00A7\u00A9"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-oci8
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 3
10
- version: 2.1.3
9
+ - 4
10
+ version: 2.1.4
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - KUBO Takehiro
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-11-11 00:00:00 +09:00
18
+ date: 2013-01-06 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies: []
21
21