Skip to content

WHERE clause in SELECT does not work with property called "status" #774

@vic0824

Description

@vic0824

ArcadeDB Version: v23.1.1-SNAPSHOT (build d465110/1673614865087/main)

JDK Version: openjdk version "11.0.12" 2021-07-20 LTS

OpenJDK Runtime Environment Corretto-11.0.12.7.1 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.12.7.1 (build 11.0.12+7-LTS, mixed mode)

OS: CentOS release 6.9 (Final)

Expected behavior

It is possible to assign the name "status" to a property, because it is not a reserved keyword.
A property called "status" can be used in the WHERE clause of a SELECT statement.

Actual behavior

A property called "status" can be created in a Document Type, and documents can be inserted, however a SELECT which uses the "status" property in the WHERE clause does not return any record even when it should.

Steps to reproduce

  • create a database
  • create a document type containing a property called "status" and a property called "my_status"
  • insert a document that has a value for both properties
  • execute a select which contains a WHERE clause that selects the "status" value inserted previously
  • verify that no records are returned
  • execute a select which contains a WHERE clause that selects the "my_status" value inserted previously
  • verify that one records is returned

The attached test class produces the following output (irrelevant ArcadeDB start-up warnings omitted):

2023-01-16 10:39:54.646 INFO  [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server v23.1.1-SNAPSHOT (build d46511029703bb08716a959c4b137e4a57dea931/1673614865087/main) is starting up...
2023-01-16 10:39:54.653 INFO  [ArcadeDBServer] <ArcadeDB_0> Starting ArcadeDB Server with plugins [] ...
2023-01-16 10:39:54.742 INFO  [ArcadeDBServer] <ArcadeDB_0> - JMX Metrics Started...
[...]
2023-01-16 10:39:55.660 INFO  [HttpServer] <ArcadeDB_0> - Starting HTTP Server (host=0.0.0.0 port=2480-2489)...
2023-01-16 10:39:55.693 INFO  [undertow] starting server: Undertow - 2.3.2.Final
2023-01-16 10:39:55.700 INFO  [xnio] XNIO version 3.8.8.Final
2023-01-16 10:39:55.707 INFO  [nio] XNIO NIO Implementation Version 3.8.8.Final
2023-01-16 10:39:55.977 INFO  [threads] JBoss Threads version 3.5.0.Final
2023-01-16 10:39:56.009 INFO  [HttpServer] <ArcadeDB_0> - HTTP Server started (host=0.0.0.0 port=2480)
[...]

2023-01-16 10:39:56.025 INFO  [ArcadeDBServer] <ArcadeDB_0> Available query languages: [java, js, sql]
2023-01-16 10:39:56.027 INFO  [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server started in 'development' mode (CPUs=8 MAXRAM=3.93GB)
2023-01-16 10:39:56.027 INFO  [ArcadeDBServer] <ArcadeDB_0> Studio web tool available at http://localhost:2480 
insert record: sqlString = UPDATE Order SET processor = ?, vstart = ?, vstop = ?, status = ?, my_status = ? UPSERT RETURN AFTER WHERE processor = ? AND vstart = ? AND vstop = ?, result = {"processor":"SIR1LRM-7.1","vstart":"20220319_002905.423534","vstop":"20220319_003419.571172","status":"PENDING","my_status":"PENDING","@cat":"d","@type":"Order","@rid":"#3:0"}
Test 1: select with status = 'PENDING' using prepared statement
sqlString = SELECT from Order WHERE status = ? ORDER BY @rid ASC LIMIT 10, parameter = PENDING
result: 
Test 2: select with my_status = 'PENDING' using prepared statement
sqlString = SELECT from Order WHERE my_status = ? ORDER BY @rid ASC LIMIT 10, parameter = PENDING
result: @rid = #3:0, processor = SIR1LRM-7.1, vstart = 20220319_002905.423534, vstop = 20220319_003419.571172, pstart = null, pstop = null, status = PENDING, my_status = PENDING, node = null


2023-01-16 10:39:56.153 INFO  [ArcadeDBServer] <ArcadeDB_0> Shutting down ArcadeDB Server...
2023-01-16 10:39:56.154 INFO  [undertow] stopping server: Undertow - 2.3.2.Final
2023-01-16 10:39:56.460 INFO  [ArcadeDBServer] <ArcadeDB_0> - Stop JMX Metrics
2023-01-16 10:39:56.460 INFO  [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server is down

ArcadeDBTest.zip

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions