[ODBC-140] Query which inserts multiple rows fails. Created: 2018-03-09  Updated: 2018-06-04  Resolved: 2018-06-04

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.3
Fix Version/s: 2.0.17, 3.0.5

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

MariaDB 10.2.13 on FreeBSD 11.1, Client Windows 10 with ODBC Connector 3.0.3


Attachments: Text File Query50.txt     Text File Query51.txt     Text File createTable.txt     File maodbc.dll    

 Description   

We are inserting about 1200 rows in batches of 50 into a table called "Positionen" . The create table statement is inside createTable.txt , the query that fails is inside Query50.txt .

To reproduce, create a schema TESTDB and a table "Positionen" with the attached create statement. Then use the Code below to send the query through the ODBC Connector.

System.Data.Odbc.OdbcConnection dbConnection = new System.Data.Odbc.OdbcConnection();
System.Data.Odbc.OdbcCommand dbCommand;
dbConnection.ConnectionString = "Driver={MariaDB ODBC 3.0 Driver};Server=mariadb-dev;Database=TESTDB;User=TEST;Password=TEST";
         
dbConnection.Open();
dbCommand = dbConnection.CreateCommand();
dbCommand.CommandText = "$INSERT"; 
int result = dbCommand.ExecuteNonQuery();

Inside the general query log two prepare statements are logged, but no execute is logged for the query from the file Query50.txt. The query does not return an exception. It returns 0 affected rows.

If we change the row batchsize to 49, 51, 100 or anything else, all 1200 rows are successful.
The file Query51.txt contains one extra row and is successful including all previous and subsequent batches on the table (does include the rows from Query50.txt).

The insert batch size of 50 rows does work for MariaDB 10.1.31.

Both queries are successful, if you use mysqlclient on MariaDB 10.2.13 .

Does the syntax check fail without notice during the prepare on 10.2.13 for the query in the file Query50.txt?



 Comments   
Comment by Patrick Dudziak [ 2018-05-04 ]

This issue still persists.
Is there any new information on this? Any clarification on the issue needed?

Comment by Lawrin Novitsky [ 2018-05-04 ]

It's not been fixed yet. Do you mean, that you build own connector version from the current repo for tests? I am currently work on something, that may fix your issue as well. Although I am not completely sure what does cause the bug you face, but most probably is some glitch in the client side query parsing.

Comment by Patrick Dudziak [ 2018-05-04 ]

I would appreciate it, if you could point me to the repo with the sources. Trying to compile from source and test it is a good suggestion, we haven't tried yet.
If i gain any new information, i will add it here.

Comment by Lawrin Novitsky [ 2018-05-04 ]

Ah, I thought you are already doing that, since you said the problem persists, and there was no new releases since you reported the bug. And that would be great for early fix testing
You can find sources on github https://github.com/MariaDB/mariadb-connector-odbc.git in the odbc-3.0 branch. It's usually more up to date, than master branch.

Comment by Lawrin Novitsky [ 2018-05-16 ]

I would actually appreciate if you could verify, if your problem persists with latest repo version. If to built it is a problem, I can attach here dll file. I am actually gonna do that anyway, with the warning, that this is no official release, of course.
On other hand, I have to come up with the testcase for your issue anyway...

Comment by Patrick Dudziak [ 2018-05-23 ]

I can confirm that this is now fixed in the latest repo. Thank you for you help.

Comment by Lawrin Novitsky [ 2018-06-04 ]

I can stand the temptation to close the issue, to make it the coming release notes/changelog.
But not with a good conscience, since I still owe the testcase. As a compromise I will open new ticket to add this testcase. But I am afraid even conscience won't help to rise its priority over other existing issues.

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