Skip to content

Commit

Permalink
verify null
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiurin committed Dec 9, 2024
1 parent 904ca57 commit 3b982f1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void shouldInsertAndSelectStruct() throws SQLException {
try (Connection connection = createConnection()) {

try (PreparedStatement statement = connection
.prepareStatement("INSERT INTO statement_test (id) VALUES (?)")) {
.prepareStatement("INSERT INTO statement_test (id) VALUES (?),(null)")) {
statement.setLong(1, car1.getSales());
// statement.setString(2, car1.getMake());
// statement.setTimestamp(3, car1.getTs());
Expand All @@ -451,6 +451,12 @@ void shouldInsertAndSelectStruct() throws SQLException {
String expectedJson = String.format("{\"id\":\"%d\"}",
car1.getSales());
assertEquals(expectedJson, rs.getString(1));
// Verify null value
rs.next();
assertEquals(FireboltDataType.STRUCT.name().toLowerCase() + "(id long null)",
rs.getMetaData().getColumnTypeName(1).toLowerCase());
expectedJson = "{\"id\":null}";
assertEquals(expectedJson, rs.getString(1));
}
} finally {
executeStatementFromFile("/statements/statement/cleanup.sql");
Expand Down

0 comments on commit 3b982f1

Please sign in to comment.