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