Skip to content
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

Handle EmptyQueryResponse #500

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Handle EmptyQueryResponse #500

merged 3 commits into from
Aug 21, 2024

Conversation

MahdiBM
Copy link
Contributor

@MahdiBM MahdiBM commented Aug 17, 2024

resolves #488.


let result = try XCTUnwrap(_result)
XCTAssertEqual(result.rows, [])
XCTAssertEqual(result.metadata.command, "")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command tag will be empty. Maybe that API should change in V2 to reflect that a query can have no command tag / metadata at all.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add an issue for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return nil
}
switch parts[0] {
switch parts.first {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it also parses empty command tags.

Copy link

codecov bot commented Aug 17, 2024

Codecov Report

Attention: Patch coverage is 85.10638% with 7 lines in your changes missing coverage. Please review.

Project coverage is 55.08%. Comparing base (cd5318a) to head (c7f58d0).
Report is 1 commits behind head on main.

Files Patch % Lines
...tion State Machine/ExtendedQueryStateMachine.swift 72.72% 6 Missing ⚠️
Sources/PostgresNIO/New/PSQLRowStream.swift 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #500      +/-   ##
==========================================
+ Coverage   54.99%   55.08%   +0.08%     
==========================================
  Files         127      127              
  Lines       10156    10174      +18     
==========================================
+ Hits         5585     5604      +19     
+ Misses       4571     4570       -1     
Files Coverage Δ
...urces/PostgresNIO/New/PostgresChannelHandler.swift 83.68% <100.00%> (ø)
Sources/PostgresNIO/PostgresDatabase+Query.swift 33.33% <100.00%> (-0.60%) ⬇️
Sources/PostgresNIO/New/PSQLRowStream.swift 83.96% <95.45%> (-0.14%) ⬇️
...tion State Machine/ExtendedQueryStateMachine.swift 77.11% <72.72%> (-0.10%) ⬇️

... and 2 files with indirect coverage changes

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Aug 17, 2024

Nightly tests failing due to the same unrelated test that caused the same issue in #497.

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round

Sources/PostgresNIO/New/PSQLRowStream.swift Outdated Show resolved Hide resolved

let result = try XCTUnwrap(_result)
XCTAssertEqual(result.rows, [])
XCTAssertEqual(result.metadata.command, "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add an issue for this.

@MahdiBM MahdiBM requested a review from fabianfett August 21, 2024 12:24
Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great fix!

@fabianfett fabianfett merged commit 3de37e6 into vapor:main Aug 21, 2024
9 of 11 checks passed
@fabianfett fabianfett added the semver-patch No public API change. label Aug 21, 2024
MahdiBM added a commit to MahdiBM/postgres-nio that referenced this pull request Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty Query Triggers Precondition Failure
2 participants