Skip to content
Snippets Groups Projects
Unverified Commit 768e01ca authored by kyle.cao's avatar kyle.cao Committed by GitHub
Browse files

fix normalize string in optimizer (#769)


add test case

add test case

small change

Co-authored-by: default avatarjie.wang <38901892+jievince@users.noreply.github.com>
parent ef5db1e1
No related branches found
No related tags found
No related merge requests found
......@@ -441,7 +441,10 @@ Value OptimizerUtils::normalizeValue(const meta::cpp2::ColumnDef& col, const Val
if (!col.type.type_length_ref().has_value()) {
return Value::kNullBadType;
}
auto len = static_cast<size_t>(*col.get_type().type_length_ref());
if (!v.isStr()) {
return v;
}
auto len = static_cast<size_t>(*col.get_type().get_type_length());
if (v.getStr().size() > len) {
return Value(v.getStr().substr(0, len));
} else {
......
......@@ -66,6 +66,18 @@ Feature: Basic match
| 'Ray Allen' | 43 |
| 'David West' | 38 |
| 'Tracy McGrady' | 39 |
When executing query:
"""
MATCH (v:player) where v.name == null RETURN v
"""
Then the result should be, in any order, with relax comparison:
| v |
When executing query:
"""
MATCH (v:player) where v.name == 3 RETURN v
"""
Then the result should be, in any order, with relax comparison:
| v |
Scenario: One step
When executing query:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment