Opened 22 months ago

Closed 9 months ago

Last modified 9 months ago

#20420 closed Cleanup/optimization (fixed)

Different query counts under Oracle when savepoints are involved

Reported by: aaugustin Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is a follow-up on #20387, see comments 5 and 6.

In short, Oracle doesn't have RELEASE SAVEPOINT, which means transaction.commit_savepoint() doesn't do anything. As a consequence, connection.queries contains one less entry under Oracle than under other databases.

#20387 was fixed by hardcoding the difference into the tests. This ticket is about finding a more robust solution to the general problem.

Change History (4)

comment:2 Changed 9 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 40bfd8561d016f6632c95d03e46a720571ad1a8a:

Fixed #20420 -- Normalized query counts on Oracle.

This is achieved by inserting a fake entry in connection.queries when
not releasing a savepoint (since Oracle doesn't support that operation.)

Also removed the can_release_savepoints feature that was recently added,
but is superseded by this solution.

comment:3 Changed 9 months ago by Aymeric Augustin <aymeric.augustin@…>

In 5cde9a7018021fc3c005e4ebcfa63967bcf56285:

[1.7.x] Fixed #20420 -- Normalized query counts on Oracle.

This is achieved by inserting a fake entry in connection.queries when
not releasing a savepoint (since Oracle doesn't support that operation.)

Also removed the can_release_savepoints feature that was recently added,
but is superseded by this solution.

Backport of 40bfd856 from master.

comment:4 Changed 9 months ago by Tim Graham <timograham@…>

In 84714dfed726212122ac9a143ddbe6719dac5884:

[1.7.x] Fixed test failures due to refs #20420.

cfcca7ccce3dc527d16757ff6dc978e50c4a2e61 renamed connection.queries
to queries_log and this wasn't backported to stable/1.7.x.

Note: See TracTickets for help on using tickets.
Back to Top