mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge pull request #70166 from ClickHouse/backport/24.8/70122
Backport #70122 to 24.8: Fix wrong LOGICAL_ERROR when replacing literals in ranges
This commit is contained in:
commit
02fd7ea893
@ -326,9 +326,6 @@ ConstantExpressionTemplate::TemplateStructure::TemplateStructure(LiteralsInfo &
|
||||
for (size_t i = 0; i < replaced_literals.size(); ++i)
|
||||
{
|
||||
const LiteralInfo & info = replaced_literals[i];
|
||||
if (info.literal->begin.value() < prev_end)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot replace literals");
|
||||
|
||||
while (prev_end < info.literal->begin.value())
|
||||
{
|
||||
tokens.emplace_back(prev_end->begin, prev_end->size());
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,7 @@
|
||||
CREATE TABLE IF NOT EXISTS 03246_range_literal_replacement_works (id UInt8) Engine=Memory;
|
||||
|
||||
INSERT INTO 03246_range_literal_replacement_works VALUES (1 BETWEEN 0 AND 2);
|
||||
|
||||
SELECT * FROM 03246_range_literal_replacement_works;
|
||||
|
||||
DROP TABLE IF EXISTS 03246_range_literal_replacement_works;
|
Loading…
Reference in New Issue
Block a user