/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/pt_explain.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  |  | // Treenode implementation for INSERT statements.  | 
16  |  | //--------------------------------------------------------------------------------------------------  | 
17  |  | #include "yb/yql/cql/ql/ptree/pt_explain.h"  | 
18  |  |  | 
19  |  | #include "yb/yql/cql/ql/ptree/sem_context.h"  | 
20  |  | #include "yb/yql/cql/ql/ptree/yb_location.h"  | 
21  |  |  | 
22  |  | namespace yb { | 
23  |  | namespace ql { | 
24  |  |  | 
25  |  | //--------------------------------------------------------------------------------------------------  | 
26  |  |  | 
27  |  | PTExplainStmt::PTExplainStmt(MemoryContext *memctx,  | 
28  |  |                              YBLocation::SharedPtr loc,  | 
29  |  |                              TreeNode::SharedPtr stmt)  | 
30  | 167  |     : stmt_(stmt) { | 
31  | 167  | }  | 
32  |  |  | 
33  | 167  | PTExplainStmt::~PTExplainStmt() { | 
34  | 167  | }  | 
35  |  |  | 
36  | 167  | CHECKED_STATUS PTExplainStmt::Analyze(SemContext *sem_context) { | 
37  | 167  |   if (!stmt_->IsDml()) { | 
38  | 0  |     return sem_context->Error(this, "Only DML statements can be explained",  | 
39  | 0  |                               ErrorCode::CQL_STATEMENT_INVALID);  | 
40  | 0  |   }  | 
41  |  |  | 
42  |  |   // Analyze explainable sub statement.  | 
43  | 167  |   return stmt_->Analyze(sem_context);  | 
44  | 167  | }  | 
45  |  |  | 
46  | 0  | void PTExplainStmt::PrintSemanticAnalysisResult(SemContext *sem_context) { | 
47  | 0  |   VLOG(3) << "SEMANTIC ANALYSIS RESULT (" << *loc_ << "):\n" << "Not yet avail"; | 
48  | 0  | }  | 
49  |  |  | 
50  |  | }  // namespace ql  | 
51  |  | }  // namespace yb  |