Permalink
Browse files

db, feat: support multi-statements in mysql.

  • Loading branch information...
xicilion committed May 15, 2018
1 parent e665e1f commit c98878f7ed7c4af990a9a2b74248de54932b8b37
Showing with 19 additions and 3 deletions.
  1. +18 −2 fibjs/src/db/sql/mysql.cpp
  2. +1 −1 vender
View
@@ -305,8 +305,24 @@ result_t mysql::execute(const char* sql, int32_t sLen,
if (!res)
return CHECK_ERROR(error());
retVal = res;
res->Unref();
if (UMConnection_HasMoreResult(m_conn)) {
retVal = new NArray();
retVal->append(res);
res->Unref();
while (UMConnection_HasMoreResult(m_conn)) {
res = (DBResult*)UMConnection_NextResultSet(m_conn);
if (!res)
return CHECK_ERROR(error());
retVal->append(res);
res->Unref();
}
} else {
retVal = res;
res->Unref();
}
return 0;
}

0 comments on commit c98878f

Please sign in to comment.