MiniOB
1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
src
observer
sql
stmt
create_index_stmt.h
1
/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2
miniob is licensed under Mulan PSL v2.
3
You can use this software according to the terms and conditions of the Mulan PSL v2.
4
You may obtain a copy of Mulan PSL v2 at:
5
http://license.coscl.org.cn/MulanPSL2
6
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9
See the Mulan PSL v2 for more details. */
10
11
//
12
// Created by Wangyunlai on 2023/4/25.
13
//
14
15
#pragma once
16
17
#include "
sql/stmt/stmt.h
"
18
19
struct
CreateIndexSqlNode
;
20
class
Table
;
21
class
FieldMeta
;
22
27
class
CreateIndexStmt
:
public
Stmt
28
{
29
public
:
30
CreateIndexStmt
(
Table
*table,
const
FieldMeta
*field_meta,
const
string
&index_name)
31
: table_(table), field_meta_(field_meta), index_name_(index_name)
32
{}
33
34
virtual
~CreateIndexStmt
() =
default
;
35
36
StmtType type()
const override
{
return
StmtType::CREATE_INDEX; }
37
38
Table
*table()
const
{
return
table_; }
39
const
FieldMeta
*field_meta()
const
{
return
field_meta_; }
40
const
string
&index_name()
const
{
return
index_name_; }
41
42
public
:
43
static
RC create(
Db
*db,
const
CreateIndexSqlNode
&create_index,
Stmt
*&stmt);
44
45
private
:
46
Table
*table_ =
nullptr
;
47
const
FieldMeta
*field_meta_ =
nullptr
;
48
string
index_name_;
49
};
CreateIndexStmt
创建索引的语句
Definition:
create_index_stmt.h:28
Db
一个DB实例负责管理一批表
Definition:
db.h:46
FieldMeta
字段元数据
Definition:
field_meta.h:30
Stmt
Stmt for Statement
Definition:
stmt.h:83
Table
表
Definition:
table.h:42
stmt.h
CreateIndexSqlNode
描述一个create index语句
Definition:
parse_defs.h:191
制作者
1.9.5