Bug #76552 | Cannot shutdown MySQL using JDBC driver | ||
---|---|---|---|
Submitted: | 31 Mar 2015 23:47 | Modified: | 3 Apr 2015 16:53 |
Reporter: | Davi Arnaut (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S1 (Critical) |
Version: | 5.6,5.7,5.6.25, 5.7.8, 8.0.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | jdbc, Malformed communication packet, regression, shutdown |
[31 Mar 2015 23:47]
Davi Arnaut
[31 Mar 2015 23:48]
Davi Arnaut
Test case
Attachment: JDBCShutdownTest.java (application/octet-stream, text), 537 bytes.
[1 Apr 2015 7:04]
MySQL Verification Team
Hello Davi Arnaut, Thank you for the report, test case and supplying patch. Observed this with 5.6.25, 5.7.8 and 5.8.0. Thanks, Umesh
[1 Apr 2015 7:07]
MySQL Verification Team
// 5.6.25, C/j - 5.1.34 - affected [umshastr@hod03]/export/umesh/mysql-5.6.25: java -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.34/mysql-connector-java-5.1.34-bin.jar' JDBCShutdownTest Shutdown failed: Unexpected exception during server shutdown. java.sql.SQLException: Unexpected exception during server shutdown. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5198) at JDBCShutdownTest.main(JDBCShutdownTest.java:13) Caused by: java.sql.SQLException: Malformed communication packet. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5196) ... 1 more // 5.6.25, C/j - 5.1.35 - affected [umshastr@hod03]/export/umesh/mysql-5.6.25: javac -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest.java [umshastr@hod03]/export/umesh/mysql-5.6.25: java -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest Shutdown failed: Unexpected exception during server shutdown. java.sql.SQLException: Unexpected exception during server shutdown. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5202) at JDBCShutdownTest.main(JDBCShutdownTest.java:13) Caused by: java.sql.SQLException: Malformed communication packet. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5200) ... 1 more // 5.7.8, C/j - 5.1.35 - affected [umshastr@hod03]/export/umesh/mysql-5.7.8: javac -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest.java [umshastr@hod03]/export/umesh/mysql-5.7.8: java -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest Shutdown failed: Unexpected exception during server shutdown. java.sql.SQLException: Unexpected exception during server shutdown. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5202) at JDBCShutdownTest.main(JDBCShutdownTest.java:13) Caused by: java.sql.SQLException: Malformed communication packet. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5200) ... 1 more // 5.8.0, C/j - 5.1.35 - affected [umshastr@hod03]/export/umesh/mysql-5.8.0: javac -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest.java [umshastr@hod03]/export/umesh/mysql-5.8.0: java -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest Shutdown failed: Unexpected exception during server shutdown. java.sql.SQLException: Unexpected exception during server shutdown. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5202) at JDBCShutdownTest.main(JDBCShutdownTest.java:13) Caused by: java.sql.SQLException: Malformed communication packet. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.ConnectionImpl.shutdownServer(ConnectionImpl.java:5200) ... 1 more // 5.5.42 - not ffected [umshastr@hod03]/export/umesh/mysql-5.5.42: bin/mysqld --basedir=/export/umesh/mysql-5.5.42 --datadir=/export/umesh/mysql-5.5.42/76424 --core-file --socket=/tmp/mysql_ushastry.sock --port=15000 --log-error=/export/umesh/mysql-5.5.42/76424/log.err 2>&1 & [1] 11574 [umshastr@hod03]/export/umesh/mysql-5.5.42: [umshastr@hod03]/export/umesh/mysql-5.5.42: [umshastr@hod03]/export/umesh/mysql-5.5.42: javac -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest.java [umshastr@hod03]/export/umesh/mysql-5.5.42: java -classpath '.:/home/umshastr/bugs/mysql-connector-java-5.1.35/mysql-connector-java-5.1.35-bin.jar' JDBCShutdownTest [umshastr@hod03]/export/umesh/mysql-5.5.42: [1]+ Done bin/mysqld --basedir=/export/umesh/mysql-5.5.42 --datadir=/export/umesh/mysql-5.5.42/76424 --core-file --socket=/tmp/mysql_ushastry.sock --port=15000 --log-error=/export/umesh/mysql-5.5.42/76424/log.err 2>&1 [umshastr@hod03]/export/umesh/mysql-5.5.42: [umshastr@hod03]/export/umesh/mysql-5.5.42: ps aux|grep mysqld umshastr 11679 0.0 0.0 112624 972 pts/0 S+ 09:05 0:00 grep --color=auto mysqld [umshastr@hod03]/export/umesh/mysql-5.5.42:
[3 Apr 2015 16:53]
Paul DuBois
Noted in 5.6.25, 5.7.8, 5.8.0 changelogs. The server rejected empty COM_SHUTDOWN packets.
[24 Jun 2015 4:01]
Laurynas Biveinis
commit b7f79a44735ab6161e6b09e042fc2834cedd89ac Author: Georgi Kodinov <georgi.kodinov@oracle.com> Date: Thu Apr 2 15:55:52 2015 +0300 Bug #20810928: CANNOT SHUTDOWN MYSQL USING JDBC DRIVER Contribution from Davi Arnaud. Re-enabled the old, 0 length format of the COM_SHUTDOWN packet. Added a test case.
[18 Jun 2016 21:25]
Omer Barnir
Posted by developer: Reported version value updated to reflect release name change from 5.8 to 8.0