mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 09:37:54 +01:00
[#843] Changed how SQL is executed:
- Now only UPDATE, INSERT, DELETE & REPLACE statements are executed using executeUpdate. Rest is executed using execute. - This fixes database patching on 1.13.2 (SQLite 3.25.0 or newer)
This commit is contained in:
parent
2e44b67f7a
commit
a4395c9076
@ -34,13 +34,22 @@ public abstract class ExecStatement extends AbstractSQLStatement {
|
||||
startBenchmark();
|
||||
try {
|
||||
prepare(statement);
|
||||
return statement.executeUpdate() > 0;
|
||||
return callExecute(statement);
|
||||
} finally {
|
||||
statement.close();
|
||||
stopBenchmark();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean callExecute(PreparedStatement statement) throws SQLException {
|
||||
if (sql.startsWith("UPDATE") || sql.startsWith("INSERT") || sql.startsWith("DELETE") || sql.startsWith("REPLACE")) {
|
||||
return statement.executeUpdate() > 0;
|
||||
} else {
|
||||
statement.execute();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void executeBatch(PreparedStatement statement) throws SQLException {
|
||||
startBatchBenchmark();
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user