patch 4.0
This commit is contained in:
@ -17,36 +17,61 @@
|
||||
#include "sql/resolver/dml/ob_select_stmt.h"
|
||||
#include "sql/resolver/expr/ob_raw_expr_printer.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace sql {
|
||||
namespace oceanbase
|
||||
{
|
||||
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() :
|
||||
ObDMLStmtPrinter(),
|
||||
column_list_(NULL),
|
||||
is_set_subquery_(false),
|
||||
is_generated_table_(false),
|
||||
force_col_alias_(false) {}
|
||||
|
||||
ObSelectStmtPrinter(char* buf, int64_t buf_len, int64_t* pos, const ObSelectStmt* stmt,
|
||||
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, print_params),
|
||||
column_list_(column_list),
|
||||
is_set_subquery_(is_set_subquery),
|
||||
is_generated_table_(is_generated_table),
|
||||
force_col_alias_(force_col_alias)
|
||||
{}
|
||||
virtual ~ObSelectStmtPrinter()
|
||||
{}
|
||||
ObSelectStmtPrinter(char *buf,
|
||||
int64_t buf_len,
|
||||
int64_t *pos,
|
||||
const ObSelectStmt *stmt,
|
||||
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, print_params),
|
||||
column_list_(column_list),
|
||||
is_set_subquery_(is_set_subquery),
|
||||
is_generated_table_(is_generated_table),
|
||||
force_col_alias_(force_col_alias) {}
|
||||
|
||||
ObSelectStmtPrinter(char *buf,
|
||||
int64_t buf_len,
|
||||
int64_t *pos,
|
||||
const ObSelectStmt *stmt,
|
||||
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, 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) {}
|
||||
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);
|
||||
void init(char *buf,
|
||||
int64_t buf_len,
|
||||
int64_t *pos,
|
||||
ObSelectStmt *stmt,
|
||||
common::ObIArray<common::ObString> *column_list,
|
||||
bool is_set_subquery);
|
||||
|
||||
virtual int do_print();
|
||||
static int remove_double_quotation_for_string(ObString& alias_string, ObIAllocator& allocator);
|
||||
static int remove_double_quotation_for_string(ObString &alias_string, ObIAllocator &allocator);
|
||||
|
||||
private:
|
||||
int print();
|
||||
@ -66,22 +91,23 @@ private:
|
||||
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_multi_rollup_items(const common::ObIArray<ObMultiRollupItem> &rollup_items);
|
||||
int print_with_check_option();
|
||||
|
||||
///////end of functions
|
||||
// disallow copy
|
||||
DISALLOW_COPY_AND_ASSIGN(ObSelectStmtPrinter);
|
||||
|
||||
private:
|
||||
// data members
|
||||
// create view v(column_list) as...
|
||||
common::ObIArray<common::ObString>* column_list_;
|
||||
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_;
|
||||
};
|
||||
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
|
||||
#endif // OCEANBASE_SQL_OB_SELECT_STMT_PRINTER_H_
|
||||
#endif // OCEANBASE_SQL_OB_SELECT_STMT_PRINTER_H_
|
||||
|
||||
Reference in New Issue
Block a user