From 50eb5dac2c8454792a90664f882e2be161ca54fc Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Mon, 3 Oct 2022 11:03:36 -0400 Subject: [PATCH] Correct SELECT query WHERE handling for capitalization --- py_dbcn/connectors/core/records.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py_dbcn/connectors/core/records.py b/py_dbcn/connectors/core/records.py index 683c4f6..479d813 100644 --- a/py_dbcn/connectors/core/records.py +++ b/py_dbcn/connectors/core/records.py @@ -56,10 +56,13 @@ class BaseRecords: select_clause = self._base.validate.sanitize_select_clause(select_clause) # Check that provided WHERE clause is valid format. + # TODO: Implement proper clause sanitization. if where_clause is None: where_clause = '' where_clause = str(where_clause).strip() - where_clause = where_clause.casefold().lstrip('WHERE ') + if where_clause.lower().startswith('where'): + where_clause = where_clause[5:] + where_clause = where_clause.strip() if len(where_clause) > 1: where_clause = '\nWHERE ({0})'.format(where_clause) if not self._base.validate.where_clause(where_clause): -- GitLab