Project

General

Profile

Actions

Bug #8730

open

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

Added by Torsten Schulz almost 3 years ago. Updated almost 3 years 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.

Actions #1

Updated by Korneel Dumon almost 3 years ago

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

Actions #2

Updated by Torsten Schulz almost 3 years 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.

Actions

Also available in: Atom PDF