mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-19 18:15:50 +00:00
Fix amendment voting persistence:
An incorrect SQL query could cause the server to improperly configure its voting state after a restart; typically, this would manifest as an apparent failure to store a vote which the administrator of the server had configured. This commit fixes the broken SQL and ensures that amendment votes are properly reloaded post-restart and closes #4220.
This commit is contained in:
committed by
Nik Bougalis
parent
8266d9d598
commit
b0b44d32bd
@@ -254,7 +254,10 @@ readAmendments(
|
||||
|
||||
soci::transaction tr(session);
|
||||
std::string sql =
|
||||
"SELECT AmendmentHash, AmendmentName, Veto FROM FeatureVotes";
|
||||
"SELECT AmendmentHash, AmendmentName, Veto FROM "
|
||||
"( SELECT AmendmentHash, AmendmentName, Veto, RANK() OVER "
|
||||
"( PARTITION BY AmendmentHash ORDER BY ROWID DESC ) "
|
||||
"as rnk FROM FeatureVotes ) WHERE rnk = 1";
|
||||
// SOCI requires boost::optional (not std::optional) as parameters.
|
||||
boost::optional<std::string> amendment_hash;
|
||||
boost::optional<std::string> amendment_name;
|
||||
|
||||
Reference in New Issue
Block a user