[ODBC-169] Empty results or error if executing mutliple selects in a batch Created: 2018-08-08  Updated: 2019-05-08  Resolved: 2018-09-13

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.6
Fix Version/s: 3.0.7, 2.0.19

Type: Bug Priority: Major
Reporter: Patrick Dudziak Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

Server: FreeBSD 10.3 , MariaDB 10.3.8 Client: Windows 10, ODBC 3.0.6


Attachments: Zip Archive Traces.zip    
Issue Links:
PartOf
includes ODBC-203 Empty results if executing mutliple s... Closed
Relates
relates to ODBC-247 Multiple batches via .NET gives Acces... Closed

 Description   

Might still be a problem with the parsing of the batch.

All examples are executed as a single batch:

Example one:

select 1;
select 1;

This does deliver the right results.

Example two:

SELECT * from DB.mytable;
SELECT 1;

This does deliver all the rows from mytable and the 1 at the end. Works.

Example three:

SELECT 1;
SELECT * FROM DB.mytable;

This does deliver the first result "1" and after that a "AccessViolationException" gets returned.

Example four:

SELECT * FROM DB.mytable;
SELECT * FROM DB.mytable;

The first SELECT delivers the right results, but the 2nd SELECT returns only the correct amount of rows but they are empty and trigger a NumberFormatException. Fields with INT datatype do work somehow.

A similar result with data from the information_schema is returned by these queries:

CREATE TEMPORARY TABLE _temp_statistics  AS (SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = "DB");
SELECT * FROM _temp_statistics;

or

DROP TABLE IF EXISTS _temp_statistics;
SELECT * FROM INFORMATION_SCHEMA.STATISTICS;

These statements do work with the mysql ODBC driver or executed on their own.



 Comments   
Comment by Lawrin Novitsky [ 2018-08-08 ]

Well, I am pretty much sure this is not parsing issue in this case. Also, I believe we have tests covering multiple resultsets case. There must be something more to that. I'd appreciate, if you could provide ODBC traces for those failing examples.

I didn't quite understand what is the problem with last two queries - one from your previous bug report and from I_S table. They both have only 1 SELECT statement. And it does not work in both cases? Well, I will extend the testcase for the previous bug report, and see if there are problem to read select results.

Comment by Patrick Dudziak [ 2018-08-09 ]

I attached a zip with traces for all 6 examples provided. And yes the last two queries both are not working, even with only 1 select, but they do contain 2 queries excecuted in a single batch.

As always thank you for help.

Comment by Lawrin Novitsky [ 2018-08-09 ]

And as always - thank you for your reports!

Comment by Lawrin Novitsky [ 2018-09-12 ]

I've fixed problem causing 3 and 4. Yet to be pushed, though.

I've noticed your reply, and that I already asked this very same question

Comment by Lawrin Novitsky [ 2018-09-13 ]

The fix and the testcase have been pushed to odbc-3.0 as bfb78c0

Generated at Thu Feb 08 03:26:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.