Merge pull request #11468 from taosdata/feature/TD-14243

feat(query): support now()/now() + duration syntax in insert clause
This commit is contained in:
Ganlin Zhao 2022-04-13 21:15:49 +08:00 committed by GitHub
commit 32b7c445c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;