fix: check for numeric arg first
This commit is contained in:
parent
0d415afdd5
commit
17f9ca9819
1 changed files with 4 additions and 3 deletions
|
|
@ -2420,14 +2420,15 @@ class SQLFunctionParser:
|
|||
).format(arg),
|
||||
frappe.ValidationError,
|
||||
)
|
||||
elif self._is_valid_field_name(arg):
|
||||
self._check_function_field_permission(arg)
|
||||
return self.engine.table[arg]
|
||||
|
||||
# Check if it's a numeric string like "1" (for COUNT(1), etc.)
|
||||
elif arg.isdigit():
|
||||
return int(arg)
|
||||
|
||||
elif self._is_valid_field_name(arg):
|
||||
self._check_function_field_permission(arg)
|
||||
return self.engine.table[arg]
|
||||
|
||||
else:
|
||||
frappe.throw(
|
||||
_(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue