Remove string quotes from integers in mysql queries for faction and rules [skip ci]

This commit is contained in:
Akkadius 2020-05-24 19:21:26 -05:00
parent 905baa71b2
commit 50c266982f
2 changed files with 5 additions and 5 deletions

View File

@ -274,7 +274,7 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool r
Log(Logs::Detail, Logs::Rules, "Processing rule set '%s' (%d) load...", default_ruleset_name.c_str(), default_ruleset_id);
std::string query = StringFormat(
"SELECT `rule_name`, `rule_value` FROM `rule_values` WHERE `ruleset_id` = '%d'",
"SELECT `rule_name`, `rule_value` FROM `rule_values` WHERE `ruleset_id` = %d",
default_ruleset_id
);
@ -292,7 +292,7 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool r
Log(Logs::Detail, Logs::Rules, "Processing rule set '%s' (%d) load...", ruleset_name, ruleset_id);
std::string query = StringFormat("SELECT `rule_name`, `rule_value` FROM `rule_values` WHERE `ruleset_id` = '%d'", ruleset_id);
std::string query = StringFormat("SELECT `rule_name`, `rule_value` FROM `rule_values` WHERE `ruleset_id` = %d", ruleset_id);
auto results = database->QueryDatabase(query);
if (!results.Success()) {

View File

@ -4106,7 +4106,7 @@ bool ZoneDatabase::LoadFactionData()
memset(faction_array, 0, (sizeof(Faction*) * (max_faction + 1)));
std::vector<size_t> faction_ids;
std::vector<std::string> faction_ids;
// load factions
query = "SELECT `id`, `name`, `base` FROM `faction_list`";
@ -4136,12 +4136,12 @@ bool ZoneDatabase::LoadFactionData()
faction_array[index]->min = MIN_PERSONAL_FACTION;
faction_array[index]->max = MAX_PERSONAL_FACTION;
faction_ids.push_back(index);
faction_ids.push_back(fr_row[0]);
}
LogInfo("[{}] Faction(s) loaded...", faction_ids.size());
const std::string faction_id_criteria(implode(",", std::pair<char, char>('\'', '\''), faction_ids));
const std::string faction_id_criteria(implode(",", faction_ids));
// load faction mins/maxes
query = fmt::format("SELECT `client_faction_id`, `min`, `max` FROM `faction_base_data` WHERE `client_faction_id` IN ({})", faction_id_criteria);