feat(query): support now()/now() + duration syntax in insert clause

TD-14243
This commit is contained in:
Ganlin Zhao 2022-04-13 12:38:57 +08:00 committed by Ganlin Zhao
parent eabfc7d31c
commit 729218f3e8
1 changed files with 5 additions and 0 deletions

View File

@ -325,6 +325,11 @@ static int parseTime(char **end, SToken *pToken, int16_t timePrec, int64_t *time
for (int k = pToken->n; pToken->z[k] != '\0'; k++) {
if (pToken->z[k] == ' ' || pToken->z[k] == '\t') continue;
if (pToken->z[k] == '(' && pToken->z[k + 1] == ')') { //for insert NOW()/TODAY()
*end = pTokenEnd = &pToken->z[k + 2];
k++;
continue;
}
if (pToken->z[k] == ',') {
*end = pTokenEnd;
*time = ts;