提交 e04366ec authored 作者: Thomas Mueller's avatar Thomas Mueller

In the trace file, the query execution time was incorrect in some cases,…

In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2.
上级 1f7e421e
...@@ -304,7 +304,7 @@ public abstract class Prepared { ...@@ -304,7 +304,7 @@ public abstract class Prepared {
* @param count the update count * @param count the update count
*/ */
void trace(long startTime, int count) { void trace(long startTime, int count) {
if (session.getTrace().isInfoEnabled()) { if (session.getTrace().isInfoEnabled() && startTime > 0) {
long time = System.currentTimeMillis() - startTime; long time = System.currentTimeMillis() - startTime;
String params = Trace.formatParams(parameters); String params = Trace.formatParams(parameters);
session.getTrace().infoSQL(sqlStatement, params, count, time); session.getTrace().infoSQL(sqlStatement, params, count, time);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论