Sql::orderBy doesn't quote columns
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start at the Sql::orderBy entry point mentioned in the report and reproduce the shown query against MySQL, focusing on how column names are rendered. Confirm the behavior with a regression test or equivalent query check; done means orderBy produces the expected quoted identifiers for timestamp and id.
Written by the indexing model from the issue text.
Description
I've this query which does not quote columns and then mysql retrieve an incorrect order. The table has timestamp column
$mapper->news->fetchAll(Sql::orderBy('timestamp', 'id')->desc()->limit($initial, $pageSize))
Resulting query:
SELECT news.* FROM news ORDER BY timestamp, id DESC LIMIT 0, 200
expected:
SELECT news.* FROM news ORDER BY `timestamp`, `id` DESC LIMIT 0, 200
Is there a way to instruct Sql to quote columns?
- Dominant language
- PHP
- Stars
- 237
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 Respect/Relational
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Respect/Relational#86 · 9 comments · 4 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Respect/Relational#85 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Respect/Relational#83 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Respect/Relational#82 ·
-
EventsOpenDiscussion New feature
Difficulty 5/5 Over a week Newbie friendliness 20/100
Respect/Relational#74 · 26 comments ·
All issues in Respect/Relational
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
filamentphp/filament#20630 ·
Maintainers usually reply within 1 day
-
needs-maintainer-review review:approve
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Ultimate-Multisite/ultimate-ai-connector-compatible-endpoints#163 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100