/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/pt_insert_values_clause.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 | | // Tree node definitions for INSERT INTO ... VALUES clause. |
16 | | //-------------------------------------------------------------------------------------------------- |
17 | | |
18 | | #include "yb/yql/cql/ql/ptree/pt_insert_values_clause.h" |
19 | | |
20 | | #include "yb/yql/cql/ql/ptree/pt_expr.h" |
21 | | |
22 | | #include "yb/yql/cql/ql/ptree/yb_location.h" |
23 | | |
24 | | namespace yb { |
25 | | namespace ql { |
26 | | |
27 | | PTInsertValuesClause::PTInsertValuesClause(MemoryContext* memctx, |
28 | | YBLocationPtr loc, |
29 | | PTExprListNode::SharedPtr tuple) |
30 | | : PTCollection(memctx, loc), |
31 | 47.3k | tuples_(memctx, loc) { |
32 | 47.3k | Append(tuple); |
33 | 47.3k | } |
34 | | |
35 | 46.7k | PTInsertValuesClause::~PTInsertValuesClause() = default; |
36 | | |
37 | 47.3k | void PTInsertValuesClause::Append(const PTExprListNode::SharedPtr& tuple) { |
38 | 47.3k | tuples_.Append(tuple); |
39 | 47.3k | } |
40 | | |
41 | 0 | void PTInsertValuesClause::Prepend(const PTExprListNode::SharedPtr& tuple) { |
42 | 0 | tuples_.Prepend(tuple); |
43 | 0 | } |
44 | | |
45 | 47.2k | CHECKED_STATUS PTInsertValuesClause::Analyze(SemContext* sem_context) { |
46 | 47.2k | return Status::OK(); |
47 | 47.2k | } |
48 | | |
49 | 0 | void PTInsertValuesClause::PrintSemanticAnalysisResult(SemContext* sem_context) { |
50 | 0 | VLOG(3) << "SEMANTIC ANALYSIS RESULT (" << *loc_ << "):\n" << "Not yet avail"; |
51 | 0 | } |
52 | | |
53 | 47.2k | PTExprListNode::SharedPtr PTInsertValuesClause::Tuple(int index) const { |
54 | 47.2k | DCHECK_GE(index, 0); |
55 | 47.2k | return tuples_.element(index); |
56 | 47.2k | } |
57 | | |
58 | | } // namespace ql |
59 | | } // namespace yb |