box / box/Anemometer

MySQL checksum field not properly escaped

Open
#152 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.4k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.