未验证 提交 883d02bb 编写于 作者: H Haojun Liao 提交者: GitHub

Merge pull request #6834 from taosdata/feature/query

Feature/query
......@@ -7816,14 +7816,20 @@ 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) {
if (!pField->visible) {
continue;
}
meta->schema[n].bytes = pField->field.bytes;
meta->schema[n].type = pField->field.type;
meta->schema[n].colId = pField->pExpr->base.resColId;
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;
}
......
......@@ -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 currentIndex;
int32_t curPos;
} STagScanInfo;
typedef struct SOptrBasicInfo {
......
......@@ -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; }
......
此差异已折叠。
......@@ -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) {
......
此差异已折叠。
......@@ -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
......
......@@ -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
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册