Bug #93828 SQLFetch Returns 100 (SQL_NO_DATA) when Record Exists Sometimes.
Submitted: 7 Jan 2019 7:34 Modified: 10 Jul 21:25
Reporter: Earnest Zhao Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.3.11 / 5.3.13 OS:CentOS
Assigned to: CPU Architecture:x86

[7 Jan 2019 7:34] Earnest Zhao
Description:
We updated ODBC Connector to Version 5.3.11 last week. Compared with 5.3.10, we discovered that SQLFetch could not return correct code sometimes. We execute an SQL SELECT Sentence in our program to find a record by ODBC Connector V5.3.11, when we executed SQLFetch, it returns 100 (SQL_NO_DATA). We executed the same SQL by ODBC Connector V5.3.10, it returns 0 (SQL_SUCCESS).

We found the SQL Sentence not only in our program, but also in MySQL Log. And we executed in MySQL Console, the data existed. We also use "tcpdump" to capture the packages, the key package shows the existence of the data.

How to repeat:
I can stably reproduce it in our docker running environment. For privacy and security, I pasted the SQL and table schema in private comment.
[7 Jan 2019 8:45] MySQL Verification Team
Thank you for the bug report. Could you please provide a complete test case and using fake table data for test. Thanks.
[8 Feb 2019 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[4 Mar 2019 13:24] David Wieland
Simple example for SQL_NO_DATA

Attachment: main.c (text/x-csrc), 1.06 KiB.

[4 Mar 2019 13:27] David Wieland
The bug happens when you have a column of VARCHAR(342) or greater (1 KiB / 3). The "WHERE id = ?" is important too. Without the filter it will succeed.

5.3.11 and 5.3.12 are affected.
[4 Mar 2019 13:32] David Wieland
create table my_table
(
	my_index int null,
	my_column varchar(2048) null,
	constraint my_table_pk
		unique (my_index)
);

INSERT INTO my_table (my_index, my_column) VALUES (1, 'abc');
INSERT INTO my_table (my_index, my_column) VALUES (2, 'def');
[10 May 16:10] Earnest Zhao
It seems that 5.3.13 is still affected by this bug. In my test, there is record has a field value whose length is more than 1100B. Could you guys please tell me which version had already fixed it? Thank you very much.
[10 Jun 21:25] MySQL Verification Team
Please try ODBC 8.0.20. Thanks.
[11 Jul 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".