RDBI/rdbi-driver-mysql — Issue #7: Statement handles aren't cleaned up leading to max_prepared_stmt_count exception
Author: pbennett
Created: 2011-12-13 15:16:12+00:00
State: open

rdbi doesn't appear to actually clean up the prepared statements it creates when results are fetched. It's trivial to get this error when running a process which has to run a lot of independent queries in a long running process.
Error in query - exception:Can't create more than max_prepared_stmt_count statements (current value: 16382).

In dbi, you have select_one (for the extremely common, fetch xxx,yyy where id = xx case) and select_all for the other common case. RDBI has a more flexible fetch mechanism. Fine. However, rdbi never cleans up the prepared statement it creates for every execution!

If you're saying that something as trivial as this in dbi:
rows = db.select_all('select xxxx where ...', xx, yyy)

Must be turned into:
res = db.execute('select xxxx where ...', xx, yyy)
rows = res.fetch(:all)
res.finish
in RDBI then I would argue RDBI has a very serious problem.