提交 986dbc1a authored 作者: Noel Grandin's avatar Noel Grandin

startTime_nanos can be zero for the command that actually turns on statistics

上级 29c9cc75
...@@ -311,7 +311,8 @@ public abstract class Prepared { ...@@ -311,7 +311,8 @@ public abstract class Prepared {
String params = Trace.formatParams(parameters); String params = Trace.formatParams(parameters);
session.getTrace().infoSQL(sqlStatement, params, rowCount, deltaTime_nanos / 1000 / 1000); session.getTrace().infoSQL(sqlStatement, params, rowCount, deltaTime_nanos / 1000 / 1000);
} }
if (session.getDatabase().getQueryStatistics()) { // startTime_nanos can be zero for the command that actually turns on statistics
if (session.getDatabase().getQueryStatistics() && startTime_nanos != 0) {
long deltaTime_nanos = System.nanoTime() - startTime_nanos; long deltaTime_nanos = System.nanoTime() - startTime_nanos;
session.getDatabase().getQueryStatisticsData(). session.getDatabase().getQueryStatisticsData().
update(toString(), deltaTime_nanos, rowCount); update(toString(), deltaTime_nanos, rowCount);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论