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/mariadb select statement bug on mac #1664

Closed
lukebp opened this issue Jul 15, 2022 · 0 comments
Closed

mysql/mariadb select statement bug on mac #1664

lukebp opened this issue Jul 15, 2022 · 0 comments

Comments

@lukebp
Copy link
Member

lukebp commented Jul 15, 2022

tiago encountered a very tricky bug when working with the legacy git backend proposal data (#1632). It caused us quite a bit of headaches, so I'm documenting it here for future reference. It appears to only impact mac users. This is not a politeia bug.

When running mariadb on a mac, the results returned from a select query were dependant on the size of the select statement. These are the results that were returned for the exact same keys, but using different sized select statements. The query that was run was to retrieve the key-value store entries for 14,440 proposal votes.

  • When querying the entries individually, all entries were found.
  • When querying the entries using select statements that contained 10 placeholders each, all entries were found.
  • When querying the entries using select statements that contained 1000 placeholders each, 400 out of 14,440 entries were found.
  • When querying the entries using a single select statement with 14,440 placeholders, 0 out of the 14,440 entries were found.

b7f8a71 set a limit on the maximum number of placeholders that a select statement can contain based on the maximum allowed by MySQL. A workaround for this bug was to update this variable only allow 10 placeholders per select statement.

This bug was not encountered until recently because mainnet proposals with thousands of votes are the only time where these large select statements are going to be used and this issue appears to only be present on macs.

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

1 participant