<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - MySQL native connector "Commands out of sync..." when calling procedure second time. - Crash"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=112423">112423</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MySQL native connector "Commands out of sync..." when calling procedure second time.  - Crash
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.4.1.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Base
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>robert@familiegrosskopf.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have tried to get the content, which should be shown after calling a stored
procedure in MySQL/MariaDB. You could only get the content by macro, but the
commands should work also without.

If you start Tools > SQL and write down
CALL `MyProcedureName`();
the command will be executed. If you do this the second time, the native
Connector gives
"Commands out of sync; you can't run this command now"
You won't be able to see the content of any table afterwords. Base will be
crashing.

If you try the same with JDBC-connector it will work and you could get the
content of a procedure by macros.

Here a detailed description for testing:

You must have a MySQL or MariaDB database.
Connect to the database with the native connector
(<a href="https://extensions.libreoffice.org/extensions/mysql-native-connector">https://extensions.libreoffice.org/extensions/mysql-native-connector</a>)
Open Tools > SQL
and run the following command:

CREATE TABLE `NamesTest` (`ID` INT PRIMARY KEY, `name_last` VARCHAR(50),
`name_first` VARCHAR(50));

Could be you have to run View > Refresh Tables after executing this command.

Now run the following commands, each separately:
-------

INSERT INTO `NamesTest` VALUES
(1, 'Burger', 'Mike'),
(2, 'Nice', 'Debby'),
(3, 'Miller', 'Arthur');

CREATE PROCEDURE `AllNames`()
BEGIN
SELECT * FROM `NamesTest`;
END

CALL `AllNames`;

CALL `AllNames`;

-------
The first CALL will work, the second runs out of sync.

Close Tools > SQL.
Try to open one of the tables for viewing the content.
Base and LO will crash.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>