Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
2b527c33
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b527c33
编写于
4月 09, 2021
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into xiaoping/add_test_case
上级
0e72f1cb
be4671d5
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
354 addition
and
270 deletion
+354
-270
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+8
-4
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+316
-242
src/query/src/qFilterfunc.c
src/query/src/qFilterfunc.c
+2
-2
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+0
-6
tests/examples/c/asyncdemo.c
tests/examples/c/asyncdemo.c
+28
-16
未找到文件。
src/client/src/tscParseInsert.c
浏览文件 @
2b527c33
...
...
@@ -937,6 +937,10 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
return
ret
;
}
if
(
sql
==
NULL
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
code
=
tscGetTableMetaEx
(
pSql
,
pTableMetaInfo
,
true
);
if
(
TSDB_CODE_TSC_ACTION_IN_PROGRESS
==
code
)
{
return
code
;
...
...
@@ -945,6 +949,10 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
}
else
{
sql
=
sToken
.
z
;
if
(
sql
==
NULL
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
code
=
tscGetTableMetaEx
(
pSql
,
pTableMetaInfo
,
false
);
if
(
pCmd
->
curSql
==
NULL
)
{
assert
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
);
...
...
@@ -953,10 +961,6 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql, char** boundC
*
sqlstr
=
sql
;
if
(
*
sqlstr
==
NULL
)
{
code
=
TSDB_CODE_TSC_INVALID_SQL
;
}
return
code
;
}
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
2b527c33
此差异已折叠。
点击以展开。
src/query/src/qFilterfunc.c
浏览文件 @
2b527c33
...
...
@@ -124,7 +124,7 @@ bool greaterEqualOperator(SColumnFilterElem *pFilter, const char *minval, const
bool
equalOperator
(
SColumnFilterElem
*
pFilter
,
const
char
*
minval
,
const
char
*
maxval
,
int16_t
type
)
{
SColumnFilterInfo
*
pFilterInfo
=
&
pFilter
->
filterInfo
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
||
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
int64_t
minv
=
-
1
,
maxv
=
-
1
;
GET_TYPED_DATA
(
minv
,
int64_t
,
type
,
minval
);
GET_TYPED_DATA
(
maxv
,
int64_t
,
type
,
maxval
);
...
...
@@ -202,7 +202,7 @@ bool likeOperator(SColumnFilterElem *pFilter, const char *minval, const char *ma
bool
notEqualOperator
(
SColumnFilterElem
*
pFilter
,
const
char
*
minval
,
const
char
*
maxval
,
int16_t
type
)
{
SColumnFilterInfo
*
pFilterInfo
=
&
pFilter
->
filterInfo
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
||
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
int64_t
minv
=
-
1
,
maxv
=
-
1
;
GET_TYPED_DATA
(
minv
,
int64_t
,
type
,
minval
);
GET_TYPED_DATA
(
maxv
,
int64_t
,
type
,
maxval
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
2b527c33
...
...
@@ -2861,12 +2861,6 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta
if
(
pHandle
->
statis
[
i
].
numOfNull
==
-
1
)
{
// set the column data are all NULL
pHandle
->
statis
[
i
].
numOfNull
=
pBlockInfo
->
compBlock
->
numOfRows
;
}
SColumnInfo
*
pColInfo
=
taosArrayGet
(
pHandle
->
pColumns
,
i
);
if
(
pColInfo
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
pHandle
->
statis
[
i
].
min
=
pBlockInfo
->
compBlock
->
keyFirst
;
pHandle
->
statis
[
i
].
max
=
pBlockInfo
->
compBlock
->
keyLast
;
}
}
int64_t
elapsed
=
taosGetTimestampUs
()
-
stime
;
...
...
tests/examples/c/asyncdemo.c
浏览文件 @
2b527c33
...
...
@@ -28,7 +28,8 @@
int
points
=
5
;
int
numOfTables
=
3
;
int
tablesProcessed
=
0
;
int
tablesInsertProcessed
=
0
;
int
tablesSelectProcessed
=
0
;
int64_t
st
,
et
;
typedef
struct
{
...
...
@@ -134,6 +135,9 @@ int main(int argc, char *argv[])
gettimeofday
(
&
systemTime
,
NULL
);
st
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
tablesInsertProcessed
=
0
;
tablesSelectProcessed
=
0
;
for
(
i
=
0
;
i
<
numOfTables
;
++
i
)
{
// insert records in asynchronous API
sprintf
(
sql
,
"insert into %s values(%ld, 0)"
,
tableList
[
i
].
name
,
1546300800000
+
i
);
...
...
@@ -143,10 +147,20 @@ int main(int argc, char *argv[])
printf
(
"once insert finished, presse any key to query
\n
"
);
getchar
();
while
(
1
)
{
if
(
tablesInsertProcessed
<
numOfTables
)
{
printf
(
"wait for process finished
\n
"
);
sleep
(
1
);
continue
;
}
break
;
}
printf
(
"start to query...
\n
"
);
gettimeofday
(
&
systemTime
,
NULL
);
st
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
tablesProcessed
=
0
;
for
(
i
=
0
;
i
<
numOfTables
;
++
i
)
{
// select records in asynchronous API
...
...
@@ -157,14 +171,8 @@ int main(int argc, char *argv[])
printf
(
"
\n
once finished, press any key to exit
\n
"
);
getchar
();
for
(
i
=
0
;
i
<
numOfTables
;
++
i
)
{
printf
(
"%s inserted:%d retrieved:%d
\n
"
,
tableList
[
i
].
name
,
tableList
[
i
].
rowsInserted
,
tableList
[
i
].
rowsRetrieved
);
}
getchar
();
while
(
1
)
{
if
(
tablesProcessed
<
numOfTables
)
{
if
(
tables
Select
Processed
<
numOfTables
)
{
printf
(
"wait for process finished
\n
"
);
sleep
(
1
);
continue
;
...
...
@@ -173,6 +181,10 @@ int main(int argc, char *argv[])
break
;
}
for
(
i
=
0
;
i
<
numOfTables
;
++
i
)
{
printf
(
"%s inserted:%d retrieved:%d
\n
"
,
tableList
[
i
].
name
,
tableList
[
i
].
rowsInserted
,
tableList
[
i
].
rowsRetrieved
);
}
taos_close
(
taos
);
free
(
tableList
);
...
...
@@ -214,8 +226,8 @@ void taos_insert_call_back(void *param, TAOS_RES *tres, int code)
}
else
{
printf
(
"%d rows data are inserted into %s
\n
"
,
points
,
pTable
->
name
);
tablesProcessed
++
;
if
(
tablesProcessed
>=
numOfTables
)
{
tables
Insert
Processed
++
;
if
(
tables
Insert
Processed
>=
numOfTables
)
{
gettimeofday
(
&
systemTime
,
NULL
);
et
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
printf
(
"%lld mseconds to insert %d data points
\n
"
,
(
et
-
st
)
/
1000
,
points
*
numOfTables
);
...
...
@@ -251,15 +263,17 @@ void taos_retrieve_call_back(void *param, TAOS_RES *tres, int numOfRows)
//taos_free_result(tres);
printf
(
"%d rows data retrieved from %s
\n
"
,
pTable
->
rowsRetrieved
,
pTable
->
name
);
tablesProcessed
++
;
if
(
tablesProcessed
>=
numOfTables
)
{
tables
Select
Processed
++
;
if
(
tables
Select
Processed
>=
numOfTables
)
{
gettimeofday
(
&
systemTime
,
NULL
);
et
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
printf
(
"%lld mseconds to query %d data rows
\n
"
,
(
et
-
st
)
/
1000
,
points
*
numOfTables
);
}
}
taos_free_result
(
tres
);
}
}
void
taos_select_call_back
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
...
...
@@ -276,6 +290,4 @@ void taos_select_call_back(void *param, TAOS_RES *tres, int code)
taos_cleanup
();
exit
(
1
);
}
taos_free_result
(
tres
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录