I'm using cppdb and trying to call a stored procedure on my mysql database like so
cppdb::result res = session << "call my_stored_proc()"
This works on the first call, but if I try to call again (after having called res.clear() or stepping through res.next()) I get a cppdb::mysql_backend::cppdb_myerror exception with the message
what(): cppdb::mysql::Commands out of sync; you can't run this command now.
I have no problem calling the stored procedure multiple times from the mysql prompt, or using queries. After searching the web my best guess is that this might have to do with called procedures returning two result sets, one being a status code, which then is perhaps left dangling (not processed)? I would like to avoid the workaround of closing and reopening the connection, which I suppose hurt performance since that cause cached statements to be cleared.
I'm using cppdb and trying to call a stored procedure on my mysql database like so
cppdb::result res = session << "call my_stored_proc()"This works on the first call, but if I try to call again (after having called
res.clear()or stepping throughres.next()) I get acppdb::mysql_backend::cppdb_myerrorexception with the messagewhat(): cppdb::mysql::Commands out of sync; you can't run this command now.I have no problem calling the stored procedure multiple times from the mysql prompt, or using queries. After searching the web my best guess is that this might have to do with called procedures returning two result sets, one being a status code, which then is perhaps left dangling (not processed)? I would like to avoid the workaround of closing and reopening the connection, which I suppose hurt performance since that cause cached statements to be cleared.