Bug #3883 Mysql Connector/J (3.1.1-alpha) Compression doesn't work - connection resets
Submitted: 25 May 2004 22:26 Modified: 25 May 2004 22:52
Reporter: Mudit Wahal Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:3.1-nightly-20040524 OS:Microsoft Windows (Windows XP)
Assigned to: CPU Architecture:Any

[25 May 2004 22:26] Mudit Wahal
Description:

The compression feature of the 3.1.1-alpha and also the latest nightly build (May 24th tried) doesn't work when you to select from a non existing table and
then issue second select command. The second command hangs the system for a while and then gives Unknown command exception. The log from the server side shows that the second select request was incomplete .. only "se^N" was
send.

How to repeat:

With useCompression=true, try to select from a non existing table and
then try to issue another select command. Its very easily reproducible.
Will attach the program which has details about how to reproduce it.
[25 May 2004 22:29] Mudit Wahal
Test Case to create compression hang bug

Attachment: TestQuery.java (text/x-java), 5.13 KiB.

[25 May 2004 22:41] Mudit Wahal
Output of the program, without and with compression enabled/disabled.

Thanks

Mudit

--------- run with compression set to false --------------
C:\Temp>mk
URL = jdbc:mysql://xx.xx.xx.xx:3306/?autoReconnect=true&useCompression
=false
Trying to connect ... connected!
statement = SELECT * FROM test_sql_compress.absent
SQLException: Base table or view not found message from server: "Table 'test_sql
_compress.absent' doesn't exist"
statement = SELECT * FROM test_sql_compress.present
=======  Result query = SELECT * FROM test_sql_compress.present =====
MySQL Connector
Testing UseCompress
======End of query =======

----------- run with compression set to true -------------
C:\Temp>mk true
URL = jdbc:mysql://xx.xx.xx.xx:3306/?autoReconnect=true&useCompression
=true
Trying to connect ... connected!
statement = SELECT * FROM test_sql_compress.absent
SQLException: Base table or view not found message from server: "Table 'test_sql
_compress.absent' doesn't exist"
statement = SELECT * FROM test_sql_compress.present
SQLException: Server connection failure during transaction. Due to underlying ex
ception: 'java.sql.SQLException: Communication link failure message from server:
 "Unknown command"'.

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Communication link failure message from server: "Unknown command"

STACKTRACE:

java.sql.SQLException: Communication link failure message from server: "Unknown
command"
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2441)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1396)
        at com.mysql.jdbc.Connection.ping(Connection.java:3207)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1799)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2248)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2199)
        at com.mysql.jdbc.Statement.executeQuery(Statement.java:1182)
        at TestQuery.do_select(TestQuery.java:87)
        at TestQuery.send_queries(TestQuery.java:153)
        at TestQuery.<init>(TestQuery.java:131)
        at TestQuery.main(TestQuery.java:103)

** END NESTED EXCEPTION **

Attempted reconnect 3 times. Giving up.
C:\Temp>

----------- mk.bat file ----------
@echo off
javac -classpath c:\mystocks\mysql-connector-java-3.1-nightly-20040524-bin.jar TestQuery.java
java -classpath c:\mystocks\mysql-connector-java-3.1-nightly-20040524-bin.jar;. TestQuery %1

-----------------------------------
[25 May 2004 22:50] Mudit Wahal
Changed version to correct nightly build used in the test case.
[25 May 2004 22:52] Mark Matthews
This is a duplicate of 3826