merge from develop
This commit is contained in:
commit
18755a1453
|
@ -583,7 +583,7 @@ data = c1.fetchall()
|
||||||
numOfRows = c1.rowcount
|
numOfRows = c1.rowcount
|
||||||
numOfCols = len(c1.description)
|
numOfCols = len(c1.description)
|
||||||
for irow in range(numOfRows):
|
for irow in range(numOfRows):
|
||||||
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2])
|
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2]))
|
||||||
|
|
||||||
# use the cursor as an iterator to retrieve all returned results
|
# use the cursor as an iterator to retrieve all returned results
|
||||||
c1.execute('select * from tb')
|
c1.execute('select * from tb')
|
||||||
|
|
|
@ -579,7 +579,7 @@ data = c1.fetchall()
|
||||||
numOfRows = c1.rowcount
|
numOfRows = c1.rowcount
|
||||||
numOfCols = len(c1.description)
|
numOfCols = len(c1.description)
|
||||||
for irow in range(numOfRows):
|
for irow in range(numOfRows):
|
||||||
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2])
|
print("Row%d: ts=%s, temperature=%d, humidity=%f" %(irow, data[irow][0], data[irow][1],data[irow][2]))
|
||||||
|
|
||||||
# 直接使用cursor 循环拉取查询结果
|
# 直接使用cursor 循环拉取查询结果
|
||||||
c1.execute('select * from tb')
|
c1.execute('select * from tb')
|
||||||
|
|
|
@ -78,23 +78,24 @@ osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2)
|
||||||
#echo "osinfo: ${osinfo}"
|
#echo "osinfo: ${osinfo}"
|
||||||
os_type=0
|
os_type=0
|
||||||
if echo $osinfo | grep -qwi "ubuntu" ; then
|
if echo $osinfo | grep -qwi "ubuntu" ; then
|
||||||
echo "this is ubuntu system"
|
echo "This is ubuntu system"
|
||||||
os_type=1
|
os_type=1
|
||||||
elif echo $osinfo | grep -qwi "debian" ; then
|
elif echo $osinfo | grep -qwi "debian" ; then
|
||||||
echo "this is debian system"
|
echo "This is debian system"
|
||||||
os_type=1
|
os_type=1
|
||||||
elif echo $osinfo | grep -qwi "Kylin" ; then
|
elif echo $osinfo | grep -qwi "Kylin" ; then
|
||||||
echo "this is Kylin system"
|
echo "This is Kylin system"
|
||||||
os_type=1
|
os_type=1
|
||||||
elif echo $osinfo | grep -qwi "centos" ; then
|
elif echo $osinfo | grep -qwi "centos" ; then
|
||||||
echo "this is centos system"
|
echo "This is centos system"
|
||||||
os_type=2
|
os_type=2
|
||||||
elif echo $osinfo | grep -qwi "fedora" ; then
|
elif echo $osinfo | grep -qwi "fedora" ; then
|
||||||
echo "this is fedora system"
|
echo "This is fedora system"
|
||||||
os_type=2
|
os_type=2
|
||||||
else
|
else
|
||||||
echo "this is other linux system"
|
echo "${osinfo}: This is an officially unverified linux system, If there are any problems with the installation and operation, "
|
||||||
os_type=0
|
echo "please feel free to contact taosdata.com for support."
|
||||||
|
os_type=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function kill_taosd() {
|
function kill_taosd() {
|
||||||
|
|
|
@ -105,10 +105,10 @@ if [ "$osType" != "Darwin" ]; then
|
||||||
echo "this is fedora system"
|
echo "this is fedora system"
|
||||||
os_type=2
|
os_type=2
|
||||||
else
|
else
|
||||||
echo "this is other linux system"
|
echo "${osinfo}: This is an officially unverified linux system, If there are any problems with the installation and operation, "
|
||||||
os_type=0
|
echo "please feel free to contact taosdata.com for support."
|
||||||
|
os_type=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function kill_taosd() {
|
function kill_taosd() {
|
||||||
|
|
|
@ -613,7 +613,7 @@ int32_t parseIntervalClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
|
||||||
/*
|
/*
|
||||||
* check invalid SQL:
|
* check invalid SQL:
|
||||||
* select count(tbname)/count(tag1)/count(tag2) from super_table_name interval(1d);
|
* select count(tbname)/count(tag1)/count(tag2) from super_table_name interval(1d);
|
||||||
*/
|
*/
|
||||||
for (int32_t i = 0; i < pQueryInfo->fieldsInfo.numOfOutputCols; ++i) {
|
for (int32_t i = 0; i < pQueryInfo->fieldsInfo.numOfOutputCols; ++i) {
|
||||||
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
|
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
|
||||||
if (pExpr->functionId == TSDB_FUNC_COUNT && TSDB_COL_IS_TAG(pExpr->colInfo.flag)) {
|
if (pExpr->functionId == TSDB_FUNC_COUNT && TSDB_COL_IS_TAG(pExpr->colInfo.flag)) {
|
||||||
|
@ -624,7 +624,7 @@ int32_t parseIntervalClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
|
||||||
/*
|
/*
|
||||||
* check invalid SQL:
|
* check invalid SQL:
|
||||||
* select tbname, tags_fields from super_table_name interval(1s)
|
* select tbname, tags_fields from super_table_name interval(1s)
|
||||||
*/
|
*/
|
||||||
if (tscQueryMetricTags(pQueryInfo) && pQueryInfo->nAggTimeInterval > 0) {
|
if (tscQueryMetricTags(pQueryInfo) && pQueryInfo->nAggTimeInterval > 0) {
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg1);
|
return invalidSqlErrMsg(pQueryInfo->msg, msg1);
|
||||||
}
|
}
|
||||||
|
@ -2888,8 +2888,8 @@ static int32_t validateSQLExpr(tSQLExpr* pExpr, SQueryInfo* pQueryInfo, SColumnL
|
||||||
return TSDB_CODE_INVALID_SQL;
|
return TSDB_CODE_INVALID_SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if column is timestamp, bool, binary, nchar, not support arithmetic, so return invalid sql
|
// if column is timestamp, bool, binary, nchar, not support arithmetic, so return invalid sql
|
||||||
SMeterMeta* pMeterMeta = tscGetMeterMetaInfoFromQueryInfo(pQueryInfo, index.tableIndex)->pMeterMeta;
|
SMeterMeta* pMeterMeta = tscGetMeterMetaInfoFromQueryInfo(pQueryInfo, index.tableIndex)->pMeterMeta;
|
||||||
SSchema* pSchema = tsGetSchema(pMeterMeta) + index.columnIndex;
|
SSchema* pSchema = tsGetSchema(pMeterMeta) + index.columnIndex;
|
||||||
if ((pSchema->type == TSDB_DATA_TYPE_TIMESTAMP) || (pSchema->type == TSDB_DATA_TYPE_BOOL)
|
if ((pSchema->type == TSDB_DATA_TYPE_TIMESTAMP) || (pSchema->type == TSDB_DATA_TYPE_BOOL)
|
||||||
|| (pSchema->type == TSDB_DATA_TYPE_BINARY) || (pSchema->type == TSDB_DATA_TYPE_NCHAR)){
|
|| (pSchema->type == TSDB_DATA_TYPE_BINARY) || (pSchema->type == TSDB_DATA_TYPE_NCHAR)){
|
||||||
|
|
|
@ -797,7 +797,10 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI
|
||||||
if (metric != NULL && metric[0] != '\0') { // dump metric definition
|
if (metric != NULL && metric[0] != '\0') { // dump metric definition
|
||||||
count = taosGetTableDes(metric, tableDes);
|
count = taosGetTableDes(metric, tableDes);
|
||||||
|
|
||||||
if (count < 0) return -1;
|
if (count < 0) {
|
||||||
|
free(tableDes);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
||||||
|
|
||||||
|
@ -805,18 +808,26 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI
|
||||||
|
|
||||||
count = taosGetTableDes(table, tableDes);
|
count = taosGetTableDes(table, tableDes);
|
||||||
|
|
||||||
if (count < 0) return -1;
|
if (count < 0) {
|
||||||
|
free(tableDes);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taosDumpCreateMTableClause(tableDes, metric, count, arguments, fp);
|
taosDumpCreateMTableClause(tableDes, metric, count, arguments, fp);
|
||||||
|
|
||||||
} else { // dump table definition
|
} else { // dump table definition
|
||||||
count = taosGetTableDes(table, tableDes);
|
count = taosGetTableDes(table, tableDes);
|
||||||
|
|
||||||
if (count < 0) return -1;
|
if (count < 0) {
|
||||||
|
free(tableDes);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(tableDes);
|
||||||
|
|
||||||
return taosDumpTableData(fp, table, arguments);
|
return taosDumpTableData(fp, table, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ void vnodeCloseShellVnode(int vnode) {
|
||||||
if (shellList[vnode] == NULL) return;
|
if (shellList[vnode] == NULL) return;
|
||||||
|
|
||||||
for (int i = 0; i < vnodeList[vnode].cfg.maxSessions; ++i) {
|
for (int i = 0; i < vnodeList[vnode].cfg.maxSessions; ++i) {
|
||||||
vnodeFreeQInfo(shellList[vnode][i].qhandle, true);
|
vnodeDecRefCount(shellList[vnode][i].qhandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t* v = malloc(sizeof(int32_t));
|
int32_t* v = malloc(sizeof(int32_t));
|
||||||
|
@ -369,8 +369,10 @@ int vnodeProcessQueryRequest(char *pMsg, int msgLen, SShellObj *pObj) {
|
||||||
|
|
||||||
if (pObj->qhandle) {
|
if (pObj->qhandle) {
|
||||||
dTrace("QInfo:%p %s free qhandle", pObj->qhandle, __FUNCTION__);
|
dTrace("QInfo:%p %s free qhandle", pObj->qhandle, __FUNCTION__);
|
||||||
vnodeFreeQInfo(pObj->qhandle, true);
|
void* qHandle = pObj->qhandle;
|
||||||
pObj->qhandle = NULL;
|
pObj->qhandle = NULL;
|
||||||
|
|
||||||
|
vnodeDecRefCount(qHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QUERY_IS_STABLE_QUERY(pQueryMsg->queryType)) {
|
if (QUERY_IS_STABLE_QUERY(pQueryMsg->queryType)) {
|
||||||
|
|
Loading…
Reference in New Issue