Merge branch '3.0' into feature/compressData

This commit is contained in:
yihaoDeng 2024-03-30 10:37:33 +00:00
parent d2d7cd854c
commit ddf37b10a0
2 changed files with 30 additions and 0 deletions

View File

@ -334,6 +334,13 @@ int8_t validColCompress(uint8_t type, uint8_t l2) {
if (l2 > TSDB_COLVAL_COMPRESS_XZ && l2 < TSDB_COLVAL_COMPRESS_DISABLED) {
return 0;
}
if (l2 == TSDB_COLVAL_COMPRESS_TSZ) {
if (type == TSDB_DATA_TYPE_FLOAT || type == TSDB_DATA_TYPE_DOUBLE) {
return 1;
} else {
return 0;
}
}
return 1;
}

View File

@ -18,6 +18,29 @@ sql create database $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, str binary(256))
sql alter table $tb add column f bool
sql desc $tb
sql alter table $tb drop column f
sql desc $tb
sql_error alter table $tb modify column b level 'i'
sql alter table $tb modify column b level 'l'
sql_error alter table $tb modify column b level 'l' # already exist
sql alter table $tb modify column b level 'm'
sql_error alter table $tb modify column b level 'l' # already exist
sql_error alter table $tb modify column b compress 'lz4'
sql alter table $tb modify column b compress 'xz'
sql alter table $tb modify column b compress 'zstd'
sql_err alter table $tb modify column b compress 'tsz'
$count = 0
while $count < $N
$ms = 1591200000000 + $count