Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MariaDB :: MySQL-specific grants messages displayed when a MariaDB us… #1596

Merged
merged 1 commit into from
Dec 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import liquibase.database.AbstractJdbcDatabase;
import liquibase.database.Database;
import liquibase.database.core.InformixDatabase;
import liquibase.database.core.MariaDBDatabase;
import liquibase.database.core.MySQLDatabase;
import liquibase.database.core.OracleDatabase;
import liquibase.exception.DatabaseException;
Expand Down Expand Up @@ -103,12 +104,21 @@ protected DatabaseObject snapshotObject(DatabaseObject example, DatabaseSnapshot
definition = StringUtil.trimToNull(definition);
if (definition == null) {
definition = "[CANNOT READ VIEW DEFINITION]";
if (database instanceof MySQLDatabase) {
String warningMessage =
String warningMessage = null;
if (database instanceof MariaDBDatabase) {
warningMessage =
"\nThe current MariaDB user does not have permissions to access view definitions needed for this Liquibase command.\n" +
"Please search the changelog for '[CANNOT READ VIEW DEFINITION]' to locate inaccessible objects. " +
"Learn more about altering permissions with suggested MariaDB GRANTs at https://docs.liquibase.com/workflows/liquibase-pro/mariadbgrants.html\n";

} else if (database instanceof MySQLDatabase) {
warningMessage =
"\nThe current MySQL user does not have permissions to access view definitions needed for this Liquibase command.\n" +
"Please search the changelog for '[CANNOT READ VIEW DEFINITION]' to locate inaccessible objects. This is\n" +
"potentially due to a known MySQL bug https://bugs.mysql.com/bug.php?id=22763. Learn more about altering\n" +
"permissions with suggested MySQL GRANTs at https://docs.liquibase.com/workflows/liquibase-pro/mysqlgrants.html\n";
}
if (warningMessage != null) {
Scope.getCurrentScope().getUI().sendMessage("WARNING: " + warningMessage);
Scope.getCurrentScope().getLog(getClass()).warning(warningMessage);
}
Expand Down