mscdex/node-mariasql — pull request #14 by med200 (2013-04-01 19:58:01+00:00)
Title: Fixing a bug in Client.prototype.prepare that can cause the wrong query to run.

When doing more than MAX_CACHE_SIZE different queries with the same client, Client.prototype.prepare removes the oldest query from its cache, but it does not update the indices for the other cached queries. What then happens is that next time you try to run a query that's in the cache, it will run a completely different query instead.

lib/Client.js:
- Properly decrement indices of cached queries in queryCache.keys when removing an old query from the cache.