Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a2982d7c
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a2982d7c
编写于
2月 15, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'enh/mainnn' into fix/main
上级
3fc8f6b7
29df9d60
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
24 deletion
+40
-24
source/dnode/mgmt/node_util/inc/dmUtil.h
source/dnode/mgmt/node_util/inc/dmUtil.h
+6
-14
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+9
-0
tests/system-test/2-query/interp.py
tests/system-test/2-query/interp.py
+3
-2
tools/shell/inc/shellAuto.h
tools/shell/inc/shellAuto.h
+1
-1
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+15
-5
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+6
-2
未找到文件。
source/dnode/mgmt/node_util/inc/dmUtil.h
浏览文件 @
a2982d7c
...
@@ -53,20 +53,12 @@ extern "C" {
...
@@ -53,20 +53,12 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
//#define dGFatal(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", gtid:%s", __VA_ARGS__, buf);}
#define dGFatal(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", gtid:%s", __VA_ARGS__, buf);}
//#define dGError(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", gtid:%s", __VA_ARGS__, buf);}
#define dGError(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", gtid:%s", __VA_ARGS__, buf);}
//#define dGWarn(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn (param ", gtid:%s", __VA_ARGS__, buf);}
#define dGWarn(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn (param ", gtid:%s", __VA_ARGS__, buf);}
//#define dGInfo(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo (param ", gtid:%s", __VA_ARGS__, buf);}
#define dGInfo(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo (param ", gtid:%s", __VA_ARGS__, buf);}
//#define dGDebug(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", gtid:%s", __VA_ARGS__, buf);}
#define dGDebug(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", gtid:%s", __VA_ARGS__, buf);}
//#define dGTrace(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", gtid:%s", __VA_ARGS__, buf);}
#define dGTrace(param, ...) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", gtid:%s", __VA_ARGS__, buf);}
// TODO: disable it temporarily
#define dGFatal(param, ...)
#define dGError(param, ...)
#define dGWarn(param, ...)
#define dGInfo(param, ...)
#define dGDebug(param, ...)
#define dGTrace(param, ...)
// clang-format on
// clang-format on
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
a2982d7c
...
@@ -1467,6 +1467,15 @@ static int32_t translateInterpFunc(STranslateContext* pCxt, SFunctionNode* pFunc
...
@@ -1467,6 +1467,15 @@ static int32_t translateInterpFunc(STranslateContext* pCxt, SFunctionNode* pFunc
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
}
SSelectStmt
*
pSelect
=
(
SSelectStmt
*
)
pCxt
->
pCurrStmt
;
SSelectStmt
*
pSelect
=
(
SSelectStmt
*
)
pCxt
->
pCurrStmt
;
SNode
*
pTable
=
pSelect
->
pFromTable
;
if
((
NULL
!=
pTable
&&
(
QUERY_NODE_REAL_TABLE
!=
nodeType
(
pTable
)
||
(
TSDB_CHILD_TABLE
!=
((
SRealTableNode
*
)
pTable
)
->
pMeta
->
tableType
&&
TSDB_NORMAL_TABLE
!=
((
SRealTableNode
*
)
pTable
)
->
pMeta
->
tableType
))))
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE
,
"%s is only supported in single table query"
,
pFunc
->
functionName
);
}
if
(
pSelect
->
hasAggFuncs
||
pSelect
->
hasMultiRowsFunc
||
pSelect
->
hasIndefiniteRowsFunc
)
{
if
(
pSelect
->
hasAggFuncs
||
pSelect
->
hasMultiRowsFunc
||
pSelect
->
hasIndefiniteRowsFunc
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_NOT_ALLOWED_FUNC
);
}
}
...
...
tests/system-test/2-query/interp.py
浏览文件 @
a2982d7c
...
@@ -1850,15 +1850,16 @@ class TDTestCase:
...
@@ -1850,15 +1850,16 @@ class TDTestCase:
tdSql
.
error
(
f
"select interp('abcd') from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)"
)
tdSql
.
error
(
f
"select interp('abcd') from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)"
)
tdSql
.
error
(
f
"select interp('中文字符') from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)"
)
tdSql
.
error
(
f
"select interp('中文字符') from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)"
)
tdLog
.
printNoPrefix
(
"==========step13:stable cases"
)
tdLog
.
printNoPrefix
(
"==========step13:stable cases"
)
#tdSql.query
(f"select interp(c0) from {dbname}.{stbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)")
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
stbname
}
range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)"
)
#tdSql.checkRows(13)
#tdSql.checkRows(13)
#tdSql.query(f"select interp(c0) from {dbname}.{ctbname1} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)")
#tdSql.query(f"select interp(c0) from {dbname}.{ctbname1} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)")
#tdSql.checkRows(13)
#tdSql.checkRows(13)
#tdSql.query
(f"select interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1s) fill(null)")
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
stbname
}
partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1s) fill(null)"
)
#tdSql.checkRows(13)
#tdSql.checkRows(13)
#tdSql.query(f"select _irowts,interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1h) fill(prev)")
#tdSql.query(f"select _irowts,interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:04', '2020-02-02 00:00:16') every(1h) fill(prev)")
...
...
tools/shell/inc/shellAuto.h
浏览文件 @
a2982d7c
...
@@ -28,7 +28,7 @@ void pressOtherKey(char c);
...
@@ -28,7 +28,7 @@ void pressOtherKey(char c);
bool
shellAutoInit
();
bool
shellAutoInit
();
// set conn
// set conn
void
shellSetConn
(
TAOS
*
conn
);
void
shellSetConn
(
TAOS
*
conn
,
bool
runOnce
);
// exit shell auto funciton, shell exit call once
// exit shell auto funciton, shell exit call once
void
shellAutoExit
();
void
shellAutoExit
();
...
...
tools/shell/src/shellAuto.c
浏览文件 @
a2982d7c
...
@@ -332,6 +332,7 @@ bool varMode = false; // enter var names list mode
...
@@ -332,6 +332,7 @@ bool varMode = false; // enter var names list mode
TAOS
*
varCon
=
NULL
;
TAOS
*
varCon
=
NULL
;
SShellCmd
*
varCmd
=
NULL
;
SShellCmd
*
varCmd
=
NULL
;
bool
varRunOnce
=
false
;
SMatch
*
lastMatch
=
NULL
;
// save last match result
SMatch
*
lastMatch
=
NULL
;
// save last match result
int
cntDel
=
0
;
// delete byte count after next press tab
int
cntDel
=
0
;
// delete byte count after next press tab
...
@@ -375,7 +376,7 @@ void showHelp() {
...
@@ -375,7 +376,7 @@ void showHelp() {
----- C -----
\n
\
----- C -----
\n
\
create table <tb_name> using <stb_name> tags ...
\n
\
create table <tb_name> using <stb_name> tags ...
\n
\
create database <db_name> <db_options> ...
\n
\
create database <db_name> <db_options> ...
\n
\
create dnode
\"
fqdn:port
\"
n\
create dnode
\"
fqdn:port
\"
...
\
n
\
create index ...
\n
\
create index ...
\n
\
create mnode on dnode <dnode_id> ;
\n
\
create mnode on dnode <dnode_id> ;
\n
\
create qnode on dnode <dnode_id> ;
\n
\
create qnode on dnode <dnode_id> ;
\n
\
...
@@ -637,10 +638,11 @@ bool shellAutoInit() {
...
@@ -637,10 +638,11 @@ bool shellAutoInit() {
}
}
// set conn
// set conn
void
shellSetConn
(
TAOS
*
conn
)
{
void
shellSetConn
(
TAOS
*
conn
,
bool
runOnce
)
{
varCon
=
conn
;
varCon
=
conn
;
varRunOnce
=
runOnce
;
// init database and stable
// init database and stable
updateTireValue
(
WT_VAR_DBNAME
,
false
);
if
(
!
runOnce
)
updateTireValue
(
WT_VAR_DBNAME
,
false
);
}
}
// exit shell auto funciton, shell exit call once
// exit shell auto funciton, shell exit call once
...
@@ -784,6 +786,12 @@ int writeVarNames(int type, TAOS_RES* tres) {
...
@@ -784,6 +786,12 @@ int writeVarNames(int type, TAOS_RES* tres) {
return
numOfRows
;
return
numOfRows
;
}
}
void
setThreadNull
(
int
type
)
{
taosThreadMutexLock
(
&
tiresMutex
);
threads
[
type
]
=
NULL
;
taosThreadMutexUnlock
(
&
tiresMutex
);
}
bool
firstMatchCommand
(
TAOS
*
con
,
SShellCmd
*
cmd
);
bool
firstMatchCommand
(
TAOS
*
con
,
SShellCmd
*
cmd
);
//
//
// thread obtain var thread from db server
// thread obtain var thread from db server
...
@@ -799,6 +807,7 @@ void* varObtainThread(void* param) {
...
@@ -799,6 +807,7 @@ void* varObtainThread(void* param) {
TAOS_RES
*
pSql
=
taos_query
(
varCon
,
varSqls
[
type
]);
TAOS_RES
*
pSql
=
taos_query
(
varCon
,
varSqls
[
type
]);
if
(
taos_errno
(
pSql
))
{
if
(
taos_errno
(
pSql
))
{
taos_free_result
(
pSql
);
taos_free_result
(
pSql
);
setThreadNull
(
type
);
return
NULL
;
return
NULL
;
}
}
...
@@ -814,6 +823,7 @@ void* varObtainThread(void* param) {
...
@@ -814,6 +823,7 @@ void* varObtainThread(void* param) {
firstMatchCommand
(
varCon
,
varCmd
);
firstMatchCommand
(
varCon
,
varCmd
);
}
}
setThreadNull
(
type
);
return
NULL
;
return
NULL
;
}
}
...
@@ -1977,7 +1987,7 @@ void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb) {
...
@@ -1977,7 +1987,7 @@ void callbackAutoTab(char* sqlstr, TAOS* pSql, bool usedb) {
if
(
dealUseDB
(
sql
))
{
if
(
dealUseDB
(
sql
))
{
// change to new db
// change to new db
updateTireValue
(
WT_VAR_STABLE
,
false
);
if
(
!
varRunOnce
)
updateTireValue
(
WT_VAR_STABLE
,
false
);
return
;
return
;
}
}
...
...
tools/shell/src/shellEngine.c
浏览文件 @
a2982d7c
...
@@ -1097,10 +1097,11 @@ int32_t shellExecute() {
...
@@ -1097,10 +1097,11 @@ int32_t shellExecute() {
}
}
#endif
#endif
shellSetConn
(
shell
.
conn
);
bool
runOnce
=
pArgs
->
commands
!=
NULL
||
pArgs
->
file
[
0
]
!=
0
;
shellSetConn
(
shell
.
conn
,
runOnce
);
shellReadHistory
();
shellReadHistory
();
if
(
pArgs
->
commands
!=
NULL
||
pArgs
->
file
[
0
]
!=
0
)
{
if
(
runOnce
)
{
if
(
pArgs
->
commands
!=
NULL
)
{
if
(
pArgs
->
commands
!=
NULL
)
{
printf
(
"%s%s
\r\n
"
,
shell
.
info
.
promptHeader
,
pArgs
->
commands
);
printf
(
"%s%s
\r\n
"
,
shell
.
info
.
promptHeader
,
pArgs
->
commands
);
char
*
cmd
=
strdup
(
pArgs
->
commands
);
char
*
cmd
=
strdup
(
pArgs
->
commands
);
...
@@ -1160,5 +1161,8 @@ int32_t shellExecute() {
...
@@ -1160,5 +1161,8 @@ int32_t shellExecute() {
taosThreadJoin
(
spid
,
NULL
);
taosThreadJoin
(
spid
,
NULL
);
shellCleanupHistory
();
shellCleanupHistory
();
taos_kill_query
(
shell
.
conn
);
taos_close
(
shell
.
conn
);
return
0
;
return
0
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录