Skip to content

Fix stats for queries executed via prepared statements - #805

Open
artemgavrilov wants to merge 1 commit into
mainfrom
fix-prepared-statements-stats
Open

Fix stats for queries executed via prepared statements#805
artemgavrilov wants to merge 1 commit into
mainfrom
fix-prepared-statements-stats

Conversation

@artemgavrilov

Copy link
Copy Markdown
Contributor

If prepared statement was created in one transaction and executed in another it may produce entry with incorrect data if query itself changes application name or user. So to fix this we just need to be sure that stas item exists in executor start hook, were no mutations we done yet.

PG-0

Description

Links

@artemgavrilov
artemgavrilov force-pushed the fix-prepared-statements-stats branch from f56e2eb to 780a9ad Compare July 29, 2026 14:28
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.67%. Comparing base (61c954b) to head (e9c4488).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #805      +/-   ##
==========================================
+ Coverage   88.12%   88.67%   +0.54%     
==========================================
  Files           3        3              
  Lines        1297     1298       +1     
  Branches      180      180              
==========================================
+ Hits         1143     1151       +8     
+ Misses         76       74       -2     
+ Partials       78       73       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@artemgavrilov
artemgavrilov marked this pull request as ready for review July 29, 2026 14:36
If prepared statement was created in one transaction and executed in
another it may produce entry with incorrect data if query itself changes
application name or user. So to fix this we just need to be sure that
stas item exists in executor start hook, were no mutations we done yet.
@artemgavrilov
artemgavrilov force-pushed the fix-prepared-statements-stats branch from 780a9ad to e9c4488 Compare July 29, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant