[Libreoffice-bugs] [Bug 103685] SQL... dialog Status: "Commands out of sync" when connecting to MySQL using direct (native) connector

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Sep 20 05:03:33 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=103685

--- Comment #6 from Lionel Elie Mamane <lionel at mamane.lu> ---
(In reply to Julien Nabet from comment #5)
> Lionel:
> I forced to update status by calling cppStatement->getResultSet()
> patch:

> --- a/mysqlc/source/mysqlc_statement.cxx
> +++ b/mysqlc/source/mysqlc_statement.cxx
> @@ -141,6 +141,7 @@ sal_Bool SAL_CALL OCommonStatement::execute(const
>      try {
>          success =
> cppStatement->execute(rtl::OUStringToOString(sSqlStatement,
> m_pConnection->getConnectionSettings().encoding).getStr());
> +        cppStatement->getResultSet();
>      } catch (const sql::SQLException &e) {

This looks like it fetches the first result set and then throws it away.
Always. Even when the caller wants the result. I'm rather sure this will cause
other problems. E.g. when the query actually returns multiple result sets, the
caller will not get the first one, only the second, third, etc.

The solution is probably in code that _calls_ that. E.g. the code that
implements the "Execute SQL Statement" dialog.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170920/37ec02d9/attachment.html>


More information about the Libreoffice-bugs mailing list