File tree Expand file tree Collapse file tree
src/java/org/apache/cassandra/db/virtual
test/unit/org/apache/cassandra/db/virtual Expand file tree Collapse file tree Original file line number Diff line number Diff line change 115.0.9
2+ * Fix failing select on system_views.settings for non-string keys (CASSANDRA-21348)
23 * Ensure SAI sends range tombstones to the coordinator for queries on static columns (CASSANDRA-21332)
34Merged from 4.1:
45 * Add Paxos v2 option and informatin in cassandra.yaml (CASSANDRA-21316)
Original file line number Diff line number Diff line change @@ -111,15 +111,16 @@ else if (value instanceof Collection)
111111 else if (value instanceof Map )
112112 {
113113 Map <String , Object > map = new HashMap <>();
114- for (Map .Entry <String , Object > entry : ((Map <String , Object >) value ).entrySet ())
114+ for (Map .Entry <?, ? > entry : ((Map <?, ? >) value ).entrySet ())
115115 {
116+ String key = String .valueOf (entry .getKey ());
116117 // this is done on best-effort basis as we do not have names in parameters
117118 // inherently under control as this is what a user is responsible for
118119 // when dealing with custom implementations
119- if (entry . getKey (). endsWith ("_password" ) || entry . getKey () .equals ("password" ))
120- map .put (entry . getKey () , Redacted .REDACTED_STRING );
120+ if (key . endsWith ("_password" ) || key .equals ("password" ))
121+ map .put (key , Redacted .REDACTED_STRING );
121122 else
122- map .put (entry . getKey () , entry .getValue ());
123+ map .put (key , entry .getValue ());
123124 }
124125
125126 return tryConstructJson (map );
Original file line number Diff line number Diff line change 4545import org .apache .cassandra .cql3 .CQLTester ;
4646import org .apache .cassandra .distributed .shared .WithProperties ;
4747import org .apache .cassandra .security .SSLFactory ;
48+ import org .apache .cassandra .service .StartupChecks .StartupCheckType ;
4849import org .slf4j .Logger ;
4950import org .slf4j .LoggerFactory ;
5051import org .yaml .snakeyaml .introspector .Property ;
@@ -135,6 +136,17 @@ public void testSelectEmpty() throws Throwable
135136 assertRowsNet (executeNet (q ));
136137 }
137138
139+ @ Test
140+ public void testStartupChecksWithEnumKeys () throws Throwable
141+ {
142+ Map <String , Object > checkDataResurrection = new LinkedHashMap <>();
143+ checkDataResurrection .put ("enabled" , true );
144+ config .startup_checks .put (StartupCheckType .check_data_resurrection , checkDataResurrection );
145+
146+ check ("startup_checks" , "{check_data_resurrection={enabled=true}}" );
147+ Assert .assertFalse (executeNet ("SELECT * FROM vts.settings" ).all ().isEmpty ());
148+ }
149+
138150 @ Test
139151 public void testSelectOverride () throws Throwable
140152 {
You can’t perform that action at this time.
0 commit comments