frankgh commented on code in PR #3766:
URL: https://github.com/apache/cassandra/pull/3766#discussion_r1901200458
##########
pylib/cqlshlib/cql3handling.py:
##########
@@ -1611,32 +1611,23 @@ def permission_completer(ctxt, _):
@completer_for('username', 'name')
def username_name_completer(ctxt, cass):
- def maybe_quote(name):
- if CqlRuleSet.is_valid_cql3_name(name):
- return name
- return "'%s'" % name
-
# disable completion for CREATE USER.
if ctxt.matched[0][1].upper() == 'CREATE':
return [Hint('<username>')]
session = cass.session
- return [maybe_quote(list(row.values())[0].replace("'", "''")) for row in
session.execute("LIST USERS")]
+ return map(maybe_escape_name, [row['name'] for row in
session.execute("LIST USERS")])
Review Comment:
`protect_name` internally calls `maybe_escape_name`. Maybe I'm missing
something, but what would be the benefit of using `protect_name`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]