Skip to content

ORDER BY on string property not returning expected alphabetical order #10499

@Aniket-Lonare

Description

@Aniket-Lonare

OrientDB Version: 3.2.39 and 3.2.42

Java Version: jdk11

OS: Linux ( Docker image)

Description:

When using the ORDER BY clause on a string property (e.g., Name), the result set is not sorted in the correct alphabetical order.

Steps to Reproduce:

  1. Create a class MyClass with a property Name of type STRING.

  2. Insert the following records:

    INSERT INTO MyClass SET ID = 1, Name = 'Delta Introduction updated';
    INSERT INTO MyClass SET ID = 2, Name = 'Delta - Statistical Analysis';
  3. Run the following query:

    SELECT * FROM MyClass ORDER BY Name;

Expected Result:

Delta - Statistical Analysis
Delta Introduction updated

Actual Result:

Delta Introduction updated
Delta - Statistical Analysis

Please Notes:

  • The JavaScript .sort() function applied on the same data in browser console returns the expected order.
  • This issue appears to be related to how special characters (like hyphens -) are treated in the sorting logic.
  • See screenshot attached for query result and comparison with .sort() in the browser.

Attachment:

Image

We have attached the sample database for reference, this db has only one class MyClass.

test.gz

Please let me know if you need any more information to look into this issue.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions