Bug #4219 Connector/J 3.1.2-alpha crashes DB
Submitted: 19 Jun 2004 14:04 Modified: 21 Jul 2005 17:42
Reporter: Helmut Leininger Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:3.1.2-alpha OS:Windows (Windows XP)
Assigned to: Alexey Botchkov CPU Architecture:Any

[19 Jun 2004 14:04] Helmut Leininger
Description:
MySQL Connector/J 3.1.2-alpha kills mysql-max-nt.exe (5.0.0a-alpha) at first SQL statement. There is an SQL exception:
"No operations allowed after statement closed; SQL Error 0".

logfile output:
mysqld-max-nt, Version: 5.0.0-alpha-max-nt-log, started with:
TCP Port: 3306, Named Pipe: MySQL
Time                 Id Command    Argument
040619 13:52:11	      1 Connect     hl@localhost on MondeoTest
040619 13:52:12	      1 Query       SET character_set_results = NULL
		      1 Query       SHOW VARIABLES
		      1 Query       SHOW COLLATION
040619 13:52:13	      1 Query       select FahrtArt from FahrtArten order by FahrtArt 

This is not the case with Connector/J 3.1.1-alpha

These are the essentials of the program:

String cnct = "jdbc:mysql:///MondeoTest?user=hl&password=cmd1307&useUnicode=true"
String drv  = "com.mysql.jdbc.Driver;

Class.forName(drv).newInstance();

Connection con = DriverManager.getConnection(cnct);

String sql = "select FahrtArt from FahrtArten order by FahrtArt"

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);

Regards

How to repeat:
String cnct = "jdbc:mysql:///MondeoTest?user=hl&password=cmd1307&useUnicode=true"
String drv  = "com.mysql.jdbc.Driver;

Class.forName(drv).newInstance();

Connection con = DriverManager.getConnection(cnct);

String sql = "select FahrtArt from FahrtArten order by FahrtArt"

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
[19 Jun 2004 14:08] Helmut Leininger
Forgot to say:
Java 1.5.0-beta2
[23 Jun 2004 21:57] Mark Matthews
This seems to be a duplicate of BUG#4259

Any query following "SET character_set_results = NULL;" causes MySQL-5.0 to crash.
[27 Dec 2004 5:03] r s
It seems that the front part of the connection string is submitted as:
jdbc:mysql:///host...
Shouldn't it be
jdbc:mysql://host...
[27 Dec 2004 5:29] Mark Matthews
The URL format in the bug report is correct, the user is specifying a database name, without a hostname when the URL format it jdbc:mysql:///somename
[21 Jul 2005 17:42] Mark Matthews
This bug doesn't seem to be present with latest MySQL-5.0 and latest Connector/J 3.1.x release.