[CP] 修正mock table options 带来的多个并且mock选项的不合法问题

This commit is contained in:
qingzhu521
2024-06-18 03:40:56 +00:00
committed by ob-robot
parent 4babd9b846
commit 2416eb407b

View File

@ -6872,7 +6872,11 @@ table_option
} }
| table_option table_option_list_space_seperated | table_option table_option_list_space_seperated
{ {
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $2); if ($1 != NULL) {
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $2);
} else {
$$ = $2;
}
} }
; ;
@ -6883,7 +6887,11 @@ table_option_list_space_seperated
} }
| table_option ',' table_option_list | table_option ',' table_option_list
{ {
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $3); if ($1 != NULL) {
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $3);
} else {
$$ = $3;
}
} }
; ;
@ -16777,7 +16785,11 @@ alter_table_action
} }
| alter_table_actions ',' alter_table_action | alter_table_actions ',' alter_table_action
{ {
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $3); if ($3 != NULL) {
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $3);
} else {
$$ = $1;
}
} }
; ;