}
if (this.profileSql) {
fetchEndTime = System.currentTimeMillis();
ProfileEventSink eventSink = ProfileEventSink.getInstance(this.connection);
eventSink.consumeEvent(new ProfilerEvent(ProfilerEvent.TYPE_QUERY,
"", catalog, this.connection.getId(), //$NON-NLS-1$
(callingStatement != null) ? callingStatement.getId() : 999,
rs.resultId, System.currentTimeMillis(),
(int) (queryEndTime - queryStartTime), null,
new Throwable(), profileQueryToLog));
eventSink.consumeEvent(new ProfilerEvent(ProfilerEvent.TYPE_FETCH,
"", catalog, this.connection.getId(), //$NON-NLS-1$
(callingStatement != null) ? callingStatement.getId() : 999,
rs.resultId, System.currentTimeMillis(),
(int) (fetchEndTime - fetchBeginTime), null,
new Throwable(), null));
if (this.queryBadIndexUsed) {
eventSink.consumeEvent(new ProfilerEvent(
ProfilerEvent.TYPE_WARN, "", catalog, //$NON-NLS-1$
this.connection.getId(),
(callingStatement != null) ? callingStatement.getId()
: 999, rs.resultId,
System.currentTimeMillis(),
(int) (queryEndTime - queryStartTime), null,
new Throwable(),
Messages.getString("MysqlIO.33") //$NON-NLS-1$
+profileQueryToLog));
}
if (this.queryNoIndexUsed) {
eventSink.consumeEvent(new ProfilerEvent(
ProfilerEvent.TYPE_WARN, "", catalog, //$NON-NLS-1$
this.connection.getId(),
(callingStatement != null) ? callingStatement.getId()
: 999, rs.resultId,
System.currentTimeMillis(),