Skip to content

Commit

Permalink
fix: missing placeholder %s in postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Sep 29, 2024
1 parent 59ed77c commit 4df7d2d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,13 @@ protected void rotateSnapshots(@NotNull User user) {
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
WITH cte AS (
SELECT id
FROM user_data_table
FROM %user_data_table%
WHERE player_uuid=?
AND pinned=FALSE
ORDER BY timestamp ASC
LIMIT %entry_count%
)
DELETE FROM user_data_table
DELETE FROM %user_data_table%
WHERE id IN (SELECT id FROM cte);""".replace("%entry_count%",
Integer.toString(unpinnedUserData.size() - maxSnapshots))))) {
statement.setObject(1, user.getUuid());
Expand Down Expand Up @@ -434,7 +434,7 @@ public void updateSnapshot(@NotNull User user, @NotNull DataSnapshot.Packed data
public void wipeDatabase() {
try (Connection connection = getConnection()) {
try (Statement statement = connection.createStatement()) {
statement.executeUpdate(formatStatementTables("DELETE FROM \"%user_data_table%\";"));
statement.executeUpdate(formatStatementTables("DELETE FROM %user_data_table%;"));
}
} catch (SQLException e) {
plugin.log(Level.SEVERE, "Failed to wipe the database", e);
Expand Down

0 comments on commit 4df7d2d

Please sign in to comment.