You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/12/22 18:43:03 UTC

[GitHub] [cassandra] patrickclee0207 commented on a change in pull request #1369: Cassandra 14879 - Log DDL Statements

patrickclee0207 commented on a change in pull request #1369:
URL: https://github.com/apache/cassandra/pull/1369#discussion_r774094470



##########
File path: src/java/org/apache/cassandra/transport/messages/QueryMessage.java
##########
@@ -113,6 +114,13 @@ protected boolean isTrackable()
 
             QueryHandler queryHandler = ClientState.getCQLQueryHandler();
             statement = queryHandler.parse(query, state, options);
+            if (statement instanceof AlterSchemaStatement){
+                logger.info(String.format("DDL Query: %s, Keyspace: %s, by User: %s, From: %s",
+                                          query,
+                                          ((AlterSchemaStatement) statement).keyspace(),
+                                          state.getClientState().getUser().getName(),
+                                          state.getClientAddress()));

Review comment:
       now using the QueryState getClientAddress which if it's an internal query it would return null else the client address.  this looks to be better here than before directly with ClientState




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org