Skip to content

Commit

Permalink
fix: don't ignore unquoted non-ascii whitespace
Browse files Browse the repository at this point in the history
add test showing inner white spaces not dropped on unquoted strings by
backend.
  • Loading branch information
bokken committed Jul 24, 2018
1 parent c89a54b commit aae0d48
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void testRetrieveArrays() throws SQLException {

// you need a lot of backslashes to get a double quote in.
stmt.executeUpdate("INSERT INTO arrtest VALUES ('{1,2,3}','{3.1,1.4}', '"
+ TestUtil.escapeString(conn, "{abc,f'a,\"fa\\\"b\",def}") + "')");
+ TestUtil.escapeString(conn, "{abc,f'a,\"fa\\\"b\",def, un quot\u000B \u2001 \r}") + "')");

ResultSet rs = stmt.executeQuery("SELECT intarr, decarr, strarr FROM arrtest");
Assert.assertTrue(rs.next());
Expand All @@ -239,6 +239,10 @@ public void testRetrieveArrays() throws SQLException {
Assert.assertEquals("f'a", strarr[0]);
Assert.assertEquals("fa\"b", strarr[1]);

strarr = (String[]) arr.getArray();
assertEquals(5, strarr.length);
assertEquals("un quot\u000B \u2001", strarr[4]);

rs.close();
stmt.close();
}
Expand Down

0 comments on commit aae0d48

Please sign in to comment.