coopernurse/mymysql — pull request #2 by coopernurse (2012-01-10 22:04:36+00:00)
Title: Modify godrv to pool statements

Hi again,

This patch caches driver.Stmt structs in the driver.conn, reusing them if possible.

conn.Close() resets the cache, and stmt.Close() removes the statement from the cache.

These changes fixed an issue I ran into where running db.Exec() continuously busted mysql's prepared statement cache. It also speeds things up 5-10%.

Let me know what you think.

-- James