[FIX] core: mis-updated SQL queries

odoo/odoo#53938 improved the SQL linter and used psycopg2.sql to
silence the linter where that still made sense. However I forgot to
mark table names (pretty much exclusively) as `sql.Identifier` in a
few somewhat rare callsites, which consequently break when invoked as
a simple string is not a Composable and psycopg2 therefore rejects it
when composing the query.

odoo/odoo#54556 fixed a few mis-updated ones, but apparently I still
managed to miss one here.

closes odoo/odoo#56191

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Xavier Morel
2020-08-20 09:02:48 +00:00
parent 98f3363113
commit 4688b2dd9d
+1 -1
View File
@@ -183,7 +183,7 @@ def exp_drop(db_name):
_drop_conn(cr, db_name)
try:
cr.execute(sql.SQL('DROP DATABASE {}').format(db_name))
cr.execute(sql.SQL('DROP DATABASE {}').format(sql.Identifier(db_name)))
except Exception as e:
_logger.info('DROP DB: %s failed:\n%s', db_name, e)
raise Exception("Couldn't drop database %s: %s" % (db_name, e))