TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

alter table to add tag then insert value but tag value is null

Open zed-hj opened this issue 5 years ago • 6 comments

1.创建超级表: CREATE TABLE IF NOT EXISTS ampere (ts TIMESTAMP(8),ampere DOUBLE(8)) TAGS (device_name BINARY(50),build_id BINARY(50),project_id BINARY(50),alias BINARY(50));

2.执行 insert into d1001 using ampere tags('test', '2','2','2') VALUES (now,123);

3.这时候ampere 超级表tag数量是4,后来我想在ampere超级表加多个tag值变成5个

4.执行 ALTER TABLE ampere ADD TAG variable_id BINARY(50);

5.继续执行 创建了一个新的子表 d1002 : insert into d1002 using ampere tags('test', '2','2','2','test') VALUES (now,124);

但是我发现去查询超级表的时候 d1002 表的数据 第五个tag 为 null,前4个tag有数据

于是我用了另外一种办法

CREATE TABLE d1003 USING ampere TAGS ('test3', '3','3','3','test3');

且向d1003 插入数据

发现查询超级表的时候 d1003 的第五个标签 为null,前4个tag有数据,那就是说第一次创建超级表添加的tag都有值,后来添加的都没值

taos> DESCRIBE ampere; Field | Type | Length | Note |

ts | TIMESTAMP | 8 | | ampere | DOUBLE | 8 | | device_name | BINARY | 50 | TAG | build_id | BINARY | 50 | TAG | project_id | BINARY | 50 | TAG | alias | BINARY | 50 | TAG | variable_id | BINARY | 50 | TAG |

Tdengine version: 2.0.10.0

image

image

zed-hj avatar Jan 07 '21 02:01 zed-hj

3.这时候meters 超级表tag数量是2,后来我想在meters 超级表加多个tag值变成3个

4.执行 ALTER TABLE meters ADD COLUMN tag3 BINARY(50);

应该是 alter table meters add tag tag3 binary(50)

sangshuduo avatar Jan 07 '21 02:01 sangshuduo

@hjxilinx hello 这个问题修复了吗?

zed-hj avatar Jan 12 '21 08:01 zed-hj

还没有,同事在处理

hjxilinx avatar Jan 17 '21 05:01 hjxilinx

还没有,同事在处理

嗯

zed-hj avatar Jan 18 '21 00:01 zed-hj

这周发布的版本会整合这个修复补丁。

hjxilinx avatar Mar 04 '21 02:03 hjxilinx

This bug has been fixed and therefore close this issue.

hjxilinx avatar May 04 '22 07:05 hjxilinx