| 309 | }; |
| 310 | |
| 311 | TEST_F(PlanExecutorTestC, FullIndexScan) { |
| 312 | json_->Set(*ctx_, "test1:a", "$", "{}"); |
| 313 | json_->Set(*ctx_, "test1:b", "$", "{}"); |
| 314 | json_->Set(*ctx_, "test2:c", "$", "{\"f3\": 6}"); |
| 315 | json_->Set(*ctx_, "test3:d", "$", "{}"); |
| 316 | json_->Set(*ctx_, "test4:e", "$", "{\"f3\": 7}"); |
| 317 | json_->Set(*ctx_, "test4:f", "$", "{\"f3\": 2}"); |
| 318 | json_->Set(*ctx_, "test4:g", "$", "{\"f3\": 8}"); |
| 319 | json_->Set(*ctx_, "test5:h", "$", "{}"); |
| 320 | json_->Set(*ctx_, "test5:i", "$", "{}"); |
| 321 | json_->Set(*ctx_, "test5:g", "$", "{}"); |
| 322 | |
| 323 | { |
| 324 | auto op = std::make_unique<FullIndexScan>(std::make_unique<IndexRef>("ia", IndexI())); |
| 325 | |
| 326 | auto ctx = ExecutorContext(op.get(), storage_.get()); |
| 327 | ASSERT_EQ(NextRow(ctx).key, "test2:c"); |
| 328 | ASSERT_EQ(NextRow(ctx).key, "test4:e"); |
| 329 | ASSERT_EQ(NextRow(ctx).key, "test4:f"); |
| 330 | ASSERT_EQ(NextRow(ctx).key, "test4:g"); |
| 331 | ASSERT_EQ(ctx.Next().GetValue(), exe_end); |
| 332 | } |
| 333 | |
| 334 | { |
| 335 | auto op = std::make_unique<Filter>( |
| 336 | std::make_unique<FullIndexScan>(std::make_unique<IndexRef>("ia", IndexI())), |
| 337 | std::make_unique<NumericCompareExpr>(NumericCompareExpr::GT, std::make_unique<FieldRef>("f3", FieldI("f3")), |
| 338 | std::make_unique<NumericLiteral>(3))); |
| 339 | |
| 340 | auto ctx = ExecutorContext(op.get(), storage_.get()); |
| 341 | ASSERT_EQ(NextRow(ctx).key, "test2:c"); |
| 342 | ASSERT_EQ(NextRow(ctx).key, "test4:e"); |
| 343 | ASSERT_EQ(NextRow(ctx).key, "test4:g"); |
| 344 | ASSERT_EQ(ctx.Next().GetValue(), exe_end); |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | struct ScopedUpdate { |
| 349 | engine::Context* db_ctx; |
nothing calls this directly
no test coverage detected