Skip to content

Commit b6b3437

Browse files
SadiHassanltrk2
authored andcommitted
bug_fix_2520 (new_guid)
1 parent 6266f2b commit b6b3437

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Parsers/Kusto/KustoFunctions/KQLStringFunctions.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,16 @@ bool MakeString::convertImpl(String & out, IParser::Pos & pos)
376376

377377
bool NewGuid::convertImpl(String & out, IParser::Pos & pos)
378378
{
379+
const String fn_name = getKQLFunctionName(pos);
380+
if (fn_name.empty())
381+
return false;
382+
++pos;
383+
++pos;
384+
if (!pos->isEnd() && pos->type != TokenType::Semicolon && pos->type != TokenType::PipeMark)
385+
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Function {} expects 0 argument(s)", fn_name);
386+
--pos;
387+
--pos;
388+
--pos;
379389
return directMapping(out, pos, "generateUUIDv4");
380390
}
381391

tests/queries/0_stateless/02366_kql_func_string.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,3 +489,6 @@ MyTable | project t = strcat(make_string(col1), '-', make_string(col2), '-', mak
489489
print str = make_string(range(80, 85), 86, 87, range(88, 90));
490490
print str = make_string(dynamic([]), 80, 81);
491491
print str = make_string(123, 1605, 29233 ,128002, 2437);
492+
493+
-- print t = new_guid(1)
494+
-- Code: 36. DB::Exception: Function new_guid expects 0 argument(s). (BAD_ARGUMENTS)

0 commit comments

Comments
 (0)