diff --git a/docs-examples/python/subscribe_demo.py b/docs-examples/python/subscribe_demo.py index db9d49c3f4f8122634800c02a683d4cb022a7ba0..bb71a62344e97d84b957e4895324600f6a6df97d 100644 --- a/docs-examples/python/subscribe_demo.py +++ b/docs-examples/python/subscribe_demo.py @@ -27,12 +27,12 @@ def query_callback(p_sub, p_result, p_param, code): if __name__ == '__main__': - conn = taos.connect() + conn = taos.connect(host="192.168.0.101",user="root",password="taosdata") restart = True topic = "topic-meter-current-bg" - sql = "select * from power.meters where current > 10" # Error sql + sql = "select * from test.meters where current > 10" # Error sql interval = 2000 # consumption interval in microseconds. - _ = conn.subscribe(restart, topic, sql, interval, query_callback) + _ = conn.subscribe(restart, topic, sql, interval) # Note: we received the return value as _ above, to avoid the TaosSubscription object to be deleted by gc. while True: time.sleep(10) # use Ctrl + C to interrupt diff --git a/output.txt b/output.txt new file mode 100644 index 0000000000000000000000000000000000000000..a27235060942e90f8dd65ef6d612b8f87d99e183 --- /dev/null +++ b/output.txt @@ -0,0 +1,6 @@ +[06/13 14:00:51.480051] INFO: start creating 100 table(s) with 8 thread(s) +Spent 0.2650 seconds to create 100 table(s) with 8 thread(s), already exist 0 table(s), actual 100 table(s) pre created, 0 table(s) will be auto created +Spent 0.0251 seconds to insert rows: 20000, affected rows: 20000 with 8 thread(s) into test 796527.14 records/second + +insert delay, min: 0.16ms, avg: 0.96ms, p90: 1.50ms, p95: 3.00ms, p99: 10.50ms, max: 10.50ms + diff --git a/src/tsdb/inc/tsdbFile.h b/src/tsdb/inc/tsdbFile.h index d753129548aba50272888e0f4edc0b93c40b4134..6b275b31e964f6fd7b3a1991fa961c43c5794967 100644 --- a/src/tsdb/inc/tsdbFile.h +++ b/src/tsdb/inc/tsdbFile.h @@ -260,9 +260,8 @@ static FORCE_INLINE int tsdbAppendDFile(SDFile* pDFile, void* buf, int64_t nbyte //bug fix. To avoid data corruption, //the end offset of current file should be checked with file size, //if not equal, known as file corrupted and return error. - //ASSERT(pDFile->info.size == toffset); if (pDFile->info.size != toffset) { - terrno = TAOS_SYSTEM_ERROR(TSDB_CODE_COM_FILE_CORRUPTED); + terrno = TSDB_CODE_TDB_FILE_CORRUPTED; return -1; }