Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Query fails with "ORDER BY random()" #16961

Open
SzymonSel opened this issue Nov 6, 2024 · 2 comments · May be fixed by #16964
Open

SQL Query fails with "ORDER BY random()" #16961

SzymonSel opened this issue Nov 6, 2024 · 2 comments · May be fixed by #16964
Labels
Milestone

Comments

@SzymonSel
Copy link
Member

Describe the bug

SQL Query with random ordering fails with:
Syntax error, expected: ASC, DESC, ., ,, ), LIMIT, OFFSET, UNION, ;, WITH, SELECT at line:5, col:15

Orchard Core version

Latest 2.0

To Reproduce

  1. Go to Admin Panel -> Search -> SQL Queries
  2. Create/Run query:
SELECT DocumentId 
FROM ContentItemIndex 
WHERE 
    ContentType='BlogPost' and Published = true
ORDER BY random()
LIMIT 10

Expected behavior

Should return random 10 BlogPost content items.

Logs and screenshots

image

@hishamco
Copy link
Member

hishamco commented Nov 6, 2024

SqlParser need to be reviewed

@sebastienros sebastienros added this to the 2.x milestone Nov 7, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@sebastienros sebastienros linked a pull request Nov 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants