Orientdb: Abnormal function in rename a property when use of Alter property command

Created on 16 Sep 2018  路  5Comments  路  Source: orientechnologies/orientdb

OrientDB Version: 3.0.7

Java Version: 8 u181

OS: macOS 10.13.6

Expected behavior

I have tried to rename a property of a class with this command:
alter property bcd.bcdId name bcd.did
I expected the name attribute has been changed because I didn't get any error with this command and it was ok. Also, I have tried the command below on another class property:
alter property bcc.bccId name cid

Actual behavior

But, the property name attribute just had been changed to NULL and also I couldn't drop the property after this... so, I had to drop the classes, it was ok but very painful.

Steps to reproduce

1- create class bcd extends V
2- create property bcd.bcdId long
3- alter property bcd.bcdId name bcd.did

and

1- create class bcc extends V
2- create property bcc.bccId long
3- alter property bcc.bccId name cid

Hey @saeedtabrizi, do you have any idea about this issue?

bug

Most helpful comment

Hi @hfereidouni @saeedtabrizi

Ok, I got the problem, the SQL executor tries to evaluate the new name as an expression and it returns null.
The following works fine:

alter property bcc.bccId name "cid"

Anyway, I think it makes sense to make it work also without the quotes, so I'm fixing it

Thanks

Luigi

All 5 comments

Hi @hfereidouni
I guess it's a bug in v3.0 query engine of ODB.
I reproduced it and see this actual result same as you said .
@luigidellaquila It seems we need to have more Test case for fix Alter Property regression .

Hi guys,

I'm checking it, I'll let you know asap

Thanks

Luigi

Hi @hfereidouni @saeedtabrizi

Ok, I got the problem, the SQL executor tries to evaluate the new name as an expression and it returns null.
The following works fine:

alter property bcc.bccId name "cid"

Anyway, I think it makes sense to make it work also without the quotes, so I'm fixing it

Thanks

Luigi

Thank you @luigidellaquila :)

@luigidellaquila Thanks .
It's a super fast bug fixing :1st_place_medal:
I will update my forked repository to achieve latest updates and fixtures .

Was this page helpful?
0 / 5 - 0 ratings