mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #58710 from aiven-sal/aiven-sal/fix_normq2
Handle signed numeric literals in normalizeQuery
This commit is contained in:
commit
61889faabd
@ -167,6 +167,8 @@ void normalizeQueryToPODArray(const char * begin, const char * end, PaddedPODArr
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (prev_comma && (token.type == TokenType::Plus || token.type == TokenType::Minus))
|
||||
continue;
|
||||
else
|
||||
{
|
||||
if (num_literals_in_sequence > 1)
|
||||
|
@ -23,3 +23,23 @@ SELECT ?..
|
||||
SELECT ? xyz11
|
||||
SELECT ?, xyz11
|
||||
SELECT ?..
|
||||
? - ?
|
||||
?..
|
||||
-?..
|
||||
? - ?..
|
||||
f(-?..)
|
||||
[-?..]
|
||||
? + ?
|
||||
?..
|
||||
-?..
|
||||
? + ?..
|
||||
f(+?..)
|
||||
[+?..]
|
||||
?.. + ?
|
||||
?.. - ?..
|
||||
f(+?..), ?
|
||||
[+?..] - ?
|
||||
-?.. - [+?..] - ?
|
||||
(+?..) - ?
|
||||
-?.. - (+?..) - ?
|
||||
(+?..)
|
||||
|
@ -23,4 +23,23 @@ SELECT normalizeQuery('SELECT 1, ''xyz11''');
|
||||
SELECT normalizeQuery('SELECT $doc$VALUE$doc$ xyz11');
|
||||
SELECT normalizeQuery('SELECT $doc$VALUE$doc$, xyz11');
|
||||
SELECT normalizeQuery('SELECT $doc$VALUE$doc$, ''xyz11''');
|
||||
|
||||
SELECT normalizeQuery('1 - 2');
|
||||
SELECT normalizeQuery('1, -2, 3');
|
||||
SELECT normalizeQuery('-1, -2, 3');
|
||||
SELECT normalizeQuery('1 - 2, 3, 4');
|
||||
SELECT normalizeQuery('f(-2, 3)');
|
||||
SELECT normalizeQuery('[-1, 2, 3]');
|
||||
SELECT normalizeQuery('1 + 2');
|
||||
SELECT normalizeQuery('1, +2, 3');
|
||||
SELECT normalizeQuery('-1, +2, 3');
|
||||
SELECT normalizeQuery('1 + 2, 3, 4');
|
||||
SELECT normalizeQuery('f(+2, 3)');
|
||||
SELECT normalizeQuery('[+1, 2, 3]');
|
||||
SELECT normalizeQuery('1, 2, 3 + 4');
|
||||
SELECT normalizeQuery('1, 2 - 3, 4');
|
||||
SELECT normalizeQuery('f(+2, 3), 1');
|
||||
SELECT normalizeQuery('[+1, 2, 3] - 1');
|
||||
SELECT normalizeQuery('-1, 1 - [+1, 2, 3] - 1');
|
||||
SELECT normalizeQuery('(+1, 2, 3) - 1');
|
||||
SELECT normalizeQuery('-1, 1 - (+1, 2, 3) - 1');
|
||||
SELECT normalizeQuery('(+1, 2, -3)');
|
||||
|
Loading…
Reference in New Issue
Block a user