Details
- 
    
Bug
 - 
    Status: Closed (View Workflow)
 - 
    
Major
 - 
    Resolution: Fixed
 - 
    None
 - 
    None
 - 
    None
 
Description
This simple part of code demonstrates the NullPointerException in the current code of the MariaDB driver (v1.1.3):
					try {
			 | 
		
					Class.forName("org.mariadb.jdbc.Driver");
			 | 
		
					String dbUrl = "jdbc:mysql://host:3306/db";
			 | 
		
					Connection con = DriverManager.getConnection(dbUrl, "user", "pwd");
			 | 
		
					Statement stmt = con.createStatement();
			 | 
		
					// do not add any batch entries!
			 | 
		
					stmt.executeBatch(); // -> NullPointerException
			 | 
		
					con.close();
			 | 
		
					}
			 | 
		
					catch(Exception ex) {
			 | 
		
					ex.printStackTrace();
			 | 
		
					}
			 | 
		
					Â  | 
		
Result:
java.lang.NullPointerException
at org.mariadb.jdbc.MySQLStatement.executeBatch(MySQLStatement.java:1121)
This NullPointerException is raised when the executeBatch is called with no batches added.