fix: SQL Statement on QUERY_LOGGER prints none to log (#14358)

This commit is contained in:
cccs-rc 2021-05-06 10:50:19 -04:00 committed by GitHub
parent 4ac90ddaee
commit f55882e756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -232,6 +232,7 @@ def execute_sql_statement(
# Hook to allow environment-specific mutation (usually comments) to the SQL
sql = SQL_QUERY_MUTATOR(sql, user_name, security_manager, database)
try:
query.executed_sql = sql
if log_query:
log_query(
query.database.sqlalchemy_uri,
@ -242,7 +243,6 @@ def execute_sql_statement(
security_manager,
log_params,
)
query.executed_sql = sql
session.commit()
with stats_timing("sqllab.query.time_executing_query", stats_logger):
logger.debug("Query %d: Running query: %s", query.id, sql)