提交 3502b597 编写于 作者: S serge-rider

#3713 MAriaDB broken privilege names fix

上级 ff461566
...@@ -58,7 +58,7 @@ public class MySQLCommandGrantPrivilege extends DBECommandAbstract<MySQLUser> { ...@@ -58,7 +58,7 @@ public class MySQLCommandGrantPrivilege extends DBECommandAbstract<MySQLUser> {
@Override @Override
public DBEPersistAction[] getPersistActions(Map<String, Object> options) public DBEPersistAction[] getPersistActions(Map<String, Object> options)
{ {
String privName = privilege.getName(); String privName = privilege.getFixedPrivilegeName();
String grantScript = "GRANT " + privName + //$NON-NLS-1$ String grantScript = "GRANT " + privName + //$NON-NLS-1$
" ON " + getObjectName() + //$NON-NLS-1$ " ON " + getObjectName() + //$NON-NLS-1$
" TO " + getObject().getFullName() + ""; //$NON-NLS-1$ //$NON-NLS-2$ " TO " + getObject().getFullName() + ""; //$NON-NLS-1$ //$NON-NLS-2$
......
...@@ -26,6 +26,8 @@ import org.jkiss.dbeaver.model.meta.Property; ...@@ -26,6 +26,8 @@ import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.struct.DBSObject; import org.jkiss.dbeaver.model.struct.DBSObject;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;
/** /**
* MySQLPrivilege * MySQLPrivilege
...@@ -37,6 +39,12 @@ public class MySQLPrivilege implements DBAPrivilege ...@@ -37,6 +39,12 @@ public class MySQLPrivilege implements DBAPrivilege
public static final String GRANT_PRIVILEGE = "Grant Option"; public static final String GRANT_PRIVILEGE = "Grant Option";
public static final String ALL_PRIVILEGES = "All Privileges"; public static final String ALL_PRIVILEGES = "All Privileges";
public static final Map<String, String> BAD_PRIV_NAME_MAP = new HashMap<>();
static {
BAD_PRIV_NAME_MAP.put("Delete versioning rows", "Delete history");
}
public enum Kind { public enum Kind {
OBJECTS, OBJECTS,
DDL, DDL,
...@@ -79,6 +87,14 @@ public class MySQLPrivilege implements DBAPrivilege ...@@ -79,6 +87,14 @@ public class MySQLPrivilege implements DBAPrivilege
return name; return name;
} }
public String getFixedPrivilegeName() {
String fixedName = BAD_PRIV_NAME_MAP.get(name);
if (fixedName != null) {
return fixedName;
}
return name;
}
@Property(viewable = true, order = 2) @Property(viewable = true, order = 2)
public String getContext() public String getContext()
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册