Skip to content

Query or QueryRows does not return ErrNoRows error when no record is found #2251

Closed
@cdong8812

Description

@cdong8812

Describe the bug
Query or QueryRow method does not return ErrNoRows error when using SQL left joins another table with where filter

To Reproduce
Sample SQL to reproduce the bug:

query := SELECT f.id, f.name FROM foo f LEFT JOIN bar b ON f.id = b.foo_id WHERE f.id = 123

Expected behavior
Query or QueryRow returns ErrNoRows error when no record is found

Actual behavior
Query or QueryRow returns no error when no record is found

Version

  • Go: 1.22.3
  • PostgreSQL: 12.2
  • pgx: v5.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions