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

[@loopback/sequelize] SQL select error if an empty string "order" is passed to SequelizeRepository find / findOne methods #10275

Closed
KalleV opened this issue Dec 28, 2023 · 0 comments · Fixed by #10279
Labels

Comments

@KalleV
Copy link
Contributor

KalleV commented Dec 28, 2023

Describe the bug

Passing an empty "order" property through an API or direct repository call leads to a broken select statement.

Example filter that will lead to the error:

{
    "order": ""
}

Logs

at Query.run (node_modules/sequelize/src/dialects/mysql/query.js:46:25)
at node_modules/sequelize/src/sequelize.js:650:28
  code: 'ER_BAD_FIELD_ERROR',
  errno: 1054,
  sqlState: '42S22',
  sqlMessage: "Unknown column 'MyTable.' in 'order clause'",
  sql: "SELECT ... ORDER BY `MyTable`.`` ASC;"
}

Additional information

No response

Reproduction

#10279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant