This is an automated email from the ASF dual-hosted git repository.
gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new 51b1a9bdc [bugfix] fixed jpa expired data clean error (#2329)
51b1a9bdc is described below
commit 51b1a9bdc79d80e0216fb428d645f269ce762a19
Author: kangli <[email protected]>
AuthorDate: Thu Aug 1 10:08:11 2024 +0800
[bugfix] fixed jpa expired data clean error (#2329)
Co-authored-by: tomsun28 <[email protected]>
---
.../src/main/java/org/apache/hertzbeat/warehouse/dao/HistoryDao.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/dao/HistoryDao.java
b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/dao/HistoryDao.java
index d00bec8e4..7af37dfa9 100644
--- a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/dao/HistoryDao.java
+++ b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/dao/HistoryDao.java
@@ -46,7 +46,7 @@ public interface HistoryDao extends JpaRepository<History,
Long>, JpaSpecificati
*/
@Modifying
@Transactional(rollbackFor = Exception.class)
- @Query(value = "delete from hzb_history limit :delNum", nativeQuery = true)
+ @Query(value = "DELETE FROM hzb_history WHERE id IN ( SELECT t2.id from
(SELECT t1.id FROM hzb_history t1 LIMIT ?1) as t2)", nativeQuery = true)
int deleteOlderHistoriesRecord(@Param(value = "delNum") int delNum);
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]