Skip to content

Commit

Permalink
fix(#12769): remove config history by derby. (#12796)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Qiu authored Oct 31, 2024
1 parent 4334cd1 commit e2d44f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class HistoryConfigInfoMapperByDerby extends AbstractMapperByDerby implem

@Override
public MapperResult removeConfigHistory(MapperContext context) {
String sql = "DELETE FROM his_config_info WHERE id IN( "
+ "SELECT id FROM his_config_info WHERE gmt_modified < ? OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY)";
String sql = "DELETE FROM his_config_info WHERE nid IN( "
+ "SELECT nid FROM his_config_info WHERE gmt_modified < ? OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY)";
return new MapperResult(sql, CollectionUtils.list(context.getWhereParameter(FieldConstant.START_TIME),
context.getWhereParameter(FieldConstant.LIMIT_SIZE)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void setUp() throws Exception {
void testRemoveConfigHistory() {
MapperResult mapperResult = historyConfigInfoMapperByDerby.removeConfigHistory(context);
assertEquals(mapperResult.getSql(),
"DELETE FROM his_config_info WHERE id IN( SELECT id FROM his_config_info WHERE gmt_modified < ? "
"DELETE FROM his_config_info WHERE nid IN( SELECT nid FROM his_config_info WHERE gmt_modified < ? "
+ "OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY)");
assertArrayEquals(new Object[] {startTime, limitSize}, mapperResult.getParamList().toArray());
}
Expand Down

0 comments on commit e2d44f2

Please sign in to comment.