Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
883d02bb
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
883d02bb
编写于
7月 13, 2021
作者:
H
Haojun Liao
提交者:
GitHub
7月 13, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6834 from taosdata/feature/query
Feature/query
上级
188f7a54
99016d14
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
851 addition
and
859 deletion
+851
-859
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+12
-6
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-2
src/query/inc/sql.y
src/query/inc/sql.y
+4
-2
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+58
-70
src/query/src/qUtil.c
src/query/src/qUtil.c
+2
-4
src/query/src/sql.c
src/query/src/sql.c
+714
-720
tests/script/general/db/alter_option.sim
tests/script/general/db/alter_option.sim
+12
-16
tests/script/general/db/topic1.sim
tests/script/general/db/topic1.sim
+11
-38
tests/script/general/parser/create_db.sim
tests/script/general/parser/create_db.sim
+36
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
883d02bb
...
...
@@ -7816,13 +7816,19 @@ static STableMeta* extractTempTableMetaFromSubquery(SQueryInfo* pUpstream) {
int32_t
n
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfColumns
;
++
i
)
{
SInternalField
*
pField
=
tscFieldInfoGetInternalField
(
&
pUpstream
->
fieldsInfo
,
i
);
if
(
pField
->
visible
)
{
meta
->
schema
[
n
].
bytes
=
pField
->
field
.
bytes
;
meta
->
schema
[
n
].
type
=
pField
->
field
.
type
;
meta
->
schema
[
n
].
colId
=
pField
->
pExpr
->
base
.
resColId
;
tstrncpy
(
meta
->
schema
[
n
].
name
,
pField
->
pExpr
->
base
.
aliasName
,
TSDB_COL_NAME_LEN
);
n
+=
1
;
if
(
!
pField
->
visible
)
{
continue
;
}
meta
->
schema
[
n
].
bytes
=
pField
->
field
.
bytes
;
meta
->
schema
[
n
].
type
=
pField
->
field
.
type
;
SExprInfo
*
pExpr
=
pField
->
pExpr
;
meta
->
schema
[
n
].
colId
=
pExpr
->
base
.
resColId
;
tstrncpy
(
meta
->
schema
[
n
].
name
,
pField
->
pExpr
->
base
.
aliasName
,
TSDB_COL_NAME_LEN
);
info
->
rowSize
+=
meta
->
schema
[
n
].
bytes
;
n
+=
1
;
}
return
meta
;
...
...
src/query/inc/qExecutor.h
浏览文件 @
883d02bb
...
...
@@ -105,7 +105,7 @@ typedef struct SResultRowInfo {
int16_t
type
:
8
;
// data type for hash key
int32_t
size
:
24
;
// number of result set
int32_t
capacity
;
// max capacity
SResultRow
*
current
;
// current active result row
int32_t
curPos
;
// current active result row index of pResult list
}
SResultRowInfo
;
typedef
struct
SColumnFilterElem
{
...
...
@@ -423,7 +423,7 @@ typedef struct STagScanInfo {
SColumnInfo
*
pCols
;
SSDataBlock
*
pRes
;
int32_t
totalTables
;
int32_t
cur
rentIndex
;
int32_t
cur
Pos
;
}
STagScanInfo
;
typedef
struct
SOptrBasicInfo
{
...
...
src/query/inc/sql.y
浏览文件 @
883d02bb
...
...
@@ -303,11 +303,13 @@ alter_db_optr(Y) ::= alter_db_optr(Z) quorum(X). { Y = Z; Y.quorum = strtol
alter_db_optr(Y) ::= alter_db_optr(Z) keep(X). { Y = Z; Y.keep = X; }
alter_db_optr(Y) ::= alter_db_optr(Z) blocks(X). { Y = Z; Y.numOfBlocks = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) wal(X). { Y = Z; Y.walLevel = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) update(X). { Y = Z; Y.update = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) cachelast(X). { Y = Z; Y.cachelast = strtol(X.z, NULL, 10); }
// dynamically update the following two parameters are not allowed.
//alter_db_optr(Y) ::= alter_db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z, NULL, 10); }
//alter_db_optr(Y) ::= alter_db_optr(Z) wal(X). { Y = Z; Y.walLevel = strtol(X.z, NULL, 10); } not support yet
%type alter_topic_optr {SCreateDbInfo}
alter_topic_optr(Y) ::= alter_db_optr(Z). { Y = Z; Y.dbType = TSDB_DB_TYPE_TOPIC; }
...
...
src/query/src/qExecutor.c
浏览文件 @
883d02bb
此差异已折叠。
点击以展开。
src/query/src/qUtil.c
浏览文件 @
883d02bb
...
...
@@ -44,8 +44,7 @@ int32_t getOutputInterResultBufSize(SQueryAttr* pQueryAttr) {
int32_t
initResultRowInfo
(
SResultRowInfo
*
pResultRowInfo
,
int32_t
size
,
int16_t
type
)
{
pResultRowInfo
->
type
=
type
;
pResultRowInfo
->
size
=
0
;
// pResultRowInfo->prevSKey = TSKEY_INITIAL_VAL;
pResultRowInfo
->
current
=
NULL
;
pResultRowInfo
->
curPos
=
-
1
;
pResultRowInfo
->
capacity
=
size
;
pResultRowInfo
->
pResult
=
calloc
(
pResultRowInfo
->
capacity
,
POINTER_BYTES
);
...
...
@@ -92,8 +91,7 @@ void resetResultRowInfo(SQueryRuntimeEnv *pRuntimeEnv, SResultRowInfo *pResultRo
}
pResultRowInfo
->
size
=
0
;
pResultRowInfo
->
current
=
NULL
;
// pResultRowInfo->prevSKey = TSKEY_INITIAL_VAL;
pResultRowInfo
->
curPos
=
-
1
;
}
int32_t
numOfClosedResultRows
(
SResultRowInfo
*
pResultRowInfo
)
{
...
...
src/query/src/sql.c
浏览文件 @
883d02bb
此差异已折叠。
点击以展开。
tests/script/general/db/alter_option.sim
浏览文件 @
883d02bb
...
...
@@ -198,29 +198,25 @@ if $data12_db != 1 then
return -1
endi
sql alter database db wal 1
sql show databases
print wal $data12_db
if $data12_db != 1 then
return -1
endi
sql_error alter database db wal 1
sql alter database db wal 1
sql alter database db wal 2
sql alter database db wal 1
sql alter database db wal 2
sql alter database db wal 0
sql
_error
alter database db wal 1
sql
_error
alter database db wal 2
sql
_error
alter database db wal 1
sql
_error
alter database db wal 2
sql
_error
alter database db wal 0
sql_error alter database db wal 3
sql_error alter database db wal 4
sql_error alter database db wal -1
sql_error alter database db wal 1000
print ============== step fsync
sql alter database db fsync 0
sql alter database db fsync 1
sql alter database db fsync 3600
sql alter database db fsync 18000
sql alter database db fsync 180000
sql
_error
alter database db fsync 0
sql
_error
alter database db fsync 1
sql
_error
alter database db fsync 3600
sql
_error
alter database db fsync 18000
sql
_error
alter database db fsync 180000
sql_error alter database db fsync 180001
sql_error alter database db fsync -1
...
...
tests/script/general/db/topic1.sim
浏览文件 @
883d02bb
...
...
@@ -495,18 +495,13 @@ if $data12_db != 1 then
endi
sql_error alter topic db wal 1
sql alter database db wal 1
sql show databases
print wal $data12_db
if $data12_db != 1 then
return -1
endi
sql_error alter database db wal 1
sql alter database db wal 1
sql alter database db wal 2
sql alter database db wal 1
sql alter database db wal 2
sql alter database db wal 0
sql
_error
alter database db wal 1
sql
_error
alter database db wal 2
sql
_error
alter database db wal 1
sql
_error
alter database db wal 2
sql
_error
alter database db wal 0
sql_error alter database db wal 3
sql_error alter database db wal 4
sql_error alter database db wal -1
...
...
@@ -523,11 +518,11 @@ sql_error alter topic db wal -1
sql_error alter topic db wal 1000
print ============== step fsync
sql alter database db fsync 0
sql alter database db fsync 1
sql alter database db fsync 3600
sql alter database db fsync 18000
sql alter database db fsync 180000
sql
_error
alter database db fsync 0
sql
_error
alter database db fsync 1
sql
_error
alter database db fsync 3600
sql
_error
alter database db fsync 18000
sql
_error
alter database db fsync 180000
sql_error alter database db fsync 180001
sql_error alter database db fsync -1
...
...
@@ -615,17 +610,6 @@ if $rows != 1 then
return -1
endi
sql alter database d1 fsync 0
sql show topics;
if $rows != 0 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql drop database d1
sql show topics;
if $rows != 0 then
...
...
@@ -649,17 +633,6 @@ if $rows != 1 then
return -1
endi
sql alter database d1 fsync 0
sql show topics;
if $rows != 1 then
return -1
endi
sql show databases;
if $rows != 1 then
return -1
endi
sql drop database d1
sql show topics;
if $rows != 0 then
...
...
tests/script/general/parser/create_db.sim
浏览文件 @
883d02bb
...
...
@@ -237,7 +237,42 @@ sql_error create database $db ctime 29
sql_error create database $db ctime 40961
# wal {0, 2}
#sql_error create database $db wal 0
sql create database testwal wal 0
sql show databases
if $rows != 1 then
return -1
endi
sql show databases
print wallevel $data12_testwal
if $data12_testwal != 0 then
return -1
endi
sql drop database testwal
sql create database testwal wal 1
sql show databases
if $rows != 1 then
return -1
endi
sql show databases
print wallevel $data12_testwal
if $data12_testwal != 1 then
return -1
endi
sql drop database testwal
sql create database testwal wal 2
sql show databases
if $rows != 1 then
return -1
endi
print wallevel $data12_testwal
if $data12_testwal != 2 then
return -1
endi
sql drop database testwal
sql_error create database $db wal -1
sql_error create database $db wal 3
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录