"Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement"
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 19
- Fork
- 11
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I get this error when I click a column sort 3 times. It sorts ASC on first click, the DESC, then error.
The generated SQL is:
SELECT
[InventoryServer].[Id] as 'InventoryServer.Id',
[InventoryServer].[Name] as 'InventoryServer.Name',
[InventoryServer].[DockDate] as 'InventoryServer.DockDate',
[InventoryServer].[BillingStartDate] as 'InventoryServer.BillingStartDate',
[PatchPartyDowntime].[Name] as 'PatchPartyDowntime.Name',
[VirtualEnvironment].[Description] as 'VirtualEnvironment.Description'
-- Many more redacted
FROM
[InventoryServer]
LEFT JOIN [ContactGroup] ON [ContactGroup].[Id] = [InventoryServer].[ContactGroupId]
LEFT JOIN [DisasterRecoveryTeir] ON [DisasterRecoveryTeir].[Id] = [InventoryServer].[DisasterRecoveryTeirId]
LEFT JOIN [Domain] ON [Domain].[Id] = [InventoryServer].[DomainId]
-- Many more redacted
WHERE
(1 = 1) OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
It appears the order by is ripped away as a part of removing the sort on my third click.
Let me know if you need more code.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il terzo clic sull'ordinamento della colonna descritto nell'issue e ispeziona l'SQL generato. Segui il punto in cui la rimozione dell'ordinamento rimuove ORDER BY, quindi assicurati che la query OFFSET/FETCH risultante rimanga valida; il lavoro è completato quando il ciclo ASC, DESC e nessun ordinamento non produce più l'errore di sintassi segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, sql
- Ambito
- backend, database
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100