Skip to content

Refactor explicit JOIN syntax in postgres local SQL tests#3483

Closed
Copilot wants to merge 3 commits intomasterfrom
copilot/refactor-cartesian-join
Closed

Refactor explicit JOIN syntax in postgres local SQL tests#3483
Copilot wants to merge 3 commits intomasterfrom
copilot/refactor-cartesian-join

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

Remove-me-section

  • Problem
    bingo/postgres/tests/local/postgres_test.sql used implicit comma joins in multiple queries, which triggers cartesian-join linting and reduces query intent clarity.

  • Change set

    • Explicit cartesian joins: replaced comma-separated table lists with CROSS JOIN in all flagged queries (self-joins and multi-table join case).
    • Adjacent syntax cleanup: normalized the nearby malformed self-join form to explicit CROSS JOIN for consistency in the same block.
    • Scope: one file, SQL-only, no behavioral predicate changes (WHERE filters preserved as-is).
  • Example

-- before
select x.id as regno, y.id as dup
from join_m_m_t x, join_m_m_t y
where x.data @ (y.data, '')::bingo.exact;

-- after
select x.id as regno, y.id as dup
from join_m_m_t x cross join join_m_m_t y
where x.data @ (y.data, '')::bingo.exact;

Generic request

  • PR name follows the pattern #1234 – issue name
  • branch name does not contain '#'
  • base branch (master or release/xx) is correct
  • PR is linked with the issue
  • task status changed to "Code review"
  • code follows product standards
  • regression tests updated

For release/xx branch

  • backmerge to master (or newer release/xx) branch is created

Optional

  • unit-tests written
  • documentation updated

Backmerge request

  • PR name follows the pattern Backmerge: #1234 – issue name
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • code contains only backmerge changes

Bump request

  • PR name follows the pattern Bump version to ...
  • add brackets [ ] for 'skip ci' and put it into the body
  • milestone is linked to PR
  • all tickets are closed inside the relevant milestone
Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor: Cartesian join without explicit JOIN clause</issue_title>
<issue_description>Problem:
Cartesian join without explicit JOIN clause

Why is this an issue?
Cartesian join without explicit JOIN clause. Consider using explicit JOIN clause.

Code examples
Non-compliant

SELECT name, order_id FROM customers, orders WHERE customers.id = orders.customer_id;

Compliant

SELECT name, surname FROM customers c
SELECT name, bank_name FROM customers c  inner join banks b on c.bank_id = b.id

Problem locations:
bingo/postgres/tests/local/postgres_test.sql:764
bingo/postgres/tests/local/postgres_test.sql:770
bingo/postgres/tests/local/postgres_test.sql:782
bingo/postgres/tests/local/postgres_test.sql:806
bingo/postgres/tests/local/postgres_test.sql:822
bingo/postgres/tests/local/postgres_test.sql:855
bingo/postgres/tests/local/postgres_test.sql:858
bingo/postgres/tests/local/postgres_test.sql:867
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Refactor Cartesian join without explicit JOIN clause Refactor explicit JOIN syntax in postgres local SQL tests Feb 15, 2026
Copilot AI requested a review from AlexeyGirin February 15, 2026 09:02
@AlexeyGirin AlexeyGirin marked this pull request as ready for review February 15, 2026 09:13
@AlexeyGirin AlexeyGirin requested review from AliaksandrDziarkach and removed request for AlexeyGirin February 15, 2026 18:58
@AlexeyGirin AlexeyGirin reopened this Feb 15, 2026
@AlexeyGirin AlexeyGirin reopened this Feb 16, 2026
@AlexeyGirin AlexeyGirin reopened this Feb 16, 2026
@AlexeyGirin
Copy link
Collaborator

@copilot please rebase branch to last master branch

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot please rebase branch to last master branch

I can’t run git rebase in this environment (push/rebase operations are restricted). The branch is currently at b261aa7 with the requested SQL changes; please rebase/merge this branch onto the latest master, and I can handle any follow-up conflicts or fixes afterward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove bingo/postgres/tests/local/ directory from SonarQube scan

2 participants