Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
1.1.7
-
None
-
None
-
Windows XP, MySQL, Java application, BIRT (report)
Description
Problem was discovered while using BIRT, and can be reproduced with a simple java class.
If you create a PreparedStatement, and call getMetaData() method before executeQuery(), then you will get an error when executeQuery() is called.
Error is:
SQL error #1:Malformed communication packet.
(full log in file)
Quick fix:
In order to advance in our work, we have found a quick fix. We have commented the following instruction in MySQLPreparedStatement.getMetaData() method:
//ssps.close();
However this fix is probably not the best solution. If executeQuery() has not been called, then a new PreparedStatement has to be created in order to gather the metadata. This seems to be done by MySQLServerSidePreparedStatement, however something seems to go wrong when closed() is called.
Simple code to reproduce the problem:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class TestClass {
public static void main(String[] args) {
try
catch(Exception e)
{ e.printStackTrace(); } }
}