mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 17:47:38 +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();
|
startBenchmark();
|
||||||
try {
|
try {
|
||||||
prepare(statement);
|
prepare(statement);
|
||||||
return statement.executeUpdate() > 0;
|
return callExecute(statement);
|
||||||
} finally {
|
} finally {
|
||||||
statement.close();
|
statement.close();
|
||||||
stopBenchmark();
|
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 {
|
public void executeBatch(PreparedStatement statement) throws SQLException {
|
||||||
startBatchBenchmark();
|
startBatchBenchmark();
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user