Project

General

Profile

Bug #8730

Unexpected "order by (SELECT NULL)" when setting a limit

Added by Torsten Schulz 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/24/2021
Due date:
% Done:

0%

Estimated time:

Description

Code:

    return session()->find<Model::Falukant::Predefine::FirstName>()
            .where("\"name\" = ?")
            .bind(tr)
            .limit(1);

Created Query:

select "id", "version", "name" from "FALUKANT_PREDEFINE"."firstname"  where ("name" = ?) order by (select null) offset 0 rows fetch first (?) rows only

I don't expect an "order by" when I don't add it.
Without the limit(1), the "order by..." is also not set.

#1

Updated by Korneel Dumon 3 months ago

I think one of the back-ends requires it. Does it cause problems for you?

#2

Updated by Torsten Schulz 3 months ago

Korneel Dumon wrote in #note-1:

I think one of the back-ends requires it. Does it cause problems for you?

I really had problems with it, because without print the SQL, I wouldn't know about that. I spend a lot of time into find the reason of an query that was working in cli wasn't working in Wt DBO.

Also available in: Atom PDF