Merge DAY() system function into opensource branch.

This commit is contained in:
xy0
2021-11-29 15:27:44 +08:00
committed by LINxiansheng
parent 7b9fe43335
commit fc8e532b0b
8 changed files with 25292 additions and 25180 deletions

View File

@ -440,6 +440,7 @@ typedef enum ObItemType {
T_FUN_SYS_INETATON = 728,
T_FUN_SYS_WEIGHT_STRING = 729,
T_FUN_SYS_CRC32 = 730,
T_FUN_SYS_DAY = 731,
///< @note add new mysql only function type before this line
T_MYSQL_ONLY_SYS_MAX_OP = 800,

View File

@ -2200,6 +2200,13 @@ MOD '(' expr ',' expr ')'
make_name_node($$, result->malloc_pool_, "date");
malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS, 2, $$, params);
}
| DAY '(' expr ')'
{
ParseNode *params = NULL;
malloc_non_terminal_node(params, result->malloc_pool_, T_EXPR_LIST, 1, $3);
make_name_node($$, result->malloc_pool_, "day");
malloc_non_terminal_node($$, result->malloc_pool_, T_FUN_SYS, 2, $$, params);
}
| YEAR '(' expr ')'
{
ParseNode *params = NULL;

File diff suppressed because it is too large Load Diff

View File

@ -383,6 +383,7 @@ const char* get_type_name(int type)
case T_FUN_SYS_INETATON : return "T_FUN_SYS_INETATON";
case T_FUN_SYS_WEIGHT_STRING : return "T_FUN_SYS_WEIGHT_STRING";
case T_FUN_SYS_CRC32 : return "T_FUN_SYS_CRC32";
case T_FUN_SYS_DAY : return "T_FUN_SYS_DAY";
case T_MYSQL_ONLY_SYS_MAX_OP : return "T_MYSQL_ONLY_SYS_MAX_OP";
case T_FUN_SYS_CONNECT_BY_PATH : return "T_FUN_SYS_CONNECT_BY_PATH";
case T_FUN_SYS_SYSTIMESTAMP : return "T_FUN_SYS_SYSTIMESTAMP";