提交 762aacbb authored 作者: Thomas Mueller's avatar Thomas Mueller

The Recover tool did not convert correctly convert CLOB data with non-ASCII characters.

上级 9ee0fdc3
...@@ -18,7 +18,8 @@ Change Log ...@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>- <ul><li>The Recover tool did not convert correctly convert CLOB data with non-ASCII characters.
This was also a problem when using the automatic upgrade to the page store file format.
</li></ul> </li></ul>
<h2>Version 1.2.128 (2010-01-30)</h2> <h2>Version 1.2.128 (2010-01-30)</h2>
......
...@@ -162,7 +162,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -162,7 +162,7 @@ public class Recover extends Tool implements DataHandler {
* INTERNAL * INTERNAL
*/ */
public static Reader readClob(String fileName) throws IOException { public static Reader readClob(String fileName) throws IOException {
return new BufferedReader(new InputStreamReader(readBlob(fileName))); return new BufferedReader(new InputStreamReader(readBlob(fileName), "UTF-8"));
} }
/** /**
......
...@@ -309,7 +309,7 @@ public class TestTools extends TestBase { ...@@ -309,7 +309,7 @@ public class TestTools extends TestBase {
stat.execute("create table test(id int primary key, name varchar, b blob, c clob)"); stat.execute("create table test(id int primary key, name varchar, b blob, c clob)");
stat.execute("create table \"test 2\"(id int primary key, name varchar)"); stat.execute("create table \"test 2\"(id int primary key, name varchar)");
stat.execute("comment on table test is ';-)'"); stat.execute("comment on table test is ';-)'");
stat.execute("insert into test values(1, 'Hello', SECURE_RAND(2000), space(2000))"); stat.execute("insert into test values(1, 'Hello', SECURE_RAND(4100), '\u00e4' || space(4100))");
ResultSet rs; ResultSet rs;
rs = stat.executeQuery("select * from test"); rs = stat.executeQuery("select * from test");
rs.next(); rs.next();
...@@ -343,8 +343,9 @@ public class TestTools extends TestBase { ...@@ -343,8 +343,9 @@ public class TestTools extends TestBase {
assertEquals("Hello", rs.getString(2)); assertEquals("Hello", rs.getString(2));
byte[] b2 = rs.getBytes(3); byte[] b2 = rs.getBytes(3);
String s2 = rs.getString(4); String s2 = rs.getString(4);
assertEquals(2000, b2.length); assertEquals("\u00e4 ", s2.substring(0, 2));
assertEquals(2000, s2.length()); assertEquals(4100, b2.length);
assertEquals(4101, s2.length());
assertEquals(b1, b2); assertEquals(b1, b2);
assertEquals(s1, s2); assertEquals(s1, s2);
assertFalse(rs.next()); assertFalse(rs.next());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论