From ca4289388c76c7737513b8586c395dcfa299d921 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Mon, 31 May 2021 09:28:19 +0800 Subject: [PATCH] add test case --- tests/script/general/parser/alter_column.sim | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/script/general/parser/alter_column.sim diff --git a/tests/script/general/parser/alter_column.sim b/tests/script/general/parser/alter_column.sim new file mode 100644 index 0000000000..47e59d76d2 --- /dev/null +++ b/tests/script/general/parser/alter_column.sim @@ -0,0 +1,43 @@ +system sh/stop_dnodes.sh + +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/exec.sh -n dnode1 -s start +sleep 100 +sql connect + +$dbPrefix = m_alt_db +$tbPrefix = m_alt_tb +$mtPrefix = m_alt_mt +$tbNum = 10 +$rowNum = 5 +$totalNum = $tbNum * $rowNum +$ts0 = 1537146000000 +$delta = 600000 +print ========== alter.sim +$i = 0 +$db = $dbPrefix . $i +$mt = $mtPrefix . $i + +sql drop database if exists $db +sql create database $db +sql use $db +##### alter table test, simeplest case +sql create table tb (ts timestamp, c1 int, c2 binary(10), c3 nchar(10)) +sql insert into tb values (now, 1, "1", "1") +sql alter table tb alter column length c2 20; +if $rows != 0 then + return -1 +endi +sql alter table tb alter column length c3 20; +if $rows != 0 then + return -1 +endi + +##### ILLEGAL OPERATIONS + +# try dropping columns that are defined in metric +sql_error alter table tb alter column length c1 10; + + +system sh/exec.sh -n dnode1 -s stop -x SIGINT -- GitLab