[FEAT MERGE]4_1_sql_feature
Co-authored-by: leslieyuchen <leslieyuchen@gmail.com> Co-authored-by: Charles0429 <xiezhenjiang@gmail.com> Co-authored-by: raywill <hustos@gmail.com>
This commit is contained in:
@ -24,12 +24,7 @@ namespace sql
|
||||
class ObSelectStmtPrinter : public ObDMLStmtPrinter {
|
||||
|
||||
public:
|
||||
ObSelectStmtPrinter() :
|
||||
ObDMLStmtPrinter(),
|
||||
column_list_(NULL),
|
||||
is_set_subquery_(false),
|
||||
is_generated_table_(false),
|
||||
force_col_alias_(false) {}
|
||||
ObSelectStmtPrinter()=delete;
|
||||
|
||||
ObSelectStmtPrinter(char *buf,
|
||||
int64_t buf_len,
|
||||
@ -37,15 +32,11 @@ public:
|
||||
const ObSelectStmt *stmt,
|
||||
ObSchemaGetterGuard *schema_guard,
|
||||
common::ObObjPrintParams print_params,
|
||||
common::ObIArray<common::ObString> *column_list,
|
||||
bool is_set_subquery,
|
||||
bool is_generated_table = false,
|
||||
const bool force_col_alias = false)
|
||||
: ObDMLStmtPrinter(buf, buf_len, pos, stmt, schema_guard, print_params),
|
||||
column_list_(column_list),
|
||||
is_set_subquery_(is_set_subquery),
|
||||
is_generated_table_(is_generated_table),
|
||||
force_col_alias_(force_col_alias) {}
|
||||
column_list_(NULL),
|
||||
force_col_alias_(force_col_alias)
|
||||
{}
|
||||
|
||||
ObSelectStmtPrinter(char *buf,
|
||||
int64_t buf_len,
|
||||
@ -54,31 +45,30 @@ public:
|
||||
ObSchemaGetterGuard *schema_guard,
|
||||
common::ObObjPrintParams print_params,
|
||||
const ParamStore *param_store,
|
||||
common::ObIArray<common::ObString> *column_list,
|
||||
bool is_set_subquery,
|
||||
bool is_generated_table = false,
|
||||
const bool force_col_alias = false)
|
||||
: ObDMLStmtPrinter(buf, buf_len, pos, stmt, schema_guard, print_params, param_store),
|
||||
column_list_(column_list),
|
||||
is_set_subquery_(is_set_subquery),
|
||||
is_generated_table_(is_generated_table),
|
||||
force_col_alias_(force_col_alias) {}
|
||||
column_list_(NULL),
|
||||
force_col_alias_(force_col_alias)
|
||||
{}
|
||||
virtual ~ObSelectStmtPrinter() {}
|
||||
|
||||
void init(char *buf,
|
||||
int64_t buf_len,
|
||||
int64_t *pos,
|
||||
ObSelectStmt *stmt,
|
||||
common::ObIArray<common::ObString> *column_list,
|
||||
bool is_set_subquery);
|
||||
common::ObIArray<common::ObString> *column_list);
|
||||
|
||||
virtual int do_print();
|
||||
static int remove_double_quotation_for_string(ObString &alias_string, ObIAllocator &allocator);
|
||||
void set_column_list(common::ObIArray<common::ObString> *column_list) { column_list_ = column_list; }
|
||||
|
||||
bool need_print_alias() const { return force_col_alias_ || (is_root_stmt() && print_params_.print_origin_stmt_); }
|
||||
|
||||
private:
|
||||
int print();
|
||||
int print_unpivot();
|
||||
int print_set_op_stmt();
|
||||
int print_recursive_union_stmt();
|
||||
int print_basic_stmt();
|
||||
|
||||
int print_select();
|
||||
@ -90,12 +80,11 @@ private:
|
||||
int print_for_update();
|
||||
|
||||
///////cte related functions
|
||||
int print_with();
|
||||
int print_cte_define_title(TableItem* cte_table);
|
||||
int print_search_and_cycle(TableItem* cte_table);
|
||||
int print_multi_rollup_items(const common::ObIArray<ObMultiRollupItem> &rollup_items);
|
||||
int print_with_check_option();
|
||||
|
||||
int find_recursive_cte_table(const ObSelectStmt* stmt, TableItem* &table);
|
||||
|
||||
///////end of functions
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObSelectStmtPrinter);
|
||||
@ -103,9 +92,6 @@ private:
|
||||
// data members
|
||||
// create view v(column_list) as...
|
||||
common::ObIArray<common::ObString> *column_list_;
|
||||
// tell printer whether current stmt is a set left/right subquery
|
||||
bool is_set_subquery_;
|
||||
bool is_generated_table_;
|
||||
bool force_col_alias_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user