提交 8eb4367d 编写于 作者: K kailixu

fix: range check and test case adjust

上级 5fc17e87
......@@ -305,6 +305,7 @@ int32_t trimString(const char* src, int32_t len, char* dst, int32_t dlen) {
dst[j] = src[k];
j++;
}
if (j >= dlen) j = dlen - 1;
dst[j] = '\0';
return j;
}
......
......@@ -176,8 +176,10 @@ class TDTestCase:
self.str107 += 'tP+2soIXpP'
self.str108 = self.str107 + '='
self.str109 = self.str108 + '+'
self.str254 = self.str108 + self.str108 + '0123456789001234567890012345678901234567'
self.str254 = self.str108 + self.str108 + '01234567890123456789012345678901234567'
self.str255 = self.str254 + '='
self.str256 = self.str254 + '=('
self.str257 = self.str254 + '=()'
self.str510 = self.str255 + self.str255
tdSql.error('alter dnode 1 "activeCode" "a"')
tdSql.error('alter dnode 1 "activeCode" "' + self.str107 + '"')
......@@ -192,16 +194,17 @@ class TDTestCase:
tdSql.checkEqual(tdSql.queryResult[0][1],'')
tdSql.error('alter dnode 1 "cActiveCode" "a"')
tdSql.error('alter dnode 1 "cActiveCode" "' + self.str107 + '"')
tdSql.execute('alter dnode 1 "cActiveCode" "' + self.str254 + '"')
tdSql.error('alter dnode 1 "cActiveCode" "' + self.str256 + '"')
tdSql.error('alter all dnodes "cActiveCode" "' + self.str255 + '"')
tdSql.execute('alter all dnodes "cActiveCode" "' + self.str254 + '"')
tdSql.error('alter dnode 1 "cActiveCode" "' + self.str510 + '"')
tdSql.query(f'select active_code,c_active_code from information_schema.ins_dnodes')
tdSql.checkEqual(tdSql.queryResult[0][0],"")
tdSql.checkEqual(tdSql.queryResult[0][1],self.str254)
tdSql.execute('alter dnode 1 "cActiveCode" "' + self.str109 + '"')
tdSql.query(f'show dnodes')
tdSql.checkEqual(tdSql.queryResult[0][0],self.str109)
tdSql.execute('alter all dnodes "activeCode" ""')
tdSql.checkEqual(tdSql.queryResult[0][9],self.str109)
tdSql.execute('alter all dnodes "cActiveCode" ""')
tdSql.query(f'select c_active_code from information_schema.ins_dnodes')
tdSql.checkEqual(tdSql.queryResult[0][0],'')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册