Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bug(arrow-odbc): SQL Server event store index guard never matches

Aperta Adatta ai principianti
#816 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
92/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, sql
Ambito
databases

Direzione di ricerca

Inizia in sqlspec/adapters/arrow_odbc/events/store.py, nella regex di CREATE INDEX, e ispeziona il relativo percorso di rendering. Aggiorna la cattura del nome della tabella in modo che si fermi prima dell’elenco delle colonne, quindi modifica tests/unit/adapters/test_arrow_odbc/test_tsql_stores.py e verifica che il guard sottoposto a rendering utilizzi OBJECT_ID(N'[dbo]/app_events]').

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

Descrizione

The SQL Server event queue store in the arrow-odbc adapter wraps CREATE INDEX in an existence check that never matches. The index DDL runs again every time the store's DDL is applied, and fails if the index already exists.

Where

sqlspec/adapters/arrow_odbc/events/store.py: re.search(r"CREATE INDEX\s+(\S+)\s+ON\s+(\S+)", ...)

What happens

For CREATE INDEX idx_app_events_channel_status ON app_events(channel, status, available_at), the second \S+ captures app_events(channel, as the table name. The rendered guard is:

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'idx_app_events_channel_status'
  AND object_id = OBJECT_ID(N'[dbo].[app_events(channel,]')) BEGIN CREATE INDEX ... END

OBJECT_ID(N'[dbo].[app_events(channel,]') is always NULL, so NOT EXISTS is always true.

Expected

OBJECT_ID(N'[dbo].[app_events]'). Stop the table-name capture at ( or whitespace, for example ON\s+([^\s(]+).

Note

tests/unit/adapters/test_arrow_odbc/test_tsql_stores.py currently asserts the rendered SQL as it is today, including OBJECT_ID(N'[dbo].[app_events(channel,]'). Update that assertion along with the fix.

Lingua principale
Python
Stelle
102
Fork
9
Merge medio
16h 30m
PR unite (30g)
77

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 litestar-org/sqlspec

Tutte le issue di litestar-org/sqlspec

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.