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

TypeOrm doesn't give error when quering by a non existing field #5372

Closed
edwinboon opened this issue Jan 17, 2020 · 2 comments
Closed

TypeOrm doesn't give error when quering by a non existing field #5372

edwinboon opened this issue Jan 17, 2020 · 2 comments

Comments

@edwinboon
Copy link

Issue type:

[ ] question
[ X] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ X] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[ ] latest
[ ] @next
[ X] 0.2.17 (or put your version here)

Steps to reproduce or a small repository showing the problem:

  1. Create a database connection.
  2. Try to use the findOne option where you query on a field that doesn't exist in the database. In our case I queried for domainName instead of name.

TypeOrm will now return the first record from the database even tho is a completely different record than it should be.

@ivan-banha
Copy link

Hi everyone. I have the same behavior but with Postgres.

If I'm trying to find a record in a table by id and the record with given id is not exists, instead of error or undefined/null object I received first record from the table.

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[X] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[ ] latest
[ ] @next
[ X] 0.2.24

@imnotjames
Copy link
Contributor

Duplicate of #3416

@imnotjames imnotjames marked this as a duplicate of #3416 Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants