diff --git a/pom.xml b/pom.xml
index 5924c466c7..2598e4b30c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -439,6 +439,7 @@
org.apache.maven.plugins
maven-surefire-plugin
+ -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8
3
3600
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/wireoutput/CopyDataResponse.java b/src/main/java/com/google/cloud/spanner/pgadapter/wireoutput/CopyDataResponse.java
index 871721d8e1..19101c663c 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/wireoutput/CopyDataResponse.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/wireoutput/CopyDataResponse.java
@@ -35,7 +35,7 @@ public enum ResponseType {
private final ResponseType responseType;
private final DataFormat format;
- private final String stringData;
+ private final byte[] stringData;
private final char rowTerminator;
private final Converter converter;
@@ -59,7 +59,11 @@ private CopyDataResponse(DataOutputStream output, int length, ResponseType respo
}
public CopyDataResponse(DataOutputStream output, String data, char rowTerminator) {
- super(output, data.length() + 5);
+ this(output, data.getBytes(StandardCharsets.UTF_8), rowTerminator);
+ }
+
+ private CopyDataResponse(DataOutputStream output, byte[] data, char rowTerminator) {
+ super(output, data.length + 5);
this.responseType = ResponseType.ROW;
this.format = DataFormat.POSTGRESQL_TEXT;
this.stringData = data;
@@ -87,7 +91,7 @@ public void send(boolean flush) throws Exception {
@Override
protected void sendPayload() throws Exception {
if (this.format == DataFormat.POSTGRESQL_TEXT) {
- this.outputStream.write(this.stringData.getBytes(StandardCharsets.UTF_8));
+ this.outputStream.write(this.stringData);
this.outputStream.write(this.rowTerminator);
} else if (this.format == DataFormat.POSTGRESQL_BINARY) {
if (this.responseType == ResponseType.TRAILER_WITH_HEADER) {
diff --git a/src/test/csharp/pgadapter_npgsql_tests/npgsql_tests/NpgsqlTest.cs b/src/test/csharp/pgadapter_npgsql_tests/npgsql_tests/NpgsqlTest.cs
index 44eee4ebc1..4e6d3e992a 100644
--- a/src/test/csharp/pgadapter_npgsql_tests/npgsql_tests/NpgsqlTest.cs
+++ b/src/test/csharp/pgadapter_npgsql_tests/npgsql_tests/NpgsqlTest.cs
@@ -241,7 +241,7 @@ public void TestQueryAllDataTypes()
Console.WriteLine($"Value mismatch: Got '{reader.GetDateTime(index)}', Want: '2022-03-29'");
return;
}
- if (reader.GetString(++index) != "test")
+ if (reader.GetString(++index) != "testÄ")
{
Console.WriteLine($"Value mismatch: Got '{reader.GetString(index)}', Want: 'test'");
return;
@@ -278,7 +278,7 @@ public void TestUpdateAllDataTypes()
new () {Value = DateTime.Parse("2022-04-02"), DbType = DbType.Date},
new () {Value = "test_string"},
new () {Value = JsonDocument.Parse("{\"key\": \"value\"}")},
- new () {Value = "test"},
+ new () {Value = "testÄ"},
}
};
var updateCount = cmd.ExecuteNonQuery();
@@ -384,7 +384,7 @@ public void TestInsertAllDataTypesReturning()
new () {Value = DateTime.Parse("2022-02-16T13:18:02.123456789Z").ToUniversalTime(), DbType = DbType.DateTimeOffset},
new () {Value = new NpgsqlInterval(14, 3, 14400000000L + 300000000L + 6789000L)},
new () {Value = DateTime.Parse("2022-03-29"), DbType = DbType.Date},
- new () {Value = "test"},
+ new () {Value = "testÄ"},
new () {Value = JsonDocument.Parse("{\"key\":\"value\"}")},
}
};
@@ -452,7 +452,7 @@ public void TestInsertAllDataTypesReturning()
Console.WriteLine($"Date value mismatch: Got '{reader.GetDateTime(index)}', Want: '2022-03-29'");
return;
}
- if (reader.GetString(++index) != "test")
+ if (reader.GetString(++index) != "testÄ")
{
Console.WriteLine($"Value mismatch: Got '{reader.GetString(index)}', Want: 'test'");
return;
@@ -871,6 +871,7 @@ public void TestBinaryCopyOut()
using var connection = new NpgsqlConnection(ConnectionString);
connection.Open();
+ Console.OutputEncoding = Encoding.UTF8;
using (var reader =
connection.BeginBinaryExport("COPY (select col_bigint, col_bool, col_bytea, col_float4, col_float8, col_int, col_numeric, col_timestamptz, col_interval::interval, col_date, col_varchar, col_jsonb, col_array_bigint, col_array_bool, col_array_bytea, col_array_float4, col_array_float8, col_array_int, col_array_numeric, col_array_timestamptz, col_array_interval, col_array_date, col_array_varchar, col_array_jsonb from all_types order by col_bigint) " +
"TO STDOUT (FORMAT BINARY)"))
@@ -1136,6 +1137,7 @@ public void TestTextCopyOut()
using var connection = new NpgsqlConnection(ConnectionString);
connection.Open();
+ Console.OutputEncoding = Encoding.UTF8;
using (var reader =
connection.BeginTextExport("COPY (select * from all_types order by col_bigint) " +
"TO STDOUT"))
diff --git a/src/test/golang/pgadapter_gorm_tests/gorm.go b/src/test/golang/pgadapter_gorm_tests/gorm.go
index da971d0788..678bc60667 100644
--- a/src/test/golang/pgadapter_gorm_tests/gorm.go
+++ b/src/test/golang/pgadapter_gorm_tests/gorm.go
@@ -263,7 +263,7 @@ func TestQueryAllDataTypes(connString string) *C.char {
if g, w := *row.ColDate, parseDate("2022-03-29"); !reflect.DeepEqual(g, w) {
return C.CString(fmt.Sprintf("ColDate mismatch\nGot: %v\nWant: %v", g, w))
}
- if g, w := *row.ColVarchar, "test"; g != w {
+ if g, w := *row.ColVarchar, "testÄ"; g != w {
return C.CString(fmt.Sprintf("ColVarchar mismatch\nGot: %v\nWant: %v", g, w))
}
diff --git a/src/test/golang/pgadapter_pgx5_tests/pgx.go b/src/test/golang/pgadapter_pgx5_tests/pgx.go
index 194bfddecc..f09f74c48e 100644
--- a/src/test/golang/pgadapter_pgx5_tests/pgx.go
+++ b/src/test/golang/pgadapter_pgx5_tests/pgx.go
@@ -227,7 +227,7 @@ func TestQueryAllDataTypes(connString string, oid, format int16) *C.char {
if g, w := intervalValue, wantIntervalValue; !reflect.DeepEqual(g, w) {
return C.CString(fmt.Sprintf("interval value mismatch\n Got: %v\nWant: %v", g, w))
}
- if g, w := varcharValue, "test"; g != w {
+ if g, w := varcharValue, "testÄ"; g != w {
return C.CString(fmt.Sprintf("value mismatch\n Got: %v\nWant: %v", g, w))
}
if g, w := jsonbValue, "{\"key\": \"value\"}"; g != w {
@@ -417,7 +417,7 @@ func TestInsertAllDataTypesReturning(connString string) *C.char {
if g, w := intervalValue, wantIntervalValue; !reflect.DeepEqual(g, w) {
return C.CString(fmt.Sprintf("interval value mismatch\n Got: %v\nWant: %v", g, w))
}
- if g, w := varcharValue, "test"; g != w {
+ if g, w := varcharValue, "testÄ"; g != w {
return C.CString(fmt.Sprintf("value mismatch\n Got: %v\nWant: %v", g, w))
}
if g, w := jsonbValue, "{\"key\": \"value\"}"; g != w {
diff --git a/src/test/golang/pgadapter_pgx_tests/pgx.go b/src/test/golang/pgadapter_pgx_tests/pgx.go
index 7049f3e32c..6c202c2490 100644
--- a/src/test/golang/pgadapter_pgx_tests/pgx.go
+++ b/src/test/golang/pgadapter_pgx_tests/pgx.go
@@ -250,7 +250,7 @@ func TestQueryAllDataTypes(connString string, oid, format int16) *C.char {
if g, w := timestamptzValue.UTC().String(), wantTimestamptzValue.UTC().String(); g != w {
return C.CString(fmt.Sprintf("value mismatch\n Got: %v\nWant: %v", g, w))
}
- if g, w := varcharValue, "test"; g != w {
+ if g, w := varcharValue, "testÄ"; g != w {
return C.CString(fmt.Sprintf("value mismatch\n Got: %v\nWant: %v", g, w))
}
if g, w := jsonbValue, "{\"key\": \"value\"}"; g != w {
@@ -526,7 +526,7 @@ func TestInsertAllDataTypesReturning(connString string) *C.char {
if g, w := timestamptzValue.UTC().String(), wantTimestamptzValue.UTC().String(); g != w {
return C.CString(fmt.Sprintf("value mismatch\n Got: %v\nWant: %v", g, w))
}
- if g, w := varcharValue, "test"; g != w {
+ if g, w := varcharValue, "testÄ"; g != w {
return C.CString(fmt.Sprintf("value mismatch\n Got: %v\nWant: %v", g, w))
}
if g, w := jsonbValue, "{\"key\": \"value\"}"; g != w {
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java
index eccd768686..2ca70a34b3 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/AbortedMockServerTest.java
@@ -346,7 +346,7 @@ public void testQueryWithParameters() throws SQLException {
new PGInterval("14 mons 3 days 4 hours 5 mins 6.789 secs"),
resultSet.getObject(++index, PGInterval.class));
assertEquals(LocalDate.of(2022, 3, 29), resultSet.getObject(++index, LocalDate.class));
- assertEquals("test", resultSet.getString(++index));
+ assertEquals("testÄ", resultSet.getString(++index));
assertEquals("{\"key\": \"value\"}", resultSet.getString(++index));
assertArrayEquals(
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/AbstractMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/AbstractMockServerTest.java
index b74996649e..6935cdd5a6 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/AbstractMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/AbstractMockServerTest.java
@@ -416,7 +416,7 @@ protected static ResultSet createAllTypesResultSet(
.build())
.addValues(Value.newBuilder().setStringValue("P1Y2M3DT4H5M6.789S").build())
.addValues(Value.newBuilder().setStringValue("2022-03-29").build())
- .addValues(Value.newBuilder().setStringValue("test").build())
+ .addValues(Value.newBuilder().setStringValue("testÄ").build())
.addValues(Value.newBuilder().setStringValue("{\"key\": \"value\"}").build())
.addValues(
Value.newBuilder()
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/CopyOutMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/CopyOutMockServerTest.java
index febd85244f..33d87b3665 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/CopyOutMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/CopyOutMockServerTest.java
@@ -227,7 +227,7 @@ public void testCopyOut() throws SQLException, IOException {
assertEquals(
"1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 13:18:02.123456+00\t"
- + "14 mons 3 days 04:05:6.789000\t2022-03-29\ttest\t{\"key\": \"value\"}\t{1,NULL,2}\t"
+ + "14 mons 3 days 04:05:6.789000\t2022-03-29\ttestÄ\t{\"key\": \"value\"}\t{1,NULL,2}\t"
+ "{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t"
+ "{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t"
+ "{\"2022-02-16 16:18:02.123456+00\",NULL,\"2000-01-01 00:00:00+00\"}\t"
@@ -267,7 +267,7 @@ public void testCopyOutWithColumns() throws SQLException, IOException {
assertEquals(
"1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 13:18:02.123456+00\t"
- + "14 mons 3 days 04:05:6.789000\t2022-03-29\ttest\t{\"key\": \"value\"}\t{1,NULL,2}\t"
+ + "14 mons 3 days 04:05:6.789000\t2022-03-29\ttestÄ\t{\"key\": \"value\"}\t{1,NULL,2}\t"
+ "{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t"
+ "{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t"
+ "{\"2022-02-16 16:18:02.123456+00\",NULL,\"2000-01-01 00:00:00+00\"}\t"
@@ -307,7 +307,7 @@ public void testCopyOutCsv() throws SQLException, IOException {
assertEquals(
"1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-"
- + "\"2022-03-29\"-test-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-"
+ + "\"2022-03-29\"-testÄ-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-"
+ "\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-"
+ "\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-"
+ "\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-"
@@ -337,8 +337,8 @@ public void testCopyOutCsvWithHeader() throws SQLException, IOException {
assertEquals(
"col_bigint-col_bool-col_bytea-col_float4-col_float8-col_int-col_numeric-col_timestamptz-col_interval-col_date-col_varchar-col_jsonb-col_array_bigint-col_array_bool-col_array_bytea-col_array_float4-col_array_float8-col_array_int-col_array_numeric-col_array_timestamptz-col_array_interval-col_array_date-col_array_varchar-col_array_jsonb\n"
- + "1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-\"2022-03-29\"-test-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-\"{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\"-\"{~\"2023-02-20~\",NULL,~\"2000-01-01~\"}\"-\"{~\"string1~\",NULL,~\"string2~\"}\"-\"{~\"{\\~\"key\\~\": \\~\"value1\\~\"}~\",NULL,~\"{\\~\"key\\~\": \\~\"value2\\~\"}~\"}\"\n"
- + "1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-\"2022-03-29\"-test-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-\"{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\"-\"{~\"2023-02-20~\",NULL,~\"2000-01-01~\"}\"-\"{~\"string1~\",NULL,~\"string2~\"}\"-\"{~\"{\\~\"key\\~\": \\~\"value1\\~\"}~\",NULL,~\"{\\~\"key\\~\": \\~\"value2\\~\"}~\"}\"\n"
+ + "1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-\"2022-03-29\"-testÄ-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-\"{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\"-\"{~\"2023-02-20~\",NULL,~\"2000-01-01~\"}\"-\"{~\"string1~\",NULL,~\"string2~\"}\"-\"{~\"{\\~\"key\\~\": \\~\"value1\\~\"}~\",NULL,~\"{\\~\"key\\~\": \\~\"value2\\~\"}~\"}\"\n"
+ + "1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-\"2022-03-29\"-testÄ-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-\"{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\"-\"{~\"2023-02-20~\",NULL,~\"2000-01-01~\"}\"-\"{~\"string1~\",NULL,~\"string2~\"}\"-\"{~\"{\\~\"key\\~\": \\~\"value1\\~\"}~\",NULL,~\"{\\~\"key\\~\": \\~\"value2\\~\"}~\"}\"\n"
+ "-----------------------\n",
writer.toString());
}
@@ -360,7 +360,7 @@ public void testCopyOutCsvWithColumnsAndHeader() throws SQLException, IOExceptio
assertEquals(
"col_bigint\n"
- + "1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-\"2022-03-29\"-test-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-\"{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\"-\"{~\"2023-02-20~\",NULL,~\"2000-01-01~\"}\"-\"{~\"string1~\",NULL,~\"string2~\"}\"-\"{~\"{\\~\"key\\~\": \\~\"value1\\~\"}~\",NULL,~\"{\\~\"key\\~\": \\~\"value2\\~\"}~\"}\"\n",
+ + "1-t-\\x74657374-3.14-3.14-100-6.626-\"2022-02-16 13:18:02.123456+00\"-14 mons 3 days 04:05:6.789000-\"2022-03-29\"-testÄ-\"{~\"key~\": ~\"value~\"}\"-{1,NULL,2}-{t,NULL,f}-\"{~\"\\\\x627974657331~\",NULL,~\"\\\\x627974657332~\"}\"-\"{3.14,NULL,-99.99}\"-\"{3.14,NULL,-99.99}\"-\"{-100,NULL,-200}\"-\"{6.626,NULL,-3.14}\"-\"{~\"2022-02-16 16:18:02.123456+00~\",NULL,~\"2000-01-01 00:00:00+00~\"}\"-\"{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\"-\"{~\"2023-02-20~\",NULL,~\"2000-01-01~\"}\"-\"{~\"string1~\",NULL,~\"string2~\"}\"-\"{~\"{\\~\"key\\~\": \\~\"value1\\~\"}~\",NULL,~\"{\\~\"key\\~\": \\~\"value2\\~\"}~\"}\"\n",
writer.toString());
}
}
@@ -382,7 +382,7 @@ public void testCopyOutCsvWithQueryAndHeader() throws SQLException, IOException
assertEquals(
"col_bigint|col_bool|col_bytea|col_float4|col_float8|col_int|col_numeric|col_timestamptz|col_interval|col_date|col_varchar|col_jsonb|col_array_bigint|col_array_bool|col_array_bytea|col_array_float4|col_array_float8|col_array_int|col_array_numeric|col_array_timestamptz|col_array_interval|col_array_date|col_array_varchar|col_array_jsonb\n"
+ "1|t|\"\\\\x74657374\"|3.14|3.14|100|6.626|2022-02-16 13:18:02.123456+00|"
- + "14 mons 3 days 04:05:6.789000|2022-03-29|test|\"{\\\"key\\\": \\\"value\\\"}\"|"
+ + "14 mons 3 days 04:05:6.789000|2022-03-29|testÄ|\"{\\\"key\\\": \\\"value\\\"}\"|"
+ "{1,NULL,2}|{t,NULL,f}|\"{\\\"\\\\\\\\x627974657331\\\",NULL,\\\"\\\\\\\\x627974657332\\\"}\"|"
+ "{3.14,NULL,-99.99}|{3.14,NULL,-99.99}|{-100,NULL,-200}|{6.626,NULL,-3.14}|"
+ "\"{\\\"2022-02-16 16:18:02.123456+00\\\",NULL,\\\"2000-01-01 00:00:00+00\\\"}\"|"
@@ -407,7 +407,7 @@ public void testCopyOutCsvWithQuote() throws SQLException, IOException {
assertEquals(
"1|t|\"\\\\x74657374\"|3.14|3.14|100|6.626|2022-02-16 13:18:02.123456+00|"
- + "14 mons 3 days 04:05:6.789000|2022-03-29|test|\"{\\\"key\\\": \\\"value\\\"}\"|"
+ + "14 mons 3 days 04:05:6.789000|2022-03-29|testÄ|\"{\\\"key\\\": \\\"value\\\"}\"|"
+ "{1,NULL,2}|{t,NULL,f}|\"{\\\"\\\\\\\\x627974657331\\\",NULL,\\\"\\\\\\\\x627974657332\\\"}\"|"
+ "{3.14,NULL,-99.99}|{3.14,NULL,-99.99}|{-100,NULL,-200}|{6.626,NULL,-3.14}|"
+ "\"{\\\"2022-02-16 16:18:02.123456+00\\\",NULL,\\\"2000-01-01 00:00:00+00\\\"}\"|"
@@ -433,7 +433,7 @@ public void testCopyOutCsvWithForceQuoteAll() throws SQLException, IOException {
assertEquals(
"\"1\"|\"t\"|\"\\\\x74657374\"|\"3.14\"|\"3.14\"|\"100\"|\"6.626\"|\"2022-02-16 13:18:02.123456+00\"|"
- + "\"14 mons 3 days 04:05:6.789000\"|\"2022-03-29\"|\"test\"|\"{\\\"key\\\": \\\"value\\\"}\"|"
+ + "\"14 mons 3 days 04:05:6.789000\"|\"2022-03-29\"|\"testÄ\"|\"{\\\"key\\\": \\\"value\\\"}\"|"
+ "\"{1,NULL,2}\"|\"{t,NULL,f}\"|\"{\\\"\\\\\\\\x627974657331\\\",NULL,\\\"\\\\\\\\x627974657332\\\"}\"|"
+ "\"{3.14,NULL,-99.99}\"|\"{3.14,NULL,-99.99}\"|\"{-100,NULL,-200}\"|\"{6.626,NULL,-3.14}\"|"
+ "\"{\\\"2022-02-16 16:18:02.123456+00\\\",NULL,\\\"2000-01-01 00:00:00+00\\\"}\"|"
@@ -550,7 +550,7 @@ public void testCopyOutBinaryPsql() throws Exception {
Value.interval(Interval.parseFromString("P1Y2M3DT4H5M6.789S")),
record.getValue(Type.interval(), ++index));
assertEquals(Value.date(Date.parseDate("2022-03-29")), record.getValue(Type.date(), ++index));
- assertEquals(Value.string("test"), record.getValue(Type.string(), ++index));
+ assertEquals(Value.string("testÄ"), record.getValue(Type.string(), ++index));
}
@Test
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java
index de82b59370..8171e7313a 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/JdbcMockServerTest.java
@@ -1633,7 +1633,7 @@ public void testQueryWithParameters() throws SQLException {
new PGInterval("14 mons 3 days 4 hours 5 mins 6.789 secs"),
resultSet.getObject(++index, PGInterval.class));
assertEquals(LocalDate.of(2022, 3, 29), resultSet.getObject(++index, LocalDate.class));
- assertEquals("test", resultSet.getString(++index));
+ assertEquals("testÄ", resultSet.getString(++index));
assertEquals("{\"key\": \"value\"}", resultSet.getString(++index));
for (int col = 1; col <= resultSet.getMetaData().getColumnCount(); col++) {
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/PsqlMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/PsqlMockServerTest.java
index 2788902c4a..090bb8b25e 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/PsqlMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/PsqlMockServerTest.java
@@ -293,7 +293,7 @@ public void testDeclareCursor() throws Exception {
+ "DECLARE CURSOR\n"
+ " col_bigint | col_bool | col_bytea | col_float4 | col_float8 | col_int | col_numeric | col_timestamptz | col_interval | col_date | col_varchar | col_jsonb | col_array_bigint | col_array_bool | col_array_bytea | col_array_float4 | col_array_float8 | col_array_int | col_array_numeric | col_array_timestamptz | col_array_interval | col_array_date | col_array_varchar | col_array_jsonb \n"
+ "------------+----------+------------+------------+------------+---------+-------------+-------------------------------+-------------------------------+------------+-------------+------------------+------------------+----------------+--------------------------------------------+--------------------+--------------------+------------------+--------------------+-----------------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------+----------------------------+--------------------------------------------------------\n"
- + " 1 | t | \\x74657374 | 3.14 | 3.14 | 100 | 6.626 | 2022-02-16 14:18:02.123456+01 | 14 mons 3 days 04:05:6.789000 | 2022-03-29 | test | {\"key\": \"value\"} | {1,NULL,2} | {t,NULL,f} | {\"\\\\x627974657331\",NULL,\"\\\\x627974657332\"} | {3.14,NULL,-99.99} | {3.14,NULL,-99.99} | {-100,NULL,-200} | {6.626,NULL,-3.14} | {\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"} | {-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000} | {\"2023-02-20\",NULL,\"2000-01-01\"} | {\"string1\",NULL,\"string2\"} | {\"{\\\"key\\\": \\\"value1\\\"}\",NULL,\"{\\\"key\\\": \\\"value2\\\"}\"}\n"
+ + " 1 | t | \\x74657374 | 3.14 | 3.14 | 100 | 6.626 | 2022-02-16 14:18:02.123456+01 | 14 mons 3 days 04:05:6.789000 | 2022-03-29 | testÄ | {\"key\": \"value\"} | {1,NULL,2} | {t,NULL,f} | {\"\\\\x627974657331\",NULL,\"\\\\x627974657332\"} | {3.14,NULL,-99.99} | {3.14,NULL,-99.99} | {-100,NULL,-200} | {6.626,NULL,-3.14} | {\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"} | {-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000} | {\"2023-02-20\",NULL,\"2000-01-01\"} | {\"string1\",NULL,\"string2\"} | {\"{\\\"key\\\": \\\"value1\\\"}\",NULL,\"{\\\"key\\\": \\\"value2\\\"}\"}\n"
+ "(1 row)\n"
+ "\n"
+ "CLOSE CURSOR",
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/csharp/AbstractNpgsqlMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/csharp/AbstractNpgsqlMockServerTest.java
index 6f2118180f..82f5f2c01e 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/csharp/AbstractNpgsqlMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/csharp/AbstractNpgsqlMockServerTest.java
@@ -32,6 +32,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
import java.util.Scanner;
import org.junit.BeforeClass;
import org.postgresql.core.Oid;
@@ -893,7 +894,8 @@ static String execute(String test, String connectionString)
static String readAll(InputStream inputStream) {
StringBuilder result = new StringBuilder();
- try (Scanner scanner = new Scanner(new InputStreamReader(inputStream))) {
+ try (Scanner scanner =
+ new Scanner(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
while (scanner.hasNextLine()) {
result.append(scanner.nextLine()).append("\n");
}
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/csharp/ITNpgsqlTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/csharp/ITNpgsqlTest.java
index 6382893a91..87a7b1515d 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/csharp/ITNpgsqlTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/csharp/ITNpgsqlTest.java
@@ -120,7 +120,7 @@ public void insertTestData() {
.set("col_date")
.to(Date.parseDate("2022-03-29"))
.set("col_varchar")
- .to("test")
+ .to("testÄ")
.set("col_jsonb")
.to("{\"key\": \"value\"}")
.set("col_array_bigint")
@@ -392,7 +392,7 @@ public void testBinaryCopyOut() throws IOException, InterruptedException {
addNullRow();
String result = execute("TestBinaryCopyOut", createConnectionString());
assertEqualsIgnoreControlCharacters(
- "1\tTrue\tdGVzdA==\t3.14\t3.14\t100\t6.626\t20220216T131802123456\t14M3DT14706789000\t20220329\ttest\t{\"key\": \"value\"}\t[1, , 2]\t[True, , False]\t[Ynl0ZXMx, , Ynl0ZXMy]\t[3.14, , -99.99]\t[3.14, , -99.99]\t[-100, , -200]\t[6.626, , -3.14]\t[20220216T161802123456, , 20000101T000000]\tNULL\t[20230220, , 20000101]\t[string1, , string2]\t[{\"key\": \"value1\"}, , {\"key\": \"value2\"}]\n"
+ "1\tTrue\tdGVzdA==\t3.14\t3.14\t100\t6.626\t20220216T131802123456\t14M3DT14706789000\t20220329\ttest\u00C4\t{\"key\": \"value\"}\t[1, , 2]\t[True, , False]\t[Ynl0ZXMx, , Ynl0ZXMy]\t[3.14, , -99.99]\t[3.14, , -99.99]\t[-100, , -200]\t[6.626, , -3.14]\t[20220216T161802123456, , 20000101T000000]\tNULL\t[20230220, , 20000101]\t[string1, , string2]\t[{\"key\": \"value1\"}, , {\"key\": \"value2\"}]\n"
+ "2\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\n"
+ "Success\n",
result);
@@ -404,7 +404,7 @@ public void testTextCopyOut() throws IOException, InterruptedException {
addNullRow();
String result = execute("TestTextCopyOut", createConnectionString());
assertEqualsIgnoreControlCharacters(
- "1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 14:18:02.123456+01\tP1Y2M3DT4H5M6.789S\t2022-03-29\ttest\t{\"key\": \"value\"}\t{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t{\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"}\t\\N\t{\"2023-02-20\",NULL,\"2000-01-01\"}\t{\"string1\",NULL,\"string2\"}\t{\"{\\\\\"key\\\\\": \\\\\"value1\\\\\"}\",NULL,\"{\\\\\"key\\\\\": \\\\\"value2\\\\\"}\"}\n"
+ "1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 14:18:02.123456+01\tP1Y2M3DT4H5M6.789S\t2022-03-29\ttest\u00C4\t{\"key\": \"value\"}\t{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t{\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"}\t\\N\t{\"2023-02-20\",NULL,\"2000-01-01\"}\t{\"string1\",NULL,\"string2\"}\t{\"{\\\\\"key\\\\\": \\\\\"value1\\\\\"}\",NULL,\"{\\\\\"key\\\\\": \\\\\"value2\\\\\"}\"}\n"
+ "2\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\n"
+ "Success\n",
result);
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/csharp/NpgsqlMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/csharp/NpgsqlMockServerTest.java
index 32cc9749cb..f8148ab21d 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/csharp/NpgsqlMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/csharp/NpgsqlMockServerTest.java
@@ -261,7 +261,7 @@ public void testUpdateAllDataTypes() throws IOException, InterruptedException {
.bind("p10")
.to(com.google.cloud.spanner.Value.pgJsonb("{\"key\":\"value\"}"))
.bind("p11")
- .to("test")
+ .to("testÄ")
.build(),
1L));
@@ -406,7 +406,7 @@ public void testInsertAllDataTypesReturning() throws IOException, InterruptedExc
.bind("p10")
.to(Date.parseDate("2022-03-29"))
.bind("p11")
- .to("test")
+ .to("testÄ")
.bind("p12")
.to(com.google.cloud.spanner.Value.pgJsonb("{\"key\":\"value\"}"))
.build(),
@@ -652,7 +652,7 @@ public void testBinaryCopyOut() throws IOException, InterruptedException {
String result = execute("TestBinaryCopyOut", createConnectionString());
assertEquals(
- "1\tTrue\tdGVzdA==\t3.14\t3.14\t100\t6.626\t20220216T131802123456\t14M3DT14706789000\t20220329\ttest\t{\"key\": \"value\"}\t[1, , 2]\t[True, , False]\t[Ynl0ZXMx, , Ynl0ZXMy]\t[3.14, , -99.99]\t[3.14, , -99.99]\t[-100, , -200]\t[6.626, , -3.14]\t[20220216T161802123456, , 20000101T000000]\t[-100M0DT123456789000, NULL, 12M0DT0]\t[20230220, , 20000101]\t[string1, , string2]\t[{\"key\": \"value1\"}, , {\"key\": \"value2\"}]\n"
+ "1\tTrue\tdGVzdA==\t3.14\t3.14\t100\t6.626\t20220216T131802123456\t14M3DT14706789000\t20220329\ttestÄ\t{\"key\": \"value\"}\t[1, , 2]\t[True, , False]\t[Ynl0ZXMx, , Ynl0ZXMy]\t[3.14, , -99.99]\t[3.14, , -99.99]\t[-100, , -200]\t[6.626, , -3.14]\t[20220216T161802123456, , 20000101T000000]\t[-100M0DT123456789000, NULL, 12M0DT0]\t[20230220, , 20000101]\t[string1, , string2]\t[{\"key\": \"value1\"}, , {\"key\": \"value2\"}]\n"
+ "NULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\tNULL\n"
+ "Success\n",
result);
@@ -672,7 +672,7 @@ public void testTextCopyOut() throws IOException, InterruptedException {
String result = execute("TestTextCopyOut", createConnectionString());
assertEquals(
- "1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 14:18:02.123456+01\t14 mons 3 days 04:05:6.789000\t2022-03-29\ttest\t{\"key\": \"value\"}\t{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t{\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"}\t{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\t{\"2023-02-20\",NULL,\"2000-01-01\"}\t{\"string1\",NULL,\"string2\"}\t{\"{\\\\\"key\\\\\": \\\\\"value1\\\\\"}\",NULL,\"{\\\\\"key\\\\\": \\\\\"value2\\\\\"}\"}\n"
+ "1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 14:18:02.123456+01\t14 mons 3 days 04:05:6.789000\t2022-03-29\ttestÄ\t{\"key\": \"value\"}\t{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t{\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"}\t{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\t{\"2023-02-20\",NULL,\"2000-01-01\"}\t{\"string1\",NULL,\"string2\"}\t{\"{\\\\\"key\\\\\": \\\\\"value1\\\\\"}\",NULL,\"{\\\\\"key\\\\\": \\\\\"value2\\\\\"}\"}\n"
+ "\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\n"
+ "Success\n",
result);
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgx5Test.java b/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgx5Test.java
index 57d410de36..5358fd602a 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgx5Test.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgx5Test.java
@@ -149,7 +149,7 @@ public void insertTestData() {
.set("col_date")
.to(Date.parseDate("2022-03-29"))
.set("col_varchar")
- .to("test")
+ .to("testÄ")
.set("col_jsonb")
.to("{\"key\": \"value\"}")
.build()));
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgxTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgxTest.java
index 88bbcd9a9f..cef10aa0f2 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgxTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/golang/ITPgxTest.java
@@ -150,7 +150,7 @@ public void insertTestData() {
.set("col_date")
.to(Date.parseDate("2022-03-29"))
.set("col_varchar")
- .to("test")
+ .to("testÄ")
.set("col_jsonb")
.to("{\"key\": \"value\"}")
.set("col_array_bigint")
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/KnexMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/KnexMockServerTest.java
index 26d25e158e..0371bd7543 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/KnexMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/KnexMockServerTest.java
@@ -149,7 +149,7 @@ public void testSelectAllTypes() throws Exception {
+ " col_timestamptz: 2022-02-16T13:18:02.123Z,\n"
+ " col_interval: PostgresInterval { months: 14, days: 3 },\n"
+ " col_date: '2022-03-29',\n"
- + " col_varchar: 'test',\n"
+ + " col_varchar: 'testÄ',\n"
+ " col_jsonb: { key: 'value' },\n"
+ " col_array_bigint: [ '1', null, '2' ],\n"
+ " col_array_bool: [ true, null, false ],\n"
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/NodePostgresMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/NodePostgresMockServerTest.java
index 630718d907..9395d04efe 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/NodePostgresMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/NodePostgresMockServerTest.java
@@ -483,7 +483,7 @@ public void testSelectAllTypes() throws IOException, InterruptedException {
+ "\"col_timestamptz\":\"2022-02-16T13:18:02.123Z\","
+ "\"col_interval\":{\"months\":14,\"days\":3},"
+ "\"col_date\":\"2022-03-29\","
- + "\"col_varchar\":\"test\","
+ + "\"col_varchar\":\"testÄ\","
+ "\"col_jsonb\":{\"key\":\"value\"},"
+ "\"col_array_bigint\":[\"1\",null,\"2\"],"
+ "\"col_array_bool\":[true,null,false],"
@@ -622,7 +622,7 @@ public void testCopyTo() throws Exception {
String output = runTest("testCopyTo", getHost(), pgServer.getLocalPort());
assertEquals(
- "1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 13:18:02.123456+00\t14 mons 3 days 04:05:6.789000\t2022-03-29\ttest\t{\"key\": \"value\"}\t"
+ "1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 13:18:02.123456+00\t14 mons 3 days 04:05:6.789000\t2022-03-29\ttestÄ\t{\"key\": \"value\"}\t"
+ "{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t"
+ "{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t"
+ "{\"2022-02-16 16:18:02.123456+00\",NULL,\"2000-01-01 00:00:00+00\"}\t"
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/PrismaMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/PrismaMockServerTest.java
index 3dd55300ef..6299bfc978 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/PrismaMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/PrismaMockServerTest.java
@@ -778,7 +778,7 @@ public void testCreateAllTypes() throws IOException, InterruptedException {
+ " col_timestamptz: 2022-02-16T13:18:02.123Z,\n"
+ " col_interval: 'P1Y2M3DT4H5M6.789S',\n"
+ " col_date: 2022-03-29T00:00:00.000Z,\n"
- + " col_varchar: 'test',\n"
+ + " col_varchar: 'testÄ',\n"
+ " col_jsonb: { key: 'value' },\n"
+ " col_array_bigint: [ 1n, 1n, 2n ],\n"
+ " col_array_bool: [ true, true, false ],\n"
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/SequelizeMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/SequelizeMockServerTest.java
index 8c48031631..ff409c68e0 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/SequelizeMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/SequelizeMockServerTest.java
@@ -248,7 +248,7 @@ public void testSelectAllTypes() throws Exception {
+ " \"col_numeric\": \"6.626\",\n"
+ " \"col_timestamptz\": \"2022-02-16T13:18:02.123Z\",\n"
+ " \"col_date\": \"2022-03-29\",\n"
- + " \"col_varchar\": \"test\",\n"
+ + " \"col_varchar\": \"testÄ\",\n"
+ " \"col_jsonb\": {\n"
+ " \"key\": \"value\"\n"
+ " }\n"
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/TypeORMMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/TypeORMMockServerTest.java
index 2b31761946..763c726943 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/TypeORMMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/nodejs/TypeORMMockServerTest.java
@@ -577,7 +577,7 @@ public void testFindOneAllTypes() throws IOException, InterruptedException {
+ " col_numeric: '6.626',\n"
+ " col_timestamptz: 2022-02-16T13:18:02.123Z,\n"
+ " col_date: '2022-03-29',\n"
- + " col_varchar: 'test',\n"
+ + " col_varchar: 'testÄ',\n"
+ " col_jsonb: { key: 'value' }\n"
+ "}\n",
output);
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/php/pdo/PdoMockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/php/pdo/PdoMockServerTest.java
index be620a688e..cd92345270 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/php/pdo/PdoMockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/php/pdo/PdoMockServerTest.java
@@ -312,8 +312,8 @@ public void testQueryAllDataTypes() throws Exception {
+ " [8] => 14 mons 3 days 04:05:6.789000\n"
+ " [col_date] => 2022-03-29\n"
+ " [9] => 2022-03-29\n"
- + " [col_varchar] => test\n"
- + " [10] => test\n"
+ + " [col_varchar] => testÄ\n"
+ + " [10] => testÄ\n"
+ " [col_jsonb] => {\"key\": \"value\"}\n"
+ " [11] => {\"key\": \"value\"}\n"
+ " [col_array_bigint] => {1,NULL,2}\n"
@@ -385,8 +385,8 @@ public void testQueryAllDataTypesWithParameter() throws Exception {
+ " [8] => 14 mons 3 days 04:05:6.789000\n"
+ " [col_date] => 2022-03-29\n"
+ " [9] => 2022-03-29\n"
- + " [col_varchar] => test\n"
- + " [10] => test\n"
+ + " [col_varchar] => testÄ\n"
+ + " [10] => testÄ\n"
+ " [col_jsonb] => {\"key\": \"value\"}\n"
+ " [11] => {\"key\": \"value\"}\n"
+ " [col_array_bigint] => {1,NULL,2}\n"
@@ -663,7 +663,7 @@ public void testTextCopyOut() throws Exception {
assertEquals(
"Array\n"
+ "(\n"
- + " [0] => 1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 14:18:02.123456+01\t14 mons 3 days 04:05:6.789000\t2022-03-29\ttest\t{\"key\": \"value\"}\t{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t{\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"}\t{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\t{\"2023-02-20\",NULL,\"2000-01-01\"}\t{\"string1\",NULL,\"string2\"}\t{\"{\\\\\"key\\\\\": \\\\\"value1\\\\\"}\",NULL,\"{\\\\\"key\\\\\": \\\\\"value2\\\\\"}\"}\n"
+ + " [0] => 1\tt\t\\\\x74657374\t3.14\t3.14\t100\t6.626\t2022-02-16 14:18:02.123456+01\t14 mons 3 days 04:05:6.789000\t2022-03-29\ttestÄ\t{\"key\": \"value\"}\t{1,NULL,2}\t{t,NULL,f}\t{\"\\\\\\\\x627974657331\",NULL,\"\\\\\\\\x627974657332\"}\t{3.14,NULL,-99.99}\t{3.14,NULL,-99.99}\t{-100,NULL,-200}\t{6.626,NULL,-3.14}\t{\"2022-02-16 17:18:02.123456+01\",NULL,\"2000-01-01 01:00:00+01\"}\t{-100 mons 0 days 34:17:36.789000,NULL,12 mons 0 days 00:00:0.000000}\t{\"2023-02-20\",NULL,\"2000-01-01\"}\t{\"string1\",NULL,\"string2\"}\t{\"{\\\\\"key\\\\\": \\\\\"value1\\\\\"}\",NULL,\"{\\\\\"key\\\\\": \\\\\"value2\\\\\"}\"}\n"
+ "\n"
+ " [1] => \\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\t\\N\n"
+ "\n"
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/python/pg8000/Pg8000BasicsTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/python/pg8000/Pg8000BasicsTest.java
index 8eec0adeca..1e4be62bc5 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/python/pg8000/Pg8000BasicsTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/python/pg8000/Pg8000BasicsTest.java
@@ -101,7 +101,7 @@ public void testSelectAllTypes() throws Exception {
String actualOutput = execute("select_all_types.py", host, pgServer.getLocalPort());
String expectedOutput =
- "row: [1, True, b'test', 3.14, 3.14, 100, Decimal('6.626'), datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc), , datetime.date(2022, 3, 29), 'test', {'key': 'value'}, [1, None, 2], [True, None, False], [b'bytes1', None, b'bytes2'], [3.14, None, -99.99], [3.14, None, -99.99], [-100, None, -200], [Decimal('6.626'), None, Decimal('-3.14')], [datetime.datetime(2022, 2, 16, 16, 18, 2, 123456, tzinfo=datetime.timezone.utc), None, datetime.datetime(2000, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)], [, None, ], [datetime.date(2023, 2, 20), None, datetime.date(2000, 1, 1)], ['string1', None, 'string2'], [{'key': 'value1'}, None, {'key': 'value2'}]]\n";
+ "row: [1, True, b'test', 3.14, 3.14, 100, Decimal('6.626'), datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc), , datetime.date(2022, 3, 29), 'testÄ', {'key': 'value'}, [1, None, 2], [True, None, False], [b'bytes1', None, b'bytes2'], [3.14, None, -99.99], [3.14, None, -99.99], [-100, None, -200], [Decimal('6.626'), None, Decimal('-3.14')], [datetime.datetime(2022, 2, 16, 16, 18, 2, 123456, tzinfo=datetime.timezone.utc), None, datetime.datetime(2000, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)], [, None, ], [datetime.date(2023, 2, 20), None, datetime.date(2000, 1, 1)], ['string1', None, 'string2'], [{'key': 'value1'}, None, {'key': 'value2'}]]\n";
assertEquals(expectedOutput, actualOutput.replace("tzlocal()", "tzutc()"));
}
@@ -112,8 +112,8 @@ public void testSelectParameterized() throws Exception {
String actualOutput = execute("select_parameterized.py", host, pgServer.getLocalPort());
String expectedOutput =
- "first execution: [1, True, b'test', 3.14, 3.14, 100, Decimal('6.626'), datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc), , datetime.date(2022, 3, 29), 'test', {'key': 'value'}, [1, None, 2], [True, None, False], [b'bytes1', None, b'bytes2'], [3.14, None, -99.99], [3.14, None, -99.99], [-100, None, -200], [Decimal('6.626'), None, Decimal('-3.14')], [datetime.datetime(2022, 2, 16, 16, 18, 2, 123456, tzinfo=datetime.timezone.utc), None, datetime.datetime(2000, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)], [, None, ], [datetime.date(2023, 2, 20), None, datetime.date(2000, 1, 1)], ['string1', None, 'string2'], [{'key': 'value1'}, None, {'key': 'value2'}]]\n"
- + "second execution: [1, True, b'test', 3.14, 3.14, 100, Decimal('6.626'), datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc), , datetime.date(2022, 3, 29), 'test', {'key': 'value'}, [1, None, 2], [True, None, False], [b'bytes1', None, b'bytes2'], [3.14, None, -99.99], [3.14, None, -99.99], [-100, None, -200], [Decimal('6.626'), None, Decimal('-3.14')], [datetime.datetime(2022, 2, 16, 16, 18, 2, 123456, tzinfo=datetime.timezone.utc), None, datetime.datetime(2000, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)], [, None, ], [datetime.date(2023, 2, 20), None, datetime.date(2000, 1, 1)], ['string1', None, 'string2'], [{'key': 'value1'}, None, {'key': 'value2'}]]\n";
+ "first execution: [1, True, b'test', 3.14, 3.14, 100, Decimal('6.626'), datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc), , datetime.date(2022, 3, 29), 'testÄ', {'key': 'value'}, [1, None, 2], [True, None, False], [b'bytes1', None, b'bytes2'], [3.14, None, -99.99], [3.14, None, -99.99], [-100, None, -200], [Decimal('6.626'), None, Decimal('-3.14')], [datetime.datetime(2022, 2, 16, 16, 18, 2, 123456, tzinfo=datetime.timezone.utc), None, datetime.datetime(2000, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)], [, None, ], [datetime.date(2023, 2, 20), None, datetime.date(2000, 1, 1)], ['string1', None, 'string2'], [{'key': 'value1'}, None, {'key': 'value2'}]]\n"
+ + "second execution: [1, True, b'test', 3.14, 3.14, 100, Decimal('6.626'), datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc), , datetime.date(2022, 3, 29), 'testÄ', {'key': 'value'}, [1, None, 2], [True, None, False], [b'bytes1', None, b'bytes2'], [3.14, None, -99.99], [3.14, None, -99.99], [-100, None, -200], [Decimal('6.626'), None, Decimal('-3.14')], [datetime.datetime(2022, 2, 16, 16, 18, 2, 123456, tzinfo=datetime.timezone.utc), None, datetime.datetime(2000, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)], [, None, ], [datetime.date(2023, 2, 20), None, datetime.date(2000, 1, 1)], ['string1', None, 'string2'], [{'key': 'value1'}, None, {'key': 'value2'}]]\n";
assertEquals(expectedOutput, actualOutput);
List messages = getWireMessages();
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/python/psycopg3/Psycopg3MockServerTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/python/psycopg3/Psycopg3MockServerTest.java
index 00d30eb2b2..4ce8642dd8 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/python/psycopg3/Psycopg3MockServerTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/python/psycopg3/Psycopg3MockServerTest.java
@@ -289,7 +289,7 @@ public void testQueryAllDataTypes() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -336,7 +336,7 @@ public void testQueryAllDataTypesWithParameter() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -398,7 +398,7 @@ private void testQueryAllDataTypesWithFixedFormat(DataFormat format) throws Exce
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -841,7 +841,7 @@ public void testInsertAllDataTypesReturning() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -1108,7 +1108,7 @@ public void testBinaryCopyOut() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -1178,7 +1178,7 @@ public void testTextCopyOut() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -1241,7 +1241,7 @@ public void testPrepareQuery() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -1442,7 +1442,7 @@ public void testNamedCursor() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
@@ -1481,7 +1481,7 @@ public void testNestedTransaction() throws Exception {
+ "col_timestamptz: 2022-02-16 13:18:02.123456+00:00\n"
+ "col_interval: P1Y2M3DT4H5M6.789S\n"
+ "col_date: 2022-03-29\n"
- + "col_string: test\n"
+ + "col_string: testÄ\n"
+ "col_jsonb: {'key': 'value'}\n"
+ "col_array_bigint: [1, None, 2]\n"
+ "col_array_bool: [True, None, False]\n"
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy/SqlAlchemyOrmTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy/SqlAlchemyOrmTest.java
index 9cde30b826..d1c3907303 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy/SqlAlchemyOrmTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy/SqlAlchemyOrmTest.java
@@ -152,7 +152,7 @@ public void testSelectAllTypes() throws Exception {
String actualOutput = execute("orm_select_first.py", host, pgServer.getLocalPort());
String expectedOutput =
- "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'test'col_jsonb= {'key': 'value'})\n";
+ "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'testÄ'col_jsonb= {'key': 'value'})\n";
assertEquals(expectedOutput, actualOutput);
assertEquals(2, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class));
@@ -175,7 +175,7 @@ public void testGetAllTypes() throws Exception {
String actualOutput = execute("orm_get.py", host, pgServer.getLocalPort());
String expectedOutput =
- "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'test'col_jsonb= {'key': 'value'})\n";
+ "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'testÄ'col_jsonb= {'key': 'value'})\n";
assertEquals(expectedOutput, actualOutput);
assertEquals(2, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class));
@@ -231,7 +231,7 @@ public void testGetAllTypesWithPreparedStatement() throws Exception {
String actualOutput =
execute("orm_get_with_prepared_statement.py", host, pgServer.getLocalPort());
String expectedOutput =
- "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'test'col_jsonb= {'key': 'value'})\n";
+ "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'testÄ'col_jsonb= {'key': 'value'})\n";
assertEquals(expectedOutput, actualOutput);
// We receive 3 ExecuteSqlRequests:
@@ -266,7 +266,7 @@ public void testOrmReadOnlyTransaction() throws Exception {
String actualOutput = execute("orm_read_only_transaction.py", host, pgServer.getLocalPort());
String expectedOutput =
- "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'test'col_jsonb= {'key': 'value'})\n";
+ "AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'testÄ'col_jsonb= {'key': 'value'})\n";
assertEquals(expectedOutput, actualOutput);
assertEquals(2, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class));
@@ -393,7 +393,7 @@ public void testRollback() throws Exception {
String actualOutput = execute("orm_rollback.py", host, pgServer.getLocalPort());
String expectedOutput =
"Before rollback: AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'updated string'col_jsonb= {'key': 'value'})\n"
- + "After rollback: AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'test'col_jsonb= {'key': 'value'})\n";
+ + "After rollback: AllTypes(col_bigint= 1,col_bool= True,col_bytea= b'test'col_float8= 3.14col_int= 100col_numeric= Decimal('6.626')col_timestamptz=datetime.datetime(2022, 2, 16, 13, 18, 2, 123456, tzinfo=datetime.timezone.utc)col_date= datetime.date(2022, 3, 29)col_varchar= 'testÄ'col_jsonb= {'key': 'value'})\n";
assertEquals(expectedOutput, actualOutput);
assertEquals(4, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class));
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy2/SqlAlchemy2OrmTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy2/SqlAlchemy2OrmTest.java
index 9946371266..5b32a5dc1b 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy2/SqlAlchemy2OrmTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/python/sqlalchemy2/SqlAlchemy2OrmTest.java
@@ -102,7 +102,7 @@ public class SqlAlchemy2OrmTest extends AbstractMockServerTest {
+ "col_timestamptz='2022-02-16T13:18:02.123456+00:00'\n"
+ "col_interval= 'P1Y2M3DT4H5M6.789S'\n"
+ "col_date= datetime.date(2022, 3, 29)\n"
- + "col_varchar= 'test'\n"
+ + "col_varchar= 'testÄ'\n"
+ "col_jsonb= {'key': 'value'}\n"
+ "col_array_bigint= [1, None, 2]\n"
+ "col_array_bool= [True, None, False]\n"
@@ -482,7 +482,7 @@ public void testUpdateAllTypes() throws Exception {
String actualOutput = execute("orm_update.py", host, pgServer.getLocalPort());
String expectedOutput =
- ALL_TYPES_ROW.replaceFirst("col_varchar=(\\s*)'test'", "col_varchar=$1'updated string'");
+ ALL_TYPES_ROW.replaceFirst("col_varchar=(\\s*)'testÄ'", "col_varchar=$1'updated string'");
assertEquals(expectedOutput, actualOutput);
assertEquals(5, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class));
@@ -565,7 +565,7 @@ public void testRollback() throws Exception {
String expectedOutput =
"Before rollback: "
+ ALL_TYPES_ROW.replaceFirst(
- "col_varchar=(\\s*)'test'", "col_varchar=$1'updated string'")
+ "col_varchar=(\\s*)'testÄ'", "col_varchar=$1'updated string'")
+ "After rollback: "
+ ALL_TYPES_ROW;
assertEquals(expectedOutput, actualOutput);