MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
全部  文件 函数 变量 枚举 枚举值 宏定义  
select_stmt.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Wangyunlai on 2022/6/5.
13//
14
15#pragma once
16
17#include <vector>
18#include <memory>
19
20#include "common/rc.h"
21#include "sql/stmt/stmt.h"
22#include "storage/field/field.h"
23
24class FieldMeta;
25class FilterStmt;
26class Db;
27class Table;
28
33class SelectStmt : public Stmt
34{
35public:
36 SelectStmt() = default;
37 ~SelectStmt() override;
38
39 StmtType type() const override
40 {
41 return StmtType::SELECT;
42 }
43
44public:
45 static RC create(Db *db, const SelectSqlNode &select_sql, Stmt *&stmt);
46
47public:
48 const std::vector<Table *> &tables() const
49 {
50 return tables_;
51 }
52 const std::vector<Field> &query_fields() const
53 {
54 return query_fields_;
55 }
56 FilterStmt *filter_stmt() const
57 {
58 return filter_stmt_;
59 }
60
61private:
62 std::vector<Field> query_fields_;
63 std::vector<Table *> tables_;
64 FilterStmt *filter_stmt_ = nullptr;
65};
一个DB实例负责管理一批表
Definition: db.h:34
字段元数据
Definition: field_meta.h:31
Filter/谓词/过滤语句
Definition: filter_stmt.h:92
表示select语句
Definition: select_stmt.h:34
Stmt for Statement
Definition: stmt.h:78
Definition: table.h:37
描述一个select语句
Definition: parse_defs.h:91