Unexpected Full Join Result

Aperta
#176,247 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, postgresql, sql

Direzione di ricerca

Start by reproducing the supplied SQL query in CockroachDB v26.4.0; it uses nested FULL JOINs, GEOGRAPHY values, and a NULL comparison, and no tables are needed. Then trace the optimizer or execution path for FULL JOIN conditions involving spatial types. Done means the query runs without errors and returns exactly three rows; the issue does not name relevant source files or tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-bug O-community T-sql-queries X-blathers-triaged X-move-internal

Describe the problem

Please describe the issue you observed, and any steps we can take to reproduce it:

A query involving nested FULL JOINs, GEOGRAPHY types, and NULL comparisons produces incorrect results. The query executes a FULL JOIN between an empty set combined with a NULL::GEOGRAPHY and a subquery containing a GEOGRAPHY point Cartesian joined with boolean values. Instead of returning 3 rows, it incorrectly returns 4 rows. This indicates a severe bug in how the optimizer or execution engine evaluates NULL comparisons with spatial types in a FULL JOIN.

To Reproduce

SELECT 1
FROM (
  (SELECT 1 AS x WHERE false) AS empty_side
  FULL JOIN (VALUES (NULL::GEOGRAPHY)) AS left_side(g) ON false
)
FULL JOIN (
  (VALUES ('SRID=4326;POINT(0 0)'::GEOGRAPHY)) AS geo_side(g)
  FULL JOIN (VALUES (true), (true)) AS bool_side(k) ON bool_side.k
)
ON left_side.g < geo_side.g;

Expected behavior

Expected result (3 rows):

  ?column?
------------
         1
         1
         1
(3 rows)

Actual result (4 rows):

  ?column?
------------
         1
         1
         1
         1
(4 rows)

Environment:

  • CockroachDB version: v26.4.0
  • Server OS: Linux
  • Client app: cockroach sql

Jira issue: CRDB-72246

Lingua principale
Go
Stelle
32.6k
Fork
4.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cockroachdb/cockroach

Tutte le issue di cockroachdb/cockroach

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.