openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
https://vos.openlinksw.com
Other
854 stars 211 forks source link

ORDER BY LCASE() not working as expected #672

Open alb3rtino opened 7 years ago

alb3rtino commented 7 years ago

SPARQL ORDER BY in conjunction with the lcase() function seems to break if there are strings with more than 20 characters present

the following sparql query works as expected:

SELECT ?x {
  VALUES (?x) { ("c") ("B") ("z") ("Zzzzzzz") ("a")  }
}
ORDER BY lcase(?x)

x
LONG VARCHAR
_______________________________________________________________________________

a
B
c
z
Zzzzzzz

when using a string that has more than 20 characters it breaks:

SELECT ?x {
  VALUES (?x) { ("c") ("B") ("z") ("Zzzzzzzzzzzzzzzzzzzzz") ("a")  }
}
ORDER BY lcase(?x)

x
LONG VARCHAR
_______________________________________________________________________________

a
Zzzzzzzzzzzzzzzzzzzzz
B
c
z

with <= 20 characters it works fine you can reproduce this behavior on the public dbpedia sparql endpoint results are the same whether using isql, jdbc or the query editor

im running Virtuoso version 7.2.4.2.3217-pthreads

HughWilliams commented 7 years ago

This problem has been recreated and reported to development to look into ...