fix: add keep time offset case
This commit is contained in:
parent
3fa3f0e3d6
commit
777b442d88
|
@ -815,6 +815,7 @@
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
|
||||||
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insertMix.py -N 3
|
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insertMix.py -N 3
|
||||||
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/stt.py -N 3
|
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/stt.py -N 3
|
||||||
|
,,n,system-test,python3 ./test.py -f eco-system/meta/database/keep_time_offset.py
|
||||||
|
|
||||||
#tsim test
|
#tsim test
|
||||||
,,y,script,./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim
|
,,y,script,./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import re
|
||||||
|
from util.log import *
|
||||||
|
from util.cases import *
|
||||||
|
from util.sql import *
|
||||||
|
from util.common import *
|
||||||
|
from util.sqlset import *
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
|
self.replicaVar = int(replicaVar)
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
self.setsql = TDSetSql()
|
||||||
|
|
||||||
|
def create_db(self):
|
||||||
|
hours = 8
|
||||||
|
# create
|
||||||
|
keep_str = f"KEEP_TIME_OFFSET {hours}"
|
||||||
|
tdSql.execute(f"create database db {keep_str}")
|
||||||
|
|
||||||
|
# check result
|
||||||
|
tdSql.query(" show create database db")
|
||||||
|
create_sql = tdSql.getData(0, 1)
|
||||||
|
if create_sql.find(keep_str) == -1:
|
||||||
|
tdLog.exit(f"create database sql not found {keep_str} sql:{create_sql}")
|
||||||
|
|
||||||
|
# alter
|
||||||
|
hours = 4
|
||||||
|
keep_str = f"KEEP_TIME_OFFSET {hours}"
|
||||||
|
tdSql.execute(f"alter database db {keep_str}")
|
||||||
|
|
||||||
|
# check result
|
||||||
|
tdSql.query(" show create database db")
|
||||||
|
create_sql = tdSql.getData(0, 1)
|
||||||
|
if create_sql.find(keep_str) == -1:
|
||||||
|
tdLog.exit(f"create database sql not found {keep_str} sql:{create_sql}")
|
||||||
|
|
||||||
|
def check_old_syntax(self):
|
||||||
|
# old syntax would not support again
|
||||||
|
tdSql.error("alter dnode 1 'keeptimeoffset 10';")
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
# check new syntax right
|
||||||
|
self.create_db()
|
||||||
|
|
||||||
|
# check old syntax error
|
||||||
|
self.check_old_syntax()
|
||||||
|
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
|
@ -125,7 +125,10 @@ void build_code(HuffmanTree *huffmanTree, node n, int len, unsigned long out1, u
|
||||||
huffmanTree->code[n->c] = (unsigned long*)malloc(2*sizeof(unsigned long));
|
huffmanTree->code[n->c] = (unsigned long*)malloc(2*sizeof(unsigned long));
|
||||||
if(len<=64)
|
if(len<=64)
|
||||||
{
|
{
|
||||||
(huffmanTree->code[n->c])[0] = out1 << (64 - len);
|
if(len == 0)
|
||||||
|
(huffmanTree->code[n->c])[0] = 0;
|
||||||
|
else
|
||||||
|
(huffmanTree->code[n->c])[0] = out1 << (64 - len);
|
||||||
(huffmanTree->code[n->c])[1] = out2;
|
(huffmanTree->code[n->c])[1] = out2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue