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

query_cache_size_MB overflow #2040

Closed
llchan opened this issue May 1, 2019 · 3 comments
Closed

query_cache_size_MB overflow #2040

llchan opened this issue May 1, 2019 · 3 comments

Comments

@llchan
Copy link

llchan commented May 1, 2019

I was seeing unexpected purges when setting mysql-query_cache_size_MB=4096. After poking around the source code, I think this is due to int overflow here:

max_memory_size=mysql_thread___query_cache_size_MB*1024*1024;

because mysql_thread___query_cache_size_MB is an int. We should probably replace all the size-related vars with size_t, or at the very least cast before performing arithmetic on it.

@renecannao
Copy link
Contributor

Thank you for the report.
And thank you for looking in the code before opening an issue!
max_memory_size is uint64_t , therefore the easier way to fix this is a cast.

max_memory_size = (uint64_t) mysql_thread___query_cache_size_MB*1024*1024; 

@renecannao
Copy link
Contributor

Fixed in 2.0.4

@renecannao
Copy link
Contributor

Closing.
Thank you again for the report!

Dieken pushed a commit to Dieken/proxysql that referenced this issue May 13, 2019
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