mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-08-21 20:22:45 +02:00
[Fix] Fix MySQL query for "Has Column"
MySQL query for has column did not take database name into account. This means that a database with multiple Plan databases would provide wrong results for the Patch system, leading to patch failiure Affected issues: Fixes #732
This commit is contained in:
parent
cbb45bf49d
commit
d1d2753422
|
@ -52,11 +52,12 @@ public abstract class Patch {
|
|||
protected boolean hasColumn(String tableName, String columnName) {
|
||||
return usingMySQL ?
|
||||
query(new QueryStatement<Boolean>("SELECT * FROM information_schema.COLUMNS" +
|
||||
" WHERE TABLE_NAME=? AND COLUMN_NAME=?") {
|
||||
" WHERE TABLE_NAME=? AND COLUMN_NAME=? AND TABLE_SCHEMA=?") {
|
||||
@Override
|
||||
public void prepare(PreparedStatement statement) throws SQLException {
|
||||
statement.setString(1, tableName);
|
||||
statement.setString(2, columnName);
|
||||
statement.setString(3, Settings.DB_DATABASE.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user