-
Notifications
You must be signed in to change notification settings - Fork 871
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
insert ... return $current.link1:{field1} syntax returns null in develop branch #8543
Comments
Hi @freeart I just tried the following on develop branch and it seems to work fine
Am I missing something? Thanks Luigi |
I found the difference between your query and my query. I think it is a bug create class TCode;
CREATE PROPERTY `TCode`.`id` STRING
ALTER PROPERTY `TCode`.`id` mandatory true
ALTER PROPERTY `TCode`.`id` readonly false
ALTER PROPERTY `TCode`.`id` notNull true
CREATE PROPERTY `TCode`.`name` STRING
ALTER PROPERTY `TCode`.`name` mandatory true
ALTER PROPERTY `TCode`.`name` readonly false
ALTER PROPERTY `TCode`.`name` notNull true
create class TTable;
CREATE PROPERTY `TTable`.`code` LINK `TCode`
ALTER PROPERTY `TTable`.`code` linkedClass "TCode"
ALTER PROPERTY `TTable`.`code` mandatory true
ALTER PROPERTY `TTable`.`code` readonly false
ALTER PROPERTY `TTable`.`code` notNull true
CREATE PROPERTY `TTable`.`name` STRING
ALTER PROPERTY `TTable`.`name` mandatory true
ALTER PROPERTY `TTable`.`name` readonly false
ALTER PROPERTY `TTable`.`name` notNull true
insert into TCode set id = 10, name= 'foo'; So, this sql insert into `TTable`
set
code = (SELECT @rid from TCode WHERE id = 10),
name = "test"
RETURN
$current.code:{id,name} as code,
$current.name as name; returns insert into `TTable`
set
code = (SELECT from TCode WHERE id = 10),
name = "test"
RETURN
$current.code:{id,name} as code,
$current.name as name; returns |
OK, it makes sense, Just to clarify, both the following will work fine:
Thanks Luigi |
But why does it work in case of update/select queries? |
Good question, I think there is an ad-hoc management of this case, let me check, maybe we can do it also for the INSERT Thanks Luigi |
Any news? I'm afraid to remove |
Hi @freeart I'm pushing a fix now, it will be released with v 3.0.12 Thanks Luigi |
OrientDB Version: current develop branch
Java Version: docker openjdk:8-jdk-alpine
OS: docker openjdk:8-jdk-alpine
Expected behavior
Actual behavior
Update
andSelect
works fine, butInsert
doesn't return values of fields of LINK type.Steps to reproduce
The text was updated successfully, but these errors were encountered: