Fix query profiled segments error (#4516)

Co-authored-by: Mrproliu <mrproliu@lagou.com>
This commit is contained in:
mrproliu 2020-03-15 20:32:36 +08:00 committed by GitHub
parent 2118a76250
commit 16de88c111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -79,9 +79,8 @@ public class H2ProfileThreadSnapshotQueryDAO implements IProfileThreadSnapshotQu
// search traces
sql = new StringBuilder();
sql.append("select * from ").append(SegmentRecord.INDEX_NAME).append(" where ");
sql.append(" 1=1 ");
for (int i = 0; i < segments.size(); i++) {
sql.append(" and ").append(SegmentRecord.SEGMENT_ID).append(" = ? ");
sql.append(i > 0 ? " or " : "").append(SegmentRecord.SEGMENT_ID).append(" = ? ");
}
sql.append(" order by ").append(SegmentRecord.START_TIME).append(" ").append(SortOrder.DESC);