Support for savepoints?


#1

Using the MySQL JDBC driver I get the impression that savepoints are not properly supported by MemSQL. I couldn’t find anything regarding this in the documentation. Is this a known limitation or a bug?

Here is the Java code I used to test this with:

try {
    conn.setAutoCommit(false);
    conn.createStatement().execute("create reference table x(x int primary key)");
    Savepoint savepoint = conn.setSavepoint();
    conn.createStatement().execute("insert into x(x) values (1)");
    PreparedStatement stmt = conn.prepareStatement("select count(1) from x");
    ResultSet resultSet = stmt.executeQuery();
    resultSet.next();
    assertEquals(1, resultSet.getInt(1));
    conn.rollback(savepoint);
    resultSet = stmt.executeQuery();
    resultSet.next();
    assertEquals(0, resultSet.getInt(1));
} finally {
    conn.createStatement().execute("drop table x");
}

#2

MemSQL does not support Savepoints.


#3

OK. Thanks for confirming. This might be worth pointing out in the documentation (in addition to the absence of a SAVEPOINT command reference) and further, the JDBC driver is expected to return false for supportsSavepoints() (see https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#supportsSavepoints--) and throw a SQLFeatureNotSupportedException on setSavepoint() (see https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#setSavepoint--). This is currently not the case.