Skip to content

Commit

Permalink
Merge branch 'master' into SNOW-1524152-implement-setQueryTimeout-for…
Browse files Browse the repository at this point in the history
…-async-queries
  • Loading branch information
sfc-gh-ext-simba-jf authored Dec 19, 2024
2 parents 41aedbf + 0251382 commit 4a54b1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public String getClientInfo(String name) throws SQLException {
@Override
public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
logger.trace("Array createArrayOf(String typeName, Object[] " + "elements)", false);
return new SfSqlArray(JDBCType.valueOf(typeName).getVendorTypeNumber(), elements);
return new SfSqlArray(JDBCType.valueOf(typeName.toUpperCase()).getVendorTypeNumber(), elements);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,11 @@ public void testWriteArray(ResultSetFormatType queryResultFormat) throws SQLExce
statement.execute(" CREATE OR REPLACE TABLE array_of_integers(arrayInt ARRAY(INTEGER))");

Array array = connection.createArrayOf("INTEGER", new Integer[] {1, 2, 3});
Array arrayFromLowerCaseType = connection.createArrayOf("integer", new Integer[] {1, 2, 3});
stmt.setArray(1, array);
stmt.executeUpdate();
stmt.setArray(1, arrayFromLowerCaseType);
stmt.executeUpdate();

try (ResultSet resultSet = statement.executeQuery("SELECT * from array_of_integers"); ) {
resultSet.next();
Expand All @@ -282,6 +285,10 @@ public void testWriteArray(ResultSetFormatType queryResultFormat) throws SQLExce
assertEquals(Long.valueOf(1), resultArray[0]);
assertEquals(Long.valueOf(2), resultArray[1]);
assertEquals(Long.valueOf(3), resultArray[2]);

resultSet.next();
Long[] resultArrayFromLowerCaseType = (Long[]) resultSet.getArray(1).getArray();
assertArrayEquals(resultArray, resultArrayFromLowerCaseType);
}
}
}
Expand Down

0 comments on commit 4a54b1e

Please sign in to comment.