diff --git a/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md b/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md index e0acaee137eb8f4d65e95ae97be7bbc8988cb122..66d17c6aa686a7ed07ff1b865000f7b4a43f3834 100644 --- a/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md +++ b/documentation20/webdocs/markdowndocs/TAOS SQL-ch.md @@ -98,12 +98,12 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic KEEP参数是指修改数据文件保存的天数,缺省值为3650,取值范围[days, 365000],必须大于或等于days参数值。 ```mysql - ALTER DATABASE db_name QUORUM 365; + ALTER DATABASE db_name QUORUM 2; ``` QUORUM参数是指数据写入成功所需要的确认数。取值范围[1, 3]。对于异步复制,quorum设为1,具有master角色的虚拟节点自己确认即可。对于同步复制,需要至少大于等于2。原则上,Quorum >=1 并且 Quorum <= replica(副本数),这个参数在启动一个同步模块实例时需要提供。 ```mysql - ALTER DATABASE db_name BLOCKS 365; + ALTER DATABASE db_name BLOCKS 100; ``` BLOCKS参数是每个VNODE (TSDB) 中有多少cache大小的内存块,因此一个VNODE的用的内存大小粗略为(cache * blocks)。取值范围[3, 1000]。 diff --git a/tests/pytest/client/alterDatabase.py b/tests/pytest/client/alterDatabase.py new file mode 100644 index 0000000000000000000000000000000000000000..fa397d16c57625d53f6f1b2772afa99ade314e1a --- /dev/null +++ b/tests/pytest/client/alterDatabase.py @@ -0,0 +1,55 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + + tdSql.query('select database()') + tdSql.checkData(0, 0, "db") + + tdSql.execute("alter database db comp 2") + tdSql.query("show databases") + tdSql.checkData(0, 14, 2) + + tdSql.execute("alter database db keep 365") + tdSql.query("show databases") + tdSql.checkData(0, 7, "3650,3650,365") + + tdSql.execute("alter database db quorum 2") + tdSql.query("show databases") + tdSql.checkData(0, 5, 2) + + tdSql.execute("alter database db blocks 100") + tdSql.query("show databases") + tdSql.checkData(0, 9, 100) + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index a73e7dd5a573483ffaeda4f3fde659e7076566dc..b679942054c000050271fcb96328d18adea60b42 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -164,6 +164,7 @@ python3 ./test.py -f alter/alter_table_crash.py # client python3 ./test.py -f client/client.py python3 ./test.py -f client/version.py +python3 ./test.py -f client/alterDatabase.py # Misc python3 testCompress.py