[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:14:50 UTC 2017


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

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

> I'm not sure to understand, execute and executeUpdate never use resultsets
> or did I miss something?

In complement to my previous comment:
executeUpdate() can only be used for a query that does not return a ResultSet,
but returns exactly one (no more, no less) update counts. E.g. a basic UPDATE
or DELETE.

executeQuery() can only be used for a query that returns exactly *one*
ResultSet and (I think) *no* update count.

execute() can be be used for a query that returns zero or more ResultSets and
zero or more update counts (but a query will always return at least one or the
other).

Since we don't know that the user types in the direct sql window, I think we
should use execute() and use the algorithm linked to in my previous comment to
process the result correctly. If the "show result" checkbox is checked, then
use the resultset, else just close it immediately and go to the next result.

-- 
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/31121f36/attachment.html>


More information about the Libreoffice-bugs mailing list