[CONJ-263] Error in stored procedure or SQL statement with allowMultiQueries does not raise Exception when there is a result returned prior to erroneous statement Created: 2016-03-03 Updated: 2016-03-07 Resolved: 2016-03-07 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.3.0, 1.3.6 |
| Fix Version/s: | 1.3.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sridevi Narra | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MariaDB 10.0.19 |
||
| Description |
|
Scenario 1: DELIMITER $$ SELECT @Something := 'Something'; – this statement triggers the issue SIGNAL SQLSTATE '70100' Java code: "); 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: Actual: |
| Comments |
| Comment by Diego Dupin [ 2016-03-07 ] |
|
Good remark. Exceptions must be thrown immediatly when there is exception in multiple queries. Commit : https://github.com/MariaDB/mariadb-connector-j/commit/c02b37914c4d15e43f24f2ce4af7064bc9e9da7d |