Fix CREATE PROPERTY UNSAFE in distributed
Resolves:
@@ -25,7 +25,10 @@ import com.orientechnologies.orient.core.command.OCommandRequestText;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.exception.OCommandExecutionException;
-import com.orientechnologies.orient.core.metadata.schema.*;
+import com.orientechnologies.orient.core.metadata.schema.OClass;
+import com.orientechnologies.orient.core.metadata.schema.OClassEmbedded;
+import com.orientechnologies.orient.core.metadata.schema.OPropertyImpl;
+import com.orientechnologies.orient.core.metadata.schema.OType;
import java.util.ArrayList;
import java.util.List;
@@ -145,12 +148,16 @@ public class OCommandExecutorSQLCreateProperty extends OCommandExecutorSQLAbstra
if (m.matches()) {
// Linked Type / Class
- if (m.group(1) != null && !m.group(1).equals("UNSAFE")) {
+ if (m.group(1) != null) {
+ if (m.group(1).equalsIgnoreCase("UNSAFE")) {
+ this.unsafe = true;
+ } else {
linked = m.group(1);
if (linked.startsWith("`") && linked.endsWith("`") && linked.length() > 1) {
linked = linked.substring(1, linked.length() - 1);
}
}
+ }
// Attributes
if (m.group(2) != null) {
@@ -341,8 +348,7 @@ public class OCommandExecutorSQLCreateProperty extends OCommandExecutorSQLAbstra
@Override
public String getSyntax() {
- return "CREATE PROPERTY <class>.<property> [IF NOT EXISTS] <type> [<linked-type>|<linked-class>] " +
- "[(mandatory <true|false>, notnull <true|false>, <true|false>, default <value>, min <value>, max <value>)] " +
- "[UNSAFE]";
+ return "CREATE PROPERTY <class>.<property> [IF NOT EXISTS] <type> [<linked-type>|<linked-class>] "
+ + "[(mandatory <true|false>, notnull <true|false>, <true|false>, default <value>, min <value>, max <value>)] " + "[UNSAFE]";
}
}
