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

impossibility to delete a property #3232

Closed
habi4ek opened this issue Dec 18, 2014 · 5 comments
Closed

impossibility to delete a property #3232

habi4ek opened this issue Dec 18, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@habi4ek
Copy link

habi4ek commented Dec 18, 2014

after peforming the incorrect request to the data base through the studio, a property named "= sec" has developed

Now it's impossible to delete is,due to the constant indication of mistake

com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #20: Expected .. Use DROP PROPERTY . Command: DROP PROPERTY xDirs.= sec ----------------------------^

@a-unite
Copy link

a-unite commented Dec 19, 2014

Same problem here. although it looks like Studio problem, why is that possible anyway?
That is not rare situation, when you could make typo and pay for that with database inconsistency.

Another problem we have, partly related to this one - is a possibility to put non Latin symbol to the class name.
What happens next (on Debian at least) - you have the file with Cyrillic (for instance) symbol in name and Java couldn't read it properly making OrientDB complain on broken file without any chance to reindex, repair of even delete this class.

@lvca lvca added the bug label Jan 8, 2015
@lvca lvca removed the bug label Apr 8, 2015
@habi4ek
Copy link
Author

habi4ek commented Aug 28, 2015

there is nearly the same problem in DB version 2.1.0
I can't delete or rename property which has white space in name
orientdb {db=test}> __create class test extends V__
Class created successfully. Total classes in database now: 12

orientdb {db=test}> __create property test.testName string__
Property created successfully with id=1

orientdb {db=test}> __select expand(properties) from (select  expand(classes) from metadata:schema) where name = 'test'__
----+------+--------+----+--------+---------+--------+-------+------------+----+----+------+------------+-------
\#   | @ CLASS|name    |type|globalId|mandatory|readonly|notNull|defaultValue|min |max |regexp|customFields|collate
----+------+--------+----+--------+---------+--------+-------+------------+----+----+------+------------+-------
0   |null  |testName|7   |20      |false    |false   |false  |null        |null|null|null  |null        |default
----+------+--------+----+--------+---------+--------+-------+------------+----+----+------+------------+-------
1 item(s) found. Query executed in 0.004 sec(s).

orientdb {db=test}> __alter property test.testName name hello mistake__
Property updated successfully

orientdb {db=test}> __select expand(properties) from (select  expand(classes) from metadata:schema) where name = 'test'__
----+------+--------------+----+--------+---------+--------+-------+------------+----+----+------+------------+-------
\#   | @ CLASS|name          |type|globalId|mandatory|readonly|notNull|defaultValue|min |max |regexp|customFields|collate
----+------+--------------+----+--------+---------+--------+-------+------------+----+----+------+------------+-------
0   |null  |hello mistake|7   |21      |false    |false   |false  |null        |null|null|null  |null        |default
----+------+--------------+----+--------+---------+--------+-------+------------+----+----+------+------------+-------
1 item(s) found. Query executed in 0.002 sec(s).

orientdb {db=test}> __alter property test.hello mistake  name renemeMistake__
Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #26: Unknown property attribute 'MISTAK
E'. Supported attributes are: [LINKEDTYPE, LINKEDCLASS, MIN, MAX, MANDATORY, NAME, NOTNULL, REGEXP, TYPE, CUSTOM, READONLY, COLLATE, DEFAULT]
Command: alter property test.hello mistake  name renemeMistake
----------------------------------^

Error: java.lang.IllegalArgumentException: No enum constant com.orientechnologies.orient.core.metadata.schema.OProperty.ATTRIBUTES.MISTAKE

orientdb {db=test}> __drop property test.hello mistake__

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #33: Wrong query parameter
Command: drop property test.hello mistake
-----------------------------------------^

@lvca
Copy link
Member

lvca commented Sep 23, 2015

Have you tried with back tick (`)? Example:

alter property `test.hello mistake  name` renemeMistake

@lvca lvca self-assigned this Sep 23, 2015
@lvca lvca added this to the 2.1.x (next hotfix) milestone Sep 23, 2015
@habi4ek
Copy link
Author

habi4ek commented Sep 23, 2015

I tried to put different signs in different places but always was getting mistake

orientdb {db=test}> alter property test.'hello mistake' name renemeMistake

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Property 'test.'hello mistake'' not exists

orientdb {db=test}> alter property 'test.hello mistake' name renemeMistake

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Source class ''test' not found

orientdb {db=test}> alter property test.'hello mistake' name renemeMistake

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Property 'test.'hello mistake'' not exists

orientdb {db=test}> alter property test.hello mistake name renemeMistake

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #26: Unknown property attribute 'MIS
E'. Supported attributes are: [LINKEDTYPE, LINKEDCLASS, MIN, MAX, MANDATORY, NAME, NOTNULL, REGEXP, TYPE, CUSTOM, READONLY, COLLATE, DEFAULT] Command: alter property test.hello mistake` name renemeMistake
----------------------------------^

Error: java.lang.IllegalArgumentException: No enum constant com.orientechnologies.orient.core.metadata.schema.OProperty.ATTRIBUTES.MISTAKE`

orientdb {db=test}> alter property test.hello mistake name renemeMistake

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #26: Unknown property attribute 'MIS
E'. Supported attributes are: [LINKEDTYPE, LINKEDCLASS, MIN, MAX, MANDATORY, NAME, NOTNULL, REGEXP, TYPE, CUSTOM, READONLY, COLLATE, DEFAULT] Command: alter propertytest.hello mistake` name renemeMistake
----------------------------------^

Error: java.lang.IllegalArgumentException: No enum constant com.orientechnologies.orient.core.metadata.schema.OProperty.ATTRIBUTES.MISTAKE`

orientdb {db=test}> alter property "test.hello mistake" name renemeMistake

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Source class '"test' not found

orientdb {db=test}> alter property 'test.hello mistake name' renemeMistake

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #41: Unknown property attribute 'REN
MISTAKE'. Supported attributes are: [LINKEDTYPE, LINKEDCLASS, MIN, MAX, MANDATORY, NAME, NOTNULL, REGEXP, TYPE, CUSTOM, READONLY, COLLATE, DEFAULT]
Command: alter property 'test.hello mistake name' renemeMistake
-------------------------------------------------^

Error: java.lang.IllegalArgumentException: No enum constant com.orientechnologies.orient.core.metadata.schema.OProperty.ATTRIBUTES.RENEMEMISTAKE

orientdb {db=test}> alter property "test.hello mistake" name renemeMistake

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Source class '"test' not found

orientdb {db=test}> alter property test."hello mistake" name renemeMistake

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Property 'test."hello mistake"' not exists

@lvca lvca assigned luigidellaquila and unassigned lvca Sep 23, 2015
@lvca lvca modified the milestones: 2.1.x (next hotfix), 2.2 Oct 26, 2015
@lvca lvca modified the milestones: 2.2.0-beta, 2.2.0-rc1 Dec 13, 2015
@lvca lvca modified the milestones: 2.2.0-rc1, 2.2.0 GA May 7, 2016
@robfrank robfrank modified the milestones: 2.2.0 GA, 2.2.1 May 18, 2016
luigidellaquila added a commit that referenced this issue May 28, 2016
luigidellaquila added a commit that referenced this issue May 28, 2016
@luigidellaquila
Copy link
Member

Fixed in develop branch (2.2.1)

Closing, please reopen if you still see any incorrect behaviors here

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants