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

[SQLBackend] Strange number of fingerprints saved to DB #23

Closed
pguridi opened this issue Jan 17, 2014 · 4 comments
Closed

[SQLBackend] Strange number of fingerprints saved to DB #23

pguridi opened this issue Jan 17, 2014 · 4 comments

Comments

@pguridi
Copy link
Contributor

pguridi commented Jan 17, 2014

When comparing the results of the ORMBackend and the SQLBackend, I found something strange:

for the same file (tests/test1.mp3 in my fork) this is the number of rows I get saved in the fingerprint table, for each backend:

ORM: 6457
SQL: 4851

but, the strange thing is, if I print the hashes quantity just before the insert, the total is 6457. ( 3406 for first channel and 3051 for the second one).

in "database_sql.py.insert_hashes", I can confirm that is trying to insert 6457 hashes. But when I check the mysql database, I get only 4851!.

(this can be easily reproduced running the unittests).

@Wessie
Copy link
Contributor

Wessie commented Jan 17, 2014

We use a UNIQUE constraint in the SQLBackend. As can be seen in the create table query and we ignore any constraint errors when inserting hashes as can be seen in the INSERT_FINGERPRINT query

@pguridi
Copy link
Contributor Author

pguridi commented Jan 17, 2014

ahh!. good point. now with a unique constrait in the ORM backend I get only 3,765 hashes :/.
Ill debug it further.., and update the tests later.

@Wessie
Copy link
Contributor

Wessie commented Jan 20, 2014

You might've overlooked the UNIQUE constraint being on (hash, offset, sid) and not just hash.

@worldveil
Copy link
Owner

As the ORM is not yet a part of master (and the hash count shouldn't be a problem if the (hash, offset, sid) constraint is kept), I'm going to mark this closed.

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

No branches or pull requests

3 participants