Skip to content

Commit

Permalink
Actualy support executing multiple queries
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 23, 2023
1 parent df36ace commit 3b13195
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/DbConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ bool DbConnection::exec(const std::string& sql) {
if (mysql_real_query(pConn_, sql.data(), sql.size()) != 0)
cpp11::stop("Error executing query: %s", mysql_error(pConn_));

MYSQL_RES* res = mysql_store_result(pConn_);
if (res != NULL)
mysql_free_result(res);
do {
MYSQL_RES* res = mysql_store_result(pConn_);
if (res != NULL)
mysql_free_result(res);
} while (mysql_next_result(pConn_) == 0);

autocommit();

Expand Down

0 comments on commit 3b13195

Please sign in to comment.