mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 02:52:13 +00:00
Merge pull request #69451 from rschu1ze/sqid-crash
Fix crash in `sqidDecode`
This commit is contained in:
commit
7a3d69b626
@ -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(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