[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
Sat Sep 23 07:25:03 UTC 2017


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

--- Comment #15 from Lionel Elie Mamane <lionel at mamane.lu> ---
(In reply to Julien Nabet from comment #12)

> Indeed, I began with:
> diff --git a/mysqlc/source/mysqlc_statement.cxx
> b/mysqlc/source/mysqlc_statement.cxx
> index 3a082004831a..9ff3ce163fb6 100644
> --- a/mysqlc/source/mysqlc_statement.cxx
> +++ b/mysqlc/source/mysqlc_statement.cxx
> @@ -240,7 +240,7 @@ sal_Bool SAL_CALL OCommonStatement::getMoreResults()
>  
>      // if your driver supports more than only one resultset
>      // and has one more at this moment return true
> -    return false;
> +    return cppStatement->getMoreResults();
>  }

This looks good.

> but then, I don't know how to call getMoreResults() from directsql.cxx.

See the algorithm linked to in comment 13.

> I tried to declare OStatement::getMoreResults

No need, it inherits it from OCommonStatement.

> (because OStatementBase::getMoreResults already exists) in statement.hxx +
> statement.cxx but I've got an error when building.

While it is not necessary, it is definitely allowed. What error did you get?

> I think it's perhaps linked to XStatement.idl but don't want to touch this
> since it's a public interface and I don't know the consequences.

Yes, don't change that.

> I also tried to use XMultipleResults but since execute method doesn't return
> anything, I can't use XMultipleResults

The XMultipleResults interface is exactly what you have to use. But I see that
mysqlc doesn't implement it, which is... "dommage" because it is pretty easy
since MySQL Connector C++ implements it!

Something like:

 sal_Int32 SAL_CALL OCommonStatement::getUpdateCount()
 {
-    return 0;
+    return cppStatement->getUpdateCount();
 }

in addition to your above patch should be all that is needed.

-- 
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/20170923/c7c5f5ab/attachment.html>


More information about the Libreoffice-bugs mailing list