Skip to content

SQL Parsing of list of objects keeps only the first element and fail later #8277

@jxerome

Description

@jxerome

OrientDB Version: 3.0.1, 3.0.0, 3.0.0RC2

Java Version: 1.8.0_162

Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

OS: Mac OS X 10.13.4

Expected behavior

Expect list of objects to be read as a list and be used

Actual behavior

The parser replace the list by it's first element. The command that use the list fails because it expects a list.

Steps to reproduce

Here is an exemple in the console. The same error happens with the execute command of the java driver.

orientdb> create database memory:test

Creating database [memory:test] using the storage type [MEMORY]...
Database created successfully.

Current database is: memory:test
orientdb {db=test}> create class values

Class created successfully.

orientdb {db=test}> create property values.name string

Property created successfully.

orientdb {db=test}> create property values.value string

Property created successfully.

orientdb {db=test}> create class stuff

Class created successfully.

orientdb {db=test}> create property stuff.name string

Property created successfully.

orientdb {db=test}> create property stuff.values embeddedlist values

Property created successfully.

orientdb {db=test}> insert into stuff set name = 'a', values = [{'name':'p1','value':'v1'}]

Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'stuff.values' has been declared as EMBEDDEDLIST but an incompatible type is used. Value: {name=p1, value=v1}
	DB name="test"
	Error Code="4"

orientdb {db=test}> insert into stuff (name, values) values ('a', [{'name':'p1','value':'v1'}])

Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'stuff.values' has been declared as EMBEDDEDLIST but an incompatible type is used. Value: {name=p1, value=v1}
	DB name="test"
	Error Code="4"

orientdb {db=test}> insert into stuff (name, values) values ('a', [{'name':'p1','value':'v1'},{'name':'b','value':'v2'}])

Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'stuff.values' has been declared as EMBEDDEDLIST but an incompatible type is used. Value: {name=p1, value=v1}
	DB name="test"
	Error Code="4"

Metadata

Metadata

Labels

buglegacy not used anymore

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions