GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SQL: Error when comparing two empty strings · Issue #1297 · ArcadeData/arcadedb

SQL: Error when comparing two empty strings #1297

New issue
Copy link
New issue
Copy link
Closed
Closed
SQL: Error when comparing two empty strings#1297
Copy link
Assignees
gramian
Milestone
23.11.1

Description

@gramian
gramian
opened on Nov 2, 2023
Issue body actions

ArcadeDB Version:

ArcadeDB Server v23.10.1 (build 47e2c315678e3a503e5c9b4e615186bed925ac7d/1698807954815/main)

OS and JDK Version:

Running on Linux 6.4.16-linuxkit - OpenJDK 64-Bit Server VM 11.0.21 (Temurin-11.0.21+9)

In 23.10.1 (via docker hub container) the following error appears when comparing an empty string against an empty string.
Particularly, this happens only if both sides in a comparison are the empty string.
However, this error is strangely not happening with the current repo head.

Maybe the case of two empty string needs to be handled here https://github.com/ArcadeData/arcadedb/blob/main/engine/src/main/java/com/arcadedb/serializer/BinaryComparator.java#L403 ?

Expected behavior

Correct string comparisons with empty strings.

Actual behavior

Internal error Index -1 out of bounds for length 0
Error on command execution (PostCommandHandler)
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0
       at com.arcadedb.serializer.BinaryComparator.equalsBytes(BinaryComparator.java:410)
       at com.arcadedb.serializer.BinaryComparator.equalsString(BinaryComparator.java:399)
       at com.arcadedb.serializer.BinaryComparator.equals(BinaryComparator.java:382)
       at com.arcadedb.query.sql.executor.QueryOperatorEquals.equals(QueryOperatorEquals.java:39)
       at com.arcadedb.query.sql.parser.EqualsCompareOperator.execute(EqualsCompareOperator.java:35)
       at com.arcadedb.query.sql.parser.BinaryCondition.evaluate(BinaryCondition.java:49)
       at com.arcadedb.query.sql.parser.NotBlock.evaluate(NotBlock.java:56)
       at com.arcadedb.query.sql.parser.AndBlock.evaluate(AndBlock.java:70)
       at com.arcadedb.query.sql.parser.OrBlock.evaluate(OrBlock.java:58)
       at com.arcadedb.query.sql.parser.WhereClause.matchesFilters(WhereClause.java:56)
       at com.arcadedb.query.sql.parser.Expression.execute(Expression.java:89)
       at com.arcadedb.query.sql.parser.ProjectionItem.execute(ProjectionItem.java:137)
       at com.arcadedb.query.sql.parser.Projection.calculateSingle(Projection.java:129)
       at com.arcadedb.query.sql.executor.ProjectionCalculationStep.calculateProjections(ProjectionCalculationStep.java:66)
       at com.arcadedb.query.sql.executor.ProjectionCalculationStep$1.next(ProjectionCalculationStep.java:51)
       at com.arcadedb.query.sql.parser.LocalResultSet.next(LocalResultSet.java:72)
       at com.arcadedb.server.http.handler.AbstractQueryHandler.serializeResultSet(AbstractQueryHandler.java:98)
       at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:100)
       at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:99)
       at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:126)
       at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
       at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
       at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
       at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
       at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
       at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
       at java.base/java.lang.Thread.run(Thread.java:829)

Steps to reproduce

Minimal example:

SELECT ('' != '')

General example:

CREATE DOCUMENT TYPE doc;
CREATE PROPERTY doc.str;
INSERT INTO doc SET str = '';
SELECT str FROM doc WHERE str != ''

Activity

  1. gramian
    self-assigned this
    on Nov 2, 2023
  2. lvca
    added
    bug
    on Nov 3, 2023
  3. lvca
    added this to the 23.11.1 milestone on Nov 3, 2023
  4. gramian commented on Nov 5, 2023

    @gramian
    gramian
    on Nov 5, 2023
    CollaboratorAuthor
    More actions

    Testing the latest docker image based on b1166c1 does not exhibit this error any more and does return the correct result.

  5. gramian
    closed this as completedon Nov 5, 2023
  6. mergify
    added a commit that references this issue on Aug 10, 2025

    chore(deps): bump jline.version from 3.30.4 to 3.30.5 [skip ci]

    e7e2b7e
  7. mergify
    added a commit that references this issue on Dec 1, 2025

    chore(deps): bump org.codehaus.mojo:versions-maven-plugin from 2.19.1…

    abcb9ff
  8. mergify
    added a commit that references this issue on Jun 14, 2026

    chore(deps): bump anthropics/claude-code-action from 1.0.140 to 1.0.1…

    f357fd3
  9. tae898
    added 3 commits that reference this issue on Jun 28, 2026

    chore(deps): bump jline.version from 3.30.4 to 3.30.5 [skip ci]

    b77173f

    chore(deps): bump org.codehaus.mojo:versions-maven-plugin from 2.19.1…

    c39faf2

    chore(deps): bump anthropics/claude-code-action from 1.0.140 to 1.0.1…

    8fd77fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @gramian
    gramian

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    • 23.11.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.