[ 
https://issues.apache.org/jira/browse/CASSANDRA-13640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16067999#comment-16067999
 ] 

Andrés de la Peña commented on CASSANDRA-13640:
-----------------------------------------------

[Here|https://github.com/apache/cassandra/compare/cassandra-3.0...adelapena:13640-3.0]
 is the patch copying the session attributes into the new session created on 
{{do_login}}. 

A simple dtest reproducing the problem can be found 
[here|https://github.com/riptano/cassandra-dtest/compare/master...adelapena:CASSANDRA-13640].

Although this bug only affects to 3.0, the root cause is present in all the 
other branches (2.1, 2.2, 3.x and trunk). It doesn't affect to other versions 
because printing is done in a slightly different way, but relying on this would 
be IMHO quite risky. Also, the usage of {{LOGIN}} statement could lead to end 
up using a different default timeout or consistency level than the initially 
specified. So, I think that the patch should be applied to all branches. What 
do you think?

> CQLSH error when using 'login' to switch users
> ----------------------------------------------
>
>                 Key: CASSANDRA-13640
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13640
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Andrés de la Peña
>            Assignee: Andrés de la Peña
>            Priority: Minor
>             Fix For: 3.0.x
>
>
> Using {{PasswordAuthenticator}} and {{CassandraAuthorizer}}:
> {code}
> bin/cqlsh -u cassandra -p cassandra
> Connected to Test Cluster at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 3.0.14-SNAPSHOT | CQL spec 3.4.0 | Native protocol 
> v4]
> Use HELP for help.
> cassandra@cqlsh> create role super with superuser = true and password = 'p' 
> and login = true;
> cassandra@cqlsh> login super;
> Password:
> super@cqlsh> list roles;
> 'Row' object has no attribute 'values'
> {code}
> When we initialize the Shell, we configure certain settings on the session 
> object such as
> {code}
> self.session.default_timeout = request_timeout
> self.session.row_factory = ordered_dict_factory
> self.session.default_consistency_level = cassandra.ConsistencyLevel.ONE
> {code}
> However, once we perform a LOGIN cmd, which calls do_login(..), we create a 
> new cluster/session object but actually never set those settings on the new 
> session.
> It isn't failing on 3.x. 
> As a workaround, it is possible to logout and log back in and things work 
> correctly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to