pyrrha
pyrrha copied to clipboard
SQL bug while fetching morph
Current Behaviour
Don't know much about how it happened since I just caught it in a log (from today) :
Traceback (most recent call last):
File "pyrrha/venv/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: near ")": syntax error
...
File " pyrrha/app/control_lists/views.py", line 211, in search_api
).limit(AUTOCOMPLETE_LIMIT)
...
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near ")": syntax error
[SQL: SELECT allowed_morph.label AS allowed_morph_label, allowed_morph.readable AS allowed_morph_readable
FROM allowed_morph
WHERE allowed_morph.control_list = ? AND () GROUP BY allowed_morph.label
LIMIT ? OFFSET ?]
[parameters: (3, 20, 0)]
It may be about the empty AND ()
in the query
Correct Behaviour
- No bugs.
- The issue relates potentially from an empty query parameters.
- No search should be perform if the value is empty.