partition by (c1,c2) return compile error, current is 4016

This commit is contained in:
obdev
2024-03-05 03:48:19 +00:00
committed by ob-robot
parent 5cb186e4a7
commit 0ef3eace68
3 changed files with 14 additions and 6 deletions

View File

@ -73,6 +73,7 @@ int ObSQLParser::parse_and_gen_sqlid(void *malloc_pool,
parse_result->is_dynamic_sql_ = false;
parse_result->is_batched_multi_enabled_split_ = false;
parse_result->may_bool_value_ = false;
parse_result->is_external_table_ = false;
int64_t new_length = str_len + 1;
char *buf = (char *)parse_malloc(new_length, parse_result->malloc_pool_);

View File

@ -317,6 +317,7 @@ typedef struct
uint32_t is_for_remap_ : 1;
uint32_t contain_sensitive_data_ : 1;
uint32_t may_contain_sensitive_data_ : 1;
uint32_t is_external_table_ : 1;
};
ParseNode *result_tree_;

View File

@ -4624,6 +4624,7 @@ TEMPORARY
| EXTERNAL
{
result->contain_sensitive_data_ = true;
result->is_external_table_ = true;
malloc_terminal_node($$, result->malloc_pool_, T_EXTERNAL);
}
| /* EMPTY */
@ -6953,12 +6954,17 @@ hash_partition_option
external_table_partition_option: /* list partition without partition defines*/
PARTITION BY '(' column_name_list ')'
{
if (result->is_external_table_) {
ParseNode *column_names = NULL;
ParseNode *partition_defs = NULL;
merge_nodes(column_names, result, T_EXPR_LIST, $4);
malloc_terminal_node(partition_defs, result->malloc_pool_, T_PARTITION_LIST);
malloc_non_terminal_node($$, result->malloc_pool_, T_LIST_COLUMNS_PARTITION, 5, column_names, partition_defs, NULL, NULL, NULL);
dup_expr_string($$, result, @4.first_column, @4.last_column);
} else {
yyerror(NULL, result, "paritition by column is not allowed");
YYERROR;
}
}
;