Join GitHub today
Correctly cache mysql server version #536
I came across the following issue: the mysql adapter is constantly requerying the version of the server. I found out that the responsible code does some caching but only for the last step of the computation ( which happens to be the least expensive one, btw. ). I fixed the caching and ran into the next problem: I could not add a spec for it since the server_version is fixed in the mysql_spec after one certain set of tests using meta_def . I added a method which reverts meta_def and added a clean-up code so that later tests get the correct server_version.
Is it okay to leave the two things in one pull request or should I split them up?
The fixing of the caching looks good. However, I'm not OK with the addition of meta_remove. The meta_def line in the spec can just be removed, it's unlikely anyone is running the specs on MySQL < 5.0.14. I'll just cherry-pick the cache fix and spec. Thanks for your help!