Skip to content

SQL: IS Comparison -> new <=> operator #626

@gramian

Description

@gramian

ArcadeDB Version: v22.10.1 (build e692f4c/1667424782661/main)

JDK Version: openjdk 11.0.16.1 2022-08-12

OS: MacOS 12.6

Dear Developers,
It seems IS in WHERE can only be used with null, other right-hand side arguments seem to produce an error (see below). It might be that IS is meant as a comparison operator to exclusively compare against null, but then it could have been named ISNULL directly, so I assumed it is a null-safe comparison operator as in SQLite (which is pretty useful).

Expected behavior

1

Actual behavior

Error on command execution (PostCommandHandler)
Encountered "" at line 1, column 26. Was expecting one of:

Trace
Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandSQLParsingException: SELECT FROM mytype WHERE value IS 1;
	at com.arcadedb.query.sql.parser.StatementCache.throwParsingException(StatementCache.java:123)
	at com.arcadedb.query.sql.parser.StatementCache.parse(StatementCache.java:115)
	at com.arcadedb.query.sql.parser.StatementCache.get(StatementCache.java:70)
	at com.arcadedb.query.sql.executor.SQLEngine.parse(SQLEngine.java:97)
	at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:75)
	at com.arcadedb.database.EmbeddedDatabase.command(EmbeddedDatabase.java:1232)
	at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:410)
	at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:109)
	at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:72)
	at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:85)
	at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:111)
	at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93)
	at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:391)
	at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:256)
	at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
	at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
	at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
	at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
	at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
Caused by: com.arcadedb.query.sql.parser.ParseException: Encountered "" at line 1, column 26.
Was expecting one of:
    
	at com.arcadedb.query.sql.parser.SqlParser.generateParseException(SqlParser.java:26749)
	at com.arcadedb.query.sql.parser.SqlParser.jj_consume_token(SqlParser.java:26585)
	at com.arcadedb.query.sql.parser.SqlParser.NotBlock(SqlParser.java:7437)
	at com.arcadedb.query.sql.parser.SqlParser.AndBlock(SqlParser.java:7265)
	at com.arcadedb.query.sql.parser.SqlParser.OrBlock(SqlParser.java:7216)
	at com.arcadedb.query.sql.parser.SqlParser.WhereClause(SqlParser.java:7182)
	at com.arcadedb.query.sql.parser.SqlParser.SelectStatement(SqlParser.java:1456)
	at com.arcadedb.query.sql.parser.SqlParser.QueryStatement(SqlParser.java:1167)
	at com.arcadedb.query.sql.parser.SqlParser.StatementInternal(SqlParser.java:977)
	at com.arcadedb.query.sql.parser.SqlParser.Statement(SqlParser.java:894)
	at com.arcadedb.query.sql.parser.SqlParser.parse(SqlParser.java:238)
	at com.arcadedb.query.sql.parser.StatementCache.parse(StatementCache.java:110)
	... 19 more

Steps to reproduce

CREATE DOCUMENT TYPE mytype;
INSERT INTO mytype SET value = 1;
SELECT value FROM mytype WHERE value IS 1;

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions