From 4688b2dd9d5ffdb929f4f36fddea1dab1e5a233f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 20 Aug 2020 09:02:48 +0000 Subject: [PATCH] [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) --- odoo/service/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/service/db.py b/odoo/service/db.py index ccb1ce41644..ea21a36d546 100644 --- a/odoo/service/db.py +++ b/odoo/service/db.py @@ -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))