提交 b509f79c 编写于 作者: C Cary Xu

fix: update schema version when modify column width of normal table

上级 2e6f25c0
...@@ -2494,6 +2494,7 @@ static int32_t mnodeChangeNormalTableColumn(SMnodeMsg *pMsg) { ...@@ -2494,6 +2494,7 @@ static int32_t mnodeChangeNormalTableColumn(SMnodeMsg *pMsg) {
SSchema *schema = (SSchema *) (pTable->schema + col); SSchema *schema = (SSchema *) (pTable->schema + col);
ASSERT(schema->type == TSDB_DATA_TYPE_BINARY || schema->type == TSDB_DATA_TYPE_NCHAR); ASSERT(schema->type == TSDB_DATA_TYPE_BINARY || schema->type == TSDB_DATA_TYPE_NCHAR);
schema->bytes = pAlter->schema[0].bytes; schema->bytes = pAlter->schema[0].bytes;
++pTable->sversion;
mInfo("msg:%p, app:%p ctable %s, start to modify column %s len to %d", pMsg, pMsg->rpcMsg.ahandle, pTable->info.tableId, mInfo("msg:%p, app:%p ctable %s, start to modify column %s len to %d", pMsg, pMsg->rpcMsg.ahandle, pTable->info.tableId,
name, schema->bytes); name, schema->bytes);
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ======== step1 create db
sql drop database if exists db1;
sql CREATE DATABASE db1;
sql use db1;
print ======== step2 create normal table
sql CREATE TABLE normal_t1('ts' TIMESTAMP, 'c1' BINARY(1));
print ======== step3 alter column width
sql alter table db1.normal_t1 modify column c1 binary(2400);
print ======== step4 insert into 20 rows
$ms = 0
$cnt = 0
while $cnt < 20
$ms = $cnt . m
sql insert into normal_t1(ts,c1) values(now + $ms , '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789');
$cnt = $cnt + 1
endw
########################################################
print ===> step 4 stop dnode1
system sh/exec.sh -n dnode1 -s stop -x SIGINT
########################################################
print ===> step 5 start dnode1
system sh/exec.sh -n dnode1 -s start
sleep 1000
sql select count(*) from db1.normal_t1;
print $data00
if $rows != 1 then
return -1
endi
if $data00 != 20 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -193,6 +193,7 @@ cd ../../../debug; make ...@@ -193,6 +193,7 @@ cd ../../../debug; make
./test.sh -f general/alter/insert2.sim ./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim ./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim ./test.sh -f general/alter/table.sim
./test.sh -f general/alter/column_width_commit.sim
./test.sh -f general/cache/new_metrics.sim ./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim ./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim ./test.sh -f general/cache/restart_table.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册