This commit is contained in:
54liuyao 2024-08-16 13:54:25 +08:00
commit a3c7467d35
6 changed files with 106 additions and 23 deletions

View File

@ -125,7 +125,7 @@ void dmLogCrash(int signum, void *sigInfo, void *context) {
_return:
taosLogCrashInfo("taosd", pMsg, msgLen, signum, sigInfo);
taosLogCrashInfo(CUS_PROMPT "d", pMsg, msgLen, signum, sigInfo);
#ifdef _TD_DARWIN_64
exit(signum);
@ -258,7 +258,7 @@ static void dmPrintArgs(int32_t argc, char const *argv[]) {
static void dmGenerateGrant() { mndGenerateMachineCode(); }
static void dmPrintVersion() {
printf("%s\ntaosd version: %s compatible_version: %s\n", TD_PRODUCT_NAME, version, compatible_version);
printf("%s\n%sd version: %s compatible_version: %s\n", TD_PRODUCT_NAME, CUS_PROMPT, version, compatible_version);
printf("git: %s\n", gitinfo);
#ifdef TD_ENTERPRISE
printf("gitOfInternal: %s\n", gitinfoOfInternal);
@ -268,7 +268,7 @@ static void dmPrintVersion() {
static void dmPrintHelp() {
char indent[] = " ";
printf("Usage: taosd [OPTION...] \n\n");
printf("Usage: %sd [OPTION...] \n\n", CUS_PROMPT);
printf("%s%s%s%s\n", indent, "-a,", indent, DM_APOLLO_URL);
printf("%s%s%s%s\n", indent, "-c,", indent, DM_CFG_DIR);
printf("%s%s%s%s\n", indent, "-s,", indent, DM_SDB_INFO);

View File

@ -5182,7 +5182,10 @@ int32_t tsdbNextDataBlock2(STsdbReader* pReader, bool* hasNext) {
if (pReader->step == EXTERNAL_ROWS_PREV) {
// prepare for the main scan
code = doOpenReaderImpl(pReader);
if (tSimpleHashGetSize(pReader->status.pTableMap) > 0) {
code = doOpenReaderImpl(pReader);
}
int32_t step = 1;
resetAllDataBlockScanInfo(pReader->status.pTableMap, pReader->innerReader[0]->info.window.ekey, step);
@ -5210,8 +5213,11 @@ int32_t tsdbNextDataBlock2(STsdbReader* pReader, bool* hasNext) {
if (pReader->step == EXTERNAL_ROWS_MAIN && pReader->innerReader[1] != NULL) {
// prepare for the next row scan
if (tSimpleHashGetSize(pReader->status.pTableMap) > 0) {
code = doOpenReaderImpl(pReader->innerReader[1]);
}
int32_t step = -1;
code = doOpenReaderImpl(pReader->innerReader[1]);
resetAllDataBlockScanInfo(pReader->innerReader[1]->status.pTableMap, pReader->info.window.ekey, step);
if (code != TSDB_CODE_SUCCESS) {
(void) tsdbReleaseReader(pReader);

View File

@ -19,6 +19,10 @@
#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
#include "cus_name.h"
#else
#ifndef CUS_PROMPT
#define CUS_PROMPT "taos"
#endif
#endif
#define PROCESS_ITEM 12
@ -987,7 +991,7 @@ void taosKillSystem() {
exit(0);
#else
// SIGINT
(void)printf("taosd will shut down soon");
(void)printf("%sd will shut down soon", CUS_PROMPT);
(void)kill(tsProcId, 2);
#endif
}

View File

@ -2,6 +2,32 @@
set -e
check_transactions() {
for i in {1..30}
do
output=$(taos -s "show transactions;")
if [[ $output == *"Query OK, 0 row(s)"* ]]; then
echo "Success: No transactions are in progress."
return 0
fi
sleep 1
done
echo "Error: Transactions are still in progress after 30 attempts."
return 1
}
reset_cache() {
response=$(curl --location -uroot:taosdata 'http://127.0.0.1:6041/rest/sql' --data 'reset query cache')
if [[ $response == \{\"code\":0* ]]; then
echo "Success: Query cache reset successfully."
else
echo "Error: Failed to reset query cache. Response: $response"
return 1
fi
}
pgrep taosd || taosd >> /dev/null 2>&1 &
pgrep taosadapter || taosadapter >> /dev/null 2>&1 &
cd ../../docs/examples/csharp
@ -10,56 +36,69 @@ dotnet run --project connect/connect.csproj
dotnet run --project wsConnect/wsConnect.csproj
taos -s "drop database if exists test"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project influxdbLine/influxdbline.csproj
taos -s "drop database if exists test"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project optsTelnet/optstelnet.csproj
taos -s "drop database if exists test"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project optsJSON/optsJSON.csproj
# query
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project wsInsert/wsInsert.csproj
dotnet run --project wsQuery/wsQuery.csproj
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project sqlInsert/sqlinsert.csproj
dotnet run --project query/query.csproj
# stmt
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project wsStmt/wsStmt.csproj
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project stmtInsert/stmtinsert.csproj
# schemaless
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project wssml/wssml.csproj
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project nativesml/nativesml.csproj
# subscribe
taos -s "drop topic if exists topic_meters"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project wssubscribe/wssubscribe.csproj
taos -s "drop topic if exists topic_meters"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
taos -s "drop database if exists power"
sleep 1
check_transactions || exit 1
reset_cache || exit 1
dotnet run --project subscribe/subscribe.csproj

View File

@ -17,6 +17,17 @@ check_transactions() {
return 1
}
reset_cache() {
response=$(curl --location -uroot:taosdata 'http://127.0.0.1:6041/rest/sql' --data 'reset query cache')
if [[ $response == \{\"code\":0* ]]; then
echo "Success: Query cache reset successfully."
else
echo "Error: Failed to reset query cache. Response: $response"
return 1
fi
}
taosd >>/dev/null 2>&1 &
taosadapter >>/dev/null 2>&1 &
sleep 1
@ -31,64 +42,83 @@ go run ./connect/connpool/main.go
go run ./connect/wsexample/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./sqlquery/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./queryreqid/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./stmt/native/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./stmt/ws/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
sleep 3
go run ./schemaless/native/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./schemaless/ws/main.go
taos -s "drop topic if exists topic_meters"
check_transactions || exit 1
reset_cache || exit 1
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./tmq/native/main.go
taos -s "drop topic if exists topic_meters"
check_transactions || exit 1
reset_cache || exit 1
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./tmq/ws/main.go
taos -s "drop database if exists test"
check_transactions || exit 1
reset_cache || exit 1
go run ./insert/json/main.go
taos -s "drop database if exists test"
check_transactions || exit 1
reset_cache || exit 1
go run ./insert/line/main.go
taos -s "drop topic if exists topic_meters"
check_transactions || exit 1
reset_cache || exit 1
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./insert/sql/main.go
taos -s "drop database if exists power"
check_transactions || exit 1
reset_cache || exit 1
go run ./insert/stmt/main.go
taos -s "drop database if exists test"
check_transactions || exit 1
reset_cache || exit 1
go run ./insert/telnet/main.go
go run ./query/sync/main.go
taos -s "drop topic if exists example_tmq_topic"
check_transactions || exit 1
reset_cache || exit 1
taos -s "drop database if exists example_tmq"
check_transactions || exit 1
reset_cache || exit 1
go run ./sub/main.go

View File

@ -22,6 +22,10 @@
#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
#include "cus_name.h"
#else
#ifndef CUS_PROMPT
#define CUS_PROMPT "taos"
#endif
#endif
#define TAOS_CONSOLE_PROMPT_CONTINUE " -> "
@ -57,7 +61,7 @@ static int32_t shellParseSingleOpt(int32_t key, char *arg);
void shellPrintHelp() {
char indent[] = " ";
printf("Usage: taos [OPTION...] \r\n\r\n");
printf("Usage: %s [OPTION...] \r\n\r\n", CUS_PROMPT);
printf("%s%s%s%s\r\n", indent, "-a,", indent, SHELL_AUTH);
printf("%s%s%s%s\r\n", indent, "-A,", indent, SHELL_GEN_AUTH);
printf("%s%s%s%s\r\n", indent, "-B,", indent, SHELL_BI_MODE);
@ -435,11 +439,11 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
shell.info.promptSize = strlen(shell.info.promptHeader);
#ifdef TD_ENTERPRISE
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion),
"%s\ntaos version: %s compatible_version: %s\ngit: %s\ngitOfInternal: %s\nbuild: %s", TD_PRODUCT_NAME,
version, compatible_version, gitinfo, gitinfoOfInternal, buildinfo);
"%s\n%s version: %s compatible_version: %s\ngit: %s\ngitOfInternal: %s\nbuild: %s", TD_PRODUCT_NAME,
CUS_PROMPT, version, compatible_version, gitinfo, gitinfoOfInternal, buildinfo);
#else
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion),
"%s\ntaos version: %s compatible_version: %s\ngit: %s\nbuild: %s", TD_PRODUCT_NAME, version,
"%s\n%s version: %s compatible_version: %s\ngit: %s\nbuild: %s", TD_PRODUCT_NAME, CUS_PROMPT, version,
compatible_version, gitinfo, buildinfo);
#endif