DB DirectQuerySupportImpl broken for small String literals
The old "too-optimized" implementation has multiple flaws:
- Index calculation did not have enough parenthesis in it which meant that the value table index was sometimes calculated incorrectly. This lead to string literal values being read incorrectly.
- Did not take into account string literals longer than 127 characters
- Did not take into account that string literals are modified-utf-8 encoded and simply decoded them as US-ASCII bytes. Essentially all resources with name containing special characters were indexed incorrectly up until now.
All of these flaws have been in the code for ages (> 7 years, since https://www.simantics.org/redmine/projects/simantics-platform/repository/revisions/21534/diff/db/trunk/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DirectQuerySupportImpl.java)
Edited by Tuukka Lehtonen