import java.sql.SQLException; import java.sql.*; public class Bug15500 extends testsuite.BaseTestCase { public Bug15500(String name) { super(name); } public void setUp() throws Exception { String prc = "create procedure bugtest (i char(10)) BEGIN "+ " MAINLOOP: BEGIN "+ "IF (i = 'bebe') then LEAVE MAINLOOP; END IF; "+ " create temporary table bzbz (f varchar(10)); "+ " insert into bzbz values('heyya');"+ " select * from bzbz;"+ " END; "+ " END"; super.setUp(); try { stmt.executeUpdate("drop procedure bugtest"); } catch (Exception e) {}; stmt.executeUpdate(prc); } public void testUnsignedInt() throws SQLException { CallableStatement queryCS = null; queryCS = conn.prepareCall("{call bugtest('bebe')}"); rs = queryCS.executeQuery(); while (rs.next()) { //This statement throws exception //ResultSet is from UPDATE. No Data. System.out.println(rs.getString(1)); } } public void tearDown() throws Exception { stmt.executeUpdate("drop procedure bugtest"); super.tearDown(); } public static void main(String args[]) throws Exception { junit.textui.TestRunner.run(Bug15500.class); } }