mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix crash in sqidDecode
This commit is contained in:
parent
5ef98cd275
commit
04dcf73e8f
@ -124,7 +124,7 @@ public:
|
||||
std::string_view sqid = col_non_const->getDataAt(i).toView();
|
||||
std::vector<UInt64> integers = sqids.decode(String(sqid));
|
||||
res_nested_data.insert(integers.begin(), integers.end());
|
||||
res_offsets_data.push_back(integers.size());
|
||||
res_offsets_data.push_back(i == 0 ? integers.size() : res_offsets_data.back() + integers.size());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -13,5 +13,6 @@ Td1EnWQo [1,2,3,4]
|
||||
XMbT
|
||||
-- invalid sqid
|
||||
[]
|
||||
-- bug 69450
|
||||
-- alias
|
||||
XMbT
|
||||
|
@ -25,5 +25,12 @@ SELECT sqidEncode(toNullable(materialize(1)), toLowCardinality(materialize(2)));
|
||||
SELECT '-- invalid sqid';
|
||||
SELECT sqidDecode('invalid sqid');
|
||||
|
||||
SELECT '-- bug 69450';
|
||||
DROP TABLE IF EXISTS tab;
|
||||
CREATE TABLE tab (id String) ENGINE = MergeTree ORDER BY id;
|
||||
INSERT INTO tab SELECT * FROM generateRandom() LIMIT 1000000;
|
||||
SELECT sqidDecode(id) FROM tab FORMAT Null;
|
||||
DROP TABLE tab;
|
||||
|
||||
SELECT '-- alias';
|
||||
SELECT sqid(1, 2);
|
||||
|
Loading…
Reference in New Issue
Block a user