Skip to content

Commit

Permalink
fix: fix testGetSQLTypeQueryCache by searching for xid type. We used …
Browse files Browse the repository at this point in the history
…to search for box type but it is now cached (#2810)

fix OidValueCorrectnessTest BOX_ARRAY OID, by adding BOX_ARRAY to the oidTypeName map
  • Loading branch information
davecramer committed Feb 15, 2023
1 parent 24e9ce3 commit 3d13b43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class OidValuesCorrectnessTest extends BaseTest4 {
* Helps in situation when variable name in Oid class isn't the same as typname in pg_type table.
*/
private static Map<String, String> oidTypeNames = new HashMap<String, String>() {{
put("BOX_ARRAY", "_BOX");
put("INT2_ARRAY", "_INT2");
put("INT4_ARRAY", "_INT4");
put("INT8_ARRAY", "_INT8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ public void testGetSQLTypeQueryCache() throws SQLException {
List<LogRecord> typeQueries = log.getRecordsMatching(SQL_TYPE_QUERY_LOG_FILTER);
assertEquals(0, typeQueries.size());

ti.getSQLType("box"); // this must be a type not in the hardcoded 'types' list
ti.getSQLType("xid"); // this must be a type not in the hardcoded 'types' list
typeQueries = log.getRecordsMatching(SQL_TYPE_QUERY_LOG_FILTER);
assertEquals(1, typeQueries.size());

ti.getSQLType("box"); // this time it should be retrieved from the cache
ti.getSQLType("xid"); // this time it should be retrieved from the cache
typeQueries = log.getRecordsMatching(SQL_TYPE_QUERY_LOG_FILTER);
assertEquals(1, typeQueries.size());
}
Expand Down

0 comments on commit 3d13b43

Please sign in to comment.