Bug #108054 Test case testUsageAdvisorOnZeroRowResultSet hangs with ProxySQL
Submitted: 2 Aug 2022 17:02 Modified: 3 Aug 2022 13:36
Reporter: Miro Stauder Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connector / J Severity:S7 (Test Cases)
Version:8.0.30 OS:Any
Assigned to: CPU Architecture:Any
Tags: cursor, empty result, proxysql

[2 Aug 2022 17:02] Miro Stauder
Description:
Running the mysql-connector-j test suite against ProxySQL the test testUsageAdvisorOnZeroRowResultSet hangs indefinitely at line
https://github.com/mysql/mysql-connector-j/blob/8.0.30/src/test/java/testsuite/regression/...

Disabling PropertyKey.useCursorFetch allows the test to PASS.
Changing LIMIT to 1, allows the test to proceed and FAIL.

Due to the nature of ProxySQL, it does not support cursors.
This is an edge case where the connector is requesting a READ_ONLY_CURSOR,
ProxySQL is replying with CURSOR_EXISTS flag set to 0
and the result set is empty.

traceback after attaching jdb:
https://gist.github.com/mirostauder/09bb2907ab7cf06e4838deae63b23be0

Wireshark screenshots:
https://i2.paste.pics/290f151b8221358e0d940e8d814d2d5b.png
https://i2.paste.pics/3de0cd5bf7878e38f4b76923b477928b.png

tcpdump capture file:
https://filebin.net/3m8mxx7k7sbx1osi/20220721-131342_proxysql_mysql8.tcpdump

How to repeat:
setup ProxySQL 2.4.2 as a target server with MySQL 8.0 backend server configured for testing and run the test: 
ant -Dcom.mysql.cj.testsuite.test.class=testsuite.regression.ResultSetRegressionTest -Dcom.mysql.cj.testsuite.test.methods=testUsageAdvisorOnZeroRowResultSet test
test hangs indefinitely
[3 Aug 2022 13:36] MySQL Verification Team
Hi Mr. Stauder,

Thank you for your bug report.

However, ProxySQL is not our product and we do not support it.

You should write to its publisher and author, Mr. Rene Cannao ......

Thank you for your interest in MySQL.