diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-04-22 14:11:31 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-04-22 14:19:17 +0000 |
commit | 77d585e79ed10d687ca50db4c731c285e80f833b (patch) | |
tree | 16a35a5d666a3eb3dfe7c4f405b2c90189d534f1 /searchlib/src/tests/query/streaming_query_test.cpp | |
parent | 7bb93176d1c15704f89d69fa6daaaefdb19692c9 (diff) |
- Prevent the rewrite that happens with equiv and phrase to handle floating point queries in string fields, from happening in under a same-element node.
- Add raw stackdump from previously failing query.
Diffstat (limited to 'searchlib/src/tests/query/streaming_query_test.cpp')
-rw-r--r-- | searchlib/src/tests/query/streaming_query_test.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/searchlib/src/tests/query/streaming_query_test.cpp b/searchlib/src/tests/query/streaming_query_test.cpp index 5ce34cfcc3f..21d55b485c0 100644 --- a/searchlib/src/tests/query/streaming_query_test.cpp +++ b/searchlib/src/tests/query/streaming_query_test.cpp @@ -708,6 +708,24 @@ TEST("require that we do not break the stack on bad query") { EXPECT_FALSE(term.isValid()); } +TEST("a unhandled sameElement stack") { + const char * stack = "\022\002\026xyz_abcdefghij_xyzxyzxQ\001\vxxxxxx_name\034xxxxxx_xxxx_xxxxxxx_xxxxxxxxE\002\005delta\b<0.00393"; + vespalib::stringref stackDump(stack); + EXPECT_EQUAL(85u, stackDump.size()); + AllowRewrite empty; + const Query q(empty, stackDump); + EXPECT_TRUE(q.valid()); + const QueryNode & root = q.getRoot(); + auto sameElement = dynamic_cast<const SameElementQueryNode *>(&root); + EXPECT_TRUE(sameElement != nullptr); + EXPECT_EQUAL(2u, sameElement->size()); + EXPECT_EQUAL("xyz_abcdefghij_xyzxyzx", sameElement->getIndex()); + auto term0 = dynamic_cast<const QueryTerm *>((*sameElement)[0].get()); + EXPECT_TRUE(term0 != nullptr); + auto term1 = dynamic_cast<const QueryTerm *>((*sameElement)[1].get()); + EXPECT_TRUE(term1 != nullptr); +} + namespace { void verifyQueryTermNode(const vespalib::string & index, const QueryNode *node) { EXPECT_TRUE(dynamic_cast<const QueryTerm *>(node) != nullptr); |