Don't try to delete conditional providers if there's nothing to delete
This commit is contained in:
parent
7368eccbbd
commit
701866cc6a
|
@ -70,8 +70,10 @@ public class StorePlayerBooleanResultTransaction extends ThrowawayTransaction {
|
|||
execute(storeValue());
|
||||
commitMidTransaction();
|
||||
List<Integer> providerIds = selectUnfulfilledProviderIds();
|
||||
execute(deleteUnsatisfiedConditionalResults(providerIds));
|
||||
execute(deleteUnsatisfiedConditionalGroups(providerIds));
|
||||
if (!providerIds.isEmpty()) {
|
||||
execute(deleteUnsatisfiedConditionalResults(providerIds));
|
||||
execute(deleteUnsatisfiedConditionalGroups(providerIds));
|
||||
}
|
||||
execute(deleteUnsatisfiedConditionalTables());
|
||||
}
|
||||
|
||||
|
@ -163,6 +165,7 @@ public class StorePlayerBooleanResultTransaction extends ThrowawayTransaction {
|
|||
|
||||
private Executable deleteUnsatisfiedConditionalTables() {
|
||||
List<Integer> tableIds = selectUnfulfilledTableIds();
|
||||
if (tableIds.isEmpty()) return Executable.empty();
|
||||
|
||||
@Language("SQL") String deleteUnsatisfiedValues = "DELETE FROM plan_extension_user_table_values " +
|
||||
"WHERE uuid=? " +
|
||||
|
|
|
@ -112,6 +112,7 @@ public class StoreServerBooleanResultTransaction extends ThrowawayTransaction {
|
|||
|
||||
private Executable deleteUnsatisfiedConditionalResults() {
|
||||
List<Integer> providerIds = selectUnfulfilledProviderIds();
|
||||
if (providerIds.isEmpty()) return Executable.empty();
|
||||
|
||||
@Language("SQL") String deleteUnsatisfiedValues = "DELETE FROM plan_extension_server_values " +
|
||||
"WHERE provider_id IN (" + Sql.nParameters(providerIds.size()) + ")";
|
||||
|
@ -143,6 +144,7 @@ public class StoreServerBooleanResultTransaction extends ThrowawayTransaction {
|
|||
|
||||
private Executable deleteUnsatisfiedConditionalTables() {
|
||||
List<Integer> tableIds = selectUnfulfilledTableIds();
|
||||
if (tableIds.isEmpty()) return Executable.empty();
|
||||
|
||||
@Language("SQL") String deleteUnsatisfiedValues = "DELETE FROM plan_extension_server_table_values " +
|
||||
"WHERE table_id IN (" + Sql.nParameters(tableIds.size()) + ")";
|
||||
|
|
Loading…
Reference in New Issue