New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong idempotence check setting session attributes #580

Closed
dvarrazzo opened this Issue Aug 11, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@dvarrazzo
Member

dvarrazzo commented Aug 11, 2017

In [9]: cnn.autocommit = False
[23759] conn_set_session: autocommit 0, isolevel 5, readonly 2, deferrable 2

In [10]: cnn.readonly = True
[23759] conn_set_session: autocommit 0, isolevel 5, readonly 1, deferrable 2

In [11]: cnn.autocommit = True
[23759] conn_set_session: autocommit 1, isolevel 5, readonly 1, deferrable 2

In [12]: cnn.readonly = True
[23759] conn_set_session: autocommit 1, isolevel 5, readonly 1, deferrable 2

The operation in [12] would be idempotent: the code checks that the
new value is the same of the previous one and bails out early. But
checking the internal state for idempotence when in autocommit is
wrong: the only state that matters is what's in the server session.

@dvarrazzo dvarrazzo added this to the psycopg 2.7.4 milestone Nov 13, 2017

@dvarrazzo dvarrazzo closed this Jan 11, 2018

dvarrazzo added a commit that referenced this issue Feb 6, 2018

Autocommit shouldn't change deferrable on servers not supporting it
Regression on unsupported Postgres versions after fixing bug #580

dvarrazzo added a commit that referenced this issue Feb 6, 2018

Autocommit shouldn't change deferrable on servers not supporting it
Regression on unsupported Postgres versions after fixing bug #580

dvarrazzo added a commit that referenced this issue Feb 6, 2018

Autocommit shouldn't change deferrable on servers not supporting it
Regression on unsupported Postgres versions after fixing bug #580

dvarrazzo added a commit that referenced this issue Feb 6, 2018

Autocommit shouldn't change deferrable on servers not supporting it
Regression on unsupported Postgres versions after fixing bug #580

dvarrazzo added a commit that referenced this issue Feb 8, 2018

Autocommit shouldn't change deferrable on servers not supporting it
Regression on unsupported Postgres versions after fixing bug #580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment