Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Fix the bug of bitmap_to_string overflow (#37405)
Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit 299165e)
- Loading branch information
1 parent
f7dbf00
commit 4294f60
Showing
4 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-- name: test_bitmap_to_string | ||
CREATE TABLE `t1` ( | ||
`c1` int(11) NULL COMMENT "", | ||
`c2` bitmap BITMAP_UNION NULL COMMENT "" | ||
) ENGINE=OLAP | ||
AGGREGATE KEY(`c1`) | ||
DISTRIBUTED BY HASH(`c1`) BUCKETS 1 | ||
PROPERTIES ("replication_num" = "1"); | ||
-- result: | ||
-- !result | ||
insert into t1 select 1, bitmap_agg(generate_series) from TABLE(generate_series(18446744073709551611)); | ||
-- result: | ||
E: (1064, "Getting analyzing error. Detail message: Unknown table function 'generate_series(LARGEINT)'.") | ||
-- !result | ||
select bitmap_to_string(c2) from t1; | ||
-- result: | ||
-- !result | ||
insert into t1 select 1, bitmap_agg(generate_series) from TABLE(generate_series(18446744073709551611, 18446744073709551615)); | ||
-- result: | ||
-- !result | ||
select bitmap_to_string(c2) from t1; | ||
-- result: | ||
18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615 | ||
-- !result | ||
insert into t1 select 1, bitmap_agg(generate_series) from TABLE(generate_series(18446744073709551551, 18446744073709551615)); | ||
-- result: | ||
-- !result | ||
select bitmap_to_string(c2) from t1; | ||
-- result: | ||
18446744073709551551,18446744073709551552,18446744073709551553,18446744073709551554,18446744073709551555,18446744073709551556,18446744073709551557,18446744073709551558,18446744073709551559,18446744073709551560,18446744073709551561,18446744073709551562,18446744073709551563,18446744073709551564,18446744073709551565,18446744073709551566,18446744073709551567,18446744073709551568,18446744073709551569,18446744073709551570,18446744073709551571,18446744073709551572,18446744073709551573,18446744073709551574,18446744073709551575,18446744073709551576,18446744073709551577,18446744073709551578,18446744073709551579,18446744073709551580,18446744073709551581,18446744073709551582,18446744073709551583,18446744073709551584,18446744073709551585,18446744073709551586,18446744073709551587,18446744073709551588,18446744073709551589,18446744073709551590,18446744073709551591,18446744073709551592,18446744073709551593,18446744073709551594,18446744073709551595,18446744073709551596,18446744073709551597,18446744073709551598,18446744073709551599,18446744073709551600,18446744073709551601,18446744073709551602,18446744073709551603,18446744073709551604,18446744073709551605,18446744073709551606,18446744073709551607,18446744073709551608,18446744073709551609,18446744073709551610,18446744073709551611,18446744073709551612,18446744073709551613,18446744073709551614,18446744073709551615 | ||
-- !result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- name: test_bitmap_to_string | ||
|
||
-- large int | ||
CREATE TABLE `t1` ( | ||
`c1` int(11) NULL COMMENT "", | ||
`c2` bitmap BITMAP_UNION NULL COMMENT "" | ||
) ENGINE=OLAP | ||
AGGREGATE KEY(`c1`) | ||
DISTRIBUTED BY HASH(`c1`) BUCKETS 1 | ||
PROPERTIES ("replication_num" = "1"); | ||
|
||
insert into t1 select 1, bitmap_agg(generate_series) from TABLE(generate_series(18446744073709551611)); | ||
select bitmap_to_string(c2) from t1; | ||
|
||
insert into t1 select 1, bitmap_agg(generate_series) from TABLE(generate_series(18446744073709551611, 18446744073709551615)); | ||
select bitmap_to_string(c2) from t1; | ||
|
||
insert into t1 select 1, bitmap_agg(generate_series) from TABLE(generate_series(18446744073709551551, 18446744073709551615)); | ||
select bitmap_to_string(c2) from t1; |