fix python source code for pep8 standard.
This commit is contained in:
parent
fd76b5f71d
commit
2777a2f0c9
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,53 +18,55 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(39)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(39)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data before with overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data before with overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(43)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(43)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(15,43):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(15, 43):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(47)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(47)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 50 data covering existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,51):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 50 data covering existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 51):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(50)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(50)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,53 +18,55 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime = self.startTime + 38
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+1, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime = self.startTime + 38
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(39)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(39)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data later with overlap")
|
||||
startTime = self.startTime + 30
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data later with overlap")
|
||||
startTime = self.startTime + 30
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(40)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(40)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,31):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(35,43):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 30 data later with partly overlap")
|
||||
startTime = self.startTime + 25
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,31):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 38 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 31):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(35, 43):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(38)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 30 data later with partly overlap")
|
||||
startTime = self.startTime + 25
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 31):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(55)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(55)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,53 +18,55 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,77):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 77):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(77)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(77)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,77):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data before with overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 77):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data before with overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(81)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(81)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(15,81):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(15, 81):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(85)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(85)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,77):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 90 data covering existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,91):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 77):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 90 data covering existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 91):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(90)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(90)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,77):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 77):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,53 +18,55 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,77):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime = self.startTime + 76
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+1, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 77):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime = self.startTime + 76
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(77)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(77)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,58 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,77):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data later with overlap")
|
||||
startTime = self.startTime + 70
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 77):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data later with overlap")
|
||||
startTime = self.startTime + 70
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(80)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(80)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,61):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(65,81):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 30 data later with partly overlap")
|
||||
startTime = self.startTime + 55
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,31):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 61):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(65, 81):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 30 data later with partly overlap")
|
||||
startTime = self.startTime + 55
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 31):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(85)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(85)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,59 +18,61 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data with gap between 2 blocks")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,39):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
for rid in range(40,78):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("one block can import 38 records")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import data into the gap between 2 blocks")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(39,40):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 76 sequential data with gap between 2 blocks")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 39):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
for rid in range(40, 78):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(76)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import data into the gap between 2 blocks")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(39, 40):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(77)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(77)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,69 +18,71 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(21)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(21)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,72 +18,74 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 10 data before with overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 10 data before with overlap")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(25)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(25)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,74 +18,78 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 9 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
if (rid == 5): continue
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(9)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 9 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
if (rid == 5):
|
||||
continue
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 9 data again with gap")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
if (rid == 5): continue
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(9)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(18)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 9 data again with gap")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
if (rid == 5):
|
||||
continue
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(18)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(23)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(23)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,72 +18,74 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 30 data covering existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,31):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 30 data covering existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 31):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(30)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(30)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,72 +18,74 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,69 +18,71 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 20
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+1, rid))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 20
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, rid))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(21)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(21)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,72 +18,74 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 10 data later with overlap")
|
||||
startTime = self.startTime + 15
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data again")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 10 data later with overlap")
|
||||
startTime = self.startTime + 15
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(25)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(25)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,74 +18,78 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 9 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
if (rid == 7): continue
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(9)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 9 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
if (rid == 7):
|
||||
continue
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 9 data again with gap")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
if (rid == 7): continue
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(9)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(18)
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 20 data later with partly overlap")
|
||||
startTime = self.startTime + 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 9 data again with gap")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
if (rid == 7):
|
||||
continue
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(18)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdLog.info("import 20 data later with partly overlap")
|
||||
startTime = self.startTime + 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(25)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(25)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,74 +18,77 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" %(self.rows/2))
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,self.rows/2+1):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(self.rows/2)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" % (self.rows / 2))
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, self.rows / 2 + 1):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime + 1, 1))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(self.rows / 2)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, 1))
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rows / 2 + 1)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdLog.info("import 10 data in batch before")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime - rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step9")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rows / 2 + 11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rows/2 + 1)
|
||||
|
||||
tdLog.info("================= step8")
|
||||
tdLog.info("import 10 data in batch before")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime - rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step9")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rows/2 + 11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,63 +18,67 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
self.rowsPerTable = 20
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
self.rowsPerTable = 20
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" %self.rowsPerTable)
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,self.rowsPerTable+1):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, self.rowsPerTable)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" % self.rowsPerTable)
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, self.rowsPerTable + 1):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 6 data before with overlap")
|
||||
startTime = self.startTime - 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,7):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, self.rowsPerTable)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 6 data before with overlap")
|
||||
startTime = self.startTime - 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 7):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rowsPerTable + 3)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rowsPerTable + 3)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,63 +18,67 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
self.rowsPerTable = 100
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
self.rowsPerTable = 100
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" %self.rowsPerTable)
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,self.rowsPerTable+1):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, self.rowsPerTable)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" % self.rowsPerTable)
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, self.rowsPerTable + 1):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 6 data before with overlap")
|
||||
startTime = self.startTime - 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(6, 0, -1):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, self.rowsPerTable)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 6 data before with overlap")
|
||||
startTime = self.startTime - 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(6, 0, -1):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rowsPerTable + 3)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rowsPerTable+3)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,65 +18,69 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
self.rowsPerTable = 20
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
self.rowsPerTable = 20
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" %self.rowsPerTable)
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,10):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(14,self.rowsPerTable+5):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, self.rowsPerTable)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" % self.rowsPerTable)
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 10):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(14, self.rowsPerTable + 5):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 4
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, self.rowsPerTable)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 4
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(self.rowsPerTable + 8)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(self.rowsPerTable+8)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,59 +18,63 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,206):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 206):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime + 1, 1))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, 1))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(206)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(206)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,62 +18,66 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,206):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 206):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 5 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 5 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(207)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(207)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,64 +18,68 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(14,209):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(14, 209):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(210)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(210)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,62 +18,66 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,206):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 206):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 250 data covering the existing data")
|
||||
startTime = self.startTime - 15
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,251):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 250 data covering the existing data")
|
||||
startTime = self.startTime - 15
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 251):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(250)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(250)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,62 +18,66 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,206):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 206):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,55 +18,59 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,206):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 206):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 205
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime + 1, 1))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 205
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, 1))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(206)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(206)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,206):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 206):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 5 data later with overlap")
|
||||
startTime = self.startTime + 203
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 5 data later with overlap")
|
||||
startTime = self.startTime + 203
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(208)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(208)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,60 +18,64 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than %d rows less than %d rows will go to data and last file" %(self.rows, 10+self.rows))
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,196):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(200,210):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than %d rows less than %d rows will go to data and last file" %
|
||||
(self.rows, 10 + self.rows))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 205 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 196):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(200, 210):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data later with partly overlap")
|
||||
startTime = self.startTime + 192
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(205)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data later with partly overlap")
|
||||
startTime = self.startTime + 192
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(212)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(212)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 30 data covering the existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,31):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 30 data covering the existing data")
|
||||
startTime = self.startTime - 5
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 31):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(30)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(30)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,63 +18,67 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" %(self.rows/2))
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,self.rows/2+1):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(self.rows/2)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import %d sequential data" % (self.rows / 2))
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, self.rows / 2 + 1):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,11):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(self.rows / 2)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 10
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 11):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step9")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rows / 2)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step9")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(self.rows/2)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,55 +18,59 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 20
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime + 1, 1))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 20
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, 1))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(21)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(21)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 6 data later with overlap")
|
||||
startTime = self.startTime + 18
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,7):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 6 data later with overlap")
|
||||
startTime = self.startTime + 18
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 7):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(24)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(24)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,61 +18,65 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("More than 10 rows less than %d rows will go to data file" %self.rows)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,18):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(22,25):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info(
|
||||
"More than 10 rows less than %d rows will go to data file" %
|
||||
self.rows)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(5)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 18):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(22, 25):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data later with partly overlap")
|
||||
startTime = self.startTime + 15
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(5)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data later with partly overlap")
|
||||
startTime = self.startTime + 15
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(35)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(35)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,49 +18,55 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.prepare()
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.prepare()
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 5 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 5 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,52 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.prepare()
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.prepare()
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,4):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(6,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1, 9):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 4):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
for rid in range(6, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1, 9):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,48 +18,52 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.prepare()
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.prepare()
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,51 +18,53 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,46 +18,48 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.prepare()
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.prepare()
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 5 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 5 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,50 +18,52 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.prepare()
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.prepare()
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,4):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
startTime += 2
|
||||
for rid in range(6,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1, 9):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 4):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
startTime += 2
|
||||
for rid in range(6, 11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
for rid in range(1, 9):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(12)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,55 +18,57 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime + 1, 1))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before")
|
||||
startTime = self.startTime - 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, 1))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 4 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,5):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 4 data before with overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 5):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(7)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(7)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,60 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 6 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,4):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(6,9):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 6 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 4):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(6, 9):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 8 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,9):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 8 data before with partly overlap")
|
||||
startTime = self.startTime - 2
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 9):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,57 +18,59 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data covering existing data")
|
||||
startTime = self.startTime - 10
|
||||
for rid in range(1,21):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 20 data covering existing data")
|
||||
startTime = self.startTime - 10
|
||||
for rid in range(1, 21):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,60 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 3 data totally repetitive")
|
||||
startTime = self.startTime + 1
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,4):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 3 data totally repetitive")
|
||||
startTime = self.startTime + 1
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 4):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,59 +18,61 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 5
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime + 1, 1))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data later")
|
||||
startTime = self.startTime + 5
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime + 1, 1))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,62 +18,64 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,6):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 5 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 6):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 4 data later with overlap")
|
||||
startTime = self.startTime + 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,5):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(5)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 4 data later with overlap")
|
||||
startTime = self.startTime + 3
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 5):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(7)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(7)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,63 +18,65 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
self.rows = 200
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' %self.rows)
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db rows %d' % self.rows)
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 6 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1,4):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(6,9):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdLog.info("less than 10 rows will go to last file")
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 6 sequential data")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(1, 4):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
for rid in range(6, 9):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 8 data later with partly overlap")
|
||||
startTime = self.startTime + 2
|
||||
for rid in range(1,9):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(6)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdDnodes.stop(1)
|
||||
tdLog.sleep(5)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 8 data later with partly overlap")
|
||||
startTime = self.startTime + 2
|
||||
for rid in range(1, 9):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data cover existing data")
|
||||
startTime = self.startTime - 5
|
||||
for rid in range(1,21):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data cover existing data")
|
||||
startTime = self.startTime - 5
|
||||
for rid in range(1, 21):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,51 +18,57 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data cover existing data")
|
||||
startTime = self.startTime - 5
|
||||
for rid in range(1,21):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 20 data cover existing data")
|
||||
startTime = self.startTime - 5
|
||||
for rid in range(1, 21):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,21):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 5
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 20 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 21):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 10 data totally repetitive")
|
||||
startTime = self.startTime + 5
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(20)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,56 +18,62 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 6 data after with overlap")
|
||||
startTime = self.startTime + 8
|
||||
for rid in range(1,7):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 6 data after with overlap")
|
||||
startTime = self.startTime + 8
|
||||
for rid in range(1, 7):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(14)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(14)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,58 +18,66 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,6):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(8,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 6):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
for rid in range(8, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data after with partly overlap")
|
||||
startTime = self.startTime + 3
|
||||
for rid in range(1,9):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data after with partly overlap")
|
||||
startTime = self.startTime + 3
|
||||
for rid in range(1, 9):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,55 +18,59 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime = self.startTime + 11
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime = self.startTime + 11
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdDnodes.forcestop(1)
|
||||
tdDnodes.start(1)
|
||||
tdLog.sleep(10)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,51 +18,53 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime += 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 1 data after")
|
||||
startTime += 1
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,53 +18,55 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 6 data after with overlap")
|
||||
startTime = self.startTime + 8
|
||||
for rid in range(1,7):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime, rid))
|
||||
startTime += 1
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 10 sequential data")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(10)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 6 data after with overlap")
|
||||
startTime = self.startTime + 8
|
||||
for rid in range(1, 7):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' % (startTime, rid))
|
||||
startTime += 1
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(14)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(14)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,53 +18,61 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1,6):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
for rid in range(8,11):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, speed int)')
|
||||
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info("import 8 sequential data with gap")
|
||||
startTime = self.startTime
|
||||
for rid in range(1, 6):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
for rid in range(8, 11):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data after with partly overlap")
|
||||
startTime = self.startTime + 3
|
||||
for rid in range(1,9):
|
||||
tdSql.execute('import into tb1 values(%ld, %d)' %(startTime+rid, rid))
|
||||
tdLog.info("================= step3")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(8)
|
||||
|
||||
tdLog.info("================= step4")
|
||||
tdLog.info("import 8 data after with partly overlap")
|
||||
startTime = self.startTime + 3
|
||||
for rid in range(1, 9):
|
||||
tdSql.execute(
|
||||
'import into tb1 values(%ld, %d)' %
|
||||
(startTime + rid, rid))
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdSql.query('select * from tb1')
|
||||
tdSql.checkRows(11)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
###################################################################
|
||||
# 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
|
||||
#
|
||||
# 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 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import taos
|
||||
|
@ -18,64 +18,68 @@ from util.cases import *
|
|||
from util.sql import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512 tables 10')
|
||||
tdSql.execute('use db')
|
||||
def init(self, conn):
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor())
|
||||
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdLog.info("one block can import 38 records and totally there are 40 blocks")
|
||||
def run(self):
|
||||
self.ntables = 1
|
||||
self.startTime = 1520000010000
|
||||
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info('insert data until the first commit')
|
||||
dnodesDir = tdDnodes.getDnodesRootDir()
|
||||
dataDir = dnodesDir + '/dnode1/data/data'
|
||||
startTime = self.startTime
|
||||
rid0 = 1
|
||||
while (True):
|
||||
sqlcmd = 'insert into tb1 values(%ld, %d)' %(startTime+rid0*2, rid0)
|
||||
tdSql.execute(sqlcmd)
|
||||
rid0 += 1
|
||||
vnodes = os.listdir(dataDir)
|
||||
if (len(vnodes) > 0):
|
||||
tdLog.info("data is committed, stop inserting")
|
||||
break
|
||||
tdDnodes.stop(1)
|
||||
tdDnodes.deploy(1)
|
||||
tdDnodes.start(1)
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db cache 512 tables 10')
|
||||
tdSql.execute('use db')
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before ")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(3,4):
|
||||
sqlcmd.append('(%ld, %d)' %(startTime+rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
tdLog.info("================= step1")
|
||||
tdLog.info("create 1 table")
|
||||
tdSql.execute('create table tb1 (ts timestamp, i int)')
|
||||
tdLog.info(
|
||||
"one block can import 38 records and totally there are 40 blocks")
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(rid0-1+1)
|
||||
tdLog.info("================= step2")
|
||||
tdLog.info('insert data until the first commit')
|
||||
dnodesDir = tdDnodes.getDnodesRootDir()
|
||||
dataDir = dnodesDir + '/dnode1/data/data'
|
||||
startTime = self.startTime
|
||||
rid0 = 1
|
||||
while (True):
|
||||
sqlcmd = 'insert into tb1 values(%ld, %d)' % (
|
||||
startTime + rid0 * 2, rid0)
|
||||
tdSql.execute(sqlcmd)
|
||||
rid0 += 1
|
||||
vnodes = os.listdir(dataDir)
|
||||
if (len(vnodes) > 0):
|
||||
tdLog.info("data is committed, stop inserting")
|
||||
break
|
||||
|
||||
tdLog.info("================= step5")
|
||||
tdLog.info("import 1 data before ")
|
||||
startTime = self.startTime
|
||||
sqlcmd = ['import into tb1 values']
|
||||
for rid in range(3, 4):
|
||||
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
|
||||
tdSql.execute(" ".join(sqlcmd))
|
||||
|
||||
tdLog.info("================= step6")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select * from tb1 order by ts desc')
|
||||
tdSql.checkRows(rid0 - 1 + 1)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, rid0 - 1 + 1)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdLog.info("================= step7")
|
||||
tdSql.execute('reset query cache')
|
||||
tdSql.query('select count(*) from tb1')
|
||||
tdSql.checkData(0, 0, rid0-1+1)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -26,12 +26,14 @@ class TDTestCase:
|
|||
def run(self):
|
||||
tdSql.prepare()
|
||||
|
||||
tdSql.execute('create table cars (ts timestamp, speed int) tags(id int)')
|
||||
tdSql.execute(
|
||||
'create table cars (ts timestamp, speed int) tags(id int)')
|
||||
tdSql.execute("create table carzero using cars tags(0)")
|
||||
tdSql.execute("create table carone using cars tags(1)")
|
||||
tdSql.execute("create table cartwo using cars tags(2)")
|
||||
|
||||
tdSql.execute("insert into carzero values(now, 100) carone values(now, 110)")
|
||||
tdSql.execute(
|
||||
"insert into carzero values(now, 100) carone values(now, 110)")
|
||||
|
||||
tdSql.query("select * from cars where tbname in ('carzero', 'carone')")
|
||||
tdSql.checkRows(2)
|
||||
|
@ -39,13 +41,16 @@ class TDTestCase:
|
|||
tdSql.query("select * from cars where tbname in ('carzero', 'cartwo')")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
tdSql.query("select * from cars where id=1 or tbname in ('carzero', 'cartwo')")
|
||||
tdSql.query(
|
||||
"select * from cars where id=1 or tbname in ('carzero', 'cartwo')")
|
||||
tdSql.checkRows(2)
|
||||
|
||||
tdSql.query("select * from cars where id=1 and tbname in ('carzero', 'cartwo')")
|
||||
tdSql.query(
|
||||
"select * from cars where id=1 and tbname in ('carzero', 'cartwo')")
|
||||
tdSql.checkRows(0)
|
||||
|
||||
tdSql.query("select * from cars where id=0 and tbname in ('carzero', 'cartwo')")
|
||||
tdSql.query(
|
||||
"select * from cars where id=0 and tbname in ('carzero', 'cartwo')")
|
||||
tdSql.checkRows(1)
|
||||
|
||||
"""
|
||||
|
|
|
@ -92,10 +92,10 @@ class TDSql:
|
|||
|
||||
if data is None:
|
||||
tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%s" %
|
||||
(self.sql, row, col, self.queryResult[row][col], data))
|
||||
(self.sql, row, col, self.queryResult[row][col], data))
|
||||
else:
|
||||
tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%d" %
|
||||
(self.sql, row, col, self.queryResult[row][col], data))
|
||||
(self.sql, row, col, self.queryResult[row][col], data))
|
||||
|
||||
def getData(self, row, col):
|
||||
if row < 0:
|
||||
|
|
Loading…
Reference in New Issue