-
Notifications
You must be signed in to change notification settings - Fork 24
INTEGRITY: Continuing set.dat's processing #32
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
Conversation
93d01e2
to
1fee585
Compare
…echecksum. Add new equal checksums for set.dat's fileset match
…rtial in the same run.
…modification time
…which is never closed.
094d152
to
898ffd0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I have less and less feedback, good job.
Parameterize all your sql queries, and limit the line length :-)
db_functions.py
Outdated
@@ -144,7 +163,7 @@ def insert_fileset( | |||
return (existing_entry, True) | |||
|
|||
# $game and $key should not be parsed as a mysql string, hence no quotes | |||
query = f"INSERT INTO fileset (game, status, src, `key`, megakey, `timestamp`) VALUES ({game}, '{status}', '{src}', {key}, {megakey}, FROM_UNIXTIME(@fileset_time_last))" | |||
query = f"INSERT INTO fileset (game, status, src, `key`, megakey, `timestamp`, set_dat_metadata) VALUES ({game}, '{status}', '{src}', {key}, {megakey}, FROM_UNIXTIME(@fileset_time_last), '{escape_string(set_dat_metadata)}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said before, use parameterized queries and don't let the lines get too long.
Where's the formatter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I do use parameterized queries whenever I write a new one. I'll definitely fix the older ones one day. Though I did run the formatter on this file.
db_functions.py
Outdated
cursor.execute( | ||
"SELECT status FROM fileset WHERE id = %s", (matched_fileset_id,) | ||
) | ||
status = cursor.fetchone()["status"] | ||
if status == "detection": | ||
update_fileset_status(cursor, matched_fileset_id, "partial") | ||
update_fileset_status(cursor, matched_fileset_id, "parital") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be partial? not parital?
Thank you, and yes, some of the older queries are still left to be parametrised. |
… handling for column migration.
…ing mismatched files.
…umber of files matched.
feab22d
to
a303645
Compare
3ef16e8
to
26c4fe2
Compare
26c4fe2
to
57df340
Compare
0d7698a
to
d1e8466
Compare
Looks fine. Green light from me. |
Merging, thank you! |
No description provided.