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

MySQL checksum field not properly escaped #152

Open
AndreasSchaek opened this issue Jan 15, 2016 · 1 comment
Open

MySQL checksum field not properly escaped #152

AndreasSchaek opened this issue Jan 15, 2016 · 1 comment

Comments

@AndreasSchaek
Copy link

On the table search main page I click on the checksum of a query to view its details.
Some of the queries can't be found and I get an error: 'Unknown checksum'
When I dig into the queries that are executed I find the following:

SELECT `checksum` FROM `global_query_review` WHERE `checksum`='11572617643159325603'

This query will return an empty resultset, altough there is a fitting row.
When I remove the apostrophe it works:

SELECT `checksum` FROM `global_query_review` WHERE `checksum`=11572617643159325603

The checksum column is a bigint and the apostrophe is not needed AFAIK.
In my local installation I adjusted all occurences of a WHERE with $checksum_field_name and it works great, using MySQL 5.5.30.

@yoku0825
Copy link

Does this cause translate_checksum function?

if (preg_match('/^[0-9]+$/', $checksum))
{
return $checksum;
}

When hexed-checksum was constructed only numeric characters, translate_checksum regards it as already translated to bigint.

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

2 participants