Skip to content

Commit

Permalink
[bug](proc) fix NumberFormatException in show proc '/current_queries' (
Browse files Browse the repository at this point in the history
…#21400)

If the current query is running for a very long time, the ExecTime of this query may larger than the MAX_INT value, then a NumberFormatException will be thrown when execute "show proc '/current_queries'."
The query's ExecTime is long type, we should not use 'Integer.parseInt' to parse it.
  • Loading branch information
xy720 authored Jul 1, 2023
1 parent 1c961f2 commit f74e635
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public ProcResult fetchResult() throws AnalysisException {

// sort according to ExecTime
sortedRowData.sort((l1, l2) -> {
final int execTime1 = Integer.parseInt(l1.get(EXEC_TIME_INDEX));
final int execTime2 = Integer.parseInt(l2.get(EXEC_TIME_INDEX));
return execTime2 - execTime1;
final long execTime1 = Long.parseLong(l1.get(EXEC_TIME_INDEX));
final long execTime2 = Long.parseLong(l2.get(EXEC_TIME_INDEX));
return Long.compare(execTime2, execTime1);
});
result.setRows(sortedRowData);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public ProcResult fetchResult() throws AnalysisException {
}
// sort according to ExecTime
sortedRowData.sort((l1, l2) -> {
final int execTime1 = Integer.parseInt(l1.get(EXEC_TIME_INDEX));
final int execTime2 = Integer.parseInt(l2.get(EXEC_TIME_INDEX));
return execTime2 - execTime1;
final long execTime1 = Long.parseLong(l1.get(EXEC_TIME_INDEX));
final long execTime2 = Long.parseLong(l2.get(EXEC_TIME_INDEX));
return Long.compare(execTime2, execTime1);
});
result.setRows(sortedRowData);
return result;
Expand Down

0 comments on commit f74e635

Please sign in to comment.