mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-05 10:20:23 +01: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) {
|
protected boolean hasColumn(String tableName, String columnName) {
|
||||||
return usingMySQL ?
|
return usingMySQL ?
|
||||||
query(new QueryStatement<Boolean>("SELECT * FROM information_schema.COLUMNS" +
|
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
|
@Override
|
||||||
public void prepare(PreparedStatement statement) throws SQLException {
|
public void prepare(PreparedStatement statement) throws SQLException {
|
||||||
statement.setString(1, tableName);
|
statement.setString(1, tableName);
|
||||||
statement.setString(2, columnName);
|
statement.setString(2, columnName);
|
||||||
|
statement.setString(3, Settings.DB_DATABASE.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user