Case sensitive SQL queries checks (#62752)

This commit is contained in:
Diogo Gomes
2022-01-07 16:19:30 +00:00
committed by GitHub
parent 04796c4410
commit d5d8eefded
2 changed files with 25 additions and 1 deletions

View File

@@ -97,7 +97,7 @@ def setup_platform(
value_template.hass = hass
# MSSQL uses TOP and not LIMIT
if not ("LIMIT" in query_str or "SELECT TOP" in query_str):
if not ("LIMIT" in query_str.upper() or "SELECT TOP" in query_str.upper()):
query_str = (
query_str.replace("SELECT", "SELECT TOP 1")
if "mssql" in db_url