Skip to content

cppdb:mysql calling stored procedures more than once leads to 'Commands out of sync' #63

Description

@esidebo

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions