Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

[Minor] Add cases from Issue #1217

Merged
merged 4 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/optimizer/OptimizerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ bool OptimizerUtils::findOptimalIndex(const Expression* condition,
const std::vector<std::shared_ptr<IndexItem>>& indexItems,
bool* isPrefixScan,
IndexQueryContext* ictx) {
// Return directly if there is not valid index to use.
// Return directly if there is no valid index to use.
if (indexItems.empty()) {
return false;
}
Expand Down
69 changes: 69 additions & 0 deletions tests/tck/features/bugfix/StringFlaotAddition.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2021 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
Feature: Test return float plus string

Background:
Given a graph with space named "nba"

# Fix https://github.com/vesoft-inc/nebula-graph/issues/1214
Scenario: addition[1]
When executing query:
"""
RETURN 30.142857142857142 + "Yao Ming"
"""
Then the result should be, in any order, with relax comparison:
| (30.142857142857142+"Yao Ming") |
| "30.142857142857142Yao Ming" |
When executing query:
"""
RETURN -30.142857142857142 + "Yao Ming"
"""
Then the result should be, in any order, with relax comparison:
| (-(30.142857142857142)+"Yao Ming") |
| "-30.142857142857142Yao Ming" |
When executing query:
"""
RETURN "Yao Ming" + 30.142857142857142
"""
Then the result should be, in any order, with relax comparison:
| ("Yao Ming"+30.142857142857142) |
| "Yao Ming30.142857142857142" |
When executing query:
"""
RETURN "Yao Ming" + -30.142857142857142
"""
Then the result should be, in any order, with relax comparison:
| ("Yao Ming"+-(30.142857142857142)) |
| "Yao Ming-30.142857142857142" |

Scenario: addition[2]
When executing query:
"""
RETURN 30.14 + "Yao Ming"
"""
Then the result should be, in any order, with relax comparison:
| (30.14+"Yao Ming") |
| "30.14Yao Ming" |
When executing query:
"""
RETURN -30.14 + "Yao Ming"
"""
Then the result should be, in any order, with relax comparison:
| (-(30.14)+"Yao Ming") |
| "-30.14Yao Ming" |
When executing query:
"""
RETURN "Yao Ming" + 30.14
"""
Then the result should be, in any order, with relax comparison:
| ("Yao Ming"+30.14) |
| "Yao Ming30.14" |
When executing query:
"""
RETURN "Yao Ming" + -30.14
"""
Then the result should be, in any order, with relax comparison:
| ("Yao Ming"+-(30.14)) |
| "Yao Ming-30.14" |