Skip to content

Commit

Permalink
0005698: Prevented data truncation error when inserting/updating log …
Browse files Browse the repository at this point in the history
…event in sym_monitor_event on Interbase
  • Loading branch information
evan-miller-jumpmind committed Feb 20, 2023
1 parent df39a24 commit cc40367
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -24,6 +24,8 @@
import java.util.Collections;
import java.util.List;

import org.jumpmind.db.platform.interbase.InterbaseDatabasePlatform;
import org.jumpmind.db.platform.interbase.InterbaseDdlBuilder;
import org.jumpmind.extension.IBuiltInExtensionPoint;
import org.jumpmind.symmetric.ISymmetricEngine;
import org.jumpmind.symmetric.ext.ISymmetricEngineAware;
Expand Down Expand Up @@ -60,9 +62,19 @@ public MonitorEvent check(Monitor monitor) {
for (LogSummary logSummary : all) {
count += logSummary.getCount();
}
event.setDetails(serializeDetails(all));
event.setValue(all.size());
event.setCount(count);
String details = serializeDetails(all);
if (engine.getDatabasePlatform() instanceof InterbaseDatabasePlatform) {
while (details != null && details.length() > InterbaseDdlBuilder.SWITCH_TO_LONGVARCHAR_SIZE && all.size() > 1) {
all.remove(all.size() - 1);
details = serializeDetails(all);
}
if (details != null && details.length() > InterbaseDdlBuilder.SWITCH_TO_LONGVARCHAR_SIZE) {
details = details.substring(0, InterbaseDdlBuilder.SWITCH_TO_LONGVARCHAR_SIZE);
}
}
event.setDetails(details);
return event;
}

Expand Down

0 comments on commit cc40367

Please sign in to comment.