17#include "common/sys/rc.h"
18#include "event/session_event.h"
19#include "event/sql_event.h"
20#include "sql/executor/sql_result.h"
21#include "sql/operator/string_list_physical_operator.h"
35 const char *strings[] = {
"show tables;",
37 "create table `table name` (`column name` `column type`, ...);",
38 "create index `index name` on `table` (`column`);",
39 "insert into `table` values(`value1`,`value2`);",
40 "update `table` set column=value [where `column`=`value`];",
41 "delete from `table` [where `column`=`value`];",
42 "select [ * | `columns` ] from `table`;"};
45 for (
size_t i = 0; i <
sizeof(strings) /
sizeof(strings[0]); i++) {
46 oper->append(strings[i]);
49 SqlResult *sql_result = sql_event->session_event()->sql_result();
52 schema.append_cell(
"Commands");
54 sql_result->set_tuple_schema(schema);
55 sql_result->set_operator(unique_ptr<PhysicalOperator>(oper));
Help语句执行器
Definition: help_executor.h:28
与SessionEvent类似,也是处理SQL请求的事件,只是用在SQL的不同阶段
Definition: sql_event.h:29
SQL执行结果
Definition: sql_result.h:32
字符串列表物理算子
Definition: string_list_physical_operator.h:26
元组的结构,包含哪些字段(这里成为Cell),每个字段的说明
Definition: tuple.h:48