YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/exec/eval_logic.cc
Line
Count
Source (jump to first uncovered line)
1
//--------------------------------------------------------------------------------------------------
2
// Copyright (c) YugaByte, Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
// in compliance with the License.  You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software distributed under the License
10
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
// or implied.  See the License for the specific language governing permissions and limitations
12
// under the License.
13
//
14
//--------------------------------------------------------------------------------------------------
15
16
#include "yb/yql/cql/ql/exec/executor.h"
17
18
#include "yb/yql/cql/ql/ptree/pt_expr.h"
19
20
namespace yb {
21
namespace ql {
22
23
0
CHECKED_STATUS Executor::PTExprToPB(const PTLogic1 *logic_pt, QLExpressionPB *logic_pb) {
24
0
  QLConditionPB *cond = logic_pb->mutable_condition();
25
0
  cond->set_op(logic_pt->ql_op());
26
27
0
  RETURN_NOT_OK(PTExprToPB(logic_pt->op1(), cond->add_operands()));
28
0
  return Status::OK();
29
0
}
30
31
147
CHECKED_STATUS Executor::PTExprToPB(const PTLogic2 *logic_pt, QLExpressionPB *logic_pb) {
32
147
  QLConditionPB *cond = logic_pb->mutable_condition();
33
147
  cond->set_op(logic_pt->ql_op());
34
35
147
  RETURN_NOT_OK(PTExprToPB(logic_pt->op1(), cond->add_operands()));
36
147
  RETURN_NOT_OK(PTExprToPB(logic_pt->op2(), cond->add_operands()));
37
147
  return Status::OK();
38
147
}
39
40
98
CHECKED_STATUS Executor::PTExprToPB(const PTRelation0 *relation_pt, QLExpressionPB *relation_pb) {
41
98
  QLConditionPB *cond = relation_pb->mutable_condition();
42
98
  cond->set_op(relation_pt->ql_op());
43
98
  return Status::OK();
44
98
}
45
46
0
CHECKED_STATUS Executor::PTExprToPB(const PTRelation1 *relation_pt, QLExpressionPB *relation_pb) {
47
0
  QLConditionPB *cond = relation_pb->mutable_condition();
48
0
  cond->set_op(relation_pt->ql_op());
49
50
0
  RETURN_NOT_OK(PTExprToPB(relation_pt->op1(), cond->add_operands()));
51
0
  return Status::OK();
52
0
}
53
54
426
CHECKED_STATUS Executor::PTExprToPB(const PTRelation2 *relation_pt, QLExpressionPB *relation_pb) {
55
426
  QLConditionPB *cond = relation_pb->mutable_condition();
56
426
  cond->set_op(relation_pt->ql_op());
57
58
426
  RETURN_NOT_OK(PTExprToPB(relation_pt->op1(), cond->add_operands()));
59
426
  RETURN_NOT_OK(PTExprToPB(relation_pt->op2(), cond->add_operands()));
60
426
  return Status::OK();
61
426
}
62
63
0
CHECKED_STATUS Executor::PTExprToPB(const PTRelation3 *relation_pt, QLExpressionPB *relation_pb) {
64
0
  QLConditionPB *cond = relation_pb->mutable_condition();
65
0
  cond->set_op(relation_pt->ql_op());
66
67
0
  RETURN_NOT_OK(PTExprToPB(relation_pt->op1(), cond->add_operands()));
68
0
  RETURN_NOT_OK(PTExprToPB(relation_pt->op2(), cond->add_operands()));
69
0
  RETURN_NOT_OK(PTExprToPB(relation_pt->op3(), cond->add_operands()));
70
0
  return Status::OK();
71
0
}
72
73
}  // namespace ql
74
}  // namespace yb