Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.3.0, 1.3.6
-
None
-
MariaDB 10.0.19
Description
Scenario 1:
Stored procedure:
DELIMITER $$
CREATE PROCEDURE `TEST_SP1`()
BEGIN
SELECT @Something := 'Something'; – this statement triggers the issue
SIGNAL SQLSTATE '70100'
SET MESSAGE_TEXT = 'Test error from SP';
END
Java code:
Connection conn = null;
try{
conn =
DriverManager.getConnection("jdbc:mysql://<server>/<Database>?" +
"user=<user>&password=<pwd>");
CallableStatement cStmt = conn.prepareCall("
");
boolean success = cStmt.execute();
System.out.println("Successful");
} catch (Exception ex)
finally
{ conn.close(); }Expected:
Exception is raised
Actual:
Call returns successfully, execute() method returns true
Scenario 2:
Connection conn = null;
try{ conn = DriverManager.getConnection("jdbc:mysql://<server>/<Database>?" + "user=<user>&password=<pwd>&allowMultiQueries=true"); PreparedStatement stmt = conn.prepareStatement("SELECT 1; INSERT INTO TEST_TBL ;"); stmt.execute(); System.out.println("Successful"); } catch (Exception ex) { System.out.println("Exception caught: " + ex.toString()); throw ex; } finally { conn.close(); }
Expected:
Syntax error in Insert statement.
Actual:
Successful. if I remove the "SELECT 1; " prior to Insert statement, it does throw java.sql.SQLSyntaxErrorException