[ODBC-219] All stored procedures fail with error "Prepared statement not a cursor-specification" Created: 2019-02-05  Updated: 2019-05-21  Resolved: 2019-03-13

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

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

Windows 7 x64, MariaDB 10.2.14, Visual Studio 2017, Enterprise Library 6.0.1304


Attachments: Text File ODBC_2019-02-06.LOG    

 Description   

While installing a several years old C# application on a new computer, I ran into an issue where all stored procedure calls are failing with the below error:

ERROR [07005] [ma-3.0.8][10.2.14-MariaDB-log]Prepared statement not a cursor-specification

Trying previous versions of the MariaDB ODBC connector revealed that 3.0.7 also exhibits the same behavior, but 3.0.6 appears to work fine. I don't see any particular item in the changelog that might shed light on the problem.



 Comments   
Comment by Lawrin Novitsky [ 2019-02-06 ]

Thank you for your report! Could you please provide ODBC trace of your application? If it's big, then only the part related to the error. There must be something more than just calling a stored procedure.

Comment by Davison Long [ 2019-02-06 ]

I've attached a trace log. Hopefully that will shed light on the issue. Thanks for looking into it!

Comment by Davison Long [ 2019-02-10 ]

Any luck with figuring out what's going on here? I'm happy to do additional diagnostics if that would be helpful.

Comment by Lawrin Novitsky [ 2019-03-13 ]

I think the issue was caused by not reporting correct columns count in case of a query with multiple results(stored procedure or statements batch) if the result with affected rows count followed a resultset.
In case of stored procedure(like in the bug report) this is always the case, if SP returns a result set. Since at the end special result with affected (by SP) rows is returned.
The bug occurred because IRD was not reset in the SQLMoreResults in the described case.
The fix has been pushed into 3.0 as 35f9e5d1ff8c90ecce0176e5e018e4d819c3c5fd

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