MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
delete_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/5/27.
13//
14
15#pragma once
16
17#include "sql/stmt/stmt.h"
18#include "sql/parser/parse_defs.h"
19
20class Table;
21class FilterStmt;
22
27class DeleteStmt : public Stmt
28{
29public:
30 DeleteStmt(Table *table, FilterStmt *filter_stmt);
31 ~DeleteStmt() override;
32
33 Table *table() const
34 {
35 return table_;
36 }
37 FilterStmt *filter_stmt() const
38 {
39 return filter_stmt_;
40 }
41
42 StmtType type() const override
43 {
44 return StmtType::DELETE;
45 }
46
47public:
48 static RC create(Db *db, const DeleteSqlNode &delete_sql, Stmt *&stmt);
49
50private:
51 Table *table_ = nullptr;
52 FilterStmt *filter_stmt_ = nullptr;
53};
一个DB实例负责管理一批表
Definition: db.h:34
Delete 语句
Definition: delete_stmt.h:28
Filter/谓词/过滤语句
Definition: filter_stmt.h:92
Stmt for Statement
Definition: stmt.h:78
Definition: table.h:37
描述一个delete语句
Definition: parse_defs.h:124