fix(db_query): relax some restrictions (#37314)
Allow valid identifiers Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
5b09a76606
commit
04b2a433b6
1 changed files with 5 additions and 1 deletions
|
|
@ -500,7 +500,11 @@ from {tables}
|
|||
if (name := (token.get_name())) and name.lower() in blacklisted_functions:
|
||||
_raise_exception()
|
||||
|
||||
if token.ttype in (tokens.Keyword, tokens.Name):
|
||||
if token.ttype in tokens.Keyword:
|
||||
if any(re.search(rf"\b{kw}\b", token.value.lower()) for kw in blacklisted_keywords):
|
||||
_raise_exception()
|
||||
|
||||
if token.ttype in tokens.Name and not re.match(r"^`\w.*`$", token.value.strip()):
|
||||
if any(re.search(rf"\b{kw}\b", token.value.lower()) for kw in blacklisted_keywords):
|
||||
_raise_exception()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue