diff --git a/CHANGES.txt b/CHANGES.txt index 3c985e154e..e98ef5851c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -19,6 +19,7 @@ * Fix a removed TTLed row re-appearance in a materialized view after a cursor compaction (CASSANDRA-21152) * Rework ZSTD dictionary compression logic to create a trainer per training (CASSANDRA-21209) Merged from 5.0: + * Fix failing select on system_views.settings for non-string keys (CASSANDRA-21348) * Ensure SAI sends range tombstones to the coordinator for queries on static columns (CASSANDRA-21332) Merged from 4.1: * Add Paxos v2 option and informatin in cassandra.yaml (CASSANDRA-21316) diff --git a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java index 5a89b23427..b7cdcb222f 100644 --- a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java +++ b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java @@ -112,15 +112,16 @@ public final class SettingsTable extends AbstractVirtualTable else if (value instanceof Map) { Map map = new HashMap<>(); - for (Map.Entry entry : ((Map) value).entrySet()) + for (Map.Entry entry : ((Map) value).entrySet()) { + String key = String.valueOf(entry.getKey()); // this is done on best-effort basis as we do not have names in parameters // inherently under control as this is what a user is responsible for // when dealing with custom implementations - if (entry.getKey().endsWith("_password") || entry.getKey().equals("password")) - map.put(entry.getKey(), Redacted.REDACTED_STRING); + if (key.endsWith("_password") || key.equals("password")) + map.put(key, Redacted.REDACTED_STRING); else - map.put(entry.getKey(), entry.getValue()); + map.put(key, entry.getValue()); } return tryConstructJson(map);