From 16802aa3db8085fc29844de8ea5e8cd3a1c3422f Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Fri, 18 Dec 2020 02:59:44 +0000 Subject: [PATCH] [TD-2481]: cannot create stream --- src/query/inc/sql.y | 4 ++-- src/query/src/sql.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index e275c50e89..32e2721103 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -346,8 +346,8 @@ create_table_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) AS select(S). { A = tSetCreateSQLElems(NULL, NULL, S, TSQL_CREATE_STREAM); setSQLInfo(pInfo, A, NULL, TSDB_SQL_CREATE_TABLE); - U.n += Z.n; - setCreatedTableName(pInfo, &U, &V); + V.n += Z.n; + setCreatedTableName(pInfo, &V, &U); } %type column{TAOS_FIELD} diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 3a8eb23cf8..045036676d 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -2420,8 +2420,8 @@ static void yy_reduce( yylhsminor.yy538 = tSetCreateSQLElems(NULL, NULL, yymsp[0].minor.yy84, TSQL_CREATE_STREAM); setSQLInfo(pInfo, yylhsminor.yy538, NULL, TSDB_SQL_CREATE_TABLE); - yymsp[-4].minor.yy0.n += yymsp[-2].minor.yy0.n; - setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0); + yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n; + setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0); } yymsp[-4].minor.yy538 = yylhsminor.yy538; break; -- GitLab