Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Calcite converts the following query
SELECT * FROM "employee" LIMIT 1
to the following one for MssqlSqlDialect:
SELECT * FROM [foodmart].[employee] FETCH NEXT 1 ROWS ONLY
The issue is that MS SQL Server allows using FETCH (and OFFSET) statements only when ORDER BY is specified, so the query above fails.
One of the workarounds for this limitation is to insert ORDER BY (SELECT NULL) for the case when no actual ORDER BY statement is specified.
Attachments
Issue Links
- links to