mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix SQL in online delete cleanup:
* SQL statement is corrected to perform an implicit JOIN * Add unit test
This commit is contained in:
@@ -573,8 +573,10 @@ SHAMapStoreImp::clearPrior (LedgerIndex lastRotated)
|
||||
// the validations table
|
||||
clearSql (*ledgerDb_, lastRotated,
|
||||
"SELECT MIN(LedgerSeq) FROM Ledgers;",
|
||||
"DELETE FROM Validations WHERE Ledgers.LedgerSeq < %u"
|
||||
" AND Validations.LedgerHash = Ledgers.LedgerHash;");
|
||||
"DELETE FROM Validations WHERE LedgerHash IN "
|
||||
"(SELECT Ledgers.LedgerHash FROM Validations JOIN Ledgers ON "
|
||||
"Validations.LedgerHash=Ledgers.LedgerHash WHERE Ledgers.LedgerSeq < %u);");
|
||||
|
||||
if (health())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user