"Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement"
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the third column-sort click described in the issue and inspect the generated SQL. Trace where removing the sort removes ORDER BY, then ensure the resulting OFFSET/FETCH query remains valid; done means cycling ASC, DESC, and no sort no longer produces the reported syntax error.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 19
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataTables/NET
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
DataTables/NET#27 · 1 comment ·
-
Async methods? Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataTables/NET#25 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataTables/NET#24 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
DataTables/NET#18 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataTables/NET#17 ·
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·