From b61b049841cad0cd5d751976e0043b5740bf2bb7 Mon Sep 17 00:00:00 2001 From: wenzhouwww Date: Mon, 13 Dec 2021 16:41:02 +0800 Subject: [PATCH] [TD-11945]: add test case coredump for TD-11945 ,and this issue has been fix on branch feature/TD-6140 --- .../2-query/9-others/TD-11945_crash.py | 65 +++++++++++++++++++ tests/system-test/fulltest.sh | 3 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 tests/system-test/2-query/9-others/TD-11945_crash.py diff --git a/tests/system-test/2-query/9-others/TD-11945_crash.py b/tests/system-test/2-query/9-others/TD-11945_crash.py new file mode 100644 index 0000000000..8c7ba9542c --- /dev/null +++ b/tests/system-test/2-query/9-others/TD-11945_crash.py @@ -0,0 +1,65 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confspeedential 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 provspeeded by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def caseDescription(self): + ''' + case1::wenzhouwww [TD-11945] this test case is an issue about taoshell and taosd crash , it now has been repaired on branch https://github.com/taosdata/TDengine/tree/feature%2FTD-6140 + the root source maybe : + The four arithmetic operations do not perform the verification of the numeric type,so that the numeric type and string type will coredump about Four arithmetic operations + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start test case for TD-11945 execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + self.ts = 1420041600000 # 2015-01-01 00:00:00 this is begin time for first record + self.num = 10 + + def run(self): + + tdSql.prepare() + tdSql.execute('create database if not exists testdb') + tdSql.execute('create table tb (ts timestamp, speed int)') + tdSql.execute('create stable st (ts timestamp, speed int) tags(ind int)') + + for i in range(self.num): + tdSql.execute('insert into tb values(%d,%d) '%(self.ts+i*10000,i)) + tdSql.execute('insert into sub1 using st tags(1) values(%d,%d) '%(self.ts+i*10000,i)) + tdSql.execute('insert into sub2 using st tags(2) values(%d,%d) '%(self.ts+i*10000,i)) + + tdLog.info(" ==================execute query =============") + tdSql.error('select 1*tbname, min(speed) , ind from st;') + tdSql.execute('select tbname, min(speed) , ind from st group by ind;') + tdSql.error('select tbname , tbname,ind ,ind, * ,speed+"ab" from st;') + tdSql.error('select tbname , ind ,speed+"abc" from st;') + tdSql.error('select speed+"abc" from st;') + tdSql.error('select speed+"abc" from sub1;') + tdSql.error('select speed+"abc" from sub2;') + tdSql.error('select max(speed) + "abc" from st;') + tdSql.error('select max(speed) + "abc" from sub1;') + tdSql.error('select max(speed) + "abc" from sub2;') + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 5040747d3a..6739db005c 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -1,2 +1,3 @@ python3 test.py -f 1-insert/0-sql/basic.py -python3 test.py -f 0-management/1-stable/create_col_tag.py \ No newline at end of file +python3 test.py -f 0-management/1-stable/create_col_tag.py +# python3 test.py -f 2-query/9-others/TD-11945_crash.py # this test case must need TD-6140 merge into develop -- GitLab