Fix exception when storing Extension boolean values with MySQL

Query was using reserved keyword 'stored' as a table alias

Changed it to use 'indb' as the alias

Affects issues:
- Fixed #3508
This commit is contained in:
Aurora Lahtela 2024-03-09 10:51:53 +02:00
parent 9c43287f60
commit 670ef2aff3
2 changed files with 20 additions and 20 deletions

View File

@ -152,13 +152,13 @@ public class StorePlayerBooleanResultTransaction extends ThrowawayTransaction {
// Need to select:
// Provider IDs where condition of this provider is met
@Language("SQL") String selectUnsatisfiedProviderIds = "SELECT unfulfilled.id " +
"FROM plan_extension_providers stored " +
"FROM plan_extension_providers indb " +
"JOIN plan_extension_providers unfulfilled ON unfulfilled.condition_name=" +
// This gives the unfulfilled condition, eg. if value is true not_condition is unfulfilled.
(value ? "CONCAT('not_', " : "") + "stored.provided_condition" + (value ? ")" : "") +
" AND stored.plugin_id=unfulfilled.plugin_id" +
" WHERE stored.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND stored.provided_condition IS NOT NULL";
(value ? "CONCAT('not_', " : "") + "indb.provided_condition" + (value ? ")" : "") +
" AND indb.plugin_id=unfulfilled.plugin_id" +
" WHERE indb.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND indb.provided_condition IS NOT NULL";
return extractIds(selectUnsatisfiedProviderIds);
}
@ -178,13 +178,13 @@ public class StorePlayerBooleanResultTransaction extends ThrowawayTransaction {
// Need to select:
// Provider IDs where condition of this provider is met
@Language("SQL") String selectUnsatisfiedProviderIds = "SELECT unfulfilled.id " +
"FROM plan_extension_providers stored " +
"FROM plan_extension_providers indb " +
"JOIN plan_extension_tables unfulfilled ON unfulfilled.condition_name=" +
// This gives the unfulfilled condition, eg. if value is true not_condition is unfulfilled.
(value ? "CONCAT('not_', " : "") + "stored.provided_condition" + (value ? ")" : "") +
" AND stored.plugin_id=unfulfilled.plugin_id" +
" WHERE stored.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND stored.provided_condition IS NOT NULL";
(value ? "CONCAT('not_', " : "") + "indb.provided_condition" + (value ? ")" : "") +
" AND indb.plugin_id=unfulfilled.plugin_id" +
" WHERE indb.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND indb.provided_condition IS NOT NULL";
return extractIds(selectUnsatisfiedProviderIds);
}

View File

@ -131,13 +131,13 @@ public class StoreServerBooleanResultTransaction extends ThrowawayTransaction {
// Need to select:
// Provider IDs where condition of this provider is met
@Language("SQL") String selectUnsatisfiedProviderIds = "SELECT unfulfilled.id " +
"FROM plan_extension_providers stored " +
"FROM plan_extension_providers indb " +
"JOIN plan_extension_providers unfulfilled ON unfulfilled.condition_name=" +
// This gives the unfulfilled condition, eg. if value is true not_condition is unfulfilled.
(value ? "CONCAT('not_', " : "") + "stored.provided_condition" + (value ? ")" : "") +
" AND stored.plugin_id=unfulfilled.plugin_id" +
" WHERE stored.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND stored.provided_condition IS NOT NULL";
(value ? "CONCAT('not_', " : "") + "indb.provided_condition" + (value ? ")" : "") +
" AND indb.plugin_id=unfulfilled.plugin_id" +
" WHERE indb.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND indb.provided_condition IS NOT NULL";
return extractIds(selectUnsatisfiedProviderIds);
}
@ -163,13 +163,13 @@ public class StoreServerBooleanResultTransaction extends ThrowawayTransaction {
// Need to select:
// Provider IDs where condition of this provider is met
@Language("SQL") String selectUnsatisfiedProviderIds = "SELECT unfulfilled.id " +
"FROM plan_extension_providers stored " +
"FROM plan_extension_providers indb " +
"JOIN plan_extension_tables unfulfilled ON unfulfilled.condition_name=" +
// This gives the unfulfilled condition, eg. if value is true not_condition is unfulfilled.
(value ? "CONCAT('not_', " : "") + "stored.provided_condition" + (value ? ")" : "") +
" AND stored.plugin_id=unfulfilled.plugin_id" +
" WHERE stored.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND stored.provided_condition IS NOT NULL";
(value ? "CONCAT('not_', " : "") + "indb.provided_condition" + (value ? ")" : "") +
" AND indb.plugin_id=unfulfilled.plugin_id" +
" WHERE indb.id=" + ExtensionProviderTable.STATEMENT_SELECT_PROVIDER_ID +
" AND indb.provided_condition IS NOT NULL";
return extractIds(selectUnsatisfiedProviderIds);
}