Closed
Description
Describe the issue
An empty query with no query content (e.g. only comments) triggers a precondition failure.
Vapor version
1.21.5
Operating system and version
macOS 15
Swift version
swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10) Target: arm64-apple-macosx15.0
Steps to reproduce
Add/Run this in PSQLIntegrationTests.swift
:
func testCommentOnlyQueryTriggersPrecondition() {
let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1)
defer { XCTAssertNoThrow(try eventLoopGroup.syncShutdownGracefully()) }
let eventLoop = eventLoopGroup.next()
var conn: PostgresConnection?
XCTAssertNoThrow(conn = try PostgresConnection.test(on: eventLoop).wait())
defer { XCTAssertNoThrow(try conn?.close().wait()) }
_ = try conn?.query("-- Some comments", logger: .psqlTest).wait()
}
Outcome

Additional notes
No response